Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of Unofficial dgoslings Samus Mod v2.2.4
SamusMod.dll
Decompiled a day ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using EmotesAPI; using EntityStates; using MonoMod.RuntimeDetour.HookGen; using On.RoR2; using On.RoR2.UI; using R2API; using R2API.ScriptableObjects; using R2API.Utils; using Rewired; using Rewired.Data; using Rewired.Data.Mapping; using RoR2; using RoR2.ContentManagement; using RoR2.Projectile; using RoR2.Skills; using RoR2.UI; using SamusMod.Misc; using SamusMod.Modules; using SamusMod.SkillStates.BaseStates; using ShaderSwapper; using TMPro; using UnityEngine; using UnityEngine.Networking; using UnityEngine.UI; using VRAPI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] [module: UnverifiableCode] public class ReplaceShaders : MonoBehaviour { } namespace SamusMod { [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.dgosling.Samus", "Samus", "2.2.4")] public class SamusPlugin : BaseUnityPlugin { public const string MODUID = "com.dgosling.Samus"; public const string MODNAME = "Samus"; public const string MODVERSION = "2.2.4"; public const string developerPrefix = "DG"; public static bool debug; public static bool cancel; public static float jumps; public static SamusPlugin instance; public static ManualLogSource logger { get { SamusPlugin samusPlugin = instance; if (samusPlugin == null) { return null; } return ((BaseUnityPlugin)samusPlugin).Logger; } } private void Awake() { instance = this; Config.ReadConfig(); Assets.Init(); if (!cancel) { Tokens.Init(); Prefabs.Init(); Buffs.Init(); Unlockables.Init(); ExtraInputs.AddActionsToInputCatalog(); HookEndpointManager.Add((MethodBase)typeof(UserData).GetMethod("gLOOAxUFAvrvUufkVjaYyZoeLbLE", BindingFlags.Instance | BindingFlags.NonPublic), (Delegate)new Action<Action<UserData>, UserData>(ExtraInputs.AddCustomActions)); if (debug) { Helpers.AwakeDebug(); } ContentPackProvider.Initialize(); Hook(); } } private void Start() { if (debug) { Helpers.StartDebug(); } } private void Hook() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Expected O, but got Unknown //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Expected O, but got Unknown //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Expected O, but got Unknown //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Expected O, but got Unknown //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Expected O, but got Unknown //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Expected O, but got Unknown //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Expected O, but got Unknown //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Expected O, but got Unknown CharacterBody.FixedUpdate += new hook_FixedUpdate(CharacterBody_FixedUpdate); DamageTrail.DoDamage += new hook_DoDamage(DamageTrail_DoDamage); CharacterBody.RecalculateStats += new hook_RecalculateStats(CharacterBody_RecalculateStats); DotController.InflictDot_GameObject_GameObject_DotIndex_float_float_Nullable1 += new hook_InflictDot_GameObject_GameObject_DotIndex_float_float_Nullable1(DotController_InflictDot_GameObject_GameObject_DotIndex_float_float_Nullable1); HealthComponent.TakeDamage += new hook_TakeDamage(HealthComponent_TakeDamage); CharacterMotor.FixedUpdate += new hook_FixedUpdate(CharacterMotor_FixedUpdate); CharacterMotor.OnLanded += new hook_OnLanded(CharacterMotor_OnLanded); CharacterMaster.OnBodyDamaged += new hook_OnBodyDamaged(CharacterMaster_OnBodyDamaged); UserProfile.LoadDefaultProfile += new hook_LoadDefaultProfile(ExtraInputs.OnLoadDefaultProfile); SaveSystem.LoadUserProfiles += new hook_LoadUserProfiles(ExtraInputs.OnLoadUserProfiles); SettingsPanelController.Start += new hook_Start(SettingsPanelControllerStart); if (EmoteAPICompatibility.enabled) { SurvivorCatalog.Init += new hook_Init(EmoteAPICompatibility.SurvivorCatalog_Init); } } private void CharacterBody_RecalculateStats(orig_RecalculateStats orig, CharacterBody self) { orig.Invoke(self); if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.inventory) && Object.op_Implicit((Object)(object)self.skillLocator) && self.baseNameToken == "DG_SAMUS_NAME") { SkillLocator skillLocator = self.skillLocator; if (Object.op_Implicit((Object)(object)skillLocator.secondary) && !BaseSamus.morphBall) { int num = skillLocator.secondary.bonusStockFromBody - self.inventory.GetItemCountEffective(Items.SecondarySkillMagazine); int itemCountEffective = self.inventory.GetItemCountEffective(Items.SecondarySkillMagazine); skillLocator.secondary.SetBonusStockFromBody(itemCountEffective * 5 + num); } } } private void GenericSkill_SetBonusStockFromBody(orig_SetBonusStockFromBody orig, GenericSkill self, int newBonusStockFromBody) { if (!Object.op_Implicit((Object)(object)self)) { return; } if ((Object)(object)self.characterBody.skillLocator.secondary == (Object)(object)self && self.characterBody.baseNameToken == "DG_SAMUS_NAME") { if (!BaseSamus.morphBall) { newBonusStockFromBody *= 5; orig.Invoke(self, newBonusStockFromBody); } else if (BaseSamus.morphBall) { newBonusStockFromBody = Mathf.FloorToInt((float)(self.characterBody.skillLocator.primary.maxStock / 3)) - 1; orig.Invoke(self, newBonusStockFromBody); } } else { orig.Invoke(self, newBonusStockFromBody); } } private void DotController_InflictDot_GameObject_GameObject_DotIndex_float_float_Nullable1(orig_InflictDot_GameObject_GameObject_DotIndex_float_float_Nullable1 orig, GameObject victimObject, GameObject attackerObject, DotIndex dotIndex, float duration, float damageMultiplier, uint? maxStacksFromAttacker) { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Invalid comparison between Unknown and I4 //IL_004e: Unknown result type (might be due to invalid IL or missing references) if ((victimObject.gameObject.GetComponent<CharacterBody>().baseNameToken == "DG_SAMUS_NAME" || attackerObject.gameObject.GetComponent<CharacterBody>().baseNameToken == "DG_SAMUS_NAME") && (int)dotIndex == 3) { duration = 0f; damageMultiplier = 0f; } orig.Invoke(victimObject, attackerObject, dotIndex, duration, damageMultiplier, maxStacksFromAttacker); } private void CustomBind() { } internal static void SettingsPanelControllerStart(orig_Start orig, SettingsPanelController self) { orig.Invoke(self); if (((Object)self).name == "SettingsSubPanel, Controls (M&KB)" || ((Object)self).name == "SettingsSubPanel, Controls (Gamepad)") { Transform buttonToCopy = ((Component)self).transform.Find("Scroll View/Viewport/VerticalLayout/SettingsEntryButton, Binding (Jump)"); uiHooks.AddActionBindingToSettings(RewiredAction.autoFire.Name, buttonToCopy); } } private void CharacterMaster_OnBodyDamaged(orig_OnBodyDamaged orig, CharacterMaster self, DamageReport damageReport) { if (Object.op_Implicit((Object)(object)self)) { if (self.GetBody().baseNameToken == "DG_SAMUS_NAME") { Util.PlaySound("Hurt", self.GetBodyObject()); } orig.Invoke(self, damageReport); } } private void CharacterMotor_OnLanded(orig_OnLanded orig, CharacterMotor self) { if (Object.op_Implicit((Object)(object)self)) { if (self.body.baseNameToken == "DG_SAMUS_NAME" && jumps > 0f) { jumps = 0f; } orig.Invoke(self); } } private void CharacterMotor_FixedUpdate(orig_FixedUpdate orig, CharacterMotor self) { if (!Object.op_Implicit((Object)(object)self)) { return; } if (self.body.baseNameToken == "DG_SAMUS_NAME") { if (self.jumpCount == 1 && jumps == 0f) { jumps = 1f; Util.PlaySound("Jump", ((Component)self).gameObject); } else if (self.jumpCount >= 2 && jumps + 1f == (float)self.jumpCount) { jumps += 1f; Util.PlaySound("DJump", ((Component)self).gameObject); } } orig.Invoke(self); } private void HealthComponent_TakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo) { //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)self != (Object)null && (Object)(object)damageInfo.inflictor != (Object)null && (Object)(object)self.body != (Object)null && self.body.baseNameToken == "DG_SAMUS_NAME" && (((Object)damageInfo.inflictor).name == "bombExplosion(Clone)" || ((Object)damageInfo.inflictor).name == "SamusMorphBomb(Clone)")) { damageInfo.damage = 0f; if (self.body.characterMotor.isGrounded || self.body.characterMotor.velocity.y > -10f) { damageInfo.force = new Vector3(0f, 1200f, 0f); } else { damageInfo.force = new Vector3(0f, 3000f, 0f); } } orig.Invoke(self, damageInfo); } private void DamageTrail_DoDamage(orig_DoDamage orig, DamageTrail self, float damageInterval) { if (Object.op_Implicit((Object)(object)self) && ((Object)self.segmentPrefab).name == "FireTrailSegment") { self.damagePerSecond = 0f; AkSoundEngine.StopPlayingID(3193947170u); } orig.Invoke(self, damageInterval); } private void CharacterBody_FixedUpdate(orig_FixedUpdate orig, CharacterBody self) { if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.skillLocator.secondary) && Object.op_Implicit((Object)(object)self.skillLocator.special) && self.baseNameToken == "DG_SAMUS_NAME" && !BaseSamus.morphBall) { if (self.skillLocator.secondary.stock >= 5) { self.skillLocator.special.stock = 1; } else { self.skillLocator.special.RemoveAllStocks(); } } orig.Invoke(self); } } } namespace SamusMod.SkillStates.Samus { public class AutoFireBeam : BaseSkillState { private GameObject projectilePrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/Tracers/TracerNoSmoke"); [SerializeField] public GameObject muzzleFlashPrefab; [SerializeField] public GameObject hitEffectPrefab; [SerializeField] public float baseDuration; private float duration; private float force = 5f; private string muzzleName = "gunCon"; private Ray aimRay; private float timer; public override void OnEnter() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; aimRay = ((BaseState)this).GetAimRay(); } private void Fire() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: 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_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_016f: 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_0187: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_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) if (((EntityState)this).isAuthority) { if (Utils.IsUsingMotionControls(((EntityState)this).characterBody)) { aimRay = MotionControls.dominantHand.aimRay; EntityState.PlayAnimationOnAnimator(MotionControls.dominantHand.animator, "Base Layer", "shoot", "Shoot.playbackRate", 0.1f, 0f); } else { ((EntityState)this).PlayAnimation("Gesture, Override", "Beam", "Charge.playbackRate", 0.05f, 0f); } if (Object.op_Implicit((Object)(object)muzzleFlashPrefab)) { EffectManager.SimpleMuzzleFlash(muzzleFlashPrefab, ((EntityState)this).gameObject, muzzleName, false); } float num = 0.1f * force; if (Utils.IsUsingMotionControls(((EntityState)this).characterBody)) { Util.PlayAttackSpeedSound("beam", ((Component)MotionControls.dominantHand.muzzle).gameObject, ((BaseState)this).attackSpeedStat); } else { Util.PlayAttackSpeedSound("beam", ((EntityState)this).gameObject, ((BaseState)this).attackSpeedStat); } new BulletAttack { owner = ((EntityState)this).gameObject, weapon = ((EntityState)this).gameObject, origin = ((Ray)(ref aimRay)).origin, aimVector = ((Ray)(ref aimRay)).direction, minSpread = 0f, maxSpread = 0f, damage = ((BaseState)this).damageStat * Config.pBeamMult, force = num, tracerEffectPrefab = projectilePrefab, muzzleName = muzzleName, hitEffectPrefab = hitEffectPrefab, isCrit = ((BaseState)this).RollCrit(), radius = 0.1f, smartCollision = true, damageType = new DamageTypeCombo(DamageTypeCombo.GenericPrimary, (DamageTypeExtended)0, (DamageSource)1) }.Fire(); } } public override void FixedUpdate() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); aimRay = ((BaseState)this).GetAimRay(); timer += Time.fixedDeltaTime; if (timer >= duration) { timer = 0f; Fire(); } if (((EntityState)this).isAuthority && !((BaseSkillState)this).IsKeyDownAuthority()) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)2; } } public class ChargeBeam : ChargeBeamBase { private GameObject chargeEffect; private Vector3 originalScale; public Vector3 newSize; public override void OnEnter() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) crosshairOverridePrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/Crosshair/ToolbotGrenadeLauncherCrosshair"); maxBloomRadius = 0.1f; minBloomRadius = 1f; originalScale = chargeEffectPrefab.transform.localScale; base.OnEnter(); ChildLocator modelChildLocator = ((EntityState)this).GetModelChildLocator(); if (Object.op_Implicit((Object)(object)modelChildLocator)) { chargeEffect = ((Component)modelChildLocator.FindChild("chargeEffect")).gameObject; chargeEffect.SetActive(false); } } public override void FixedUpdate() { //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) base.FixedUpdate(); if (!chargeEffect.activeSelf && calcCharge() > 0.15f) { chargeEffect.SetActive(true); } if (!Utils.IsUsingMotionControls(((EntityState)this).characterBody)) { newSize = new Vector3(calcCharge() * 10f, calcCharge() * 10f, calcCharge() * 10f); } else { newSize = new Vector3(calcCharge() / 2f, calcCharge() / 2f, calcCharge() / 2f); } base.chargeEffectInstance.transform.localScale = newSize; } public override void OnExit() { base.OnExit(); if (Object.op_Implicit((Object)(object)chargeEffect)) { chargeEffect.SetActive(false); } } public override BaseFireBeam GetNextBase() { return new FireBeam(); } } public class ExitMorphBall : BaseSkillState { private static float baseDuration = 0.42f; private float duration; private ChildLocator childLocator; private GameObject ball; [SerializeField] public SkillDef bomb; [SerializeField] public SkillDef exitMorph; private static float recharge; private static int pstock; public static float BaseDuration { get { return baseDuration; } set { baseDuration = value; } } public static float Recharge { get { return recharge; } set { recharge = value; } } public static int Pstock { get { return pstock; } set { pstock = value; } } public override void OnEnter() { ((BaseState)this).OnEnter(); duration = BaseDuration / ((BaseState)this).attackSpeedStat; childLocator = ((EntityState)this).GetModelChildLocator(); ball = ((Component)childLocator.FindChild("Ball2")).gameObject; if (NetworkServer.active) { ((EntityState)this).characterBody.RemoveBuff(Buffs.ArmorBoost); } Collider component = ball.GetComponent<Collider>(); ball.GetComponent<Rigidbody>(); component.enabled = false; ((Component)childLocator.FindChild("Ball2")).gameObject.SetActive(false); ((Component)childLocator.FindChild("Body")).gameObject.SetActive(true); ((EntityState)this).PlayAnimation("Body", "transformOut", "Roll.playbackRate", duration, 0f); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (!(((EntityState)this).fixedAge < duration) && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { //IL_00e1: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).OnExit(); ((EntityState)this).characterBody.baseMoveSpeed = morphBallEnter.NormalSpeed; ((EntityState)this).characterBody.baseJumpCount = morphBallEnter.NormalJumps; ((EntityState)this).characterBody.sprintingSpeedMultiplier = morphBallEnter.NormalSprint; ((EntityState)this).characterBody.RecalculateStats(); ((EntityState)this).skillLocator.primary.UnsetSkillOverride((object)((EntityState)this).skillLocator.primary, bomb, (SkillOverridePriority)4); ((EntityState)this).skillLocator.utility.UnsetSkillOverride((object)((EntityState)this).skillLocator.utility, exitMorph, (SkillOverridePriority)4); ((EntityState)this).skillLocator.secondary = BaseSamus.MissileSkill; if (Utils.IsUsingMotionControls(((EntityState)this).characterBody)) { SkinnedMeshRenderer[] dsMR = morphBallEnter.DsMR; for (int i = 0; i < dsMR.Length; i++) { ((Renderer)dsMR[i]).enabled = true; } dsMR = morphBallEnter.NDsMR; for (int i = 0; i < dsMR.Length; i++) { ((Renderer)dsMR[i]).enabled = true; } morphBallEnter.VRCamera.localPosition = morphBallEnter.CameraPOS; } BaseSamus.morphBall = false; } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)7; } } public class FireBeam : BaseFireBeam { public Vector3 sizes; public override void OnEnter() { baseDuration = 0.05f; force = 5f; maxDamageCoefficient = StaticValues.cshootDamageCoefficient; minDamageCoefficient = StaticValues.shootDamageCoefficient; selfForce = 0f; speed = 200f; ResizeProjectile(); tracerPrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/Tracers/TracerNoSmoke"); muzzleName = "gunCon"; if (charge <= 0.4f) { projSound = "cShoot25"; } else if (charge <= 0.7f) { projSound = "cShoot50"; } else if (charge <= 0.9f) { projSound = "cShoot75"; } else { projSound = "cShoot100"; } tracerSound = "beam"; base.OnEnter(); } public override void OnExit() { //IL_000b: 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) projectilePrefab.transform.localScale = Vector3.one; projectilePrefab.GetComponent<ProjectileController>().ghostPrefab.transform.localScale = Vector3.one; projectilePrefab.GetComponent<SphereCollider>().radius = 0.6f; base.OnExit(); } } public class Missile : BaseMissile { public override void OnEnter() { baseDuration = 0.1f; damageCoef = StaticValues.missileDamageCoefficient; recoil = 0.5f; smissleObject = null; Sound = "Missile"; sMissile = false; base.OnEnter(); } } public class MorphBallBomb : BaseSkillState { public float baseDuration = 0.1f; public string bombSound; [SerializeField] public GameObject projectilePrefab; private bool hasFired; private ChildLocator childLocator; public float damageCoef = 3f * Config.pBombMult; public override void OnEnter() { ((BaseState)this).OnEnter(); bombSound = "morphBomb"; childLocator = ((EntityState)this).GetModelChildLocator(); hasFired = false; } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (!hasFired) { Fire(); } if (!(((EntityState)this).fixedAge < baseDuration) && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } private void Fire() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) if (((EntityState)this).isAuthority) { Ray aimRay = ((BaseState)this).GetAimRay(); if ((Object)(object)projectilePrefab != (Object)null) { FireProjectileInfo val = new FireProjectileInfo { projectilePrefab = projectilePrefab, owner = ((EntityState)this).gameObject, position = ((EntityState)this).GetModelChildLocator().FindChild("Ball2").position, rotation = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), damage = damageCoef * ((BaseState)this).damageStat, force = 0f, crit = ((BaseState)this).RollCrit() }; ProjectileManager.instance.FireProjectile(val); hasFired = true; } } } public override void OnExit() { ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)7; } } public class morphBallEnter : BaseSkillState { private ChildLocator ChildLocator; public float speedMult = 1.2f; public float baseDuration = 0.42f; private float duration; private GameObject ball; private GameObject armature; private GameObject mesh; private GameObject bone; private static float normalSpeed; private Transform tran; private float velx; private float vely; private float velz; private static int normalJumps; private static float normalSprint; [SerializeField] public SkillDef bomb; [SerializeField] public SkillDef powerBomb; [SerializeField] public SkillDef exitMorph; private static SkinnedMeshRenderer[] nDsMR; private static Vector3 cameraPOS; private static Transform vRCamera; private static Animator vR; private static SkinnedMeshRenderer[] dsMR; public static int NormalJumps { get { return normalJumps; } set { normalJumps = value; } } public static float NormalSprint { get { return normalSprint; } set { normalSprint = value; } } public static SkinnedMeshRenderer[] DsMR { get { return dsMR; } set { dsMR = value; } } public static SkinnedMeshRenderer[] NDsMR { get { return nDsMR; } set { nDsMR = value; } } public static Vector3 CameraPOS { get { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return cameraPOS; } set { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) cameraPOS = value; } } public static Transform VRCamera { get { return vRCamera; } set { vRCamera = value; } } public static Animator VR { get { return vR; } set { vR = value; } } public static float NormalSpeed { get { return normalSpeed; } set { normalSpeed = value; } } public override void OnEnter() { //IL_019a: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; ((EntityState)this).skillLocator.primary.SetSkillOverride((object)((EntityState)this).skillLocator.primary, bomb, (SkillOverridePriority)4); ((EntityState)this).skillLocator.utility.SetSkillOverride((object)((EntityState)this).skillLocator.utility, exitMorph, (SkillOverridePriority)4); ((EntityState)this).skillLocator.secondary = BaseSamus.PowerBallskill; ChildLocator = ((EntityState)this).GetModelChildLocator(); ball = ((Component)ChildLocator.FindChild("Ball2")).gameObject; armature = ((Component)ChildLocator.FindChild("armature")).gameObject; mesh = ((Component)ChildLocator.FindChild("Body")).gameObject; bone = ((Component)ChildLocator.FindChild("Ball2Bone")).gameObject; if (Utils.IsUsingMotionControls(((EntityState)this).characterBody)) { VR = MotionControls.dominantHand.animator; VRCamera = ((EntityState)this).characterBody.transform.Find("VRCamera"); DsMR = ((Component)MotionControls.dominantHand.transform).gameObject.GetComponentsInChildren<SkinnedMeshRenderer>(); NDsMR = ((Component)MotionControls.nonDominantHand.transform).gameObject.GetComponentsInChildren<SkinnedMeshRenderer>(); VRStuff.SamusHUD.inMorphBall = true; SkinnedMeshRenderer[] array = DsMR; for (int i = 0; i < array.Length; i++) { ((Renderer)array[i]).enabled = false; } array = NDsMR; for (int i = 0; i < array.Length; i++) { ((Renderer)array[i]).enabled = false; } CameraPOS = VRCamera.localPosition; VRCamera.Translate(0f, -0.5f, 0f); } ((EntityState)this).PlayAnimation("Body", "transformIn", "Roll.playbackRate", duration, 0f); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (!(((EntityState)this).fixedAge < duration) && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { ((EntityState)this).OnExit(); ball.GetComponent<Rigidbody>().constraints = (RigidbodyConstraints)94; ball.GetComponent<Rigidbody>().detectCollisions = false; NormalSpeed = ((EntityState)this).characterBody.baseMoveSpeed; ((EntityState)this).characterBody.baseMoveSpeed = NormalSpeed * 2f; NormalJumps = ((EntityState)this).characterBody.baseJumpCount; ((EntityState)this).characterBody.baseJumpCount = 0; NormalSprint = ((EntityState)this).characterBody.sprintingSpeedMultiplier; ((EntityState)this).characterBody.sprintingSpeedMultiplier = 1.2f; if (NetworkServer.active) { ((EntityState)this).characterBody.AddBuff(Buffs.ArmorBoost); } ball.SetActive(true); mesh.SetActive(false); BaseSamus.morphBall = true; } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)7; } } public class MorphBallPBomb : BaseSkillState { public float baseDuration = 0.5f; public string bombSound; [SerializeField] public GameObject projectilePrefab; private bool hasFired; private ChildLocator childLocator; public float damageCoef = 10f * Config.pPowerBombMult; public override void OnEnter() { ((BaseState)this).OnEnter(); bombSound = "Powerbomb"; childLocator = ((EntityState)this).GetModelChildLocator(); hasFired = false; } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (!hasFired) { Fire(); } if (!(((EntityState)this).fixedAge < baseDuration) && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } private void Fire() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) if (((EntityState)this).isAuthority) { Ray aimRay = ((BaseState)this).GetAimRay(); if ((Object)(object)projectilePrefab != (Object)null) { FireProjectileInfo val = new FireProjectileInfo { projectilePrefab = projectilePrefab, owner = ((EntityState)this).gameObject, position = ((EntityState)this).GetModelChildLocator().FindChild("Ball2").position, rotation = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), damage = damageCoef * ((BaseState)this).damageStat, force = 0f, crit = ((BaseState)this).RollCrit() }; ProjectileManager.instance.FireProjectile(val); hasFired = true; } } } public override void OnExit() { ((EntityState)this).skillLocator.primary.RemoveAllStocks(); ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)7; } } public class Roll : BaseState { public float duration; private float initialSpeedCoefficient; private float finalSpeedCoefficient; public string dodgeSoundString; public string bombSoundString; [SerializeField] public GameObject projectilePrefab; public float damageCoefficient; public float dodgeFOV; private float rollSpeed; private Vector3 forwardDirection; private Animator animator; private Vector3 previousPosition; private bool hasFired; public SkinnedMeshRenderer[] DmeshRenderers; public SkinnedMeshRenderer[] NDmeshRenderers; private bool vrCheck; public override void OnEnter() { //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_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_011a: 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_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_030e: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02de: Unknown result type (might be due to invalid IL or missing references) //IL_02e3: Unknown result type (might be due to invalid IL or missing references) //IL_0313: Unknown result type (might be due to invalid IL or missing references) //IL_0318: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); duration = 0.8f; dodgeFOV = 110f; bombSoundString = "Bomb"; dodgeSoundString = "Roll"; if (VR.enabled) { DmeshRenderers = ((Component)MotionControls.dominantHand.transform).gameObject.GetComponentsInChildren<SkinnedMeshRenderer>(); NDmeshRenderers = ((Component)MotionControls.nonDominantHand.transform).gameObject.GetComponentsInChildren<SkinnedMeshRenderer>(); } damageCoefficient = StaticValues.dashDamageCoefficient; initialSpeedCoefficient = StaticValues.rollSpeedCoefficientIni; finalSpeedCoefficient = StaticValues.rollSpeedCoefficientFin; if (dodgeSoundString != null) { Util.PlaySound(dodgeSoundString, ((EntityState)this).gameObject); } animator = ((EntityState)this).GetModelAnimator(); ((Component)animator).GetComponent<ChildLocator>(); if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).inputBank) && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection) && !Utils.IsUsingMotionControls(((EntityState)this).characterBody)) { Vector3 val = ((((EntityState)this).inputBank.moveVector == Vector3.zero) ? ((EntityState)this).characterDirection.forward : ((EntityState)this).inputBank.moveVector); forwardDirection = ((Vector3)(ref val)).normalized; } else if (((EntityState)this).isAuthority && Utils.IsUsingMotionControls(((EntityState)this).characterBody)) { forwardDirection = ((Component)Camera.main).transform.forward; vrCheck = true; SkinnedMeshRenderer[] dmeshRenderers = DmeshRenderers; for (int i = 0; i < dmeshRenderers.Length; i++) { ((Renderer)dmeshRenderers[i]).enabled = false; } dmeshRenderers = NDmeshRenderers; for (int i = 0; i < dmeshRenderers.Length; i++) { ((Renderer)dmeshRenderers[i]).enabled = false; } } Vector3 val2 = (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection) ? ((EntityState)this).characterDirection.forward : forwardDirection); Vector3 val3 = Vector3.Cross(Vector3.up, val2); float num = Vector3.Dot(forwardDirection, val2); float num2 = Vector3.Dot(forwardDirection, val3); animator.SetFloat("forwardSpeed", num, 0.1f, Time.fixedDeltaTime); animator.SetFloat("rightSpeed", num2, 0.1f, Time.fixedDeltaTime); if (Mathf.Abs(num) > Mathf.Abs(num2)) { ((EntityState)this).PlayAnimation("Body", (num > 0f) ? "Roll" : "Roll", "Roll.playbackRate", duration, 0f); } else { ((EntityState)this).PlayAnimation("Body", (num2 > 0f) ? "Roll" : "Roll", "Roll.playbackRate", duration, 0f); } RecalculateRollSpeed(); if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection)) { ((EntityState)this).characterMotor.velocity.y = 0f; ((EntityState)this).characterMotor.velocity = forwardDirection * rollSpeed; } previousPosition = ((EntityState)this).transform.position - (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) ? ((EntityState)this).characterMotor.velocity : Vector3.zero); } private void RecalculateRollSpeed() { rollSpeed = base.moveSpeedStat * Mathf.Lerp(initialSpeedCoefficient, finalSpeedCoefficient, ((EntityState)this).fixedAge / duration); } public override void FixedUpdate() { //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_010b: 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) ((EntityState)this).FixedUpdate(); RecalculateRollSpeed(); if (((EntityState)this).fixedAge >= duration / 2f && !hasFired) { Fire(); } if (Object.op_Implicit((Object)(object)((EntityState)this).cameraTargetParams)) { ((EntityState)this).cameraTargetParams.fovOverride = Mathf.Lerp(dodgeFOV, 60f, ((EntityState)this).fixedAge / duration); } Vector3 val = ((EntityState)this).transform.position - previousPosition; Vector3 normalized = ((Vector3)(ref val)).normalized; if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection) && normalized != Vector3.zero) { Vector3 val2 = normalized * rollSpeed; float y = val2.y; val2.y = 0f; Vector3 velocity = forwardDirection * Mathf.Max(Vector3.Dot(val2, forwardDirection), 0f); velocity.y += Mathf.Max(y, 0f); ((EntityState)this).characterMotor.velocity = velocity; } previousPosition = ((EntityState)this).transform.position; if (!(((EntityState)this).fixedAge < duration) && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } private void Fire() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) if (!((EntityState)this).isAuthority) { return; } Ray aimRay = ((BaseState)this).GetAimRay(); if ((Object)(object)projectilePrefab != (Object)null) { FireProjectileInfo val = new FireProjectileInfo { projectilePrefab = projectilePrefab, owner = ((EntityState)this).gameObject, position = ((Ray)(ref aimRay)).origin, rotation = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), damage = damageCoefficient * base.damageStat, force = 0f, crit = ((BaseState)this).RollCrit() }; if (bombSoundString != null) { Util.PlaySound(bombSoundString, ((EntityState)this).gameObject); } ProjectileManager.instance.FireProjectile(val); hasFired = true; } } public override void OnExit() { ((Component)animator).GetComponent<ChildLocator>(); if (Object.op_Implicit((Object)(object)((EntityState)this).cameraTargetParams)) { ((EntityState)this).cameraTargetParams.fovOverride = -1f; } if (hasFired) { hasFired = false; } if (Utils.IsUsingMotionControls(((EntityState)this).characterBody) && vrCheck) { SkinnedMeshRenderer[] dmeshRenderers = DmeshRenderers; for (int i = 0; i < dmeshRenderers.Length; i++) { ((Renderer)dmeshRenderers[i]).enabled = true; } dmeshRenderers = NDmeshRenderers; for (int i = 0; i < dmeshRenderers.Length; i++) { ((Renderer)dmeshRenderers[i]).enabled = true; } } ((EntityState)this).OnExit(); } public override void OnSerialize(NetworkWriter writer) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).OnSerialize(writer); writer.Write(forwardDirection); } public override void OnDeserialize(NetworkReader reader) { //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) ((EntityState)this).OnDeserialize(reader); forwardDirection = reader.ReadVector3(); } } public class SMissile : BaseMissile { public override void OnEnter() { damageCoef = StaticValues.smissileDamageCoefficient; baseDuration = 0.1f; recoil = 0.5f; Sound = "SMissile"; sMissile = true; base.OnEnter(); } public override void OnExit() { ((EntityState)this).skillLocator.secondary.DeductStock(5); ((EntityState)this).skillLocator.secondary.RecalculateMaxStock(); base.OnExit(); } } public class trackingMissile : BaseMissile { protected SamusTracker SamusTracker; public override void OnEnter() { SamusTracker = ((EntityState)this).gameObject.GetComponent<SamusTracker>(); target = SamusTracker.GetTrackingTarget(); baseDuration = 0.1f; damageCoef = StaticValues.missileDamageCoefficient; recoil = 0.5f; smissleObject = null; Sound = "Missile"; sMissile = false; base.OnEnter(); } } } namespace SamusMod.SkillStates.BaseStates { public class BaseFireBeam : BaseSkillState { [SerializeField] public GameObject projectilePrefab; [SerializeField] public GameObject muzzleflashEffectPrefab; public float baseDuration; public float minDamageCoefficient; public float maxDamageCoefficient; public float force; public string muzzleName; public GameObject tracerPrefab; [SerializeField] public GameObject bulletHitEffect; private float duration; public float selfForce; public float charge; public float speed; private GameObject guncon; public Vector3 size; public string tracerSound; public string projSound; public Vector3 csize; public override void OnEnter() { ((BaseState)this).OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; Transform val = ((EntityState)this).GetModelChildLocator().FindChild("gunCon"); guncon = ((Component)val).gameObject; if (Utils.IsUsingMotionControls(((EntityState)this).characterBody)) { Animator animator = MotionControls.dominantHand.animator; if (charge <= 0.15f) { EntityState.PlayAnimationOnAnimator(animator, "Base Layer", "shoot", "Shoot.playbackRate", duration * 2f, 0f); } else if (charge > 0.15f) { EntityState.PlayAnimationOnAnimator(animator, "Base Layer", "chargeShoot", "Charge.playbackRate", ((BaseState)this).attackSpeedStat * 0.4585f, 0f); } } else if (charge == 1f) { ((EntityState)this).PlayAnimation("Gesture, Override", "chargeMaxShoot", "Charge.playbackRate", duration, 0f); } else { ((EntityState)this).PlayAnimation("Gesture, Override", "Beam", "Charge.playbackRate", duration, 0f); } if (Object.op_Implicit((Object)(object)muzzleflashEffectPrefab)) { EffectManager.SimpleMuzzleFlash(muzzleflashEffectPrefab, ((EntityState)this).gameObject, "gunCon", false); } Fire(); } public virtual void ResizeProjectile() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_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_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) projectilePrefab.transform.localScale = projectilePrefab.transform.localScale * charge + new Vector3(0.1f, 0.1f, 0.1f); ProjectileController component = projectilePrefab.GetComponent<ProjectileController>(); component.ghostPrefab.transform.localScale = component.ghostPrefab.transform.localScale * charge; } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { ((EntityState)this).OnExit(); } private void Fire() { //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) if (!((EntityState)this).isAuthority) { return; } if (charge <= 0.15f) { SphereCollider[] componentsInChildren = projectilePrefab.GetComponentsInChildren<SphereCollider>(); for (int i = 0; i < componentsInChildren.Length; i++) { _ = componentsInChildren[i].radius; } charge = 0.1f; } Ray aimRay = ((BaseState)this).GetAimRay(); if (Utils.IsUsingMotionControls(((EntityState)this).characterBody)) { aimRay = MotionControls.dominantHand.aimRay; } _ = (Object)(object)projectilePrefab != (Object)null; if ((Object)(object)projectilePrefab != (Object)null && charge > 0.15f) { float num = Util.Remap(charge, 0f, 1f, minDamageCoefficient, maxDamageCoefficient); float num2 = charge * force; if (Utils.IsUsingMotionControls(((EntityState)this).characterBody)) { Util.PlaySound(projSound, ((Component)MotionControls.dominantHand.muzzle).gameObject); } else { Util.PlaySound(projSound, ((EntityState)this).gameObject); } projectilePrefab.GetComponent<colision_test>().inTransform = guncon.transform; FireProjectileInfo val = new FireProjectileInfo { projectilePrefab = projectilePrefab, position = ((Ray)(ref aimRay)).origin, rotation = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), owner = ((EntityState)this).gameObject, damage = ((BaseState)this).damageStat * num, force = num2, crit = ((BaseState)this).RollCrit() }; ((FireProjectileInfo)(ref val)).speedOverride = speed; FireProjectileInfo val2 = val; ProjectileManager.instance.FireProjectile(val2); } else if (((EntityState)this).isAuthority) { Util.Remap(0.1f, 0.1f, 1f, minDamageCoefficient, maxDamageCoefficient); float num3 = charge * force; if (Utils.IsUsingMotionControls(((EntityState)this).characterBody)) { Util.PlaySound(projSound, ((Component)MotionControls.dominantHand.muzzle).gameObject); } else { Util.PlaySound(tracerSound, ((EntityState)this).gameObject); } new BulletAttack { owner = ((EntityState)this).gameObject, weapon = ((EntityState)this).gameObject, origin = ((Ray)(ref aimRay)).origin, aimVector = ((Ray)(ref aimRay)).direction, minSpread = 0f, maxSpread = 0f, damage = ((BaseState)this).damageStat * Config.pBeamMult, force = num3, tracerEffectPrefab = tracerPrefab, muzzleName = muzzleName, hitEffectPrefab = bulletHitEffect, isCrit = ((BaseState)this).RollCrit(), radius = 0.1f, smartCollision = true, damageType = new DamageTypeCombo(DamageTypeCombo.GenericPrimary, (DamageTypeExtended)0, (DamageSource)1) }.Fire(); } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)2; } } public class BaseMissile : BaseSkillState { public float damageCoef; public float baseDuration; public float recoil; [SerializeField] public GameObject projectilePrefab; [SerializeField] public GameObject muzzleEffectPrefab; [SerializeField] public GameObject smissleObject; public GameObject sMissileExtraMissiles; protected static int secStock; public bool sMissile; public string Sound; private float duration; private float fireDuration; private bool hasFired; private Animator animator; private string muzzleString; private Transform muzzleTransform; public HurtBox target; private Ray gunRay; public override void OnEnter() { ((BaseState)this).OnEnter(); sMissileExtraMissiles = (((Object)(object)smissleObject != (Object)null) ? smissleObject : null); duration = baseDuration / ((BaseState)this).attackSpeedStat; fireDuration = 0.5f * duration; ((EntityState)this).characterBody.SetAimTimer(2f); animator = ((EntityState)this).GetModelAnimator(); muzzleString = "gunCon"; ((EntityState)this).PlayAnimation("Gesture, Override", "Missile", "Missile.playbackRate", duration, 0f); secStock = ((EntityState)this).skillLocator.secondary.stock; muzzleTransform = ((EntityState)this).GetModelChildLocator().FindChild(muzzleString); } public override void OnExit() { if (Utils.IsUsingMotionControls(((EntityState)this).characterBody)) { VRStuff.SamusHUD.setMissileActive(active: true); } ((EntityState)this).OnExit(); } private void fireMissile() { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006c: 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_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) if (!hasFired) { hasFired = true; if (Utils.IsUsingMotionControls(((EntityState)this).characterBody)) { Util.PlaySound(Sound, ((Component)MotionControls.dominantHand.muzzle).gameObject); } else { Util.PlaySound(Sound, ((EntityState)this).gameObject); } ((EntityState)this).characterBody.AddSpreadBloom(0.75f); Ray aimRay = ((BaseState)this).GetAimRay(); gunRay = new Ray(muzzleTransform.position, ((Ray)(ref aimRay)).direction); if (Utils.IsUsingMotionControls(((EntityState)this).characterBody)) { aimRay = MotionControls.dominantHand.aimRay; } if ((Object)(object)muzzleEffectPrefab != (Object)null) { EffectManager.SimpleMuzzleFlash(muzzleEffectPrefab, ((EntityState)this).gameObject, muzzleString, false); } if (((EntityState)this).isAuthority && (Object)(object)target != (Object)null) { MissileUtils.FireMissile(((Ray)(ref gunRay)).origin, ((EntityState)this).characterBody, default(ProcChainMask), ((Component)target).gameObject, damageCoef * ((BaseState)this).damageStat, ((BaseState)this).RollCrit(), projectilePrefab, (DamageColorIndex)0, ((Ray)(ref gunRay)).direction + Random.insideUnitSphere * 0.1f, 100f, true); } else if (((EntityState)this).isAuthority && (Object)(object)target == (Object)null && !sMissile) { MissileUtils.FireMissile(((Ray)(ref gunRay)).origin, ((EntityState)this).characterBody, default(ProcChainMask), (GameObject)null, damageCoef * ((BaseState)this).damageStat, ((BaseState)this).RollCrit(), projectilePrefab, (DamageColorIndex)0, ((Ray)(ref gunRay)).direction + Random.insideUnitSphere * 0.25f, 100f, true); } else if (((EntityState)this).isAuthority && (Object)(object)target == (Object)null && sMissile) { SuperMissileICBMLaunch(((Ray)(ref gunRay)).origin, ((EntityState)this).characterBody, default(ProcChainMask), null, damageCoef * ((BaseState)this).damageStat, ((BaseState)this).RollCrit(), projectilePrefab, (DamageColorIndex)0); } } } private void SuperMissileICBMLaunch(Vector3 position, CharacterBody attacker, ProcChainMask procChainMask, GameObject victim, float missileDamage, bool isCrit, GameObject projectilePrefab, DamageColorIndex damageColorIndex) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: 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_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_010f: 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_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0118: 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_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.up + Random.insideUnitSphere * 0.1f; float force = 200f; Inventory inventory = ((EntityState)this).characterBody.inventory; int num = ((inventory != null) ? inventory.GetItemCountEffective(Items.MoreMissile) : 0); float num2 = Mathf.Max(1f, 1f + 0.5f * (float)(num - 1)); InputBankTest inputBank = ((EntityState)this).inputBank; ProcChainMask procChainMask2 = procChainMask; if (true) { ((ProcChainMask)(ref procChainMask2)).AddProc((ProcType)1); } FireProjectileInfo val2 = new FireProjectileInfo { projectilePrefab = projectilePrefab, position = position, rotation = Util.QuaternionSafeLookRotation(((Ray)(ref gunRay)).direction), procChainMask = procChainMask2, target = victim, owner = ((Component)attacker).gameObject, damage = missileDamage * num2, crit = isCrit, force = force, damageColorIndex = damageColorIndex }; ProjectileManager.instance.FireProjectile(val2); if (num > 0) { Vector3 val3 = (Object.op_Implicit((Object)(object)inputBank) ? inputBank.aimDirection : attacker.transform.position); FireProjectileInfo val4 = val2; val4.rotation = Util.QuaternionSafeLookRotation(Quaternion.AngleAxis(45f, val3) * val); val4.projectilePrefab = sMissileExtraMissiles; val4.damage = StaticValues.missileDamageCoefficient * ((BaseState)this).damageStat; FireProjectileInfo val5 = val2; val5.rotation = Util.QuaternionSafeLookRotation(Quaternion.AngleAxis(-45f, val3) * val); val5.projectilePrefab = sMissileExtraMissiles; val5.damage = StaticValues.missileDamageCoefficient * ((BaseState)this).damageStat; ProjectileManager.instance.FireProjectile(val4); ProjectileManager.instance.FireProjectile(val5); } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= fireDuration) { fireMissile(); } if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)1; } public void calculateSMissiles() { int maxStock = 0; if (secStock % 5 == 0) { maxStock = secStock / 5; } else if (secStock / 5 > 1) { maxStock = secStock / 5; } else if (secStock < 1) { maxStock = 0; } ((EntityState)this).skillLocator.special.maxStock = maxStock; } } public class BaseMorphBall : BaseSkillState { private ChildLocator ChildLocator; private bool onEnter; [SerializeField] public float speedMult = 1.2f; private GameObject ball; private GameObject armature; private GameObject mesh; private GameObject bone; private float normalSpeed; private Transform tran; private float velx; private float vely; private float velz; [SerializeField] public SkillDef bomb; [SerializeField] public SkillDef powerBomb; [SerializeField] public SkillDef exitMorph; public override void OnEnter() { ((BaseState)this).OnEnter(); onEnter = true; ((EntityState)this).skillLocator.utility.SetSkillOverride((object)((EntityState)this).skillLocator.utility, exitMorph, (SkillOverridePriority)4); ChildLocator = ((EntityState)this).GetModelChildLocator(); ((Component)((EntityState)this).characterBody).gameObject.GetComponent<Collider>().enabled = false; ball = ((Component)ChildLocator.FindChild("Ball2")).gameObject; armature = ((Component)ChildLocator.FindChild("armature")).gameObject; mesh = ((Component)ChildLocator.FindChild("Body")).gameObject; bone = ((Component)ChildLocator.FindChild("Ball2Bone")).gameObject; ball.GetComponent<Rigidbody>().constraints = (RigidbodyConstraints)14; normalSpeed = ((BaseState)this).moveSpeedStat; ((BaseState)this).moveSpeedStat = normalSpeed * 2f; if (NetworkServer.active) { ((EntityState)this).characterBody.AddBuff(Buffs.ArmorBoost); } ball.SetActive(true); armature.SetActive(false); mesh.SetActive(false); } private Vector3 IdealVelocity() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) return ((EntityState)this).characterDirection.forward * ((EntityState)this).characterBody.moveSpeed * speedMult; } public override void FixedUpdate() { //IL_0075: 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) ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= 0.5f && onEnter) { onEnter = false; } if (Object.op_Implicit((Object)(object)((EntityState)this).inputBank) && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection)) { Collider component = ball.GetComponent<Collider>(); Rigidbody component2 = ball.GetComponent<Rigidbody>(); component.enabled = true; component2.isKinematic = false; component2.interpolation = (RigidbodyInterpolation)1; component2.collisionDetectionMode = (CollisionDetectionMode)1; component2.AddForce(((EntityState)this).characterMotor.velocity * 100f, (ForceMode)0); } } public override void Update() { ((EntityState)this).Update(); velx = ((EntityState)this).characterMotor.velocity.x; vely = ((EntityState)this).characterMotor.velocity.y; velz = ((EntityState)this).characterMotor.velocity.z; } public override void OnExit() { if (NetworkServer.active) { ((EntityState)this).characterBody.RemoveBuff(Buffs.ArmorBoost); } ((Component)((EntityState)this).characterBody).gameObject.GetComponent<Collider>().enabled = true; Collider component = ball.GetComponent<Collider>(); Rigidbody component2 = ball.GetComponent<Rigidbody>(); component.enabled = false; component2.isKinematic = true; component2.interpolation = (RigidbodyInterpolation)0; component2.collisionDetectionMode = (CollisionDetectionMode)0; ((Component)ChildLocator.FindChild("Ball2")).gameObject.SetActive(false); ((Component)ChildLocator.FindChild("armature")).gameObject.SetActive(true); ((Component)ChildLocator.FindChild("Body")).gameObject.SetActive(true); ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)2; } } public class BaseSamus : GenericCharacterMain { private ChildLocator ChildLocator; private Animator Animator; private static bool noPowerBomb; private bool filled; private Collision collision; private Collider collider; private GameObject ball; private Rigidbody BallRigidBody; private Vector3 velocity; private Vector3 direction; public Vector3 camera; private float horizontalInput; private Vector3 forwardDir; private static float stopwatch; private static float stopwatch2; private static float cacheStopwatch; private static float cacheStopwatch2; private static float maxStopwatch; private static float maxStopwatch2; private static bool powerBombInit; private static bool vrCheck; private static CharacterBody body; [SerializeField] public SkillDef morphBallRef; [SerializeField] public SkillDef autoFireSkill; private static GenericSkill powerBallskill; private static GenericSkill missileSkill; private bool effectiveAuth; private PlayerCharacterMasterController PlayerCharacterMasterController; private Player player; public static bool morphBall { get; set; } public static CharacterBody Body { get { return body; } set { body = value; } } public static bool VrCheck { get { return vrCheck; } set { vrCheck = value; } } public static float Stopwatch { get { return stopwatch; } set { stopwatch = value; } } public static float Stopwatch2 { get { return stopwatch2; } set { stopwatch2 = value; } } public static bool PowerBombInit { get { return powerBombInit; } set { powerBombInit = value; } } public static GenericSkill PowerBallskill { get { return powerBallskill; } set { powerBallskill = value; } } public static GenericSkill MissileSkill { get { return missileSkill; } set { missileSkill = value; } } public override void OnEnter() { ChildLocator = ((EntityState)this).GetModelChildLocator(); ball = ((Component)ChildLocator.FindChild("Ball2")).gameObject; collider = ball.GetComponent<Collider>(); BallRigidBody = ball.GetComponent<Rigidbody>(); PlayerCharacterMasterController = ((EntityState)this).characterBody.master.playerCharacterMasterController; LocalUser val = default(LocalUser); CameraRigController val2 = default(CameraRigController); bool flag = default(bool); PlayerCharacterMasterController.CanSendBodyInput(PlayerCharacterMasterController.networkUser, ref val, ref player, ref val2, ref flag); if ((Object)(object)((EntityState)this).skillLocator.utility.skillDef == (Object)(object)morphBallRef) { MissileSkill = ((EntityState)this).skillLocator.FindSkillByFamilyName("SamusSecondary"); powerBallskill = ((EntityState)this).skillLocator.FindSkillByFamilyName("SamusSecondary2"); } else { ((Behaviour)((EntityState)this).skillLocator.FindSkillByFamilyName("SamusSecondary2")).enabled = false; } Stopwatch = 0f; Stopwatch2 = 0f; powerBombInit = false; Body = ((EntityState)this).characterBody; if (VR.enabled) { VrCheck = Utils.IsUsingMotionControls(Body); if (VrCheck) { VRStuff.setupVR(Body); Camera.main.nearClipPlane = 0.05f; ((Component)ChildLocator.FindChild("chargeEffect")).gameObject.SetActive(false); if (Config.enableHud.Value) { VRStuff.SamusHUD.initSamusHUD(Body); } } } ((GenericCharacterMain)this).OnEnter(); } public override void Update() { ((GenericCharacterMain)this).Update(); if ((Object)(object)DotController.FindDotController(((EntityState)this).gameObject) != (Object)null) { DotController val = DotController.FindDotController(((EntityState)this).gameObject); switch (val.activeDotFlags) { case 3u: val.RemoveDotStackAtServer(3); break; case 1u: val.RemoveDotStackAtServer(1); break; case 2u: val.RemoveDotStackAtServer(2); break; } } if (effectiveAuth && !morphBall && player.GetButtonDown(RewiredAction.autoFire.ActionId)) { if ((Object)(object)((EntityState)this).skillLocator.primary.skillDef == (Object)(object)autoFireSkill) { ((EntityState)this).skillLocator.primary.UnsetSkillOverride((object)((EntityState)this).skillLocator.primary, autoFireSkill, (SkillOverridePriority)4); } else { ((EntityState)this).skillLocator.primary.SetSkillOverride((object)((EntityState)this).skillLocator.primary, autoFireSkill, (SkillOverridePriority)4); } } } public override void FixedUpdate() { //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0442: Unknown result type (might be due to invalid IL or missing references) //IL_0447: Unknown result type (might be due to invalid IL or missing references) //IL_045e: Unknown result type (might be due to invalid IL or missing references) ((GenericCharacterMain)this).FixedUpdate(); effectiveAuth = ((EntityState)this).characterBody.master.hasEffectiveAuthority; if (Object.op_Implicit((Object)(object)Animator)) { Animator.SetFloat("sprintValue", (float)(((EntityState)this).characterBody.isSprinting ? (-1) : 0), 0.2f, Time.fixedDeltaTime); Animator.SetBool("inCombat", !((EntityState)this).characterBody.outOfCombat || !((EntityState)this).characterBody.outOfDanger); } if (!((EntityState)this).healthComponent.alive) { EntityState.Destroy((Object)(object)VRStuff.hudHandle); } if (((EntityState)this).healthComponent.isInFrozenState && ChildLocator.FindChild("Ball").localScale != new Vector3(0.5f, 0.5f, 0.5f)) { ChildLocator.FindChild("Ball").localScale = new Vector3(0.5f, 0.5f, 0.5f); } if (stopwatch2 < maxStopwatch2) { stopwatch2 += Time.fixedDeltaTime; } if (!morphBall) { return; } if (stopwatch < maxStopwatch) { stopwatch += Time.fixedDeltaTime; } velocity = ((EntityState)this).characterMotor.velocity; direction = ((EntityState)this).inputBank.moveVector; Quaternion rotation = ((EntityState)this).cameraTargetParams.cameraPivotTransform.rotation; camera = ((Quaternion)(ref rotation)).eulerAngles; Vector3.Scale(velocity, direction); collider.enabled = true; BallRigidBody.isKinematic = false; BallRigidBody.interpolation = (RigidbodyInterpolation)1; BallRigidBody.collisionDetectionMode = (CollisionDetectionMode)1; float num; if (((EntityState)this).characterBody.isSprinting) { num = ((velocity.x < 0f && velocity.z < 0f) ? (0f - velocity.x + (0f - velocity.z)) : ((velocity.x < 0f && velocity.z > 0f) ? (0f - velocity.x + velocity.z) : ((velocity.x > 0f && velocity.z < 0f) ? (velocity.x + (0f - velocity.z)) : ((!(velocity.x > 0f) || !(velocity.z > 0f)) ? (velocity.x + velocity.z) : (velocity.x + velocity.z))))); if (num > 16.8f || num < -16.8f) { num = 16.8f; } } else { num = ((velocity.x < 0f && velocity.z < 0f) ? (0f - velocity.x + (0f - velocity.z)) : ((velocity.x < 0f && velocity.z > 0f) ? (0f - velocity.x + velocity.z) : ((velocity.x > 0f && velocity.z < 0f) ? (velocity.x + (0f - velocity.z)) : ((!(velocity.x > 0f) || !(velocity.z > 0f)) ? (velocity.x + velocity.z) : (velocity.x + velocity.z))))); if (num > 14f || num < -14f) { num = 14f; } } if (((EntityState)this).characterMotor.velocity != Vector3.zero) { ball.transform.Rotate(Vector3.up, 0f - num); } } private void DotController_onDotInflictedServerGlobal(DotController dotController, ref InflictDotInfo inflictDotInfo) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Invalid comparison between Unknown and I4 if ((inflictDotInfo.victimObject.gameObject.GetComponent<CharacterBody>().baseNameToken == "DG_SAMUS_NAME" || inflictDotInfo.attackerObject.gameObject.GetComponent<CharacterBody>().baseNameToken == "DG_SAMUS_NAME") && (int)inflictDotInfo.dotIndex == 3) { inflictDotInfo.duration = 0f; inflictDotInfo.damageMultiplier = 0f; } } public override void OnExit() { ((GenericCharacterMain)this).OnExit(); EntityState.Destroy((Object)(object)VRStuff.hudHandle); } } public class ChargeBeamBase : BaseSkillState { [SerializeField] public GameObject chargeEffectPrefab; [SerializeField] public string chargeSoundString; [SerializeField] public GameObject chargeMuzzle; public float baseDuration = 1.15f; [SerializeField] public float minBloomRadius; [SerializeField] public float maxBloomRadius; public GameObject crosshairOverridePrefab; protected static readonly float minChargeDuration; protected static Vector3 size; private GameObject defaultCrosshairPrefab; private uint loopSoundInstanceId; private OverrideRequest crosshairOverrideRequest; private bool isPlayingSound; private float duration { get; set; } private Animator animator { get; set; } private ChildLocator childLocator { get; set; } [SerializeField] public GameObject chargeEffectInstance { get; set; } public virtual BaseFireBeam GetNextBase() { return new BaseFireBeam(); } public override void OnEnter() { //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; animator = ((EntityState)this).GetModelAnimator(); childLocator = ((EntityState)this).GetModelChildLocator(); Transform val = childLocator.FindChild("gunCon"); crosshairOverrideRequest = CrosshairUtils.RequestOverrideForBody(((EntityState)this).characterBody, crosshairOverridePrefab, (OverridePriority)1); if (!Utils.IsUsingMotionControls(((EntityState)this).characterBody)) { if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)chargeEffectPrefab)) { chargeEffectInstance = Object.Instantiate<GameObject>(chargeEffectPrefab, val.position, val.rotation); chargeEffectInstance.transform.parent = val; } } else { chargeEffectInstance = Object.Instantiate<GameObject>(chargeEffectPrefab, val); chargeEffectInstance.transform.Rotate(90f, 0f, 0f); } ((EntityState)this).PlayAnimation("Gesture, Override", "chargeLoop", "Charge.playbackRate", duration, 0f); defaultCrosshairPrefab = ((EntityState)this).characterBody.defaultCrosshairPrefab; ((BaseState)this).StartAimMode(duration + 2f, false); } public override void OnExit() { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) OverrideRequest obj = crosshairOverrideRequest; if (obj != null) { obj.Dispose(); } AkSoundEngine.StopPlayingID(loopSoundInstanceId); if (!((EntityState)this).outer.destroying) { ((EntityState)this).PlayAnimation("Gesture, Override", "BufferEmpty"); } size = chargeEffectInstance.transform.localScale; EntityState.Destroy((Object)(object)chargeEffectInstance); ((EntityState)this).OnExit(); } protected virtual float calcCharge() { if (((EntityState)this).age <= Time.fixedDeltaTime) { return Mathf.Clamp01(Time.fixedDeltaTime / duration); } return Mathf.Clamp01(((EntityState)this).fixedAge / duration); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); float charge = calcCharge(); TryNextState(charge); } public override void Update() { ((EntityState)this).Update(); float charge = calcCharge(); TryNextState(charge); ((EntityState)this).characterBody.SetSpreadBloom(Util.Remap(calcCharge(), 0f, 1f, minBloomRadius, maxBloomRadius), true); } private void TryNextState(float charge) { if (((EntityState)this).isAuthority && !isPlayingSound && (double)charge > 0.15) { if (Utils.IsUsingMotionControls(((EntityState)this).characterBody)) { loopSoundInstanceId = Util.PlayAttackSpeedSound(chargeSoundString, ((Component)MotionControls.dominantHand.muzzle).gameObject, duration - 0.15f); } else { loopSoundInstanceId = Util.PlayAttackSpeedSound(chargeSoundString, ((EntityState)this).gameObject, duration - 0.15f); } isPlayingSound = true; } if (((EntityState)this).isAuthority && !((BaseSkillState)this).IsKeyDownAuthority() && ((EntityState)this).age >= minChargeDuration) { BaseFireBeam nextBase = GetNextBase(); nextBase.charge = charge; ((EntityState)this).outer.SetNextState((EntityState)(object)nextBase); } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)2; } } public class DeathState : GenericCharacterDeath { private Vector3 previousPosition; private float upSpeedVelocity; private float upSpeed; private Animator modelAnimator; public override bool shouldAutoDestroy => false; public override void OnEnter() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) ((GenericCharacterDeath)this).OnEnter(); Vector3 val = Vector3.up * 3f; if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { val += ((EntityState)this).characterMotor.velocity; ((Behaviour)((EntityState)this).characterMotor).enabled = false; } if (Object.op_Implicit((Object)(object)((GenericCharacterDeath)this).cachedModelTransform)) { RagdollController component = ((Component)((GenericCharacterDeath)this).cachedModelTransform).GetComponent<RagdollController>(); if (Object.op_Implicit((Object)(object)component)) { component.BeginRagdoll(val); } } } public override void PlayDeathAnimation(float crossfadeDuration = 0.1f) { } public override void FixedUpdate() { ((GenericCharacterDeath)this).FixedUpdate(); if (NetworkServer.active && ((EntityState)this).fixedAge > 4f) { EntityState.Destroy((Object)(object)((EntityState)this).gameObject); } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)9; } } public class SpawnState : BaseState { [SerializeField] public float duration; private Transform modelTransform; private Animator animator; public override void OnEnter() { ((BaseState)this).OnEnter(); animator = ((EntityState)this).GetModelAnimator(); modelTransform = ((EntityState)this).GetModelTransform(); if (NetworkServer.active) { ((EntityState)this).characterBody.AddBuff(Buffs.HiddenInvincibility); } ((EntityState)this).PlayAnimation("Body", "Spawn", "Spawn.playbackRate", duration, 0f); if (Object.op_Implicit((Object)(object)animator)) { animator.SetFloat(AnimationParameters.aimWeight, 0f); } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (Object.op_Implicit((Object)(object)animator)) { animator.SetBool("inCombat", true); } if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { ((EntityState)this).OnExit(); if (Object.op_Implicit((Object)(object)animator)) { animator.SetFloat(AnimationParameters.aimWeight, 1f); } if (NetworkServer.active) { ((EntityState)this).characterBody.RemoveBuff(Buffs.HiddenInvincibility); } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)9; } } } namespace SamusMod.Misc { public class colision_test : MonoBehaviour { public Transform inTransform; private ProjectileSingleTargetImpact projectileSingle; private float length; private float dist; private void Awake() { projectileSingle = ((Component)this).gameObject.GetComponent<ProjectileSingleTargetImpact>(); length = 1f; projectileSingle.destroyOnWorld = false; } private void FixedUpdate() { //IL_0019: 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) if (Object.op_Implicit((Object)(object)inTransform)) { dist = Vector3.Distance(((Component)this).gameObject.transform.position, inTransform.position); } if (dist >= length) { projectileSingle.destroyOnWorld = true; ((Behaviour)this).enabled = false; } } } public class hudBall : MonoBehaviour { private hudColors hudColors; private GameObject bombDeco; private Image bombIcon; private Text bombDigits; private List<Image> bombFilled; private List<Image> bombEmpty; private GameObject energyDeco; private GameObject baseObject; private int pbAmount; private int pbCapacity; private int availableBombs; private bool hasPb; public bool ballini; private void Awake() { //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) hudColors = new hudColors(combatVisor: false); string text = "ballHUD"; baseObject = ((Component)((Component)this).gameObject.transform.Find(text)).gameObject; bombDeco = ((Component)((Component)this).gameObject.transform.Find(text + "/bombdeco")).gameObject; bombIcon = ((Component)((Component)this).gameObject.transform.Find(text + "/Bombs/Powerbomb/PBfill")).gameObject.GetComponent<Image>(); bombDigits = ((Component)((Component)this).gameObject.transform.Find(text + "/Text/PowerBombText")).gameObject.GetComponent<Text>(); bombFilled = new List<Image>(); bombEmpty = new List<Image>(); for (int i = 0; i < 3; i++) { string text2 = text + "/Bombs/bomb" + (i + 1) + "/Bfill" + (i + 1); bombFilled.Add(((Component)((Component)this).gameObject.transform.Find(text2)).gameObject.GetComponent<Image>()); ((Graphic)bombFilled[i]).color = hudColors.ballBombFilled; text2 = text + "/Bombs/bomb" + (i + 1) + "/Bempty" + (i + 1); bombEmpty.Add(((Component)((Component)this).gameObject.transform.Find(text2)).gameObject.GetComponent<Image>()); ((Graphic)bombEmpty[i]).color = hudColors.ballBombEmpty; } ((Graphic)bombDeco.GetComponent<Image>()).color = hudColors.ballBombDeco; energyDeco = ((Component)((Component)this).gameObject.transform.Find(text + "/energydeco")).gameObject; ((Graphic)energyDeco.GetComponent<Image>()).color = hudColors.ballBombEnergyDeco; ballini = false; } private void Update() { } public bool isActive(bool init) { if (init) { return true; } if (((Component)energyDeco.transform.parent).gameObject.activeInHierarchy) { return true; } return false; } private void UpdatePowerBombReadoutColors() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_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_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) Color color; Color effectColor; if (pbAmount > 0) { color = hudColors.powerBombDigitAvaliableFont; effectColor = hudColors.powerBombDigitAvaliableOutline; } else if (pbCapacity > 0) { color = hudColors.powerBombDigitDepletedFont; effectColor = hudColors.powerBombDigitDepletedOutline; } else { color = Color.clear; effectColor = Color.clear; } ((Graphic)bombDigits).color = color; ((Shadow)((Component)bombDigits).gameObject.GetComponent<Outline>()).effectColor = effectColor; Color color2 = ((pbAmount > 0) ? hudColors.powerBombIconAvaliable : ((pbCapacity <= 0) ? Color.clear : hudColors.powerBombIconUnavaliable)); ((Graphic)bombIcon).color = color2; } public void SetBombParams(int PbAmount, int PbCapacity, int AvailableBombs, bool init, hudColors colors) { if (PbAmount != pbAmount || init) { bombDigits.text = PbAmount.ToString("D2"); pbAmount = PbAmount; UpdatePowerBombReadoutColors(); } if (pbCapacity != PbCapacity || init) { pbCapacity = PbCapacity; UpdatePowerBombReadoutColors(); } for (int i = 0; i < 3; i++) { bool active = i < AvailableBombs; ((Component)bombFilled[i]).gameObject.SetActive(active); } availableBombs = AvailableBombs; hudColors = colors; bombDeco.SetActive(pbCapacity > 0); if (init) { ballini = true; } } public void SetavaliableBombs(int AvailableBombs) { availableBombs = AvailableBombs; } public void SetActive(bool active) { baseObject.SetActive(active); } } public class hudBossEnergy : MonoBehaviour { private float alpha; private float fader; private float curEnergy; private float maxEnergy; private bool visible; [SerializeField] private GameObject root; [SerializeField] private List<GameObject> rootChildren; [SerializeField] private hudEnergyBar bossBar; private Text textBoss; private Text textBossSub; public bool bossIni; private hudColors hudColors; private hudColors.EnergyBarColors EnergyBarColors; public Color debugColor; public bool loaded; private void Start() { bossIni = false; alpha = 1f; fader = 0f; curEnergy = 0f; maxEnergy = 0f; visible = false; root = ((Component)((Component)this).gameObject.transform.Find("bossHud")).gameObject; bossBar = ((Component)root.transform.Find("BossHealth/BossBar")).gameObject.GetComponent<hudEnergyBar>(); textBoss = ((Component)root.transform.Find("BossFrame/bossName")).gameObject.GetComponent<Text>(); textBossSub = ((Component)((Component)textBoss).transform.GetChild(0)).GetComponent<Text>(); rootChildren = new List<GameObject>(); Transform[] componentsInChildren = ((Component)root.transform).GetComponentsInChildren<Transform>(true); foreach (Transform val in componentsInChildren) { if ((Object)(object)val != (Object)(object)root.transform) { rootChildren.Add(((Component)val).gameObject); } } bossBar.SetTesselation(0.2f); loaded = true; } public bool isVisible(bool init) { if (init) { return false; } if (visible) { return true; } return false; } public void hudUpdate(float dt) { //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: 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_013c: Unknown result type (might be due to invalid IL or missing references) bossBar.updateBar(dt); if (visible) { fader = Mathf.Min(fader + dt, 1f); } else { fader = Mathf.Max(0f, fader - dt); } if (fader > 0f) { Color white = Color.white; white.a = alpha * fader; debugColor = white; for (int i = 0; i < rootChildren.Count; i++) { if ((Object)(object)rootChildren[i].gameObject.GetComponent<Image>() != (Object)null) { ((Graphic)rootChildren[i].gameObject.GetComponent<Image>()).material.color = white; } else if ((Object)(object)rootChildren[i].gameObject.GetComponent<Text>() != (Object)null) { ((Graphic)rootChildren[i].gameObject.GetComponent<Text>()).material.color = white; } else if ((Object)(object)rootChildren[i].gameObject.GetComponent<RawImage>() != (Object)null) { ((Graphic)rootChildren[i].gameObject.GetComponent<RawImage>()).material.color = white; } } for (int j = 0; j < rootChildren.Count; j++) { root.SetActive(true); rootChildren[j].SetActive(true); } } else { for (int k = 0; k < rootChildren.Count; k++) { root.SetActive(false); rootChildren[k].SetActive(false); } } bossBar.Draw(); } public void SetAlpha(float a) { alpha = a; } public void SetBossParams(bool Visible, string name, string subtitle, float curenerg, float maxenerg, hudColors colors, hudColors.EnergyBarColors barColors) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0055: 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) hudColors = colors; EnergyBarColors = barColors; visible = Visible; if (Visible) { bossBar.SetFilledColor(EnergyBarColors.filled); bossBar.SetShadowColor(EnergyBarColors.shadow); bossBar.SetEmptyColor(EnergyBarColors.empty); bossBar.SetColor2(Color.white); bossBar.SetFilledDrainSpeed(maxenerg); bossBar.SetCurrEnergy(curenerg, hudEnergyBar.ESetMode.Normal); bossBar.SetMaxEnergy(maxenerg); textBoss.text = name; textBossSub.text = subtitle; } curEnergy = curenerg; maxEnergy = maxenerg; bossIni = true; } public void SetCurrHealth(float CurrEnergy) { curEnergy = CurrEnergy; bossBar.SetCurrEnergy(CurrEnergy, hudEnergyBar.ESetMode.Normal); } public void reset() { bossBar.ResetMaxEnergy(); bossBar.SetCurrEnergy(0f, hudEnergyBar.ESetMode.Normal); textBoss.text = ""; textBossSub.text = ""; alpha = 1f; fader = 0f; visible = false; bossIni = false; } public float GetCurrentHealth() { if (Object.op_Implicit((Object)(object)bossBar)) { return bossBar.GetSetEnergy(); } return 0f; } public float GetMaxEnergy() { return maxEnergy; } } public struct hudColors { public struct EnergyBarColors { public Color filled; public Color empty; public Color shadow; } public struct EnergyInitColors { public Color tankFilled; public Color tankEmpty; public Color digitsFont; public Color digitsOutlin