Decompiled source of Starstorm2 v0.6.7
plugins/Starstorm2.dll
Decompiled 4 months ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; 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 System.Text; using AncientScepter; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using EntityStates; using EntityStates.AI.Walker; using EntityStates.Bandit2; using EntityStates.Barrel; using EntityStates.Bison; using EntityStates.BrotherMonster; using EntityStates.Captain.Weapon; using EntityStates.Chirr; using EntityStates.Chirr.Claws; using EntityStates.Chirr.Wings; using EntityStates.Commando; using EntityStates.Commando.CommandoWeapon; using EntityStates.Drone; using EntityStates.DroneTable; using EntityStates.DropPod; using EntityStates.Engi.EngiMissilePainter; using EntityStates.Events; using EntityStates.Generic; using EntityStates.GolemMonster; using EntityStates.GravekeeperBoss; using EntityStates.Huntress; using EntityStates.ImpBossMonster; using EntityStates.Interactables.StoneGate; using EntityStates.Knight; using EntityStates.LemurianMonster; using EntityStates.LunarGolem; using EntityStates.LunarWisp; using EntityStates.Merc; using EntityStates.MiniMushroom; using EntityStates.NemMerc; using EntityStates.NullifierMonster; using EntityStates.Pickups.Augury; using EntityStates.Toolbot; using EntityStates.Trader.Bag; using HG; using HG.BlendableTypes; using HG.Reflection; using IL.EntityStates.AI.Walker; using IL.RoR2; using IL.RoR2.UI; using JetBrains.Annotations; using KinematicCharacterController; using Microsoft.CodeAnalysis; using Mono.Cecil.Cil; using MonoMod.Cil; using Moonstorm; using Moonstorm.AddressableAssets; using Moonstorm.Components; using Moonstorm.Config; using Moonstorm.Loaders; using Moonstorm.Starstorm2; using Moonstorm.Starstorm2.Artifacts; using Moonstorm.Starstorm2.Buffs; using Moonstorm.Starstorm2.Components; using Moonstorm.Starstorm2.DamageTypes; using Moonstorm.Starstorm2.Equipments; using Moonstorm.Starstorm2.Interactables; using Moonstorm.Starstorm2.Items; using Moonstorm.Starstorm2.Modules; using Moonstorm.Starstorm2.Orbs; using Moonstorm.Starstorm2.PostProcess; using Moonstorm.Starstorm2.ScriptableObjects; using Moonstorm.Starstorm2.Survivors; using On.EntityStates; using On.EntityStates.Drone; using On.EntityStates.Interactables.StoneGate; using On.EntityStates.Toolbot; using On.RoR2; using On.RoR2.CharacterAI; using On.RoR2.Items; using On.RoR2.Orbs; using On.RoR2.Projectile; using On.RoR2.UI; using On.RoR2.UI.MainMenu; using R2API; using R2API.Networking; using R2API.Networking.Interfaces; using R2API.ScriptableObjects; using R2API.Utils; using RiskOfOptions; using RiskOfOptions.OptionConfigs; using RoR2; using RoR2.Achievements; using RoR2.Achievements.Artifacts; using RoR2.Artifacts; using RoR2.Audio; using RoR2.CharacterAI; using RoR2.ExpansionManagement; using RoR2.HudOverlay; using RoR2.Items; using RoR2.Navigation; using RoR2.Networking; using RoR2.Orbs; using RoR2.Projectile; using RoR2.Skills; using RoR2.UI; using RoR2.UI.MainMenu; using TMPro; using ThreeEyedGames; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.Rendering.PostProcessing; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("Starstorm 2")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Starstorm 2")] [assembly: AssemblyCopyright("")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: OptIn] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class IsReadOnlyAttribute : Attribute { } } public class AnimEquip : MonoBehaviour { public Transform equip; public Transform unequip; private int equipped = -1; public void EquipKnife(int equip) { if (equip != equipped) { equipped = equip; bool flag = equip == 1; if (Object.op_Implicit((Object)(object)this.equip)) { ((Component)this.equip).gameObject.SetActive(flag); } if (Object.op_Implicit((Object)(object)unequip)) { ((Component)unequip).gameObject.SetActive(!flag); } } } } public class ActivateTriggerAfterXSeconds : StateMachineBehaviour { public string triggerParameterName; public float desiredTriggerTime; private float timer; public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { timer = 0f; } public override void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { timer += Time.deltaTime; if (timer >= desiredTriggerTime) { animator.SetTrigger(triggerParameterName); timer = 0f; } } public override void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { timer = 0f; } } public class CrosshairPositionNormalize : MonoBehaviour { private RectTransform rectTransform; private void Awake() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) rectTransform = ((Component)this).GetComponent<RectTransform>(); ((Transform)rectTransform).localPosition = Vector3.zero; } private void FixedUpdate() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) ((Transform)rectTransform).localPosition = Vector3.zero; } } public class CrosshairScaleNormalize : MonoBehaviour { private RectTransform rectTransform; private void Awake() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) rectTransform = ((Component)this).GetComponent<RectTransform>(); ((Transform)rectTransform).localScale = new Vector3(1.2f, 1f, 0f); } private void FixedUpdate() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) ((Transform)rectTransform).localScale = new Vector3(1.2f, 1f, 0f); } } public class VFXListComponent : MonoBehaviour { public List<GameObject> VFXParticles = new List<GameObject>(); private void Start() { } private void FixedUpdate() { } public void TurnOffVFX() { foreach (GameObject vFXParticle in VFXParticles) { vFXParticle.SetActive(false); } } public void TurnOnVFX() { foreach (GameObject vFXParticle in VFXParticles) { vFXParticle.SetActive(true); } } } namespace Assets.Starstorm2.ScriptableObjects { [CreateAssetMenu(menuName = "Starstorm2/SkillDef/BeastmasterSkillDef")] internal class BeastmasterSkillDef : SkillDef { protected class InstanceData : BaseSkillInstanceData, IDisposable { public CharacterBody currentlyTrackingOrTamedTarget; public float trackerUpdateFrequency; public float maxTrackingDistance; public float maxTrackingAngle; private readonly BullseyeSearch search = new BullseyeSearch(); internal Indicator indicator; private float trackerUpdateStopwatch; public InstanceData() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0024: Unknown result type (might be due to invalid IL or missing references) search.filterByLoS = true; search.sortMode = (SortMode)1; } public void SetNewTrackingTarget(CharacterBody characterBody) { currentlyTrackingOrTamedTarget = characterBody; } public void SetNewTrackingTarget(HurtBox hurtbox) { if (Object.op_Implicit((Object)(object)hurtbox) && Object.op_Implicit((Object)(object)hurtbox.healthComponent) && Object.op_Implicit((Object)(object)hurtbox.healthComponent.body)) { currentlyTrackingOrTamedTarget = hurtbox.healthComponent.body; } } public void DoFixedUpdate(GenericSkill runningGS) { trackerUpdateStopwatch += Time.fixedDeltaTime; if (trackerUpdateStopwatch >= 1f / trackerUpdateFrequency) { trackerUpdateStopwatch -= 1f / trackerUpdateFrequency; _ = currentlyTrackingOrTamedTarget; SearchForTarget(runningGS); indicator.targetTransform = (Object.op_Implicit((Object)(object)currentlyTrackingOrTamedTarget) ? currentlyTrackingOrTamedTarget.transform : null); } } public virtual void SearchForTarget(GenericSkill skillSlot) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_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_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)currentlyTrackingOrTamedTarget) || TeamManager.IsTeamEnemy(skillSlot.characterBody.teamComponent.teamIndex, currentlyTrackingOrTamedTarget.teamComponent.teamIndex)) { search.teamMaskFilter = TeamMask.GetEnemyTeams(skillSlot.characterBody.teamComponent.teamIndex); search.searchOrigin = skillSlot.characterBody.inputBank.aimOrigin; search.searchDirection = skillSlot.characterBody.inputBank.aimDirection; search.maxDistanceFilter = maxTrackingDistance; search.maxAngleFilter = maxTrackingAngle; search.RefreshCandidates(); search.FilterOutGameObject(((Component)skillSlot).gameObject); SetNewTrackingTarget(((InstanceData)(object)skillSlot.skillInstanceData).search.GetResults().FirstOrDefault()); } } public void Dispose() { currentlyTrackingOrTamedTarget = null; indicator.DestroyVisualizer(); indicator = null; } } [Header("Beastmaster Parameters")] [Header("Beastmaster To-Tame Parameters")] [Tooltip("Entity state to use whenever the target is NOT a friend.")] public SerializableEntityStateType tameStateType; [Tooltip("This is the indicator prefab that the skill defaults to.")] public GameObject tameIndicatorPrefab; public Sprite tameSkillIcon; public string tameSkillNameToken; public string tameSkillDescToken; public float tameMaxTrackingDistance; public float tameMaxTrackingAngle; [Header("Beastmaster Friend Parameters")] [Tooltip("Entity state to use whenever the target is a friend.")] public SerializableEntityStateType friendStateType; public GameObject friendIndicatorPrefab; public Sprite friendSkillIcon; public string friendSkillNameToken; public string friendSkillDescToken; [Tooltip("Max distance for a friend to be considered available for friendStateType, set zero or less to disable.")] public float friendMaxAvailableDistance; public override BaseSkillInstanceData OnAssigned([NotNull] GenericSkill skillSlot) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown return (BaseSkillInstanceData)(object)new InstanceData { indicator = new Indicator(((Component)skillSlot.characterBody).gameObject, tameIndicatorPrefab), maxTrackingAngle = tameMaxTrackingAngle, maxTrackingDistance = tameMaxTrackingDistance }; } public override void OnUnassigned(GenericSkill skillSlot) { if ((InstanceData)(object)skillSlot.skillInstanceData != null) { ((InstanceData)(object)skillSlot.skillInstanceData).Dispose(); } ((SkillDef)this).OnUnassigned(skillSlot); } public override Sprite GetCurrentIcon(GenericSkill skillSlot) { if ((InstanceData)(object)skillSlot.skillInstanceData != null && (Object)(object)((InstanceData)(object)skillSlot.skillInstanceData).currentlyTrackingOrTamedTarget != (Object)null) { if (!IsTargetFriend(skillSlot)) { return tameSkillIcon; } return friendSkillIcon; } return ((SkillDef)this).GetCurrentIcon(skillSlot); } public override string GetCurrentNameToken(GenericSkill skillSlot) { if ((InstanceData)(object)skillSlot.skillInstanceData != null && (Object)(object)((InstanceData)(object)skillSlot.skillInstanceData).currentlyTrackingOrTamedTarget != (Object)null) { if (!IsTargetFriend(skillSlot)) { return tameSkillNameToken; } return friendSkillNameToken; } return ((SkillDef)this).GetCurrentNameToken(skillSlot); } public override string GetCurrentDescriptionToken(GenericSkill skillSlot) { if ((InstanceData)(object)skillSlot.skillInstanceData != null && (Object)(object)((InstanceData)(object)skillSlot.skillInstanceData).currentlyTrackingOrTamedTarget != (Object)null) { if (!IsTargetFriend(skillSlot)) { return tameSkillDescToken; } return friendSkillDescToken; } return ((SkillDef)this).GetCurrentDescriptionToken(skillSlot); } public virtual bool IsTargetFriend(GenericSkill skillSlot) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((InstanceData)(object)skillSlot.skillInstanceData).currentlyTrackingOrTamedTarget == (Object)null) { throw new ArgumentNullException("BeastmasterSkillDef::IsTargetFriend()::((BeastmasterSkillDef.InstanceData)skillSlot.skillInstanceData).currentlyTrackingOrTamedTarget is null."); } return !TeamManager.IsTeamEnemy(skillSlot.characterBody.teamComponent.teamIndex, ((InstanceData)(object)skillSlot.skillInstanceData).currentlyTrackingOrTamedTarget.teamComponent.teamIndex); } public virtual bool HasAvailableTargets([NotNull] GenericSkill skillSlot) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((InstanceData)(object)skillSlot.skillInstanceData).currentlyTrackingOrTamedTarget != (Object)null) { if (IsTargetFriend(skillSlot)) { if (IsTargetFriend(skillSlot)) { if (!(friendMaxAvailableDistance <= 0f)) { return Vector3.Distance(skillSlot.characterBody.corePosition, ((InstanceData)(object)skillSlot.skillInstanceData).currentlyTrackingOrTamedTarget.corePosition) <= friendMaxAvailableDistance; } return true; } return false; } return true; } return false; } public override bool CanExecute([NotNull] GenericSkill skillSlot) { if (HasAvailableTargets(skillSlot)) { return ((SkillDef)this).CanExecute(skillSlot); } return false; } public override bool IsReady([NotNull] GenericSkill skillSlot) { if (((SkillDef)this).IsReady(skillSlot)) { return HasAvailableTargets(skillSlot); } return false; } public override EntityState InstantiateNextState(GenericSkill skillSlot) { //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) if ((InstanceData)(object)skillSlot.skillInstanceData != null && (Object)(object)((InstanceData)(object)skillSlot.skillInstanceData).currentlyTrackingOrTamedTarget != (Object)null) { if (!IsTargetFriend(skillSlot)) { return EntityStateCatalog.InstantiateState(tameStateType); } return EntityStateCatalog.InstantiateState(friendStateType); } return EntityStateCatalog.InstantiateState(base.activationState); } public override void OnFixedUpdate([NotNull] GenericSkill skillSlot) { ((SkillDef)this).OnFixedUpdate(skillSlot); if ((InstanceData)(object)skillSlot.skillInstanceData != null) { ((InstanceData)(object)skillSlot.skillInstanceData).DoFixedUpdate(skillSlot); } } } [CreateAssetMenu(menuName = "Starstorm2/SkillDef/OverstressedSkillDef")] public class OverstressedSkillDef : SkillDef { protected class InstanceData : BaseSkillInstanceData { public NemCaptainController ncc; } [Tooltip("If the skill can be casted while overstressed.")] public bool canCastIfOverstressed; public override BaseSkillInstanceData OnAssigned([NotNull] GenericSkill skillSlot) { return (BaseSkillInstanceData)(object)new InstanceData { ncc = ((Component)skillSlot).GetComponent<NemCaptainController>() }; } private static bool IsOverstressed([NotNull] GenericSkill skillSlot) { return ((InstanceData)(object)skillSlot.skillInstanceData).ncc.isOverstressed; } public override bool CanExecute([NotNull] GenericSkill skillSlot) { if (!IsOverstressed(skillSlot) || canCastIfOverstressed) { return ((SkillDef)this).CanExecute(skillSlot); } return false; } public override bool IsReady([NotNull] GenericSkill skillSlot) { if (((SkillDef)this).IsReady(skillSlot)) { if (IsOverstressed(skillSlot)) { return canCastIfOverstressed; } return true; } return false; } } [CreateAssetMenu(menuName = "Starstorm2/SkillDef/SS2ReloadSkillDef")] public class SS2ReloadSkillDef : ReloadSkillDef { public override void OnFixedUpdate([NotNull] GenericSkill skillSlot) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) ((ReloadSkillDef)this).OnFixedUpdate(skillSlot); InstanceData val = (InstanceData)skillSlot.skillInstanceData; val.currentStock = skillSlot.stock; if (val.currentStock >= ((SkillDef)this).GetMaxStock(skillSlot) + skillSlot.bonusStockFromBody) { return; } if (Object.op_Implicit((Object)(object)skillSlot.stateMachine) && !skillSlot.stateMachine.HasPendingState() && skillSlot.stateMachine.CanInterruptState(base.reloadInterruptPriority)) { val.graceStopwatch += Time.fixedDeltaTime; if (val.graceStopwatch >= base.graceDuration || val.currentStock == 0) { skillSlot.stateMachine.SetNextState(EntityStateCatalog.InstantiateState(base.reloadState)); } } else { val.graceStopwatch = 0f; } } } [CreateAssetMenu(menuName = "Starstorm2/SkillDef/StressSkillDef")] public class StressSkillDef : SkillDef { protected class InstanceData : BaseSkillInstanceData { public NemCaptainController ncc; } [Tooltip("The amount of stress added by this skill.")] public float stressValue; [Tooltip("If the skill can be casted while overstressed.")] public bool canCastIfOverstressed; [Tooltip("If the skill can be casted when there is insufficient stress.")] public bool canCastIfWillOverstress; public override BaseSkillInstanceData OnAssigned([NotNull] GenericSkill skillSlot) { return (BaseSkillInstanceData)(object)new InstanceData { ncc = ((Component)skillSlot).GetComponent<NemCaptainController>() }; } private static bool IsOverstressed([NotNull] GenericSkill skillSlot) { return ((InstanceData)(object)skillSlot.skillInstanceData).ncc.isOverstressed; } public override bool CanExecute([NotNull] GenericSkill skillSlot) { NemCaptainController ncc = ((InstanceData)(object)skillSlot.skillInstanceData).ncc; if ((!IsOverstressed(skillSlot) || canCastIfOverstressed) && (100f - ncc.stress > stressValue || canCastIfWillOverstress)) { return ((SkillDef)this).CanExecute(skillSlot); } return false; } public override bool IsReady([NotNull] GenericSkill skillSlot) { NemCaptainController ncc = ((InstanceData)(object)skillSlot.skillInstanceData).ncc; if (((SkillDef)this).IsReady(skillSlot) && (!IsOverstressed(skillSlot) || canCastIfOverstressed)) { if (!(100f - ncc.stress > stressValue)) { return canCastIfWillOverstress; } return true; } return false; } public override void OnExecute([NotNull] GenericSkill skillSlot) { ((SkillDef)this).OnExecute(skillSlot); ((InstanceData)(object)skillSlot.skillInstanceData).ncc.AddStress(stressValue); } } } namespace Starstorm2.Cores.States.Wayfarer { internal class CloakState : BaseSkillState { public static float baseDuration = 3f; private Animator animator; private float duration; private bool hasCloaked; public override void OnEnter() { ((BaseState)this).OnEnter(); animator = ((EntityState)this).GetModelAnimator(); duration = baseDuration / ((BaseState)this).attackSpeedStat; ((EntityState)this).PlayCrossfade("FullBody, Override", "Cloak", "Cloak.playbackRate", duration, 0.2f); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (!hasCloaked && (double)animator.GetFloat("Cloak.active") > 0.5) { ((EntityState)this).characterBody.AddTimedBuff(Buffs.Cloak, 10f); hasCloaked = true; } if (((EntityState)this).fixedAge >= duration) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)1; } } } namespace EntityStates { public class GrabbedState : BaseState { public float duration = float.PositiveInfinity; public GrabController inflictor; public override void OnEnter() { ((BaseState)this).OnEnter(); Animator modelAnimator = ((EntityState)this).GetModelAnimator(); if (Object.op_Implicit((Object)(object)modelAnimator)) { modelAnimator.GetLayerIndex("Body"); ((Behaviour)modelAnimator).enabled = false; modelAnimator.CrossFadeInFixedTime((Random.Range(0, 2) == 0) ? "Hurt1" : "Hurt2", 0.1f); modelAnimator.Update(0f); } } public override void OnExit() { Animator modelAnimator = ((EntityState)this).GetModelAnimator(); if (Object.op_Implicit((Object)(object)modelAnimator)) { ((Behaviour)modelAnimator).enabled = true; } ((EntityState)this).OnExit(); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration) { ((EntityState)this).outer.SetNextStateToMain(); if (Object.op_Implicit((Object)(object)inflictor)) { inflictor.AttemptGrab(null); SS2Log.Warning("GrabbedState: " + ((EntityState)this).characterBody.GetDisplayName() + " duration expired!"); } } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)5; } } } namespace EntityStates.Wayfarer { internal class CreateBuffWard : BaseSkillState { public static float baseDuration = 3.5f; public static float radius = 30f; private Animator animator; private GameObject buffPrefab; public override void OnEnter() { ((BaseState)this).OnEnter(); animator = ((EntityState)this).GetModelAnimator(); ((EntityState)this).PlayCrossfade("FullBody, Override", "Ward", "Ward.playbackRate", baseDuration / ((BaseState)this).attackSpeedStat, 0.2f); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (!Object.op_Implicit((Object)(object)buffPrefab)) { _ = (double)animator.GetFloat("Ward.active"); _ = 0.5; } if (((EntityState)this).fixedAge >= baseDuration) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { if (Object.op_Implicit((Object)(object)buffPrefab)) { Object.Destroy((Object)(object)buffPrefab); } ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)1; } } internal class FireChains : BaseSkillState { public static float baseDuration = 2.5f; public static float damageCoefficient = 4f; public static float force = 10f; public static float radius = 15f; public static GameObject explosionPrefab = Resources.Load<GameObject>("prefabs/effects/omnieffect/OmniExplosionVFX"); private Animator animator; private float duration; private EffectData effectData; private BlastAttack attack; private ChildLocator locator; private bool hasAttackedL; private bool hasAttackedR; private GameObject chainPrefab; public override void OnEnter() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown ((BaseState)this).OnEnter(); animator = ((EntityState)this).GetModelAnimator(); duration = baseDuration / ((BaseState)this).attackSpeedStat; effectData = new EffectData(); effectData.scale = radius; ((EntityState)this).PlayCrossfade("FullBody, Override", "Melee", "Melee.playbackRate", duration, 0.2f); locator = ((Component)((EntityState)this).GetModelTransform()).GetComponent<ChildLocator>(); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (Object.op_Implicit((Object)(object)animator)) { if (!hasAttackedL && (double)animator.GetFloat("MeleeL.active") > 0.5) { hasAttackedL = true; DoAttack("LanternL"); } else if (!hasAttackedR && (double)animator.GetFloat("MeleeR.active") > 0.5) { hasAttackedR = true; DoAttack("LanternR"); } } if (((EntityState)this).fixedAge >= duration) { ((EntityState)this).outer.SetNextStateToMain(); } } private void DoAttack(string childName) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_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) Util.PlayAttackSpeedSound(FireHook.soundString, ((EntityState)this).gameObject, ((BaseState)this).attackSpeedStat); if (((EntityState)this).isAuthority) { ProjectileManager instance = ProjectileManager.instance; GameObject obj = chainPrefab; Vector3 position = locator.FindChild(childName).position; Ray aimRay = ((BaseState)this).GetAimRay(); instance.FireProjectile(obj, position, Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), ((EntityState)this).gameObject, ((BaseState)this).damageStat * damageCoefficient, force, Util.CheckRoll(((BaseState)this).critStat, ((EntityState)this).characterBody.master), (DamageColorIndex)0, (GameObject)null, -1f); } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)1; } } internal class MeleeSlam : BaseSkillState { public static float baseDuration = 2f; public static float damageCoefficient = 4f; public static float force = 10f; public static float radius = 15f; public static GameObject explosionPrefab = Resources.Load<GameObject>("prefabs/effects/omnieffect/OmniExplosionVFX"); private Animator animator; private float duration; private EffectData effectData; private BlastAttack attack; private ChildLocator locator; private bool hasAttackedL; private bool hasAttackedR; public override void OnEnter() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Expected O, but got Unknown //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); animator = ((EntityState)this).GetModelAnimator(); duration = baseDuration / ((BaseState)this).attackSpeedStat; effectData = new EffectData(); effectData.scale = radius; ((EntityState)this).PlayCrossfade("FullBody, Override", "Melee", "Melee.playbackRate", duration, 0.2f); attack = new BlastAttack(); attack.attacker = ((EntityState)this).gameObject; attack.inflictor = ((EntityState)this).gameObject; attack.baseDamage = ((BaseState)this).damageStat * damageCoefficient; attack.baseForce = force; attack.radius = radius; attack.teamIndex = TeamComponent.GetObjectTeam(((EntityState)this).gameObject); locator = ((Component)((EntityState)this).GetModelTransform()).GetComponent<ChildLocator>(); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (Object.op_Implicit((Object)(object)animator)) { if (!hasAttackedL && (double)animator.GetFloat("MeleeL.active") > 0.5) { hasAttackedL = true; DoAttack("LanternL"); } else if (!hasAttackedR && (double)animator.GetFloat("MeleeR.active") > 0.5) { hasAttackedR = true; DoAttack("LanternR"); } } if (((EntityState)this).fixedAge >= duration) { ((EntityState)this).outer.SetNextStateToMain(); } } private void DoAttack(string childName) { //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_0018: 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_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) Vector3 position = locator.FindChild(childName).position; effectData.origin = position; EffectManager.SpawnEffect(explosionPrefab, effectData, true); if (((EntityState)this).isAuthority) { Debug.Log((object)position); attack.position = position; attack.Fire(); } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)1; } } } namespace EntityStates.Trader.Bag { public class BagBaseState : BaseState { protected PickupPickerController pickupPickerController; protected TraderController traderController; protected virtual bool enableInteraction => true; public override void OnEnter() { ((BaseState)this).OnEnter(); pickupPickerController = ((EntityState)this).GetComponent<PickupPickerController>(); traderController = ((EntityState)this).GetComponent<TraderController>(); pickupPickerController.SetAvailable(enableInteraction); } } public class Idle : BagBaseState { protected override bool enableInteraction { get { Debug.Log((object)"returning true"); return true; } } } public class TradeToIdle : BagBaseState { public static string enterSoundString; public static string exitSoundString; public static float duration; public static float dropUpVelocityStrength; public static float dropForwardVelocityStrength; public static GameObject muzzleFlashEffectPrefab; public static string muzzleString; public static float lowTrade = -0.1f; public static float highTrade = 0.4f; public static float rareThreshold = 0.72f; public static float uncommonThreshold = 0.32f; public static float commonThreshold = 0.01f; private bool foundValidItem; protected override bool enableInteraction => false; public override void OnEnter() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_006c: 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_007a: Invalid comparison between Unknown and I4 //IL_00d8: 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_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_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_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_013d: 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_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_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: 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_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: 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_01be: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) base.OnEnter(); Util.PlaySound(enterSoundString, ((EntityState)this).gameObject); if (!NetworkServer.active) { return; } foundValidItem = false; PickupIndex val = PickupIndex.none; ItemDef itemDef = ItemCatalog.GetItemDef(traderController.lastTradedItemIndex); if (!((Object)(object)itemDef != (Object)null)) { return; } float num = traderController.GetValue(itemDef); Debug.Log((object)("initial player item value: " + num)); if ((int)itemDef.tier == 0 || (int)itemDef.tier == 6) { num -= 0.05f; } num += Util.Remap(Random.value, 0f, 1f, lowTrade, highTrade); Debug.Log((object)("slightly randomized: " + num)); if (num >= rareThreshold) { ItemIndex[] array = ItemCatalog.tier3ItemList.ToArray(); val = PickupCatalog.FindPickupIndex(array[Random.Range(0, array.Length)]); } else if (num >= uncommonThreshold) { ItemIndex[] array2 = ItemCatalog.tier2ItemList.ToArray(); val = PickupCatalog.FindPickupIndex(array2[Random.Range(0, array2.Length)]); } else if (num >= commonThreshold) { ItemIndex[] array3 = ItemCatalog.tier1ItemList.ToArray(); val = PickupCatalog.FindPickupIndex(array3[Random.Range(0, array3.Length)]); } if (num < commonThreshold) { val = PickupCatalog.FindPickupIndex(Items.ScrapWhite.itemIndex); } else { if (val == PickupCatalog.FindPickupIndex(Items.ScrapWhite.itemIndex)) { val = PickupCatalog.FindPickupIndex(Items.Syringe.itemIndex); } if (val == PickupCatalog.FindPickupIndex(Items.ScrapGreen.itemIndex)) { val = PickupCatalog.FindPickupIndex(Items.Feather.itemIndex); } if (val == PickupCatalog.FindPickupIndex(Items.ScrapRed.itemIndex)) { val = PickupCatalog.FindPickupIndex(Items.ExtraLife.itemIndex); } } if (!Run.instance.IsItemAvailable(((PickupIndex)(ref val)).itemIndex)) { val = PickupCatalog.FindPickupIndex((ItemIndex)(((PickupIndex)(ref val)).itemIndex + 1)); } if (itemDef.itemIndex == SS2Content.Items.VoidRock.itemIndex) { val = PickupCatalog.FindPickupIndex(SS2Content.Items.GildedAmulet.itemIndex); } traderController.ReduceValue(); Debug.Log((object)("zan giving: " + ((PickupIndex)(ref val)).GetPickupNameToken())); if (val != PickupIndex.none) { foundValidItem = true; Transform val2 = ((BaseState)this).FindModelChild(muzzleString); PickupDropletController.CreatePickupDroplet(val, val2.position, Vector3.up * dropUpVelocityStrength + val2.forward * dropForwardVelocityStrength); } } public override void OnExit() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) Util.PlaySound(exitSoundString, ((EntityState)this).gameObject); if (((EntityState)this).isAuthority) { ((EntityState)this).characterBody.SetBuffCount(SS2Content.Buffs.bdHiddenSlow20.buffIndex, 0); } ((EntityState)this).OnExit(); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (foundValidItem && ((EntityState)this).fixedAge > duration) { ((EntityState)this).outer.SetNextState((EntityState)(object)new Idle()); } } } public class Trading : BagBaseState { public static float duration; public static string enterSoundString; public static string exitSoundString; protected override bool enableInteraction => false; public override void OnEnter() { base.OnEnter(); Util.PlaySound(enterSoundString, ((EntityState)this).gameObject); } public override void OnExit() { Util.PlaySound(exitSoundString, ((EntityState)this).gameObject); ((EntityState)this).OnExit(); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge > duration) { ((EntityState)this).outer.SetNextState((EntityState)(object)new TradeToIdle()); } } } public class WaitToBeginTrade : BagBaseState { public static float duration; protected override bool enableInteraction => false; public override void OnEnter() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) base.OnEnter(); if (((EntityState)this).isAuthority) { ((EntityState)this).characterBody.SetBuffCount(SS2Content.Buffs.bdHiddenSlow20.buffIndex, 10); } ((EntityState)this).PlayCrossfade("Body", "Scavenge", "Scavenge.playbackRate", duration + Trading.duration + TradeToIdle.duration, 0.05f); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge > duration) { ((EntityState)this).outer.SetNextState((EntityState)(object)new Trading()); } } } } namespace EntityStates.Seraph { public class SeraphPrimary : BaseSkillState { [TokenModifier(/*Could not decode attribute arguments.*/)] public static float damageCoefficient; public static float procCoefficient; public static float baseDuration; public static float recoil; public static float spreadBloom; public static float force; [HideInInspector] public static GameObject muzzleEffectPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/effects/muzzleflashes/Muzzleflash1"); [HideInInspector] public static GameObject tracerPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/effects/tracers/tracercommandodefault"); [HideInInspector] public static GameObject hitPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/effects/HitsparkCommando"); private float duration; private float fireDuration; private string muzzleString; private bool hasFired; private Animator animator; public override void OnEnter() { ((BaseState)this).OnEnter(); animator = ((EntityState)this).GetModelAnimator(); duration = baseDuration / ((BaseState)this).attackSpeedStat; fireDuration = 0.1f * duration; ((EntityState)this).characterBody.SetAimTimer(2f); muzzleString = "Muzzle"; hasFired = false; ((EntityState)this).PlayCrossfade("Gesture, Override", "Primary", "Primary.playbackRate", duration * 2.5f, 0.05f); Shoot(); } public override void OnExit() { ((EntityState)this).OnExit(); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (!(((EntityState)this).fixedAge < duration) && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } private void Shoot() { //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: 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_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_010d: 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_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0142: 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_0159: Unknown result type (might be due to invalid IL or missing references) if (!hasFired) { hasFired = true; bool isCrit = ((BaseState)this).RollCrit(); ((BaseState)this).AddRecoil(-0.4f * recoil, -0.8f * recoil, -0.3f * recoil, 0.3f * recoil); if (Object.op_Implicit((Object)(object)muzzleEffectPrefab)) { EffectManager.SimpleMuzzleFlash(muzzleEffectPrefab, ((EntityState)this).gameObject, muzzleString, false); } if (((EntityState)this).isAuthority) { _ = damageCoefficient; _ = ((BaseState)this).damageStat; Ray aimRay = ((BaseState)this).GetAimRay(); new BulletAttack { aimVector = ((Ray)(ref aimRay)).direction, origin = ((Ray)(ref aimRay)).origin, damage = damageCoefficient * ((BaseState)this).damageStat, damageType = (DamageType)0, damageColorIndex = (DamageColorIndex)0, minSpread = 0f, maxSpread = ((EntityState)this).characterBody.spreadBloomAngle, falloffModel = (FalloffModel)0, force = force, isCrit = isCrit, owner = ((EntityState)this).gameObject, muzzleName = muzzleString, smartCollision = true, procChainMask = default(ProcChainMask), procCoefficient = procCoefficient, radius = 0.35f, weapon = ((EntityState)this).gameObject, tracerEffectPrefab = tracerPrefab, hitEffectPrefab = hitPrefab }.Fire(); } ((EntityState)this).characterBody.AddSpreadBloom(spreadBloom); } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)2; } } } namespace EntityStates.Runshroom { public class PlaceSpores : BaseSkillState { private GameObject projectilePrefab; private bool hasFired; private bool hasWaited; public static float baseDuration; public static float damageCoefficient = 1f; public static float projectileVelocity = 40f; public static GameObject chargeEffectPrefab; private float duration; private Animator animator; private ChildLocator childLocator; private float originalMoveSpeed; public override void OnEnter() { ((BaseState)this).OnEnter(); projectilePrefab = SporeGrenade.projectilePrefab; originalMoveSpeed = ((EntityState)this).characterBody.moveSpeed; ((EntityState)this).characterBody.moveSpeed = 0f; ((EntityState)this).PlayCrossfade("Body", "ToIdle", 0.05f); duration = baseDuration / ((BaseState)this).attackSpeedStat; childLocator = ((EntityState)this).GetModelChildLocator(); hasFired = false; hasWaited = false; animator = ((EntityState)this).GetModelAnimator(); } public override void FixedUpdate() { //IL_0073: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); ((EntityState)this).characterBody.moveSpeed = 0f; if (((EntityState)this).fixedAge >= duration * 0.2f && !hasWaited) { hasWaited = true; GameObject obj = Object.Instantiate<GameObject>(chargeEffectPrefab); obj.transform.SetParent(childLocator.FindChild("TippyTop")); obj.transform.position = childLocator.FindChild("TippyTop").position; ((EntityState)this).PlayCrossfade("Body", "Attack", "Primary.playbackRate", duration, 0.1f); } if (animator.GetFloat("Attack") > 0.5f && !hasFired) { hasFired = true; if (((EntityState)this).isAuthority) { FireProjectile(); } } if (((EntityState)this).fixedAge >= duration * 1.2f && hasFired) { ((EntityState)this).outer.SetNextStateToMain(); } } public void FireProjectile() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) float num = damageCoefficient * ((BaseState)this).damageStat; Ray aimRay = ((BaseState)this).GetAimRay(); ProjectileManager.instance.FireProjectile(projectilePrefab, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(Vector3.down), ((EntityState)this).gameObject, num, 0f, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, projectileVelocity); } public override void OnExit() { ((EntityState)this).OnExit(); ((EntityState)this).characterBody.moveSpeed = originalMoveSpeed; } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)3; } } public class RushroomDeath : GenericCharacterDeath { public override void OnEnter() { ((GenericCharacterDeath)this).OnEnter(); VFXListComponent component = ((Component)((EntityState)this).characterBody).GetComponent<VFXListComponent>(); if (Object.op_Implicit((Object)(object)component)) { component.TurnOffVFX(); } } public override void FixedUpdate() { ((GenericCharacterDeath)this).FixedUpdate(); } public override void OnExit() { ((GenericCharacterDeath)this).OnExit(); } } } namespace EntityStates.RemunerationOption { public class Opening : EntityState { public static float duration = 1f; public static int maxItemDropCount = 5; private ChestBehavior chestBehavior; private float itemDropCount; private float timeBetweenDrops; private float itemDropAge; public override void OnEnter() { ((EntityState)this).OnEnter(); ((EntityState)this).PlayAnimation("Body", "Opening"); timeBetweenDrops = duration / (float)maxItemDropCount; chestBehavior = ((EntityState)this).GetComponent<ChestBehavior>(); if (Object.op_Implicit((Object)(object)((EntityState)this).sfxLocator)) { Util.PlaySound(((EntityState)this).sfxLocator.openSound, ((EntityState)this).gameObject); } } public override void FixedUpdate() { //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Expected O, but got Unknown //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); if (NetworkServer.active) { itemDropAge += Time.fixedDeltaTime; if (itemDropCount < (float)maxItemDropCount && itemDropAge > timeBetweenDrops) { itemDropCount += 1f; itemDropAge -= timeBetweenDrops; chestBehavior.dropPickup = PickupCatalog.FindPickupIndex(MiscPickups.LunarCoin.miscPickupIndex); chestBehavior.ItemDrop(); } if (((EntityState)this).fixedAge >= duration) { base.outer.SetNextState((EntityState)new Opened()); } } } } } namespace EntityStates.Pickups.Remuneration { public class OfferCoin : BaseState { public static float duration = 1.93f; public override void OnEnter() { ((BaseState)this).OnEnter(); Transform obj = ((EntityState)this).transform.Find("RemunerationPortal"); ((Component)obj).gameObject.SetActive(true); ((Component)obj).GetComponent<ScaleParticleSystemDuration>().newDuration = duration; ((Component)obj.Find("Portal/Sphere")).GetComponent<ObjectScaleCurve>().timeMax = duration; Util.PlaySound("RemunerationSpawn2", ((EntityState)this).gameObject); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= duration) { ((EntityState)this).outer.SetNextState((EntityState)(object)new Reward()); } } } public class Reward : BaseState { public static float dropletSpreadAngle = 30f; public static float dropletUpVelocity = 20f; public static float dropletForwardVelocity = 8f; private int itemsDropped; private int numItems = 3; private RemunerationShopBehavior shop; private Transform portalTransform; public static GameObject explosionPrefab = SS2Assets.LoadAsset<GameObject>("RemunerationExplosion", SS2Bundle.Items); public static float effectScale = 1f; public override void OnEnter() { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0062: 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_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Expected O, but got Unknown ((BaseState)this).OnEnter(); shop = ((EntityState)this).GetComponent<RemunerationShopBehavior>(); if (NetworkServer.active) { ChildLocator component = ((EntityState)this).GetComponent<ChildLocator>(); if (Object.op_Implicit((Object)(object)component)) { portalTransform = component.FindChild("Portal"); EffectData val = new EffectData { origin = (Object.op_Implicit((Object)(object)portalTransform) ? portalTransform.position : ((EntityState)this).transform.position), rotation = Quaternion.identity, scale = effectScale }; EffectManager.SpawnEffect(explosionPrefab, val, true); } while (itemsDropped < numItems) { DropItem(); itemsDropped++; } } } private void DropItem() { //IL_0030: 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_0048: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_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_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: 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_00ab: Unknown result type (might be due to invalid IL or missing references) float num = (0f - dropletSpreadAngle / 2f) * (float)(numItems - 1) + (float)itemsDropped * dropletSpreadAngle; Vector3 val = Quaternion.Euler(0f, num, 0f) * (Object.op_Implicit((Object)(object)portalTransform) ? portalTransform.forward : ((EntityState)this).transform.forward); Vector3 velocity = Vector3.up * dropletUpVelocity + val * dropletForwardVelocity; shop.SpawnDroplet(Object.op_Implicit((Object)(object)portalTransform) ? portalTransform.position : ((EntityState)this).transform.position, velocity); } } public class Wait : BaseState { public static float duration = 1.75f; public override void OnEnter() { ((BaseState)this).OnEnter(); ((Component)((EntityState)this).transform.Find("RemunerationPortal")).gameObject.SetActive(false); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= duration) { ((EntityState)this).outer.SetNextState((EntityState)(object)new OfferCoin()); } } } } namespace EntityStates.Pickups.Extinction { public class ExtinctionBaseState : EntityState { private GenericOwnership genericOwnership; private SimpleLeash simpleLeash; private RadialForce radial; private MemoizedGetComponent<CharacterBody> bodyGetComponent; private protected ExtinctionController extinctionController { get; set; } protected CharacterBody ownerBody { get { GenericOwnership val = genericOwnership; return bodyGetComponent.Get(((Object)(object)val != (Object)null) ? val.ownerObject : null); } } protected virtual bool shouldFollow => true; public override void OnEnter() { ((EntityState)this).OnEnter(); genericOwnership = ((EntityState)this).GetComponent<GenericOwnership>(); simpleLeash = ((EntityState)this).GetComponent<SimpleLeash>(); extinctionController = ((EntityState)this).GetComponent<ExtinctionController>(); radial = ((EntityState)this).GetComponent<RadialForce>(); } public override void Update() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).Update(); if (Object.op_Implicit((Object)(object)ownerBody) && shouldFollow) { simpleLeash.leashOrigin = ownerBody.corePosition; } } protected float GetScale() { float num = 1f; if (Object.op_Implicit((Object)(object)ownerBody) && Object.op_Implicit((Object)(object)ownerBody.inventory)) { num *= (float)ownerBody.inventory.GetItemCount(SS2Content.Items.RelicOfExtinction); } return num; } } internal class ExtinctionDieStage : ExtinctionBaseState { public static float baseDuration = 10f; public FixedTimeStamp readyTime { get; private set; } protected override bool shouldFollow => false; public override void OnEnter() { //IL_000f: 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) base.OnEnter(); if (((EntityState)this).isAuthority) { readyTime = FixedTimeStamp.now + baseDuration; } } public override void FixedUpdate() { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006c: 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_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: 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_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)base.ownerBody)) { ((EntityState)this).outer.SetNextState((EntityState)(object)new ExtinctionIdleState()); } if (((EntityState)this).isAuthority && !Object.op_Implicit((Object)(object)base.ownerBody) && FixedTimeStamp.now >= readyTime) { BlastAttack val = new BlastAttack { attacker = ((EntityState)this).gameObject, inflictor = ((EntityState)this).gameObject }; val.teamIndex = TeamComponent.GetObjectTeam(val.attacker); val.position = ((EntityState)this).characterBody.corePosition; val.procCoefficient = 1f; val.radius = GetScale() * 2f; val.baseForce = GetScale(); val.bonusForce = Vector3.up * 20f; val.baseDamage = base.ownerBody.baseDamage * 5f; val.falloffModel = (FalloffModel)1; val.damageColorIndex = (DamageColorIndex)3; val.attackerFiltering = (AttackerFiltering)0; val.Fire(); Object.Destroy((Object)(object)((EntityState)this).gameObject); } } public override void OnSerialize(NetworkWriter writer) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).OnSerialize(writer); NetworkExtensions.Write(writer, readyTime); } public override void OnDeserialize(NetworkReader reader) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).OnDeserialize(reader); readyTime = NetworkExtensions.ReadFixedTimeStamp(reader); } } internal class ExtinctionEnterState : ExtinctionBaseState { public static float baseDuration = 10f; public FixedTimeStamp readyTime { get; private set; } public override void OnEnter() { //IL_000f: 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) base.OnEnter(); if (((EntityState)this).isAuthority) { readyTime = FixedTimeStamp.now + baseDuration; } base.extinctionController.showExtinctionDisplay = false; } public override void FixedUpdate() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); if (((EntityState)this).isAuthority && (Object.op_Implicit((Object)(object)base.ownerBody) || base.ownerBody.inventory.GetItemCount(SS2Content.Items.RelicOfExtinction) < 1) && FixedTimeStamp.now >= readyTime) { ((EntityState)this).outer.SetNextState((EntityState)(object)new ExtinctionIdleState()); } } public override void OnExit() { ((EntityState)this).OnExit(); base.extinctionController.showExtinctionDisplay = true; } public override void OnSerialize(NetworkWriter writer) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).OnSerialize(writer); NetworkExtensions.Write(writer, readyTime); } public override void OnDeserialize(NetworkReader reader) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).OnDeserialize(reader); readyTime = NetworkExtensions.ReadFixedTimeStamp(reader); } } internal class ExtinctionIdleState : ExtinctionBaseState { private OverlapAttack attack; private float fireStopwatch; private float resetStopwatch; [Tooltip("The frequency (1/time) at which the overlap attack is tested. Higher values are more accurate but more expensive.")] public float fireFrequency = 1f; [Tooltip("The frequency (1/time) at which the overlap attack is reset. Higher values means more frequent ticks of damage.")] public float resetFrequency = 4f; [Tooltip("Should the attacks also damage the owner.")] public AttackerFiltering attackerFiltering = (AttackerFiltering)1; public override void OnEnter() { base.OnEnter(); ResetOverlap(); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).isAuthority) { resetStopwatch += Time.fixedDeltaTime; fireStopwatch += Time.fixedDeltaTime; if (resetStopwatch >= 1f / resetFrequency) { ResetOverlap(); resetStopwatch -= 1f / resetFrequency; } if (fireStopwatch >= 1f / fireFrequency) { attack.Fire((List<HurtBox>)null); fireStopwatch -= 1f / fireFrequency; } } if (((EntityState)this).isAuthority && (!Object.op_Implicit((Object)(object)base.ownerBody) || base.ownerBody.inventory.GetItemCount(SS2Content.Items.RelicOfExtinction) < 1)) { ((EntityState)this).outer.SetNextState((EntityState)(object)new ExtinctionDieStage()); } } private void ResetOverlap() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) attack = new OverlapAttack(); attack.procCoefficient = 0f; attack.attacker = ((Component)base.ownerBody).gameObject; attack.inflictor = ((EntityState)this).gameObject; attack.teamIndex = base.ownerBody.teamComponent.teamIndex; attack.attackerFiltering = attackerFiltering; attack.damage = base.ownerBody.baseDamage * 2.5f; attack.isCrit = false; attack.damageColorIndex = (DamageColorIndex)7; attack.damageType = (DamageType)131072; attack.hitBoxGroup = ((EntityState)this).GetComponent<HitBoxGroup>(); } } } namespace EntityStates.Pickups.Augury { public abstract class AuguryBaseState : BaseBodyAttachmentState { protected AuguryEffectController auguryEffect; protected Moonstorm.Starstorm2.Items.Augury.Behavior auguryBehavior; public override void OnEnter() { ((BaseBodyAttachmentState)this).OnEnter(); ChildLocator component = ((EntityState)this).GetComponent<ChildLocator>(); if (Object.op_Implicit((Object)(object)component)) { Transform obj = component.FindChild("Center"); auguryEffect = ((obj != null) ? ((Component)obj).GetComponent<AuguryEffectController>() : null); auguryBehavior = ((Component)((BaseBodyAttachmentState)this).attachedBody).GetComponent<Moonstorm.Starstorm2.Items.Augury.Behavior>(); } } } public class AuguryDetonation : AuguryBaseState { public static string detonationSound = ""; public static float duration = 5f; public static float divisorValueForBosses = 2f; public TeamIndex attackerTeam; private CharacterBody body; public override void OnEnter() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) base.OnEnter(); body = ((BaseBodyAttachmentState)this).attachedBody; if (NetworkServer.active && Object.op_Implicit((Object)(object)((BaseBodyAttachmentState)this).attachedBody)) { foreach (TeamComponent teamMember in TeamComponent.GetTeamMembers(attackerTeam)) { CharacterBody val = teamMember.body; if (Object.op_Implicit((Object)(object)val)) { if (val.isBoss || val.isChampion) { DamageForHalfOfMaxHealth(val); continue; } GameObject val2 = (Object.op_Implicit((Object)(object)((BaseBodyAttachmentState)this).attachedBody) ? ((Component)((BaseBodyAttachmentState)this).attachedBody).gameObject : null); val.healthComponent.Suicide(val2, val2, (DamageType)65536); Util.PlaySound(val.sfxLocator.deathSound, ((EntityState)this).gameObject); } } } auguryEffect.fadeOut = true; } private void DamageForHalfOfMaxHealth(CharacterBody bossBody) { //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_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0058: 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_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Expected O, but got Unknown DamageInfo val = new DamageInfo { attacker = (Object.op_Implicit((Object)(object)body) ? ((Component)body).gameObject : null), inflictor = (Object.op_Implicit((Object)(object)body) ? ((Component)body).gameObject : null), crit = body.RollCrit(), damage = bossBody.maxHealth / 2f, damageColorIndex = (DamageColorIndex)7, damageType = (DamageType)0, dotIndex = (DotIndex)(-1), procCoefficient = 1f }; bossBody.healthComponent.TakeDamage(val); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration) { ((Behaviour)auguryEffect.explosionScaleCurve).enabled = false; ((EntityState)this).outer.SetNextState((EntityState)(object)new AuguryRecharge()); } } } public class AuguryIdle : AuguryBaseState { public static float damageThresholdMultiplier = 6f; private float damageThreshold; private float tankedDamage; private TeamIndex lastestAttackerTeamIndex; private Vector3 effectScale; public void OnTakeDamage(DamageReport damageReport) { //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) if (!damageReport.isFallDamage) { tankedDamage += damageReport.damageDealt; lastestAttackerTeamIndex = damageReport.attackerTeamIndex; } } public override void Update() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).Update(); effectScale = Vector3.one * tankedDamage / ((BaseBodyAttachmentState)this).attachedBody.maxHealth / 2f * ((BaseBodyAttachmentState)this).attachedBody.bestFitRadius; auguryEffect.UpdateSize(effectScale); } public override void FixedUpdate() { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); damageThreshold = ((BaseBodyAttachmentState)this).attachedBody.maxHealth * damageThresholdMultiplier; if (tankedDamage > damageThreshold && NetworkServer.active) { tankedDamage = 0f; AuguryPrepDetonation auguryPrepDetonation = new AuguryPrepDetonation(); auguryPrepDetonation.scale = effectScale; auguryPrepDetonation.detonatorTeamIndex = lastestAttackerTeamIndex; ((EntityState)this).outer.SetNextState((EntityState)(object)auguryPrepDetonation); } } public override void OnSerialize(NetworkWriter writer) { ((EntityState)this).OnSerialize(writer); writer.Write(tankedDamage); } public override void OnDeserialize(NetworkReader reader) { ((EntityState)this).OnDeserialize(reader); tankedDamage = reader.ReadSingle(); } } public class AuguryPrepDetonation : AuguryBaseState { public static float baseDuration = 10f; public static float minDuration = 3f; public static string chargeSound = ""; public Vector3 scale; public TeamIndex detonatorTeamIndex; private float duration; public override void OnEnter() { //IL_0060: Unknown result type (might be due to invalid IL or missing references) base.OnEnter(); float num = baseDuration / (Object.op_Implicit((Object)(object)((BaseBodyAttachmentState)this).attachedBody) ? ((BaseBodyAttachmentState)this).attachedBody.attackSpeed : 1f); duration = Mathf.Clamp(num, minDuration, baseDuration * 2f); Util.PlaySound(chargeSound, ((EntityState)this).gameObject); auguryEffect.BeginScale(scale, duration); } public override void FixedUpdate() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration) { AuguryDetonation auguryDetonation = new AuguryDetonation(); auguryDetonation.attackerTeam = detonatorTeamIndex; ((EntityState)this).outer.SetNextState((EntityState)(object)auguryDetonation); } } } public class AuguryRecharge : AuguryBaseState { public static float BaseDuration = 60f; public static float MaxDuration = 90f; public static float MinDuration = 30f; private float rechargeDuration; public override void OnEnter() { base.OnEnter(); rechargeDuration = Mathf.Clamp(MinDuration, MaxDuration, Object.op_Implicit((Object)(object)((BaseBodyAttachmentState)this).attachedBody) ? (BaseDuration / ((BaseBodyAttachmentState)this).attachedBody.attackSpeed) : BaseDuration); auguryEffect.RestoreDefaults(); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge > rechargeDuration) { ((EntityState)this).outer.SetNextState((EntityState)(object)new AuguryIdle()); } } } } namespace EntityStates.Nucleator { internal class ApplyRadionuclideSurge : BaseSkillState { private float stateDuration = 6f; private float buffDuration = 6f; private Animator animator; public override void OnEnter() { ((BaseState)this).OnEnter(); if (NetworkServer.active) { ((EntityState)this).characterBody.AddTimedBuff(SS2Content.Buffs.BuffNucleatorSpecial, buffDuration); } animator = ((EntityState)this).GetModelAnimator(); if (Object.op_Implicit((Object)(object)animator)) { animator.SetLayerWeight(animator.GetLayerIndex("Body, Additive"), 1f); } } public override void OnExit() { ((EntityState)this).OnExit(); if (Object.op_Implicit((Object)(object)animator)) { animator.SetLayerWeight(animator.GetLayerIndex("Body, Additive"), 0f); } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= stateDuration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)1; } } [RequireComponent(typeof(ProjectileController))] [RequireComponent(typeof(ProjectileDamage))] public class NucleatorProjectile : MonoBehaviour { private ProjectileController projectileController; private ProjectileImpactExplosion projectileImpactExplosion; private ProjectileDamage projectileDamage; private float duration; private float fixedAge; private Rigidbody rigidbody; private float frequency = 14f; private float magnitude = 0.25f; private Vector3 axis; private Vector3 pos; public TeamIndex teamIndex; public float baseDuration = 2f; public float acceleration = 50f; public GameObject rotateObject; public float removalTime = 1f; public float baseRadius; public float baseDamage; public float charge; private void Awake() { //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_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) projectileController = ((Component)this).GetComponent<ProjectileController>(); projectileDamage = ((Component)this).GetComponent<ProjectileDamage>(); projectileImpactExplosion = ((Component)this).GetComponent<ProjectileImpactExplosion>(); rigidbody = ((Component)this).GetComponent<Rigidbody>(); rigidbody.useGravity = false; duration = baseDuration; fixedAge = 0f; baseDamage = projectileDamage.damage; projectileImpactExplosion.lifetime = baseDuration; acceleration = (1f - charge) * 30f + 20f; pos = ((Component)this).transform.position; axis = ((Component)this).transform.up * -1f; } private void FixedUpdate() { //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: 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) fixedAge += Time.deltaTime; float num = fixedAge / baseDuration; if (fixedAge < baseDuration) { ((ProjectileExplosion)projectileImpactExplosion).blastRadius = baseRadius + num * (baseRadius * 1.25f - 1f) + 1f; projectileDamage.damage = baseDamage + num * (baseDamage * 1.25f - 1f) + 1f; pos += ((Component)this).transform.forward * Time.deltaTime * acceleration; ((Component)this).transform.position = pos + axis * Mathf.Sin(Time.time * frequency) * magnitude; } } } } namespace EntityStates.Nemmando { public class Appear : BaseState { private static GameObject spawnEffectPrefab = SpawnState.spawnEffectPrefab; public static float duration = 2.5f; public static float delayBeforeAimAnimatorWeight; private Animator modelAnimator; private CharacterModel characterModel; public override void OnEnter() { ((BaseState)this).OnEnter(); characterModel = null; if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody.modelLocator) && Object.op_Implicit((Object)(object)((EntityState)this).characterBody.modelLocator.modelTransform)) { characterModel = ((Component)((EntityState)this).characterBody.modelLocator.modelTransform).GetComponent<CharacterModel>(); } if (Object.op_Implicit((Object)(object)characterModel)) { CharacterModel obj = characterModel; obj.invisibilityCount--; } modelAnimator = ((EntityState)this).GetModelAnimator(); if (Object.op_Implicit((Object)(object)modelAnimator)) { modelAnimator.SetFloat(AnimationParameters.aimWeight, 0f); } ((EntityState)this).PlayAnimation("FullBody, Override", "Spawn", "Spawn.playbackRate", duration); if (Object.op_Implicit((Object)(object)spawnEffectPrefab)) { Util.PlaySound(SpawnState.spawnSoundString, ((EntityState)this).gameObject); EffectManager.SimpleMuzzleFlash(spawnEffectPrefab, ((EntityState)this).gameObject, "PortalSpawn", false); } if (NetworkServer.active) { ((EntityState)this).characterBody.AddTimedBuff(Buffs.HiddenInvincibility, duration * 1.2f); } } public override void Update() { ((EntityState)this).Update(); if (Object.op_Implicit((Object)(object)modelAnimator)) { modelAnimator.SetFloat(AnimationParameters.aimWeight, Mathf.Clamp01((((EntityState)this).age - delayBeforeAimAnimatorWeight) / duration)); } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= duration) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { if (Object.op_Implicit((Object)(object)modelAnimator)) { modelAnimator.SetFloat(AnimationParameters.aimWeight, 1f); } ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)6; } } public class BarrageCharge : BaseSkillState { public static float baseChargeDuration; public static GameObject chargeEffect; private float chargeDuration; private ChildLocator childLocator; private Animator animator; private Transform modelBaseTransform; private uint chargePlayID; private bool hasFinishedCharging; private GameObject chargeEffectInstance; public override void OnEnter() { ((BaseState)this).OnEnter(); animator = ((EntityState)this).GetModelAnimator(); chargeDuration = baseChargeDuration; childLocator = ((EntityState)this).GetModelChildLocator(); modelBaseTransform = ((EntityState)this).GetModelBaseTransform(); animator = ((EntityState)this).GetModelAnimator(); hasFinishedCharging = false; chargePlayID = Util.PlaySound("NemmandoSubmissionCharge", ((EntityState)this).gameObject); if (Object.op_Implicit((Object)(object)chargeEffect)) { Transform val = childLocator.FindChild("GunChargeEffect"); chargeEffectInstance = Object.Instantiate<GameObject>(chargeEffect, val); } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); float num = CalcCharge(); if (num >= 1f && !hasFinishedCharging) { hasFinishedCharging = true; Util.PlaySound("NemmandoSubmissionReady", ((EntityState)this).gameObject); } if (((EntityState)this).isAuthority && !((BaseSkillState)this).IsKeyDownAuthority() && ((EntityState)this).fixedAge >= 0.1f) { BarrageFire barrageFire = new BarrageFire(); barrageFire.charge = num; ((EntityState)this).outer.SetNextState((EntityState)(object)barrageFire); } } protected float CalcCharge() { return Mathf.Clamp01(((EntityState)this).fixedAge / chargeDuration); } public override void OnExit() { ((EntityState)this).OnExit(); AkSoundEngine.StopPlayingID(chargePlayID); if (Object.op_Implicit((Object)(object)chargeEffectInstance)) { EntityState.Destroy((Object)(object)chargeEffectInstance); } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)4; } } public class BarrageFire : RendHandler { [TokenModifier(/*Could not decode attribute arguments.*/)] public static float damageCoefficient; public static float procCoefficient; public static uint bulletCountPerShot; public static float range; public static float maxSpread; public static int minBulletCount; [TokenModifier(/*Could not decode attribute arguments.*/)] public static int maxBulletCount; public static float baseDuration; public static float minTimeBetweenShots; public static float maxTimeBetweenShots; public static float recoil; public static GameObject tracerPrefab; private int totalBulletsFired; private int bulletCount; public float stopwatchBetweenShots; public float charge; private Animator modelAnimator; private Transform modelTransform; private float duration; private float durationBetweenShots; private GameObject muzzleFlashEffect = Resources.Load<GameObject>("Prefabs/Effects/ImpactEffects/FusionCellExplosion"); public override void OnEnter() { ((BaseState)this).OnEnter(); ((EntityState)this).characterBody.SetSpreadBloom(0.2f, false); ((EntityState)this).characterBody.isSprinting = false; duration = baseDuration; durationBetweenShots = Util.Remap(charge, 0f, 1f, minTimeBetweenShots, maxTimeBetweenShots) / ((BaseState)this).attackSpeedStat; bulletCount = (int)((float)Mathf.RoundToInt(Util.Remap(charge, 0f, 1f, (float)minBulletCount, (float)maxBulletCount)) * ((BaseState)this).attackSpeedStat); modelAnimator = ((EntityState)this).GetModelAnimator(); modelTransform = ((EntityState)this).GetModelTransform(); ((EntityState)this).characterBody.SetAimTimer(2f); ((EntityState)this).characterBody.outOfCombatStopwatch = 0f; FireBullet(); } private void FireBullet() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_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_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_010f: 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_0121: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Expected O, but got Unknown Ray aimRay = ((BaseState)this).GetAimRay(); string text = "Muzzle"; EffectManager.SimpleMuzzleFlash(FireBarrage.effectPrefab, ((EntityState)this).gameObject, text, false); Util.PlaySound("NemmandoSubmissionFire", ((EntityState)this).gameObject); ((EntityState)this).PlayCrossfade("Gesture, Additive", "FireGun", "FireGun.playbackRate", durationBetweenShots, durationBetweenShots / 2f); ((BaseState)this).AddRecoil(-0.8f * recoil, -1f * recoil, -0.1f * recoil, 0.15f * recoil); if (((EntityState)this).isAuthority) { BulletAttack val = new BulletAttack { owner = ((EntityState)this).gameObject, weapon = ((EntityState)this).gameObject, origin = ((Ray)(ref aimRay)).origin, aimVector = ((Ray)(ref aimRay)).direction, minSpread = 0f, maxSpread = maxSpread, bulletCount = bulletCountPerShot, damage = damageCoefficient * ((BaseState)this).damageStat, force = 0.5f * FireBarrage.force, tracerEffectPrefab = tracerPrefab, muzzleName = text, hitEffectPrefab = FireBarrage.hitEffectPrefab, isCrit = ((BaseState)this).RollCrit(), radius = FireBarrage.bulletRadius, smartCollision = true, damageType = (DamageType)0, spreadPitchScale = 0.5f, spreadYawScale = 0.5f, procChainMask = default(ProcChainMask), procCoefficient = procCoefficient, falloffModel = (FalloffModel)1, maxDistance = range }; RendMultiplier(val); val.Fire(); } ((EntityState)this).characterBody.AddSpreadBloom(2f * FireBarrage.spreadBloomValue); totalBulletsFired++; } public override void OnExit() { ((EntityState)this).OnExit(); ((EntityState)this).PlayCrossfade("Gesture, Override", "BufferEmpty", "", 1f, 0.4f); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); stopwatchBetweenShots += Time.fixedDeltaTime; if (stopwatchBetweenShots >= durationBetweenShots && totalBulletsFired < bulletCount) { stopwatchBetweenShots -= durationBetweenShots; FireBullet(); } if (((EntityState)this).fixedAge >= duration && totalBulletsFired == bulletCount && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)1; } } public class BossAttack : BaseSkillState { public float charge; public static float baseDuration; [TokenModifier(/*Could not decode attribute arguments.*/)] public static int maxHits; public static int minHits; [TokenModifier(/*Could not decode attribute arguments.*/)] public static float maxDamageCoefficient; public static float minDamageCoefficient; public static float maxRadius; public static float minRadius; public static float maxEmission; public static float minEmission; public static GameObject effectPrefab; private float hitStopwatch; private float duration; private int hitCount; private float damageCoefficient; private float radius; private float emission; private BlastAttack blastAttack; private EffectData attackEffect; public Material swordMat; public Material matInstance; private float minimumEmission; private string skinNameToken; public CameraParamsOverrideHandle camOverrideHandle; public override void OnEnter() { //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_0271: 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_027d: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Expected O, but got Unknown //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02cb: Unknown result type (might be due to invalid IL or missing references) //IL_02d0: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_02e8: Expected O, but got Unknown //IL_0306: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); ((EntityState)this).characterBody.isSprinting = false; duration = baseDuration / ((BaseState)this).attackSpeedStat; hitCount = Mathf.RoundToInt(Util.Remap(charge, 0f, 1f, (float)minHits, (float)maxHits)); SS2Log.Debug("hit count inital: " + hitCount + "| " + ((EntityState)this).characterBody.attackSpeed, 51, "OnEnter"); int num = (int)((float)hitCount * (0.5f * ((EntityState)this).characterBody.attackSpeed + 0.5f)); hitCount = Mathf.Max(hitCount, num); SS2Log.Debug("hit count after: " + hitCount, 54, "OnEnter"); damageCoefficient = maxDamageCoefficient; radius = maxRadius; emission = Util.Remap(charge, 0f, 1f, minEmission, maxEmission); ((EntityState)this).characterBody.hideCrosshair = false; CharacterBody characterBody = ((EntityState)this).characterBody; characterBody.bodyFlags = (BodyFlags)(characterBody.bodyFlags | 1); skinNameToken = ((Component)((EntityState)this).GetModelTransform()).GetComponentInChildren<ModelSkinController>().skins[((EntityState)this).characterBody.skinIndex].nameToken; if (skinNameToken != "SS2_SKIN_NEMCOMMANDO_DEFAULT" && skinNameToken != "SS2_SKIN_NEMCOMMANDO_GRANDMASTERY") { if (skinNameToken == "SS2_SKIN_NEMCOMMANDO_MASTERY") { effectPrefab = SS2Assets.LoadAsset<GameObject>("DecisiveStrikeSlashYellow", SS2Bundle.NemCommando); } if (skinNameToken == "SS2_SKIN_NEMCOMMANDO_COMMANDO") { effectPrefab = SS2Assets.LoadAsset<GameObject>("DecisiveStrikeSlashBlue", SS2Bundle.NemCommando); } } else { effectPrefab = SS2Assets.LoadAsset<GameObject>("DecisiveStrikeSlash", SS2Bundle.NemCommando); } blastAttack = new BlastAttack { attacker = ((EntityState)this).gameObject, attackerFiltering = (AttackerFiltering)2, baseDamage = damageCoefficient * ((BaseState)this).damageStat, baseForce = -500f, bonusForce = Vector3.zero, crit = ((BaseState)this).RollCrit(), damageColorIndex = (DamageColorIndex)0, damageType = (DamageType)0, falloffModel = (FalloffModel)0, inflictor = ((EntityState)this).gameObject, losType = (LoSType)0, position = ((EntityState)this).characterBody.corePosition, procChainMask = default(ProcChainMask), procCoefficient = 1f, radius = radius, teamIndex = ((BaseState)this).GetTeam() }; DamageAPI.AddModdedDamageType(blastAttack, Moonstorm.Starstorm2.DamageTypes.Gouge.gougeDamageType); ((EntityState)this).characterMotor.rootMotion = Vector3.zero; ((EntityState)this).characterMotor.velocity = Vector3.zero; if (charge >= 0.4f) { EffectData val = new EffectData(); val.scale = ((EntityState)this).characterBody.bestFitRadius * 10f; val.origin = ((EntityState)this).characterBody.corePosition; EffectManager.SpawnEffect(effectPrefab, val, true); } FireAttack(); if (charge >= 0.6f) { ((EntityState)this).PlayAnimation("FullBody, Override", "DecisiveStrikeMax", "DecisiveStrike.playbackRate", duration); Util.PlaySound("NemmandoDecisiveStrikeFire", ((EntityState)this).gameObject); } else { ((EntityState)this).PlayAnimation("FullBody, Override", "DecisiveStrike", "DecisiveStrike.playbackRate", duration); } } private void FireAttack() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0038: 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_005e: Expected O, but got Unknown //IL_007c: Unknown result type (might be due to invalid IL or missing references) hitStopwatch = duration / (float)hitCount; if (((EntityState)this).isAuthority) { blastAttack.position = ((EntityState)this).characterBody.corePosition; blastAttack.Fire(); if (hitCount > 0) { Util.PlaySound(GroundLight.hitSoundString, ((EntityState)this).gameObject); } EffectData val = new EffectData(); val.scale = ((EntityState)this).characterBody.bestFitRadius * 10f; val.origin = ((EntityState)this).characterBody.corePosition; EffectManager.SpawnEffect(effectPrefab, val, true); } } public override void FixedUpdate() { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_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) ((EntityState)this).FixedUpdate(); hitStopwatch -= Time.fixedDeltaTime; emission -= 2f * Time.fixedDeltaTime; if (emission < 0f) { emission = 0f; } ((EntityState)this).characterMotor.rootMotion = Vector3.zero; ((EntityState)this).characterMotor.velocity = Vector3.zero; int num = 0; while (hitStopwatch <= 0f && num < hitCount) { FireAttack(); num++; } if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invali