Decompiled source of AerosSkills v2.0.0
AerosSkills.dll
Decompiled 3 weeks ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using AncientScepter; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using EntityStates; using EntityStates.Captain.Weapon; using EntityStates.Commando.CommandoWeapon; using EntityStates.Engi.EngiWeapon; using EntityStates.Loader; using KinematicCharacterController; using On.RoR2; using R2API; using R2API.Models; using R2API.Utils; using Rewired.ComponentControls.Effects; using RoR2; using RoR2.CharacterAI; using RoR2.Networking; using RoR2.Projectile; using RoR2.Skills; using RoR2.UI; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.Rendering; [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: CompilationRelaxations(8)] [assembly: AssemblyCompany("AerosSkills")] [assembly: AssemblyProduct("AerosSkills")] [assembly: AssemblyTitle("AerosSkills")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace AerosSkills; internal class Assets { public static AssetBundle MainAssetBundle; public static T Load<T>(string name) where T : Object { return MainAssetBundle.LoadAsset<T>(name); } public static void PopulateAssets() { Assembly executingAssembly = Assembly.GetExecutingAssembly(); if ((Object)(object)MainAssetBundle == (Object)null) { using (Stream stream = executingAssembly.GetManifestResourceStream("AerosSkills.AssetBundle." + "AerosSkills".ToLower() + "assets")) { MainAssetBundle = AssetBundle.LoadFromStream(stream); } } } } internal class CrosshairSwap : MonoBehaviour { private CharacterBody body; private void Awake() { body = ((Component)this).GetComponent<CharacterBody>(); } private void Start() { if (body.skillLocator.primary.skillNameToken == "AEROS_M1") { body.spreadBloomCurve = Prefabs.spreadBloomCurve; body._defaultCrosshairPrefab = Prefabs.Load<GameObject>("RoR2/Base/UI/StandardCrosshair.prefab"); } } } internal class DebugHelper : MonoBehaviour { } [DefaultExecutionOrder(100)] internal class eee : MonoBehaviour { private Tracer tracer; public float zPos = 13f; private void Start() { //IL_001d: 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_0025: 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_0031: Unknown result type (might be due to invalid IL or missing references) tracer = ((Component)this).GetComponent<Tracer>(); Vector3 localPosition = tracer.beamObject.transform.localPosition; Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(localPosition.x, localPosition.y, localPosition.z + zPos); } } internal class ForcePos : MonoBehaviour { private void LateUpdate() { //IL_0007: 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) ((Component)this).transform.localPosition = Vector3.up * 4f; } } internal class MissileSearchTweak : MonoBehaviour { public float maxAngle = 75f; private MissileController missile; private void Start() { missile = ((Component)this).GetComponent<MissileController>(); missile.search.maxAngleFilter = 20f; } } internal class RadialBuff : MonoBehaviour { private TeamFilter teamFilter; private void OnCollisionEnter(Collision collision) { //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown //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_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_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_0102: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_0270: Expected O, but got Unknown float value = MainPlugin.radius.Value; if (NetworkServer.active) { SphereSearch val = new SphereSearch(); val.origin = ((Component)this).transform.position; val.radius = value; val.mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask; HurtBox[] hurtBoxes = val.RefreshCandidates().FilterCandidatesByHurtBoxTeam(TeamMask.GetEnemyTeams(teamFilter.teamIndex)).FilterCandidatesByDistinctHurtBoxEntities() .GetHurtBoxes(); HurtBox[] array = hurtBoxes; foreach (HurtBox val2 in array) { if (Object.op_Implicit((Object)(object)val2.healthComponent)) { SetStateOnHurt component = ((Component)val2.healthComponent).GetComponent<SetStateOnHurt>(); if (Object.op_Implicit((Object)(object)component)) { component.SetPain(); } } } } foreach (TeamComponent teamMember in TeamComponent.GetTeamMembers(teamFilter.teamIndex)) { if (!Object.op_Implicit((Object)(object)teamMember.body) || !(Vector3.Distance(((Component)this).transform.position, ((Component)teamMember).transform.position) <= value)) { continue; } float value2 = MainPlugin.duration.Value; if (Object.op_Implicit((Object)(object)teamMember.body.modelLocator) && Object.op_Implicit((Object)(object)teamMember.body.modelLocator.modelTransform)) { CharacterModel component2 = ((Component)teamMember.body.modelLocator.modelTransform).GetComponent<CharacterModel>(); if (Object.op_Implicit((Object)(object)component2)) { TemporaryOverlayInstance val3 = TemporaryOverlayManager.AddOverlay(((Component)component2).gameObject); val3.duration = value2; val3.animateShaderAlpha = true; val3.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); val3.alphaCurve.AddKey(0.85f, 1f); val3.destroyComponentOnEnd = true; val3.originalMaterial = Prefabs.overlay; val3.AddToCharacterModel(component2); } } if (NetworkServer.active) { teamMember.body.AddTimedBuff(Prefabs.overclock, value2); } } EffectManager.SpawnEffect(Prefabs.buffProjectileExplosion, new EffectData { origin = ((Component)this).transform.position, scale = value }, false); } private void Awake() { teamFilter = ((Component)this).GetComponent<TeamFilter>(); } } internal class SimpleUpdate : MonoBehaviour { private ProjectileSimple simple; private ProjectileTargetComponent target; private void Awake() { simple = ((Component)this).GetComponent<ProjectileSimple>(); target = ((Component)this).GetComponent<ProjectileTargetComponent>(); } private void FixedUpdate() { simple.updateAfterFiring = Object.op_Implicit((Object)(object)target.target); } } [DefaultExecutionOrder(100)] internal class TurretChargeBehaviour : MonoBehaviour { private CharacterBody body; private CharacterModel model; private Material mat; public bool firing; public float stopwatch = 3f; public bool addstock; private void Awake() { model = ((Component)this).GetComponent<CharacterModel>(); } private void Start() { body = model.body; UpdateMaterial(); } public void UpdateMaterial() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown //IL_00a5: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)mat)) { Object.Destroy((Object)(object)mat); } mat = new Material(model.baseRendererInfos[3].defaultMaterial); model.baseRendererInfos[3].defaultMaterial = mat; model.baseRendererInfos[3].renderer.material = mat; if (!Object.op_Implicit((Object)(object)body)) { mat.SetTextureScale("_MainTex", new Vector2(2.07f, 1f)); mat.SetFloat("_EmPower", 2f); } } private void FixedUpdate() { //IL_00f3: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)model) || !Object.op_Implicit((Object)(object)mat)) { return; } if (firing) { if (stopwatch <= 0f) { stopwatch = 3f; } stopwatch -= Time.fixedDeltaTime; } else { stopwatch = 3f; } GenericSkill primary = body.skillLocator.primary; mat.SetTextureScale("_MainTex", new Vector2(primary.CanExecute() ? 2.07f : (firing ? 2.07f : Util.Remap(Math.Min(1f, primary.rechargeStopwatch / primary.finalRechargeInterval), 0f, 1f, 0.66f, 2.07f)), 1f)); } } [DefaultExecutionOrder(100)] internal class TurretSkinBehaviour : NetworkBehaviour { private CharacterBody body; private NetworkLoadout networkLoadout; private BodyIndex bodyIndex; private ModelSkinController skinController; private TurretChargeBehaviour chargeBehaviour; private CharacterSelectSurvivorPreviewDisplayController displayController; private void Awake() { skinController = ((Component)this).GetComponent<ModelSkinController>(); chargeBehaviour = ((Component)this).GetComponent<TurretChargeBehaviour>(); } private void Start() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Expected O, but got Unknown //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Expected O, but got Unknown body = ((Component)this).GetComponent<CharacterModel>().body; bodyIndex = BodyCatalog.FindBodyIndex("EngiBody"); if (Object.op_Implicit((Object)(object)body)) { return; } displayController = ((Component)this).GetComponentInParent<CharacterSelectSurvivorPreviewDisplayController>(); if (Object.op_Implicit((Object)(object)displayController)) { displayController.skinChangeResponses[0].response.AddListener((UnityAction)delegate { UpdateModel(0); }); displayController.skinChangeResponses[1].response.AddListener((UnityAction)delegate { UpdateModel(1); }); displayController.skinChangeResponses[2].response.AddListener((UnityAction)delegate { UpdateModel(2); }); } } private void UpdateModel(int skinIndex) { if (Object.op_Implicit((Object)(object)skinController) && Object.op_Implicit((Object)(object)chargeBehaviour)) { ((Behaviour)skinController.characterModel).enabled = true; skinController.ApplySkin(skinIndex); chargeBehaviour.UpdateMaterial(); } } private void UNetVersion() { } public override bool OnSerialize(NetworkWriter writer, bool forceAll) { bool result = default(bool); return result; } public override void OnDeserialize(NetworkReader reader, bool initialState) { } } internal class TurretSpawner : NetworkBehaviour { private CharacterBody body; private static int kCmdCmdSpawn; private void Awake() { body = ((Component)this).GetComponent<CharacterBody>(); } [Command] public void CmdSpawn(Vector3 pos, Quaternion rot) { //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_0011: 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_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0030: 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_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Expected O, but got Unknown //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Expected O, but got Unknown //IL_00a4: Unknown result type (might be due to invalid IL or missing references) CharacterMaster val = new MasterSummon { masterPrefab = Prefabs.turretMaster, position = pos, rotation = rot, summonerBodyObject = ((Component)body).gameObject, ignoreTeamMemberLimit = true, inventoryToCopy = body.inventory, teamIndexOverride = body.teamComponent.teamIndex }.Perform(); Deployable val2 = ((Component)val).gameObject.AddComponent<Deployable>(); val2.onUndeploy = new UnityEvent(); val2.onUndeploy.AddListener(new UnityAction(val.TrueKill)); body.master.AddDeployable(val2, Prefabs.bigTurret); } private void UNetVersion() { } protected static void InvokeCmdCmdSpawn(NetworkBehaviour obj, NetworkReader reader) { //IL_001d: 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 (!NetworkServer.active) { Debug.LogError((object)"Command CmdSpawn called on client."); } else { ((TurretSpawner)(object)obj).CmdSpawn(reader.ReadVector3(), reader.ReadQuaternion()); } } public void CallCmdSpawn(Vector3 pos, Quaternion rot) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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_0026: Unknown result type (might be due to invalid IL or missing references) if (!NetworkClient.active) { Debug.LogError((object)"Command function CmdSpawn called on server."); return; } if (((NetworkBehaviour)this).isServer) { CmdSpawn(pos, rot); return; } NetworkWriter val = new NetworkWriter(); val.Write((short)0); val.Write((short)5); val.WritePackedUInt32((uint)kCmdCmdSpawn); val.Write(((Component)this).GetComponent<NetworkIdentity>().netId); val.Write(pos); val.Write(rot); ((NetworkBehaviour)this).SendCommandInternal(val, 0, "CmdSpawn"); } static TurretSpawner() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown kCmdCmdSpawn = -274844957; NetworkBehaviour.RegisterCommandDelegate(typeof(TurretSpawner), kCmdCmdSpawn, new CmdDelegate(InvokeCmdCmdSpawn)); NetworkCRC.RegisterBehaviour("TurretSpawner", 0); } public override bool OnSerialize(NetworkWriter writer, bool forceAll) { bool result = default(bool); return result; } public override void OnDeserialize(NetworkReader reader, bool initialState) { } } internal class Hook { internal static void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients); HealthComponent.TakeDamage += new hook_TakeDamage(HealthComponent_TakeDamage); } private static void HealthComponent_TakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo) { bool flag = Object.op_Implicit((Object)(object)self.body) && self.body.HasBuff(Prefabs.block); float damage = damageInfo.damage; float num = Math.Clamp(MainPlugin.blockAmount.Value, 0.01f, 1f); if (flag) { damageInfo.damage *= 1f - num; } orig.Invoke(self, damageInfo); if (flag) { self.AddBarrier(damage * num); } } private static void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args) { if (sender.HasBuff(Prefabs.block)) { args.moveSpeedReductionMultAdd += MainPlugin.blockSpeedReduction.Value; } if (sender.HasBuff(Prefabs.overclock)) { args.baseRegenAdd += MainPlugin.regen.Value; args.baseAttackSpeedAdd += MainPlugin.atkspd.Value; args.baseMoveSpeedAdd += MainPlugin.movspd.Value; args.cooldownMultAdd += 0f - MainPlugin.cooldown.Value; } } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.Dragonyck.AerosSkills", "AerosSkills", "2.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class MainPlugin : BaseUnityPlugin { public const string MODUID = "com.Dragonyck.AerosSkills"; public const string MODNAME = "AerosSkills"; public const string VERSION = "2.0.0"; public const string MODKEY = "AEROS"; internal static ConfigFile captainCfg; internal static ConfigEntry<bool> enableCap; internal static ConfigEntry<float> burstDMG; internal static ConfigEntry<float> radius; internal static ConfigEntry<float> regen; internal static ConfigEntry<float> atkspd; internal static ConfigEntry<float> movspd; internal static ConfigEntry<float> cooldown; internal static ConfigEntry<float> duration; internal static ConfigEntry<float> CD; internal static ConfigFile engiCfg; internal static ConfigEntry<bool> enableEngi; internal static ConfigEntry<float> missileDamageCoefficient; internal static ConfigEntry<bool> missileTracking; internal static ConfigEntry<float> turretDamageCoefficient; internal static ConfigFile loaderCfg; internal static ConfigEntry<bool> enableLoader; internal static ConfigEntry<float> blockDuration; internal static ConfigEntry<float> blockSpeedReduction; internal static ConfigEntry<float> blockAmount; internal static ConfigEntry<float> blockWaveDamage; internal static ConfigEntry<int> maxPunchCount; internal static ConfigEntry<float> punchDamageCoefficient; internal static ConfigEntry<float> punchChargeTime; internal static ConfigEntry<float> punchVelocity; internal static ConfigEntry<float> punchSpeed; internal static BepInPlugin Metadata; internal static string Location; internal static SkillDef engiScepter; private void Awake() { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Expected O, but got Unknown //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Expected O, but got Unknown Location = ((BaseUnityPlugin)this).Info.Location; Metadata = ((BaseUnityPlugin)this).Info.Metadata; captainCfg = new ConfigFile(Paths.ConfigPath + "\\AerosSkills\\Captain.cfg", true); enableCap = captainCfg.Bind<bool>("General", "Enable Captain Skills", true, (ConfigDescription)null); burstDMG = captainCfg.Bind<float>("VulcanRepeater", "Damage Coefficient", 1.65f, (ConfigDescription)null); radius = captainCfg.Bind<float>("Overclock", "Explosion Radius", 12f, (ConfigDescription)null); regen = captainCfg.Bind<float>("Overclock", "Base Health Regen Add", 5f, (ConfigDescription)null); atkspd = captainCfg.Bind<float>("Overclock", "Base Attack Speed Add", 0.6f, (ConfigDescription)null); movspd = captainCfg.Bind<float>("Overclock", "Base Movement Speed Add", 5f, (ConfigDescription)null); cooldown = captainCfg.Bind<float>("Overclock", "Cooldown Reduction Mult", 0.5f, (ConfigDescription)null); duration = captainCfg.Bind<float>("Overclock", "Buff Duration", 5f, (ConfigDescription)null); CD = captainCfg.Bind<float>("Overclock", "Skill Cooldown", 8f, (ConfigDescription)null); engiCfg = new ConfigFile(Paths.ConfigPath + "\\AerosSkills\\Engineer.cfg", true); enableEngi = engiCfg.Bind<bool>("General", "Enable Engineer Skills", true, (ConfigDescription)null); missileDamageCoefficient = engiCfg.Bind<float>("Missiles", "Damage Coefficient", 1.4f, (ConfigDescription)null); missileTracking = engiCfg.Bind<bool>("Seekers", "Enable Tracking", true, (ConfigDescription)null); turretDamageCoefficient = engiCfg.Bind<float>("TR90 Railgun Turret", "Damage Coefficient", 30f, (ConfigDescription)null); loaderCfg = new ConfigFile(Paths.ConfigPath + "\\AerosSkills\\Loader.cfg", true); enableLoader = loaderCfg.Bind<bool>("General", "Enable Loader Skills", true, (ConfigDescription)null); blockDuration = loaderCfg.Bind<float>("Block", "Duration", 10f, (ConfigDescription)null); blockSpeedReduction = loaderCfg.Bind<float>("Block", "Speed Reduction", 0.6f, (ConfigDescription)null); blockAmount = loaderCfg.Bind<float>("Block", "Block Coefficient", 0.8f, (ConfigDescription)null); blockWaveDamage = loaderCfg.Bind<float>("Block", "Block Wave Damage Coefficient", 4.5f, (ConfigDescription)null); maxPunchCount = loaderCfg.Bind<int>("Charged Barrage", "Max Punch Count", 9, (ConfigDescription)null); punchDamageCoefficient = loaderCfg.Bind<float>("Charged Barrage", "Damage Coefficient", 3.5f, (ConfigDescription)null); punchChargeTime = loaderCfg.Bind<float>("Charged Barrage", "Charge Time Required Per Punch", 0.15f, (ConfigDescription)null); punchVelocity = loaderCfg.Bind<float>("Charged Barrage", "Added Velocity After Charge", 5f, (ConfigDescription)null); punchSpeed = loaderCfg.Bind<float>("Charged Barrage", "Swing Duration", 0.13f, (ConfigDescription)null); Assets.PopulateAssets(); Prefabs.CreatePrefabs(); GameObject val = null; SkillLocator val2 = null; if (enableCap.Value) { val = Prefabs.Load<GameObject>("RoR2/Base/Captain/CaptainBody.prefab"); val2 = val.GetComponent<SkillLocator>(); val.AddComponent<CrosshairSwap>(); Prefabs.spreadBloomCurve = Prefabs.Load<GameObject>("RoR2/Base/Commando/CommandoBody.prefab").GetComponent<CharacterBody>().spreadBloomCurve; CaptainPrimarySetup(val2); CaptainSecondarySetup(val2); } if (enableEngi.Value) { val = Prefabs.Load<GameObject>("RoR2/Base/Engi/EngiBody.prefab"); val.AddComponent<TurretSpawner>(); val2 = val.GetComponent<SkillLocator>(); EngiPrimarySetup(val2); EngiSpecialSetup(val2); if (ModCompat.AncientScepterEnabled) { ModCompat.AddScepterSupport(); } } if (enableLoader.Value) { val = Prefabs.Load<GameObject>("RoR2/Base/Loader/LoaderBody.prefab"); val2 = val.GetComponent<SkillLocator>(); val.gameObject.AddComponent<DebugHelper>(); LoaderUtilitySetup(val2); LoaderSpecialSetup(val2); } RegisterStates(); Hook.Hooks(); } private void LoaderUtilitySetup(SkillLocator skillLocator) { LanguageAPI.Add("AEROSLOADER_UTIL", "Charged Barrage"); LanguageAPI.Add("AEROSLOADER_UTIL_DESCRIPTION", "Charge up to perform a series of punches for <style=cIsDamage>" + punchDamageCoefficient.Value * 100f + "% damage</style> each, increasing in count with charge time."); SkillDef skillDef = Utils.NewSkillDef<SkillDef>(typeof(ChargePunches), "Weapon", 1, 8f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: true, (InterruptPriority)1, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: true, 1, 1, 1, Assets.MainAssetBundle.LoadAsset<Sprite>("loaderutility"), "AEROSLOADER_UTIL_DESCRIPTION", "AEROSLOADER_UTIL", Array.Empty<string>()); Utils.AddAlt(skillLocator.utility._skillFamily, skillDef); } private void LoaderSpecialSetup(SkillLocator skillLocator) { LanguageAPI.Add("AEROSLOADER_SPEC", "Block"); LanguageAPI.Add("AEROSLOADER_SPEC_DESCRIPTION", "Enter a block stance for up to <style=cIsDamage>" + blockDuration.Value + "s</style>, blocking " + blockAmount.Value * 100f + "% damage</style> of all incoming damage and turning it into <style=cIsHealing>barrier</style>. Finishes by consuming all barrier and releasing a lightning wave for " + blockWaveDamage.Value * 100f + "% damage</style>, increasing in damage and size based on trhe amount of barrier consumed."); SkillDef skillDef = Utils.NewSkillDef<SkillDef>(typeof(Block), "Weapon", 1, 8f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: true, (InterruptPriority)1, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: true, 1, 1, 1, Assets.MainAssetBundle.LoadAsset<Sprite>("loaderspecial"), "AEROSLOADER_SPEC_DESCRIPTION", "AEROSLOADER_SPEC", Array.Empty<string>()); Utils.AddAlt(skillLocator.special._skillFamily, skillDef); } private void EngiSpecialSetup(SkillLocator skillLocator) { LanguageAPI.Add("AEROSENGI_SPEC2", "TR90 Railgun Turret"); LanguageAPI.Add("AEROSENGI_SPEC", "TR90 Railgun Turret"); LanguageAPI.Add("AEROSENGI_SPEC_DESCRIPTION", "Drop a turret that charges up over <style=cIsUtility>8s</style> and fires for <style=cIsDamage>" + turretDamageCoefficient.Value * 100f + "% damage</style>, inheriting all of your items."); SkillDef skillDef = Utils.NewSkillDef<SkillDef>(typeof(EngiSpecial), "Weapon", 1, 25f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: true, (InterruptPriority)0, isCombatSkill: true, mustKeyPress: false, cancelSprintingOnActivation: true, 1, 1, 1, Assets.MainAssetBundle.LoadAsset<Sprite>("engispecial"), "AEROSENGI_SPEC_DESCRIPTION", "AEROSENGI_SPEC", Array.Empty<string>()); Utils.AddAlt(skillLocator.special._skillFamily, skillDef); skillDef = Utils.NewSkillDef<SkillDef>(typeof(EngiSpecial), "Weapon", 1, 25f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: true, (InterruptPriority)0, isCombatSkill: true, mustKeyPress: false, cancelSprintingOnActivation: true, 1, 1, 1, Assets.MainAssetBundle.LoadAsset<Sprite>("engispecial2"), "AEROSENGI_SPEC_DESCRIPTION", "AEROSENGI_SPEC2", Array.Empty<string>()); engiScepter = skillDef; } private void EngiPrimarySetup(SkillLocator skillLocator) { LanguageAPI.Add("AEROSENGI_M1", "Seekers"); LanguageAPI.Add("AEROSENGI_M1_DESCRIPTION", "Charge up to <style=cIsDamage>8</style> missiles that deal <style=cIsDamage>" + missileDamageCoefficient.Value * 100f + "% damage</style> each."); SkillDef skillDef = Utils.NewSkillDef<SkillDef>(typeof(EngiPrimaryCharge), "Weapon", 0, 0f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: true, (InterruptPriority)0, isCombatSkill: true, mustKeyPress: false, cancelSprintingOnActivation: true, 0, 0, 0, Assets.MainAssetBundle.LoadAsset<Sprite>("engiprimary"), "AEROSENGI_M1_DESCRIPTION", "AEROSENGI_M1", Array.Empty<string>()); Utils.AddAlt(skillLocator.primary._skillFamily, skillDef); } private void CaptainPrimarySetup(SkillLocator skillLocator) { LanguageAPI.Add("AEROSCAP_M1", "Vulcan Repeater"); LanguageAPI.Add("AEROSCAP_M1_DESCRIPTION", "Fire a quick burst of <style=cIsDamage>3</style> pellets that deal <style=cIsDamage>3x" + burstDMG.Value * 100f + "% damage</style>."); SkillDef skillDef = Utils.NewSkillDef<SkillDef>(typeof(CaptainPrimary), "Weapon", 0, 0f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: true, (InterruptPriority)0, isCombatSkill: true, mustKeyPress: false, cancelSprintingOnActivation: true, 0, 0, 0, Assets.MainAssetBundle.LoadAsset<Sprite>("capprimary"), "AEROSCAP_M1_DESCRIPTION", "AEROSCAP_M1", Array.Empty<string>()); Utils.AddAlt(skillLocator.primary._skillFamily, skillDef); } private void CaptainSecondarySetup(SkillLocator skillLocator) { LanguageAPI.Add("AEROSCAP_M2", "Overclock"); LanguageAPI.Add("AEROSCAP_M2_DESCRIPTION", "Fire a <style=cIsHealth>non damaging</style> projectile that <style=cIsDamage>buffs</style> nearby allies on impact with <style=cIsHealing>+" + regen.Value + " hp/s health regen</style>, <style=cIsDamage>+" + atkspd.Value + " attack speed</style>, <style=cIsUtility>+" + movspd.Value + " movement speed</style> and <style=cIsUtility>" + cooldown.Value * 100f + "% cooldown reduction</style> for <style=cIsUtility>" + duration.Value + "s</style>."); SkillDef skillDef = Utils.NewSkillDef<SkillDef>(typeof(CaptainSecondary), "Weapon", 1, CD.Value, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)1, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: false, 1, 1, 1, Assets.MainAssetBundle.LoadAsset<Sprite>("capsecondary"), "AEROSCAP_M2_DESCRIPTION", "AEROSCAP_M2", Array.Empty<string>()); Utils.AddAlt(skillLocator.secondary.skillFamily, skillDef); } private void RegisterStates() { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0023: 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_0033: 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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) bool flag = default(bool); ContentAddition.AddEntityState<CaptainPrimary>(ref flag); ContentAddition.AddEntityState<CaptainSecondary>(ref flag); ContentAddition.AddEntityState<EngiPrimaryCharge>(ref flag); ContentAddition.AddEntityState<EngiPrimaryFire>(ref flag); ContentAddition.AddEntityState<EngiSpecial>(ref flag); ContentAddition.AddEntityState<EngiTurretPrimary>(ref flag); ContentAddition.AddEntityState<TurretSpawn>(ref flag); ContentAddition.AddEntityState<ChargePunches>(ref flag); ContentAddition.AddEntityState<Punches>(ref flag); ContentAddition.AddEntityState<Block>(ref flag); ContentAddition.AddEntityState<Slam>(ref flag); } } public static class ModCompat { private static bool? ancientEnabled; public static bool AncientScepterEnabled { get { if (!ancientEnabled.HasValue) { ancientEnabled = Chainloader.PluginInfos.ContainsKey("com.DestroyedClone.AncientScepter"); } return ancientEnabled.Value; } } public static void AddScepterSupport() { ItemBase<AncientScepterItem>.instance.RegisterScepterSkill(MainPlugin.engiScepter, "EngiBody", (SkillSlot)3, 3); } } internal class Prefabs { internal static GameObject buffProjectileGhost; internal static GameObject buffProjectile; internal static GameObject buffProjectileExplosion; internal static GameObject tracer; internal static GameObject missileProjectile; internal static GameObject shieldEffect; internal static GameObject loaderImpact; internal static GameObject slamProjectile; internal static GameObject turret; internal static GameObject turretMaster; internal static GameObject turretBlueprint; internal static GameObject turretMuzzleFlash; internal static GameObject turretTracer; internal static GameObject turretBigTracer; internal static DeployableSlot bigTurret; internal static Material overlay; internal static BuffDef overclock; internal static BuffDef block; internal static AnimationCurve spreadBloomCurve; internal static AnimationClip clip; internal static T Load<T>(string path) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) return Addressables.LoadAssetAsync<T>((object)path).WaitForCompletion(); } internal static GameObject Instantiate(string path, string name, bool registerNetwork = false) { return PrefabAPI.InstantiateClone(Load<GameObject>(path), name, registerNetwork); } internal static GameObject Instantiate(GameObject obj, string name, bool registerNetwork = false) { return PrefabAPI.InstantiateClone(obj, name, registerNetwork); } internal static int DeployableCount(CharacterMaster master, int count) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) int num = 1; if (Object.op_Implicit((Object)(object)master.inventory)) { if (master.inventory.GetItemCount(ItemCatalog.FindItemIndex("ITEM_ANCIENT_SCEPTER")) > 0) { num++; } num += master.inventory.GetItemCount(Items.EquipmentMagazineVoid); } return num; } internal static void CreatePrefabs() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Expected O, but got Unknown //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_108a: Unknown result type (might be due to invalid IL or missing references) //IL_1094: Unknown result type (might be due to invalid IL or missing references) //IL_1099: Unknown result type (might be due to invalid IL or missing references) //IL_10bb: Unknown result type (might be due to invalid IL or missing references) //IL_10c0: Unknown result type (might be due to invalid IL or missing references) //IL_10fb: Unknown result type (might be due to invalid IL or missing references) //IL_1100: Unknown result type (might be due to invalid IL or missing references) //IL_111c: Unknown result type (might be due to invalid IL or missing references) //IL_1126: Expected O, but got Unknown //IL_0598: Unknown result type (might be due to invalid IL or missing references) //IL_05a2: Unknown result type (might be due to invalid IL or missing references) //IL_05b9: Unknown result type (might be due to invalid IL or missing references) //IL_05c3: Expected O, but got Unknown //IL_05da: Unknown result type (might be due to invalid IL or missing references) //IL_05f1: Unknown result type (might be due to invalid IL or missing references) //IL_0633: Unknown result type (might be due to invalid IL or missing references) //IL_063a: Expected O, but got Unknown //IL_06be: Unknown result type (might be due to invalid IL or missing references) //IL_06cb: Unknown result type (might be due to invalid IL or missing references) //IL_06d5: Unknown result type (might be due to invalid IL or missing references) //IL_06f3: Unknown result type (might be due to invalid IL or missing references) //IL_06fd: Unknown result type (might be due to invalid IL or missing references) //IL_071e: 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_025d: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Expected O, but got Unknown //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_0286: 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_02ca: Expected O, but got Unknown //IL_02d7: Unknown result type (might be due to invalid IL or missing references) //IL_033e: Unknown result type (might be due to invalid IL or missing references) //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_03ca: Unknown result type (might be due to invalid IL or missing references) //IL_03cf: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Expected O, but got Unknown //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_12b4: Unknown result type (might be due to invalid IL or missing references) //IL_12b9: Unknown result type (might be due to invalid IL or missing references) //IL_12f0: Unknown result type (might be due to invalid IL or missing references) //IL_12fa: Unknown result type (might be due to invalid IL or missing references) //IL_079e: Unknown result type (might be due to invalid IL or missing references) //IL_07e3: Unknown result type (might be due to invalid IL or missing references) //IL_07ed: Unknown result type (might be due to invalid IL or missing references) //IL_081e: Unknown result type (might be due to invalid IL or missing references) //IL_0844: Unknown result type (might be due to invalid IL or missing references) //IL_084e: Expected O, but got Unknown //IL_08a1: Unknown result type (might be due to invalid IL or missing references) //IL_08d7: Unknown result type (might be due to invalid IL or missing references) //IL_08f9: Unknown result type (might be due to invalid IL or missing references) //IL_09c1: Unknown result type (might be due to invalid IL or missing references) //IL_09ef: Unknown result type (might be due to invalid IL or missing references) //IL_0a04: Unknown result type (might be due to invalid IL or missing references) //IL_0a06: Unknown result type (might be due to invalid IL or missing references) //IL_0a57: Unknown result type (might be due to invalid IL or missing references) //IL_0a79: Unknown result type (might be due to invalid IL or missing references) //IL_0a9b: Unknown result type (might be due to invalid IL or missing references) //IL_0b4b: Unknown result type (might be due to invalid IL or missing references) //IL_0b50: Unknown result type (might be due to invalid IL or missing references) //IL_0b94: Unknown result type (might be due to invalid IL or missing references) //IL_0bb5: Unknown result type (might be due to invalid IL or missing references) //IL_0bc7: Unknown result type (might be due to invalid IL or missing references) //IL_0bd1: Unknown result type (might be due to invalid IL or missing references) //IL_0bf9: Unknown result type (might be due to invalid IL or missing references) //IL_0bfe: Unknown result type (might be due to invalid IL or missing references) //IL_0c1c: Unknown result type (might be due to invalid IL or missing references) //IL_0ca8: Unknown result type (might be due to invalid IL or missing references) //IL_0cbf: Unknown result type (might be due to invalid IL or missing references) //IL_0cc9: Expected O, but got Unknown //IL_0cc4: Unknown result type (might be due to invalid IL or missing references) //IL_0cc9: Unknown result type (might be due to invalid IL or missing references) //IL_0970: Unknown result type (might be due to invalid IL or missing references) //IL_097a: Unknown result type (might be due to invalid IL or missing references) //IL_0d12: Unknown result type (might be due to invalid IL or missing references) //IL_0d1c: Expected O, but got Unknown //IL_0d88: Unknown result type (might be due to invalid IL or missing references) //IL_0d9c: Unknown result type (might be due to invalid IL or missing references) //IL_0e03: Unknown result type (might be due to invalid IL or missing references) //IL_0e0d: Expected O, but got Unknown //IL_0e94: Unknown result type (might be due to invalid IL or missing references) //IL_0e9e: Expected O, but got Unknown //IL_0e53: Unknown result type (might be due to invalid IL or missing references) //IL_0e58: Unknown result type (might be due to invalid IL or missing references) //IL_0e5c: Unknown result type (might be due to invalid IL or missing references) //IL_0e61: Unknown result type (might be due to invalid IL or missing references) //IL_0f41: Unknown result type (might be due to invalid IL or missing references) //IL_0f4b: Expected O, but got Unknown //IL_0f81: Unknown result type (might be due to invalid IL or missing references) //IL_0f8b: Expected O, but got Unknown //IL_102d: Unknown result type (might be due to invalid IL or missing references) //IL_0fd0: Unknown result type (might be due to invalid IL or missing references) //IL_0fd5: Unknown result type (might be due to invalid IL or missing references) //IL_0ff6: Unknown result type (might be due to invalid IL or missing references) overclock = Utils.NewBuffDef("Overclock", stack: false, hidden: false, Load<Sprite>("RoR2/Base/Croco/texBuffRegenBoostIcon.tif"), Color32.op_Implicit(new Color32((byte)226, (byte)81, (byte)65, byte.MaxValue))); block = Utils.NewBuffDef("Block", stack: false, hidden: false, Load<Sprite>("RoR2/Junk/Common/texBuffBodyArmorIcon.tif"), Color32.op_Implicit(new Color32((byte)239, (byte)245, (byte)140, byte.MaxValue))); if (MainPlugin.enableCap.Value) { overlay = new Material(Load<Material>("RoR2/Base/Common/matEnergyShield.mat")); overlay.SetColor("_TintColor", Color.red); overlay.SetFloat("_OffsetAmount", 0.025f); buffProjectileExplosion = Instantiate("RoR2/Base/FusionCellDestructible/FusionCellExplosion.prefab", "BuffExplosion"); buffProjectileExplosion.GetComponent<EffectComponent>().soundName = "Play_roboBall_attack1_explode"; ParticleSystemRenderer[] componentsInChildren = buffProjectileExplosion.GetComponentsInChildren<ParticleSystemRenderer>(); foreach (ParticleSystemRenderer val in componentsInChildren) { string name = ((Object)val).name; if (name == "Ring") { ((Renderer)val).material = new Material(Load<Material>("RoR2/Base/RoboBallBoss/matRoboBallParticleRing.mat")); ((Renderer)val).material.SetTexture("_RemapTex", (Texture)(object)Load<Texture2D>("RoR2/Base/Common/ColorRamps/texRampHuntressSoftCrit.png")); Object.Instantiate<GameObject>(((Component)val).gameObject, ((Component)val).transform.position, ((Component)val).transform.rotation, ((Component)val).transform.parent); } if (name == "") { } if (name == "") { } if (name == "") { } if (name == "") { } } ContentAddition.AddEffect(buffProjectileExplosion); buffProjectileGhost = Instantiate("RoR2/Base/Captain/CaptainTazerGhost.prefab", "BuffProjectileGhost"); Transform child = buffProjectileGhost.transform.GetChild(1); ((Component)child.GetChild(1)).gameObject.SetActive(false); Transform child2 = child.GetChild(0); ((Component)child2).transform.localPosition = Vector3.zero; TrailRenderer component = ((Component)child2).GetComponent<TrailRenderer>(); component.textureMode = (LineTextureMode)0; ((Renderer)component).material = new Material(Load<Material>("RoR2/Base/Bandit2/matBandit2SplatterOpaqueTrailAlt.mat")); ((Renderer)component).material.SetColor("_TintColor", Color32.op_Implicit(new Color32(byte.MaxValue, (byte)44, (byte)44, byte.MaxValue))); ((Renderer)component).material.SetTexture("_RemapTex", (Texture)(object)Load<Texture2D>("RoR2/Base/Common/ColorRamps/texRampParentEyes.png")); ParticleSystemRenderer componentInChildren = ((Component)child2).GetComponentInChildren<ParticleSystemRenderer>(); ((Renderer)componentInChildren).material = new Material(Load<Material>("RoR2/Base/Common/VFX/matArcaneCircleProvi.mat")); ((Renderer)componentInChildren).material.SetColor("_TintColor", Color.red); ((Renderer)componentInChildren).material.SetFloat("_Boost", 6f); buffProjectile = Instantiate("RoR2/Base/Captain/CaptainTazer.prefab", "BuffProjectile", registerNetwork: true); buffProjectile.GetComponent<Rigidbody>().collisionDetectionMode = (CollisionDetectionMode)2; buffProjectile.GetComponent<ProjectileController>().ghostPrefab = buffProjectileGhost; buffProjectile.GetComponent<ProjectileDamage>().damageType = DamageTypeCombo.op_Implicit((DamageType)0); buffProjectile.GetComponent<ProjectileSimple>().desiredForwardSpeed = 110f; Object.Destroy((Object)(object)buffProjectile.GetComponent<ProjectileImpactExplosion>()); ProjectileSingleTargetImpact val2 = buffProjectile.AddComponent<ProjectileSingleTargetImpact>(); val2.destroyOnWorld = true; val2.destroyWhenNotAlive = true; buffProjectile.AddComponent<RadialBuff>(); ContentAddition.AddProjectile(buffProjectile); tracer = Instantiate("RoR2/Base/Bandit2/TracerBanditPistol.prefab", "Tracer"); tracer.GetComponent<LineRenderer>().endColor = Color32.op_Implicit(new Color32(byte.MaxValue, (byte)31, (byte)0, byte.MaxValue)); ContentAddition.AddEffect(tracer); } if (MainPlugin.enableEngi.Value) { missileProjectile = Instantiate("RoR2/Base/Engi/EngiHarpoon.prefab", "AerosMissileProjectile", registerNetwork: true); Object.Destroy((Object)(object)missileProjectile.GetComponent<MissileController>()); Object.Destroy((Object)(object)missileProjectile.GetComponent<QuaternionPID>()); Rigidbody component2 = missileProjectile.GetComponent<Rigidbody>(); component2.useGravity = false; component2.collisionDetectionMode = (CollisionDetectionMode)2; ProjectileSimple val3 = missileProjectile.AddComponent<ProjectileSimple>(); val3.desiredForwardSpeed = 60f; val3.lifetime = 8f; ProjectileDirectionalTargetFinder val4 = missileProjectile.AddComponent<ProjectileDirectionalTargetFinder>(); val4.lookRange = 45f; val4.lookCone = 35f; val4.allowTargetLoss = false; val4.onlySearchIfNoTarget = true; val4.testLoS = false; val4.targetSearchInterval = 0.1f; val4.ignoreAir = false; ((Behaviour)val4).enabled = MainPlugin.missileTracking.Value; ProjectileSteerTowardTarget val5 = missileProjectile.AddComponent<ProjectileSteerTowardTarget>(); val5.rotationSpeed = 220f; ProjectileController component3 = missileProjectile.GetComponent<ProjectileController>(); ProjectileSingleTargetImpact component4 = missileProjectile.GetComponent<ProjectileSingleTargetImpact>(); GameObject val6 = Instantiate(component4.impactEffect, "AerosMissileImpact"); val6.GetComponent<EffectComponent>().soundName = "Play_engi_M1_explo"; ContentAddition.AddEffect(val6); component4.impactEffect = val6; if (MainPlugin.missileTracking.Value) { missileProjectile.AddComponent<SimpleUpdate>(); } GameObject val7 = Instantiate(component3.ghostPrefab, "AerosMissileGhost"); ((Component)val7.GetComponentsInChildren<ParticleSystem>()[^1]).gameObject.SetActive(false); TrailRenderer componentInChildren2 = val7.GetComponentInChildren<TrailRenderer>(); ((Component)componentInChildren2).transform.localPosition = Vector3.forward * 0.1f; ((Renderer)componentInChildren2).material = new Material(Load<Material>("RoR2/DLC1/EliteEarth/matAffixEarthTrailBloblets.mat")); ((Renderer)componentInChildren2).material.SetTextureScale("_Cloud2Tex", new Vector2(0.7f, 1f)); ((Renderer)componentInChildren2).material.SetVector("_CutoffScroll", Vector4.zero); component3.ghostPrefab = val7; ContentAddition.AddProjectile(missileProjectile); GameObject val8 = Assets.Load<GameObject>("turretMdl"); GameObject val9 = val8; MeshRenderer[] componentsInChildren2 = val9.GetComponentsInChildren<MeshRenderer>(); Material val10 = new Material(Load<Material>("RoR2/Base/Engi/matEngiTurret.mat")); val10.SetFloat("_PrintOn", 0f); val10.SetFloat("_EmPower", 5f); turret = Instantiate("RoR2/Base/Engi/EngiTurretBody.prefab", "AerosBigTurretBody", registerNetwork: true); ((Component)turret.GetComponentInChildren<SkinnedMeshRenderer>()).gameObject.SetActive(false); ChildLocator component5 = ((Component)turret.GetComponent<ModelLocator>().modelTransform).GetComponent<ChildLocator>(); Transform val11 = component5.FindChild("Muzzle"); val11.localPosition = new Vector3(0f, 3.5f, 9.6f); val11.localScale = Vector3.one * 2f; HurtBox componentInChildren3 = turret.GetComponentInChildren<HurtBox>(); ((Component)componentInChildren3).transform.localPosition = Vector3.up * 2f; ((Component)componentInChildren3).transform.localScale = new Vector3(3f, 7f, 3f); List<Renderer> list = new List<Renderer>(); Transform[] componentsInChildren3 = turret.GetComponentsInChildren<Transform>(); foreach (Transform val12 in componentsInChildren3) { string name2 = ((Object)val12).name; if (name2 == "Base") { GameObject val13 = Object.Instantiate<GameObject>(((Component)componentsInChildren2[0]).gameObject); val13.transform.parent = val12; ((Renderer)val13.GetComponent<MeshRenderer>()).material = val10; val13.transform.localPosition = Vector3.zero; list.Add((Renderer)(object)val13.GetComponent<MeshRenderer>()); } if (name2 == "Head") { ((Component)val12).gameObject.AddComponent<ForcePos>(); ((Component)val12).transform.localPosition = Vector3.up * 4f; GameObject val14 = Object.Instantiate<GameObject>(((Component)componentsInChildren2[1]).gameObject); val14.transform.parent = val12; val14.transform.localPosition = Vector3.zero; MeshRenderer[] componentsInChildren4 = val14.GetComponentsInChildren<MeshRenderer>(); ((Renderer)componentsInChildren4[0]).material = val10; ((Renderer)componentsInChildren4[1]).material = new Material(val10); Texture2D val15 = Assets.Load<Texture2D>("chargeindicator"); Texture2D val16 = Assets.Load<Texture2D>("chargeindicator_e"); ((Renderer)componentsInChildren4[1]).material.SetTexture("_MainTex", (Texture)(object)val15); ((Renderer)componentsInChildren4[1]).material.SetTexture("_EmTex", (Texture)(object)val16); ((Renderer)componentsInChildren4[1]).material.SetTextureScale("_MainTex", Vector2.zero); ((Renderer)componentsInChildren4[1]).material.SetFloat("_EmPower", 10f); List<NameTransformPair> list2 = component5.transformPairs.ToList(); list2.Add(new NameTransformPair { name = "Charge", transform = ((Component)componentsInChildren4[1]).transform }); component5.transformPairs = list2.ToArray(); list.Add((Renderer)(object)componentsInChildren4[0]); list.Add((Renderer)(object)componentsInChildren4[1]); } if (name2 == "Neck") { GameObject val17 = Object.Instantiate<GameObject>(((Component)componentsInChildren2[3]).gameObject); val17.transform.parent = val12; ((Renderer)val17.GetComponent<MeshRenderer>()).material = val10; val17.transform.localPosition = Vector3.up * -1.4f; list.Add((Renderer)(object)val17.GetComponent<MeshRenderer>()); } } RendererInfo[] array = (RendererInfo[])(object)new RendererInfo[list.Count]; for (int k = 0; k < array.Length; k++) { array[k] = new RendererInfo { renderer = list[k], defaultMaterial = list[k].material, defaultShadowCastingMode = (ShadowCastingMode)0, hideOnDeath = false, ignoreOverlays = false }; } CharacterModel component6 = ((Component)component5).GetComponent<CharacterModel>(); component6.baseRendererInfos = array.ToArray(); ModelSkinController component7 = ((Component)component5).GetComponent<ModelSkinController>(); component7.skins = (SkinDef[])(object)new SkinDef[3] { Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(list, ((Component)component5).gameObject, array, val10)), Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(list, ((Component)component5).gameObject, array, Load<Material>("RoR2/Base/Engi/matEngiAlt.mat"))), Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(list, ((Component)component5).gameObject, array, Load<Material>("RoR2/Base/Engi/matEngiAltColossusTool.mat"))) }; component7.currentSkinIndex = 0; Utils.AddMinionSkin(Load<SkinDef>("RoR2/Base/Engi/skinEngiDefault.asset"), turret, component7.skins[0]); Utils.AddMinionSkin(Load<SkinDef>("RoR2/Base/Engi/skinEngiAlt.asset"), turret, component7.skins[1]); Utils.AddMinionSkin(Load<SkinDef>("RoR2/Base/Engi/skinEngiAltColossus.asset"), turret, component7.skins[2]); ((Behaviour)component6).enabled = false; ((Component)component5).gameObject.AddComponent<TurretChargeBehaviour>(); ((Component)component5).gameObject.AddComponent<TurretSkinBehaviour>(); GameObject val18 = Load<GameObject>("RoR2/Base/Engi/EngiDisplay.prefab"); GameObject val19 = Object.Instantiate<GameObject>(((Component)component5).gameObject, val18.transform.position, Quaternion.identity); ((Behaviour)val19.GetComponent<Animator>()).enabled = false; val19.transform.parent = val18.transform; val19.transform.localPosition = new Vector3(0.3f, 0f, -3.5f); val19.transform.localRotation = Quaternion.Euler(0f, 20f, 0f); val19.transform.localScale = Vector3.one * 0.36f; ((Behaviour)component6).enabled = true; turret.GetComponent<EntityStateMachine>().initialStateType = new SerializableEntityStateType(typeof(TurretSpawn)); turret.GetComponent<SkillLocator>().primary = Utils.NewGenericSkill(turret, Utils.NewSkillDef<SkillDef>(new SerializableEntityStateType(typeof(EngiTurretPrimary)), "Weapon", 1, 8f, beginSkillCooldownOnSkillEnd: false, canceledFromSprinting: false, fullRestockOnAssign: true, (InterruptPriority)0, isCombatSkill: true, mustKeyPress: false, cancelSprintingOnActivation: true, 1, 1, 1, (Sprite)null, "AEROSENGI_SPEC_DESCRIPTION", "AEROSENGI_SPEC", Array.Empty<string>())); ContentAddition.AddBody(turret); turretMaster = Instantiate("RoR2/Base/Engi/EngiTurretMaster.prefab", "AerosBigTurretMaster", registerNetwork: true); turretMaster.GetComponent<CharacterMaster>().bodyPrefab = turret; AISkillDriver[] components = turretMaster.GetComponents<AISkillDriver>(); components[0].maxDistance = 250f; components[1].moveTargetType = (TargetType)0; ContentAddition.AddMaster(turretMaster); bigTurret = DeployableAPI.RegisterDeployableSlot(new GetDeployableSameSlotLimit(DeployableCount)); Texture2D val20 = Load<Texture2D>("RoR2/Base/Common/ColorRamps/texRampEngi.png"); turretMuzzleFlash = Instantiate("RoR2/Base/Engi/MuzzleflashEngiTurret.prefab", "AerosTurretMuzzleFlash"); ParticleSystemRenderer[] componentsInChildren5 = turretMuzzleFlash.GetComponentsInChildren<ParticleSystemRenderer>(); foreach (ParticleSystemRenderer val21 in componentsInChildren5) { ((Renderer)val21).material = new Material(((Renderer)val21).material); ((Renderer)val21).material.SetTexture("_RemapTex", (Texture)(object)val20); } ContentAddition.AddEffect(turretMuzzleFlash); turretBlueprint = Instantiate("RoR2/Base/Engi/EngiTurretBlueprints.prefab", "AerosBigTurretBlueprint"); ((Component)turretBlueprint.transform.GetChild(1)).gameObject.SetActive(false); GameObject val22 = Object.Instantiate<GameObject>(val8, turretBlueprint.transform.position, Quaternion.Euler(0f, 180f, 0f), turretBlueprint.transform); turretBlueprint.GetComponent<BlueprintController>().renderers = val22.GetComponentsInChildren<Renderer>(); turretTracer = Instantiate("RoR2/DLC1/VoidSurvivor/VoidSurvivorBeamCorrupt.prefab", "AerosTurretTracer"); ParticleSystemRenderer[] componentsInChildren6 = turretTracer.GetComponentsInChildren<ParticleSystemRenderer>(); foreach (ParticleSystemRenderer val23 in componentsInChildren6) { ((Renderer)val23).material = new Material(((Renderer)val23).material); ((Renderer)val23).material.SetTexture("_RemapTex", (Texture)(object)val20); ((Renderer)val23).material.DisableKeyword("VERTEXCOLOR"); if (((Object)val23).name == "Glows") { MainModule main = ((Component)val23).GetComponent<ParticleSystem>().main; ((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(Color.green); } } MeshRenderer componentInChildren4 = turretTracer.GetComponentInChildren<MeshRenderer>(); ((Renderer)componentInChildren4).material = new Material(((Renderer)componentInChildren4).material); ((Renderer)componentInChildren4).material.SetTexture("_RemapTex", (Texture)(object)val20); turretBigTracer = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/DLC1/VoidRaidCrab/TracerVoidRaidCrabTripleBeam.prefab"), "ZeriBeamTracer", false); turretBigTracer.GetComponent<EffectComponent>().soundName = ""; turretBigTracer.AddComponent<eee>(); LineRenderer[] componentsInChildren7 = turretBigTracer.GetComponentsInChildren<LineRenderer>(); foreach (LineRenderer val24 in componentsInChildren7) { ((Renderer)val24).enabled = false; } ParticleSystemRenderer[] componentsInChildren8 = turretBigTracer.GetComponentsInChildren<ParticleSystemRenderer>(); foreach (ParticleSystemRenderer val25 in componentsInChildren8) { ((Renderer)val25).material = new Material(((Renderer)val25).material); } ParticleSystemRenderer[] componentsInChildren9 = turretBigTracer.GetComponentsInChildren<ParticleSystemRenderer>(); foreach (ParticleSystemRenderer val26 in componentsInChildren9) { ((Renderer)val26).material = new Material(((Renderer)val26).material); ((Renderer)val26).material.DisableKeyword("VERTEXCOLOR"); if (((Object)val26).name == "BeamParticles, Rings") { ((Renderer)val26).material.SetColor("_TintColor", Color32.op_Implicit(new Color32((byte)10, (byte)189, (byte)10, byte.MaxValue))); ((Renderer)val26).material.SetTextureScale("_MainTex", new Vector2(1f, 0.7f)); ((Renderer)val26).material.SetTexture("_RemapTex", (Texture)(object)Load<Texture2D>("RoR2/Base/Common/ColorRamps/texRampHealingVariant.png")); } else { ((Renderer)val26).material.SetColor("_TintColor", Color.green); } } ContentAddition.AddEffect(turretBigTracer); } if (!MainPlugin.enableLoader.Value) { return; } slamProjectile = Instantiate("RoR2/Base/Brother/BrotherSunderWave.prefab", "SlamProjectile"); slamProjectile.GetComponent<ProjectileOverlapAttack>().forceVector = Vector3.up * 2500f; ProjectileController component8 = slamProjectile.GetComponent<ProjectileController>(); GameObject val27 = Object.Instantiate<GameObject>(component8.ghostPrefab, slamProjectile.transform.position, Quaternion.identity, slamProjectile.transform); Object.Destroy((Object)(object)val27.GetComponent<ProjectileGhostController>()); Object.Destroy((Object)(object)val27.GetComponent<VFXAttributes>()); slamProjectile.GetComponent<ProjectileDamage>().damageType = DamageTypeCombo.op_Implicit((DamageType)0); MeshRenderer component9 = ((Component)val27.GetComponentInChildren<HitBox>()).GetComponent<MeshRenderer>(); ((Renderer)component9).material = new Material(((Renderer)component9).material); ((Renderer)component9).material.SetTexture("_RemapTex", (Texture)(object)Load<Texture2D>("RoR2/Base/Common/ColorRamps/texRampLightningYellowOffset.png")); ParticleSystemRenderer[] componentsInChildren10 = val27.GetComponentsInChildren<ParticleSystemRenderer>(); foreach (ParticleSystemRenderer val28 in componentsInChildren10) { string name3 = ((Object)val28).name; if (name3 == "Infection, World") { ((Renderer)val28).material = Load<Material>("RoR2/Base/Loader/matLoaderTrailImpact.mat"); } if (name3 == "Dust") { ((Renderer)val28).material = Load<Material>("RoR2/Base/Loader/matLoaderLightningLarge.mat"); } if (name3 == "Water") { ((Renderer)val28).material = Load<Material>("RoR2/Base/Loader/matLoaderLightningTile.mat"); } } component8.ghostPrefab = null; Object.Destroy((Object)(object)slamProjectile.GetComponent<ProjectileCharacterController>()); Object.Destroy((Object)(object)slamProjectile.GetComponent<CharacterController>()); ProjectileSimple val29 = slamProjectile.AddComponent<ProjectileSimple>(); val29.desiredForwardSpeed = 90f; val29.lifetime = 3f; ContentAddition.AddProjectile(slamProjectile); loaderImpact = Instantiate("RoR2/Base/Loader/OmniImpactVFXLoader.prefab", "LoaderImpact"); Utils.RegisterEffect(loaderImpact, -1f, "Play_loader_m1_impact"); shieldEffect = Instantiate(Assets.Load<GameObject>("ReflectShield"), "ShieldEffect"); Material val30 = Object.Instantiate<Material>(Load<Material>("RoR2/Base/Engi/matDefenseMatrix.mat")); val30.SetColor("_TintColor", Color32.op_Implicit(new Color32(byte.MaxValue, byte.MaxValue, (byte)158, byte.MaxValue))); val30.SetTexture("_RemapTex", (Texture)(object)Assets.Load<Texture2D>("shieldRamp")); val30.SetTexture("_Cloud1Tex", (Texture)null); val30.SetTextureScale("_Cloud1Tex", Vector2.one * 10f); val30.SetFloat("_SoftPower", 0f); val30.SetFloat("_Boost", 0.6f); val30.SetFloat("_RimPower", 2.4f); ((Renderer)shieldEffect.GetComponentInChildren<ParticleSystemRenderer>()).material = val30; } } internal class CaptainPrimary : BaseSkillState { private float duration; private float baseDuration = 0.95f; private float delay = 0.095f; private float stopwatch; private int maxShots = 3; private int shotCount; public override void OnEnter() { ((BaseState)this).OnEnter(); ((BaseState)this).StartAimMode(2f, false); duration = baseDuration / Math.Min(((BaseState)this).attackSpeedStat, 5.85f); delay /= Math.Min(((BaseState)this).attackSpeedStat, 5.85f); } public override void FixedUpdate() { //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); stopwatch += Time.fixedDeltaTime; if (stopwatch >= delay && shotCount < maxShots) { stopwatch = 0f; shotCount++; ((EntityState)this).PlayAnimation("Gesture, Additive", FireCaptainShotgun.FireCaptainShotgunStateHash); ((EntityState)this).PlayAnimation("Gesture, Override", FireCaptainShotgun.FireCaptainShotgunStateHash); AkSoundEngine.PostEvent(FireBarrage.fireBarrageSoundString, ((EntityState)this).gameObject); EffectManager.SimpleMuzzleFlash(Prefabs.Load<GameObject>("RoR2/Base/Common/VFX/Muzzleflash1.prefab"), ((EntityState)this).gameObject, ChargeCaptainShotgun.muzzleName, false); if (((EntityState)this).isAuthority) { float num = 0.8f; ((EntityState)this).characterBody.AddSpreadBloom(num); ((BaseState)this).AddRecoil(-1f * num, -1.5f * num, -0.25f * num, 0.25f * num); Ray aimRay = ((BaseState)this).GetAimRay(); float num2 = 0.0425f; new BulletAttack { bulletCount = 1u, aimVector = ((Ray)(ref aimRay)).direction, origin = ((Ray)(ref aimRay)).origin, damage = ((BaseState)this).damageStat * MainPlugin.burstDMG.Value, damageColorIndex = (DamageColorIndex)0, damageType = DamageTypeCombo.GenericPrimary, falloffModel = (FalloffModel)0, maxDistance = 250f, force = 20f, hitMask = CommonMasks.bullet, minSpread = 0f - num2, maxSpread = num2, isCrit = ((BaseState)this).RollCrit(), owner = ((EntityState)this).gameObject, muzzleName = ChargeCaptainShotgun.muzzleName, smartCollision = false, procChainMask = default(ProcChainMask), procCoefficient = 0.6f, radius = 0.08f, sniper = false, stopperMask = CommonMasks.bullet, weapon = null, tracerEffectPrefab = Prefabs.Load<GameObject>("RoR2/Base/Captain/TracerCaptainShotgun.prefab"), spreadPitchScale = 1f, spreadYawScale = 1f, hitEffectPrefab = Prefabs.Load<GameObject>("RoR2/Base/Captain/HitsparkCaptainShotgun.prefab") }.Fire(); } } if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)1; } } internal class CaptainSecondary : BaseSkillState { private float duration; private float baseDuration = 0.35f; public override void OnEnter() { //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_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; ((EntityState)this).PlayAnimation("Gesture, Additive", FireTazer.FireTazerStateHash, FireTazer.FireTazerParamHash, duration); ((EntityState)this).PlayAnimation("Gesture, Override", FireTazer.FireTazerStateHash, FireTazer.FireTazerParamHash, duration); EffectManager.SimpleMuzzleFlash(Prefabs.Load<GameObject>("RoR2/Base/Common/VFX/Muzzleflash1.prefab"), ((EntityState)this).gameObject, ChargeCaptainShotgun.muzzleName, false); if (((EntityState)this).isAuthority) { float num = 0.8f; ((EntityState)this).characterBody.AddSpreadBloom(num); ((BaseState)this).AddRecoil(-1f * num, -1.5f * num, -0.25f * num, 0.25f * num); Ray aimRay = ((BaseState)this).GetAimRay(); ProjectileManager.instance.FireProjectile(Prefabs.buffProjectile, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), ((EntityState)this).gameObject, 0f, 1220f, false, (DamageColorIndex)0, (GameObject)null, -1f, (DamageTypeCombo?)DamageTypeCombo.GenericSecondary); } AkSoundEngine.PostEvent(FireCaptainShotgun.tightSoundString, ((EntityState)this).gameObject); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)2; } } internal class EngiPrimaryCharge : ChargeGrenades { private float stopwatch; public override void FixedUpdate() { stopwatch += Time.fixedDeltaTime; if (((EntityState)this).isAuthority && (stopwatch >= base.totalDuration || !((EntityState)this).inputBank.skill1.down)) { EngiPrimaryFire engiPrimaryFire = new EngiPrimaryFire(); ((FireGrenades)engiPrimaryFire).grenadeCountMax = Mathf.FloorToInt(Mathf.Lerp((float)ChargeGrenades.minGrenadeCount, (float)ChargeGrenades.maxGrenadeCount, (float)base.charge / (float)ChargeGrenades.maxCharges)); ((EntityState)this).outer.SetNextState((EntityState)(object)engiPrimaryFire); } else { ((ChargeGrenades)this).FixedUpdate(); } } } internal class EngiPrimaryFire : FireGrenades { private float stopwatch = 1f; private GameObject ogPrefab; private float ogDamage; public override void OnEnter() { ((FireGrenades)this).OnEnter(); ogPrefab = FireGrenades.projectilePrefab; ogDamage = FireGrenades.damageCoefficient; } public override void FixedUpdate() { base.fireTimer = 1f; ((FireGrenades)this).FixedUpdate(); stopwatch += Time.fixedDeltaTime; if (stopwatch >= FireGrenades.fireDuration / ((BaseState)this).attackSpeedStat / (float)base.grenadeCountMax && base.grenadeCount < base.grenadeCountMax) { stopwatch = 0f; string text = ((base.grenadeCount % 2 == 0) ? "Left" : "Right"); ((EntityState)this).PlayCrossfade("Gesture " + text + " Cannon, Additive", "FireGrenade" + text, 0.1f); if (((EntityState)this).isAuthority) { FireGrenades.damageCoefficient = MainPlugin.missileDamageCoefficient.Value; FireGrenades.projectilePrefab = Prefabs.missileProjectile; } ((FireGrenades)this).FireGrenade("Muzzle" + text); if (((EntityState)this).isAuthority) { FireGrenades.projectilePrefab = ogPrefab; FireGrenades.damageCoefficient = ogDamage; } base.grenadeCount++; } } } internal class EngiSpecial : PlaceTurret { private CharacterMaster master; public override void OnEnter() { base.wristDisplayPrefab = Prefabs.Load<GameObject>("RoR2/Base/Engi/EngiTurretWristDisplay.prefab"); base.blueprintPrefab = Prefabs.turretBlueprint; ((PlaceTurret)this).OnEnter(); master = ((EntityState)this).characterBody.master; ((EntityState)this).outer.commonComponents.characterBody = null; } public override void OnExit() { ((EntityState)this).outer.commonComponents.characterBody = ((EntityState)this).GetComponent<CharacterBody>(); if (base.currentPlacementInfo.ok) { Summon(); } ((PlaceTurret)this).OnExit(); } private void Summon() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) if (NetworkServer.active) { ((EntityState)this).GetComponent<TurretSpawner>().CallCmdSpawn(base.currentPlacementInfo.position, base.currentPlacementInfo.rotation); } } } internal class EngiTurretPrimary : BaseSkillState { private float duration = 3f; private float damageCoefficient; private TurretChargeBehaviour chargeBehaviour; private bool hasFired; private BaseAI ai; public override void OnEnter() { ((BaseState)this).OnEnter(); ai = ((Component)((EntityState)this).characterBody.master).GetComponent<BaseAI>(); damageCoefficient = MainPlugin.turretDamageCoefficient.Value * ((BaseState)this).attackSpeedStat; chargeBehaviour = ((EntityState)this).GetComponent<TurretChargeBehaviour>(); } public override void FixedUpdate() { //IL_0076: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); if (!hasFired && Object.op_Implicit((Object)(object)ai) && ai.hasAimConfirmation && ai.hasAimTarget && ai.currentEnemy != null && Object.op_Implicit((Object)(object)ai.currentEnemy.bestHurtBox) && ai.HasLOS(((Component)ai.currentEnemy.bestHurtBox).transform.position)) { hasFired = true; AkSoundEngine.PostEvent("Play_voidDevastator_death_vortex_explode", ((EntityState)this).gameObject); Fire(); } if ((((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration) || hasFired) { ((EntityState)this).outer.SetNextStateToMain(); } } private void Fire() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0027: 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_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0049: 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_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: 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_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0092: 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_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_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: 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_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) if (((EntityState)this).isAuthority) { Ray aimRay = ((BaseState)this).GetAimRay(); new BulletAttack { maxDistance = 250f, stopperMask = ((LayerIndex)(ref LayerIndex.world)).mask, falloffModel = (FalloffModel)0, radius = 2f, owner = ((EntityState)this).gameObject, weapon = ((EntityState)this).gameObject, origin = ((Ray)(ref aimRay)).origin, aimVector = ((Ray)(ref aimRay)).direction, minSpread = 0f, maxSpread = 0f, bulletCount = 1u, damage = ((BaseState)this).damageStat * damageCoefficient, force = damageCoefficient * 100f, tracerEffectPrefab = Prefabs.turretBigTracer, muzzleName = "Muzzle", hitEffectPrefab = Prefabs.turretMuzzleFlash, isCrit = ((BaseState)this).RollCrit(), procCoefficient = 1f, smartCollision = true, damageType = DamageTypeCombo.GenericPrimary }.Fire(); } } public override void OnExit() { ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)1; } } internal class EngiTurretPrimaryOld : BaseSkillState { private float duration = 3f; private float fireFrequency = 0.2f; private float damageCoefficient; private float stopwatch; private GameObject tracer; private TurretChargeBehaviour chargeBehaviour; private uint ID; private MeshRenderer tracerMesh; public override void OnEnter() { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); damageCoefficient = MainPlugin.turretDamageCoefficient.Value * fireFrequency; chargeBehaviour = ((EntityState)this).GetComponent<TurretChargeBehaviour>(); chargeBehaviour.firing = true; Transform val = ((BaseState)this).FindModelChild("Muzzle"); tracer = Object.Instantiate<GameObject>(Prefabs.turretTracer, val.position, val.rotation, val); tracerMesh = tracer.GetComponentInChildren<MeshRenderer>(); ID = AkSoundEngine.PostEvent("Play_voidman_m1_corrupted_start", ((EntityState)this).gameObject); } public override void Update() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: 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_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).Update(); if (Object.op_Implicit((Object)(object)tracerMesh)) { Ray aimRay = ((BaseState)this).GetAimRay(); float num = 250f; RaycastHit val = default(RaycastHit); if (Physics.Raycast(aimRay, ref val, 250f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask) | LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask))) { num = Vector3.Distance(((RaycastHit)(ref val)).point, ((Ray)(ref aimRay)).origin); } ((Component)tracerMesh).transform.localPosition = Vector3.forward * num * 0.488f; Vector3 localScale = ((Component)tracerMesh).transform.localScale; ((Component)tracerMesh).transform.localScale = new Vector3(localScale.x, localScale.y, num * 0.0288f); } if (Object.op_Implicit((Object)(object)tracer)) { Transform transform = tracer.transform; Ray aimRay2 = ((BaseState)this).GetAimRay(); transform.forward = ((Ray)(ref aimRay2)).direction; } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); stopwatch += Time.fixedDeltaTime; if (stopwatch >= fireFrequency / ((BaseState)this).attackSpeedStat) { stopwatch = 0f; Fire(); } if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration) { ((EntityState)this).outer.SetNextStateToMain(); } } private void Fire() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: 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_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008d: 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_00a7: 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_00c0: 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_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) if (((EntityState)this).isAuthority) { Ray aimRay = ((BaseState)this).GetAimRay(); new BulletAttack { maxDistance = 250f, stopperMask = BulletAttack.defaultStopperMask, falloffModel = (FalloffModel)0, radius = 0.25f, owner = ((EntityState)this).gameObject, weapon = ((EntityState)this).gameObject, origin = ((Ray)(ref aimRay)).origin, aimVector = ((Ray)(ref aimRay)).direction, minSpread = 0f, maxSpread = 0f, bulletCount = 1u, damage = ((BaseState)this).damageStat * damageCoefficient, force = damageCoefficient * 100f, tracerEffectPrefab = null, muzzleName = "Muzzle", hitEffectPrefab = Prefabs.turretMuzzleFlash, isCrit = ((BaseState)this).RollCrit(), procCoefficient = 1f, smartCollision = true, damageType = DamageTypeCombo.op_Implicit((DamageType)0) }.Fire(); } } public override void OnExit() { AkSoundEngine.StopPlayingID(ID); AkSoundEngine.PostEvent("Play_voidman_m1_corrupted_end", ((EntityState)this).gameObject); chargeBehaviour.firing = false; if (Object.op_Implicit((Object)(object)tracer)) { EntityState.Destroy((Object)(object)tracer); } ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)1; } } internal class TurretSpawn : BaseState { public override void OnEnter() { ((BaseState)this).OnEnter(); if (((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } } internal class Block : BaseSkillState { private float animDuration = 0.45f; private float animStopTime = 0.65f; private DebugHelper helper; private bool stopped; private Animator animator; private GameObject effect; public override void OnEnter() { //IL_009b: 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_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); if (NetworkServer.active) { ((EntityState)this).characterBody.AddBuff(Prefabs.block); } animator = ((EntityState)this).GetModelAnimator(); helper = ((EntityState)this).GetComponent<DebugHelper>(); ((EntityState)this).PlayAnimation("Grapple", FireHook.FireHookIntroStateHash); ((EntityState)this).PlayCrossfade("Gesture, Additive", "SwingFistRight", "SwingFist.playbackRate", animDuration, 0.1f); ((EntityState)this).PlayCrossfade("Gesture, Override", "SwingFistRight", "SwingFist.playbackRate", animDuration, 0.1f); effect = Object.Instantiate<GameObject>(Prefabs.shieldEffect, ((EntityState)this).transform.position, Quaternion.identity, ((EntityState)this).transform); effect.transform.localScale = Vector3.one * 1.6f; AkSoundEngine.PostEvent("Play_loader_m1_shield", ((EntityState)this).gameObject); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (!stopped && ((EntityState)this).fixedAge >= animDuration * animStopTime) { stopped = true; animator.SetFloat("SwingFist.playbackRate", 0f); } if ((((EntityState)this).isAuthority && !((BaseSkillState)this).IsKeyDownAuthority()) || ((EntityState)this).fixedAge >= MainPlugin.blockDuration.Value) { if (((EntityState)this).healthComponent.barrier > 0f) { ((EntityState)this).outer.SetNextState((EntityState)(object)new Slam()); } else { ((EntityState)this).outer.SetNextStateToMain(); } } } public override void OnExit() { ((EntityState)this).PlayAnimation("Grapple", FireHook.FireHookExitStateHash); if (Object.op_Implicit((Object)(object)effect)) { EntityState.Destroy((Object)(object)effect); } animator.SetFloat("SwingFist.playbackRate", 1f); if (NetworkServer.active) { ((EntityState)this).characterBody.RemoveBuff(Prefabs.block); } ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)2; } } internal class Slam : GroundSlam { private float stopwatch; private float damageCoefficient; private float barrierPercentage; public override void OnEnter() { ((EntityState)this).PlayAnimation("Body", PreGroundSlam.PreGroundSlamStateHash, PreGroundSlam.GroundSlamParamHash, 0.25f); ((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground(0.1f); ((EntityState)this).characterMotor.disableAirControlUntilCollision = false; ((GroundSlam)this).OnEnter(); barrierPercentage = 1f + ((EntityState)this).healthComponent.barrier / ((EntityState)this).healthComponent.fullBarrier; damageCoefficient = MainPlugin.blockWaveDamage.Value * barrierPercentage; if (NetworkServer.active) { ((EntityState)this).healthComponent.SetBarrier(0f); } } public override void FixedUpdate() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) ((GroundSlam)this).FixedUpdate(); ((EntityState)this).fixedAge = 0f; stopwatch += Time.fixedDeltaTime; Prefabs.slamProjectile.transform.localScale = Vector3.one * 0.5f * barrierPercentage; if (stopwatch >= GroundSlam.minimumDuration && (base.detonateNextFrame || ((BaseCharacterController)((EntityState)this).characterMotor).Motor.GroundingStatus.IsStableOnGround)) { EffectManager.SimpleEffect(Prefabs.Load<GameObject>("RoR2/Base/Loader/LoaderGroundSlam.prefab"), ((EntityState)this).characterBody.footPosition, Quaternion.identity, true); Ray aimRay = ((BaseState)this).GetAimRay(); ProjectileManager.instance.FireProjectile(Prefabs.slamProjectile, ((Ray)(ref aimRay)).origin, Quaternion.LookRotation(((Ray)(ref aimRay)).direction), ((EntityState)this).gameObject, ((BaseState)this).damageStat * damageCoefficient, 10f, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, -1f, (DamageTypeCombo?)null); ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { ((EntityState)this).PlayAnimation("Body", "Jump"); ((GroundSlam)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)7; } } internal class ChargePunches : BaseSkillState { private float chargePerPunch; private float maxChargeTime; private GameObject effectLeft; private GameObject effectRight; private GameObject chargePrefab = Prefabs.Load<GameObject>("RoR2/Base/Loader/ChargeLoaderFist.prefab"); private uint ID; public override void OnEnter() { ((BaseState)this).OnEnter(); chargePerPunch = MainPlugin.punchChargeTime.Value; maxChargeTime = (float)MainPlugin.maxPunchCount.Value * chargePerPunch; Transform muzzle = ((BaseState)this).FindModelChild("MechHandL"); effectLeft = InstantiateChargeFX(muzzle); muzzle = ((BaseState)this).FindModelChild("MechHandR"); effectRight = InstantiateChargeFX(muzzle); Util.PlaySound(BaseChargeFist.enterSFXString, ((EntityState)this).gameObject); ID = AkSoundEngine.PostEvent("Play_loader_shift_charge_loop", ((EntityState)this).gameObject); } private GameObject InstantiateChargeFX(Transform muzzle) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate<GameObject>(chargePrefab, muzzle.position, Quaternion.identity, muzzle); val.GetComponent<ScaleParticleSystemDuration>().newDuration = maxChargeTime; return val; } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).isAuthority && !((BaseSkillState)this).IsKeyDownAuthority()) { ((EntityState)this).outer.SetNextState((EntityState)(object)new Punches { punchCount = Mathf.Clamp(Mathf.FloorToInt(((EntityState)this).fixedAge / chargePerPunch), 2, MainPlugin.maxPunchCount.Value) }); } } public override void OnExit() { Util.PlaySound(BaseChargeFist.endChargeLoopSFXString, ((EntityState)this).gameObject); AkSoundEngine.StopPlayingID(ID); if (Object.op_Implicit((Object)(object)effectLeft)) { EntityState.Destroy((Object)(object)effectLeft); } if (Object.op_Implicit((Object)(object)effectRight)) { EntityState.Destroy((Object)(object)effectRight); } ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)2; } } internal class Punches : BaseSkillState { private DebugHelper helper; private float duration; private float basePunchDuration; public int punchCount; private int punches; private float stopwatch = 1f; private bool left = true; private OverlapAttack attack; private Animator animator; private Transform modelTransform; private GameObject effectLeft; private GameObject effectRight; private GameObject chargePrefab = Prefabs.Load<GameObject>("RoR2/Base/Loader/LoaderFistLoop.prefab"); public override void OnSerialize(NetworkWriter writer) { ((BaseSkillState)this).OnSerialize(writer); writer.Write((byte)punchCount); } public override void OnDeserialize(NetworkReader reader) { ((BaseSkillState)this).OnDeserialize(reader); punchCount = reader.ReadByte(); } public override void OnEnter() { //IL_00a0: 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_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); animator = ((EntityState)this).GetModelAnimator(); modelTransform = ((Component)animator).transform; helper = ((EntityState)this).GetComponent<DebugHelper>(); basePunchDuration = MainPlugin.punchSpeed.Value / ((BaseState)this).attackSpeedStat; duration = (float)punchCount * basePunchDuration; Transform muzzle = ((BaseState)this).FindModelChild("MechHandL"); effectLeft = InstantiateChargeFX(muzzle); muzzle = ((BaseState)this).FindModelChild("MechHandR"); effectRight = InstantiateChargeFX(muzzle); if (((EntityState)this).isAuthority) { CharacterMotor characterMotor = ((EntityState)this).characterMotor; Vector3 velocity = characterMotor.velocity; Ray aimRay = ((BaseState)this).GetAimRay(); characterMotor.velocity = velocity + ((Ray)(ref aimRay)).direction * MainPlugin.punchVelocity.Value; } } private GameObject InstantiateChargeFX(Transform muzzle) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate<GameObject>(chargePrefab, muzzle.position, Quaternion.identity, muzzle); val.GetComponent<ScaleParticleSystemDuration>().newDuration = duration; return val; } private void Punch() { //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) left = !left; punches++; AkSoundEngine.PostEvent("Play_loader_shift_release", ((EntityState)this).gameObject); if (!left) { ((EntityState)this).PlayAnimation("Grapple", FireHook.FireHookExitStateHash); ((EntityState)this).PlayCrossfade("FullBody, Override", BaseSwingChargedFist.ChargePunchStateHash, BaseSwingChargedFist.ChargePunchParamHash, basePunchDuration, 0.1f); } else { ((EntityState)this).PlayAnimation("Grapple", FireHook.FireHookIntroStateHash); ((EntityState)this).PlayCrossfade("Gesture, Override", "SwingFistLeft", "SwingFist.playbackRate", basePunchDuration, 0.1f); } AkSoundEngine.PostEvent("Play_loader_m1_swing", ((EntityState)this).gameObject); if (((EntityState)this).isAuthority) { Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 direction = ((Ray)(ref aimRay)).direction; attack = ((BaseState)this).InitMeleeOverlap(MainPlugin.punchDamageCoefficient.Value, Prefabs.loaderImpact, ((EntityState)this).GetModelTransform(), "Punch"); attack.damageType = DamageTypeCombo.GenericPrimary; } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); ((BaseState)this).StartAimMode(2f, false); if (((BaseState)this).isGrounded) { ((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground(0.1f); ((BaseState)this).SmallHop(((EntityState)this).characterMotor, 5f); } stopwatch += Time.fixedDeltaTime; if (stopwatch >= basePunchDuration) { stopwatch = 0f; Punch(); } if (attack != null && attack.Fire((List<HurtBox>)null)) { ((BaseState)this).SmallHop(((EntityState)this).characterMotor, 7f); ((EntityState)this).healthComponent.AddBarrierAuthority(LoaderMeleeAttack.barrierPercentagePerHit * ((EntityState)this).healthComponent.fullBarrier); } ((EntityState)this).skillLocator.utility.rechargeStopwatch = 0f; if ((((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration) || punches >= MainPlugin.maxPunchCount.Value) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { //IL_0063: Unknown result type (might be due to invalid IL or missing references) if (left) { ((EntityState)this).PlayAnimation("Grapple", FireHook.FireHookExitStateHash); } if (Object.op_Implicit((Object)(object)effectLeft)) { EntityState.Destroy((Object)(object)effectLeft); } if (Object.op_Implicit((Object)(object)effectRight)) { EntityState.Destroy((Object)(object)effectRight); } ((Component)modelTransform).transform.localScale = Vector3.one; ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterrupt