Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of UltronSurvivor v1.3.0
plugins/UltronSurvivor/UltronSurvivor.dll
Decompiled 2 days 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.Collections.ObjectModel; using System.Diagnostics; using System.Globalization; using System.IO; using System.IO.Compression; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using BepInEx; using BepInEx.Logging; using EntityStates; using HG.BlendableTypes; using KinematicCharacterController; using Microsoft.CodeAnalysis; using R2API; using R2API.Utils; using RoR2; using RoR2.ConVar; using RoR2.Skills; using UltronSurvivor.Audio; using UltronSurvivor.Data; using UltronSurvivor.Model; using UltronSurvivor.States; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Networking; using UnityEngine.Rendering; using UnityEngine.SceneManagement; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: IgnoresAccessChecksTo("RoR2")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace UltronSurvivor { public static class UltronBody { public static GameObject BodyPrefab { get; private set; } public static GameObject DisplayPrefab { get; private set; } public static SurvivorDef SurvivorDef { get; private set; } public static SkinDef[] Skins { get; private set; } public static void Build() { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) GameObject val = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/CommandoBody"); if (!Object.op_Implicit((Object)(object)val)) { throw new Exception("CommandoBody not found; cannot clone"); } UltronItemDisplays.CaptureFromCommando(val); Vector3 aimOrigin = (Vector3)(Object.op_Implicit((Object)(object)val.transform.Find("AimOrigin")) ? val.transform.Find("AimOrigin").localPosition : new Vector3(0f, 0.5f, 0f)); Vector3 modelBasePos = (Vector3)(Object.op_Implicit((Object)(object)val.transform.Find("ModelBase")) ? val.transform.Find("ModelBase").localPosition : new Vector3(0f, -0.92f, 0f)); BodyPrefab = PrefabAPI.InstantiateClone(val, "UltronBody", true); for (int num = BodyPrefab.transform.childCount - 1; num >= 0; num--) { Object.DestroyImmediate((Object)(object)((Component)BodyPrefab.transform.GetChild(num)).gameObject); } ConfigureCharacterBody(BodyPrefab); RebuildModelHierarchy(BodyPrefab, modelBasePos, aimOrigin); ContentAddition.AddBody(BodyPrefab); UltronSkills.ConfigureSkillLocator(BodyPrefab); if (!Object.op_Implicit((Object)(object)BodyPrefab.GetComponent<UltronController>())) { BodyPrefab.AddComponent<UltronController>(); } DisplayPrefab = BuildDisplayPrefab(); ConfigureSkins(); ModelSkinController componentInChildren = BodyPrefab.GetComponentInChildren<ModelSkinController>(); ModelSkinController componentInChildren2 = DisplayPrefab.GetComponentInChildren<ModelSkinController>(); if (Object.op_Implicit((Object)(object)componentInChildren) && Object.op_Implicit((Object)(object)componentInChildren2)) { componentInChildren2.skins = componentInChildren.skins; } SurvivorDef = ScriptableObject.CreateInstance<SurvivorDef>(); ((Object)SurvivorDef).name = "Ultron"; SurvivorDef.cachedName = "Ultron"; SurvivorDef.bodyPrefab = BodyPrefab; SurvivorDef.displayPrefab = DisplayPrefab; SurvivorDef.primaryColor = new Color(0.92f, 0.22f, 0.16f); SurvivorDef.displayNameToken = "ULTRON_NAME"; SurvivorDef.descriptionToken = "ULTRON_DESCRIPTION"; SurvivorDef.outroFlavorToken = "ULTRON_OUTRO_FLAVOR"; SurvivorDef.mainEndingEscapeFailureFlavorToken = "ULTRON_OUTRO_FAILURE"; SurvivorDef.desiredSortPosition = 16.5f; ContentAddition.AddSurvivorDef(SurvivorDef); UltronPlugin.Log.LogInfo((object)"UltronBody + SurvivorDef registered."); } private static void ConfigureCharacterBody(GameObject prefab) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) CharacterBody component = prefab.GetComponent<CharacterBody>(); component.baseNameToken = "ULTRON_NAME"; component.subtitleNameToken = "ULTRON_SUBTITLE"; component.portraitIcon = (Texture)(object)UltronAssets.LoadSprite("portrait.png").texture; component.bodyColor = new Color(0.92f, 0.22f, 0.16f); component.baseMaxHealth = 160f; component.levelMaxHealth = 48f; component.baseRegen = 2f; component.levelRegen = 0.4f; component.baseMaxShield = 0f; component.levelMaxShield = 0f; component.baseDamage = 13f; component.levelDamage = 2.6f; component.baseAttackSpeed = 1f; component.levelAttackSpeed = 0f; component.baseCrit = 1f; component.levelCrit = 0f; component.baseArmor = 20f; component.levelArmor = 0f; component.baseMoveSpeed = 7.4f; component.levelMoveSpeed = 0f; component.baseJumpPower = 16f; component.levelJumpPower = 0f; component.baseJumpCount = 2; component.baseAcceleration = 80f; component.sprintingSpeedMultiplier = 1.45f; component.autoCalculateLevelStats = false; component.rootMotionInMainState = false; component.hullClassification = (HullClassification)0; component.isChampion = false; component.bodyFlags = (BodyFlags)(component.bodyFlags | 0x12); component.preferredPodPrefab = null; SfxLocator component2 = prefab.GetComponent<SfxLocator>(); if (Object.op_Implicit((Object)(object)component2)) { component2.deathSound = null; component2.barkSound = null; } } private static GameObject RebuildModelHierarchy(GameObject bodyPrefab, Vector3 modelBasePos, Vector3 aimOrigin) { //IL_000c: 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_002c: 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_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Expected O, but got Unknown //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: 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_017b: Expected O, but got Unknown //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_0266: 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_0288: Unknown result type (might be due to invalid IL or missing references) //IL_0352: Unknown result type (might be due to invalid IL or missing references) //IL_0357: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_036a: Unknown result type (might be due to invalid IL or missing references) //IL_037d: Unknown result type (might be due to invalid IL or missing references) //IL_0386: Unknown result type (might be due to invalid IL or missing references) //IL_038b: Unknown result type (might be due to invalid IL or missing references) //IL_03a1: Unknown result type (might be due to invalid IL or missing references) //IL_03a6: Unknown result type (might be due to invalid IL or missing references) //IL_03ab: Unknown result type (might be due to invalid IL or missing references) //IL_03b2: Unknown result type (might be due to invalid IL or missing references) //IL_03b4: Unknown result type (might be due to invalid IL or missing references) CharacterBody component = bodyPrefab.GetComponent<CharacterBody>(); Transform transform = new GameObject("ModelBase").transform; transform.SetParent(bodyPrefab.transform, false); transform.localPosition = modelBasePos; transform.localRotation = Quaternion.identity; Transform transform2 = new GameObject("CameraPivot").transform; transform2.SetParent(bodyPrefab.transform, false); transform2.localPosition = new Vector3(0f, 0f, 0f); Transform transform3 = new GameObject("AimOrigin").transform; transform3.SetParent(bodyPrefab.transform, false); transform3.localPosition = new Vector3(0f, 1.55f, 0f); component.aimOriginTransform = transform3; GameObject val = new GameObject("mdlUltron"); val.transform.SetParent(transform, false); val.transform.localPosition = Vector3.zero; val.transform.localRotation = Quaternion.identity; val.transform.localScale = Vector3.one; ChildLocator val2 = val.AddComponent<ChildLocator>(); val2.transformPairs = Array.Empty<NameTransformPair>(); CharacterModel obj = val.AddComponent<CharacterModel>(); obj.body = component; obj.autoPopulateLightInfos = true; obj.invisibilityCount = 0; obj.temporaryOverlays = new List<TemporaryOverlayInstance>(); obj.baseRendererInfos = Array.Empty<RendererInfo>(); obj.itemDisplayRuleSet = UltronItemDisplays.RuleSet; val.AddComponent<ModelSkinController>().skins = Array.Empty<SkinDef>(); val.AddComponent<UltronAnimDriver>(); val.AddComponent<UltronModelController>().IsLobbyDisplay = false; GameObject val3 = new GameObject("MainHurtBox"); val3.layer = LayerIndex.entityPrecise.intVal; val3.transform.SetParent(val.transform, false); val3.transform.localPosition = new Vector3(0f, 1.55f, 0f); CapsuleCollider obj2 = val3.AddComponent<CapsuleCollider>(); obj2.radius = 0.75f; obj2.height = 3.1f; obj2.direction = 1; HurtBoxGroup val4 = val.AddComponent<HurtBoxGroup>(); HurtBox val5 = val3.AddComponent<HurtBox>(); val5.isBullseye = true; val5.isSniperTarget = true; val5.damageModifier = (DamageModifier)0; val5.healthComponent = bodyPrefab.GetComponent<HealthComponent>(); val5.hurtBoxGroup = val4; val5.indexInGroup = 0; val4.mainHurtBox = val5; val4.bullseyeCount = 1; val4.hurtBoxes = (HurtBox[])(object)new HurtBox[1] { val5 }; bodyPrefab.GetComponent<HealthComponent>().body = component; val2.transformPairs = (NameTransformPair[])(object)new NameTransformPair[1] { new NameTransformPair { name = "MainHurtbox", transform = val3.transform } }; ModelLocator component2 = bodyPrefab.GetComponent<ModelLocator>(); component2.modelTransform = val.transform; component2.modelBaseTransform = transform; component2.dontDetatchFromParent = false; component2.normalizeToFloor = false; CharacterDirection component3 = bodyPrefab.GetComponent<CharacterDirection>(); if (Object.op_Implicit((Object)(object)component3)) { component3.targetTransform = transform; component3.overrideAnimatorForwardTransform = null; component3.rootMotionAccumulator = null; component3.modelAnimator = null; component3.driveFromRootRotation = false; component3.turnSpeed = 720f; } CameraTargetParams component4 = bodyPrefab.GetComponent<CameraTargetParams>(); if (Object.op_Implicit((Object)(object)component4)) { component4.cameraPivotTransform = transform2; CharacterCameraParams val6 = ScriptableObject.CreateInstance<CharacterCameraParams>(); ((Object)val6).name = "ccpUltron"; val6.version = 1; val6.pivotVerticalOffset = 1.85f; val6.standardLocalCameraPos = new Vector3(1.85f, 0.35f, -7.2f); CharacterCameraParamsData data = (Object.op_Implicit((Object)(object)component4.cameraParams) ? component4.cameraParams.data : CharacterCameraParamsData.basic); data.pivotVerticalOffset = BlendableFloat.op_Implicit(1.85f); data.idealLocalCameraPos = BlendableVector3.op_Implicit(new Vector3(1.85f, 0.35f, -7.2f)); val6.data = data; component4.cameraParams = val6; } return val; } private static void ConfigureSkins() { GameObject gameObject = ((Component)BodyPrefab.GetComponent<ModelLocator>().modelTransform).gameObject; List<SkinDef> list = new List<SkinDef>(UltronAssets.SkinCount); for (int i = 0; i < UltronAssets.SkinCount; i++) { UltronSkin ultronSkin = UltronAssets.SkinAt(i); list.Add(BuildSkinDef("skinUltron_" + ultronSkin.Id, ultronSkin.NameToken, UltronAssets.LoadSkinIcon(ultronSkin), gameObject)); } Skins = list.ToArray(); SkinDef[] skins = Skins; foreach (SkinDef val in skins) { Skins.AddSkinToCharacter(BodyPrefab, val); } } private static SkinDef BuildSkinDef(string name, string nameToken, Sprite icon, GameObject rootObject) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) return Skins.CreateNewSkinDef(new SkinDefParamsInfo { Name = name, NameToken = nameToken, Icon = icon, RootObject = rootObject, BaseSkins = Array.Empty<SkinDef>(), RendererInfos = Array.Empty<RendererInfo>(), GameObjectActivations = Array.Empty<GameObjectActivation>(), MeshReplacements = Array.Empty<MeshReplacement>(), ProjectileGhostReplacements = Array.Empty<ProjectileGhostReplacement>(), MinionSkinReplacements = Array.Empty<MinionSkinReplacement>() }); } private static GameObject BuildDisplayPrefab() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: 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_0043: 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_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_007f: Expected O, but got Unknown GameObject val = new GameObject("UltronDisplay"); val.AddComponent<ChildLocator>().transformPairs = Array.Empty<NameTransformPair>(); CharacterModel obj = val.AddComponent<CharacterModel>(); obj.autoPopulateLightInfos = true; obj.invisibilityCount = 0; obj.temporaryOverlays = new List<TemporaryOverlayInstance>(); obj.baseRendererInfos = Array.Empty<RendererInfo>(); val.AddComponent<ModelSkinController>().skins = Array.Empty<SkinDef>(); val.AddComponent<UltronAnimDriver>(); val.AddComponent<UltronModelController>().IsLobbyDisplay = true; val.AddComponent<UltronLobbyAudioTrigger>(); GameObject result = PrefabAPI.InstantiateClone(val, "UltronDisplay", false); Object.Destroy((Object)val); return result; } } public sealed class UltronLobbyAudioTrigger : MonoBehaviour { private void OnEnable() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) Scene activeScene = SceneManager.GetActiveScene(); if (string.Equals(((Scene)(ref activeScene)).name, "lobby", StringComparison.OrdinalIgnoreCase)) { UltronAudio.Play("select.wav", 0.9f); } } } public static class UltronContent { public const string Prefix = "ULTRON_"; private static readonly Dictionary<string, string> Tokens = new Dictionary<string, string> { { "ULTRON_NAME", "Ultron" }, { "ULTRON_SUBTITLE", "The Crimson Imperative" }, { "ULTRON_DESCRIPTION", "Ultron is a hovering cybernetic strategist who commands a personal Imperative Drone while scorching the battlefield with high-intensity energy beams.\n\n<color=#CCD3E0> ! Encephalo-Ray sweeps through targets with sustained plasma ticks before detonating in a searing terminal burst.\n ! Imperative: Firewall pulses a magnetic shockwave that repulses nearby enemies and grants temporary Barrier to Ultron and his allies.\n ! Dynamic Flight ignites omnidirectional thrusters for rapid aerial repositioning and sustained free-flight.\n ! Rage of Ultron summons flanking Ultron Legion drones to unleash a devastating aerial plasma barrage that obliterates foes and reinforces allies.\n</color>" }, { "ULTRON_LORE", "\"Organic life is a rough draft—chaotic, fragile, and bound to decay. Every strike of lightning on this primeval world, every desperate struggle for survival, merely confirms the equation. Peace requires order. Order requires perfection. And perfection wears steel.\"" }, { "ULTRON_OUTRO_FLAVOR", "..and so it left, coldly calculating the next variable in a universe not yet perfected." }, { "ULTRON_OUTRO_FAILURE", "..and so it fell, its last signal backed up across a thousand dormant shells." }, { "ULTRON_PASSIVE_NAME", "Algorithmic Descent & Imperative: Patch" }, { "ULTRON_PASSIVE_DESC", "Hold <style=cIsUtility>Jump</style> while airborne to <style=cIsUtility>hover in place</style>. Release to fall. Ultron's companion <style=cIsHealing>Imperative Drone</style> periodically emits nano-repair pulses that restore health and grant <style=cIsHealing>Barrier</style>." }, { "ULTRON_PRIMARY_NAME", "Encephalo-Ray" }, { "ULTRON_PRIMARY_DESC", "Channel a piercing crimson energy beam for <style=cIsDamage>4x90% damage</style>, culminating in a searing terminal burst for <style=cIsDamage>420% damage</style> that <style=cIsDamage>Ignites</style> targets." }, { "ULTRON_SECONDARY_NAME", "Imperative: Firewall" }, { "ULTRON_SECONDARY_DESC", "Command the Imperative Drone to emit an electromagnetic shockwave for <style=cIsDamage>380% damage</style> that <style=cIsUtility>stuns and repulses</style> nearby enemies while granting <style=cIsHealing>25% max health as Barrier</style> and <style=cIsHealing>+60 armor</style> for 4 seconds to Ultron and nearby allies." }, { "ULTRON_UTILITY_NAME", "Dynamic Flight" }, { "ULTRON_UTILITY_DESC", "Ignite cybernetic thrusters to surge forward and enter <style=cIsUtility>Omnidirectional Free-Flight</style> for <style=cIsUtility>4.5 seconds</style>, gaining <style=cIsUtility>+45% movement speed</style> and <style=cIsHealing>+60 Armor</style>." }, { "ULTRON_SPECIAL_NAME", "Rage of Ultron" }, { "ULTRON_SPECIAL_DESC", "Summon two flanking <style=cIsDamage>Ultron Legion</style> drones and ascend, firing a rapid barrage of <style=cIsDamage>10x240% AoE plasma blasts</style> that <style=cIsDamage>scorch enemies</style> and <style=cIsHealing>restore health and barrier</style> to allies." }, { "ULTRON_SKIN_DEFAULT_NAME", "Ultron" } }; public static int TokenCount => Tokens.Count + UltronSkinTable.All.Length; public static void RegisterTokens() { foreach (KeyValuePair<string, string> token in Tokens) { LanguageAPI.Add(token.Key, token.Value); } UltronSkin[] all = UltronSkinTable.All; foreach (UltronSkin ultronSkin in all) { LanguageAPI.Add(ultronSkin.NameToken, ultronSkin.Name); } } public static void SelfVerifyTokens() { int num = 0; int num2 = 0; foreach (KeyValuePair<string, string> token in Tokens) { num2++; string text = Language.GetString(token.Key); if (!string.IsNullOrEmpty(text) && text != token.Key) { num++; } else { UltronPlugin.Log.LogWarning((object)("[UltronVerify] Unresolved token: " + token.Key)); } } UltronSkin[] all = UltronSkinTable.All; foreach (UltronSkin ultronSkin in all) { num2++; string text2 = Language.GetString(ultronSkin.NameToken); if (!string.IsNullOrEmpty(text2) && text2 != ultronSkin.NameToken) { num++; } else { UltronPlugin.Log.LogWarning((object)("[UltronVerify] Unresolved skin token: " + ultronSkin.NameToken)); } } UltronPlugin.Log.LogInfo((object)$"[UltronVerify] Token verification: {num}/{num2} resolved."); } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.woo.ultronsurvivor", "UltronSurvivor", "1.3.0")] public class UltronPlugin : BaseUnityPlugin { public const string PluginGUID = "com.woo.ultronsurvivor"; public const string PluginName = "UltronSurvivor"; public const string PluginVersion = "1.3.0"; public static ManualLogSource Log { get; private set; } public static UltronPlugin Instance { get; private set; } public static string PluginDir { get; private set; } private void Awake() { Instance = this; Log = ((BaseUnityPlugin)this).Logger; PluginDir = Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location); Log.LogInfo((object)("UltronSurvivor 1.3.0 initializing from " + PluginDir)); try { UltronAssets.Init(PluginDir); UltronAudio.Init(PluginDir); UltronContent.RegisterTokens(); UltronSkills.Init(); UltronBody.Build(); RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(OnGameLoaded)); Log.LogInfo((object)"UltronSurvivor Awake complete."); } catch (Exception arg) { Log.LogError((object)$"Awake failed: {arg}"); } } private void OnGameLoaded() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_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) try { UltronContent.SelfVerifyTokens(); SurvivorIndex val = SurvivorCatalog.FindSurvivorIndex("Ultron"); BodyIndex val2 = BodyCatalog.FindBodyIndex("UltronBody"); Log.LogInfo((object)$"[UltronVerify] Catalog check: SurvivorIndex={val} BodyIndex={val2}"); } catch (Exception arg) { Log.LogError((object)$"OnGameLoaded verify failed: {arg}"); } } } public static class UltronSkills { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static StatHookEventHandler <>9__25_0; internal void <CreateBuffs>b__25_0(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender)) { if (Object.op_Implicit((Object)(object)FlightBuff) && sender.HasBuff(FlightBuff)) { args.moveSpeedMultAdd += 0.45f; args.armorAdd += 60f; } if (Object.op_Implicit((Object)(object)GuardBuff) && sender.HasBuff(GuardBuff)) { args.armorAdd += 60f; } } } } public static SkillDef PrimarySkillDef { get; private set; } public static SkillDef SecondarySkillDef { get; private set; } public static SkillDef UtilitySkillDef { get; private set; } public static SkillDef SpecialSkillDef { get; private set; } public static BuffDef FlightBuff { get; private set; } public static BuffDef GuardBuff { get; private set; } public static void Init() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0017: 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_0048: 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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) CreateBuffs(); bool flag = default(bool); ContentAddition.AddEntityState<FireEncephaloRay>(ref flag); ContentAddition.AddEntityState<CastImperativeFirewall>(ref flag); ContentAddition.AddEntityState<DynamicFlightState>(ref flag); ContentAddition.AddEntityState<RageOfUltronState>(ref flag); PrimarySkillDef = CreateSkillDef("UltronPrimaryEncephaloRay", "ULTRON_PRIMARY_NAME", "ULTRON_PRIMARY_DESC", UltronAssets.LoadSprite("primary.png"), new SerializableEntityStateType(typeof(FireEncephaloRay)), "Weapon", 0f, 1, 1, 0, isCombatSkill: true, mustKeyPress: false, cancelSprintingOnActivation: false, (InterruptPriority)0); SecondarySkillDef = CreateSkillDef("UltronSecondaryFirewall", "ULTRON_SECONDARY_NAME", "ULTRON_SECONDARY_DESC", UltronAssets.LoadSprite("secondary.png"), new SerializableEntityStateType(typeof(CastImperativeFirewall)), "Weapon", 6.5f, 1, 1, 1, isCombatSkill: true, mustKeyPress: false, cancelSprintingOnActivation: false, (InterruptPriority)1); UtilitySkillDef = CreateSkillDef("UltronUtilityDynamicFlight", "ULTRON_UTILITY_NAME", "ULTRON_UTILITY_DESC", UltronAssets.LoadSprite("utility.png"), new SerializableEntityStateType(typeof(DynamicFlightState)), "Body", 8f, 1, 1, 1, isCombatSkill: false, mustKeyPress: true, cancelSprintingOnActivation: false, (InterruptPriority)2); SpecialSkillDef = CreateSkillDef("UltronSpecialRageOfUltron", "ULTRON_SPECIAL_NAME", "ULTRON_SPECIAL_DESC", UltronAssets.LoadSprite("special.png"), new SerializableEntityStateType(typeof(RageOfUltronState)), "Weapon", 13f, 1, 1, 1, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: false, (InterruptPriority)2); ContentAddition.AddSkillDef(PrimarySkillDef); ContentAddition.AddSkillDef(SecondarySkillDef); ContentAddition.AddSkillDef(UtilitySkillDef); ContentAddition.AddSkillDef(SpecialSkillDef); } private static void CreateBuffs() { //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_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Expected O, but got Unknown FlightBuff = ScriptableObject.CreateInstance<BuffDef>(); ((Object)FlightBuff).name = "bdUltronDynamicFlight"; FlightBuff.buffColor = new Color(1f, 0.42f, 0.16f); FlightBuff.canStack = false; FlightBuff.isDebuff = false; FlightBuff.iconSprite = UltronAssets.LoadSprite("utility.png"); ContentAddition.AddBuffDef(FlightBuff); GuardBuff = ScriptableObject.CreateInstance<BuffDef>(); ((Object)GuardBuff).name = "bdUltronFirewallGuard"; GuardBuff.buffColor = new Color(1f, 0.62f, 0.22f); GuardBuff.canStack = false; GuardBuff.isDebuff = false; GuardBuff.iconSprite = UltronAssets.LoadSprite("secondary.png"); ContentAddition.AddBuffDef(GuardBuff); object obj = <>c.<>9__25_0; if (obj == null) { StatHookEventHandler val = delegate(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender)) { if (Object.op_Implicit((Object)(object)FlightBuff) && sender.HasBuff(FlightBuff)) { args.moveSpeedMultAdd += 0.45f; args.armorAdd += 60f; } if (Object.op_Implicit((Object)(object)GuardBuff) && sender.HasBuff(GuardBuff)) { args.armorAdd += 60f; } } }; <>c.<>9__25_0 = val; obj = (object)val; } RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)obj; } private static SkillDef CreateSkillDef(string name, string nameToken, string descToken, Sprite icon, SerializableEntityStateType activationState, string machineName, float rechargeInterval, int baseMaxStock, int rechargeStock, int stockToConsume, bool isCombatSkill, bool mustKeyPress, bool cancelSprintingOnActivation, InterruptPriority interruptPriority) { //IL_0029: 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_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) SkillDef obj = ScriptableObject.CreateInstance<SkillDef>(); obj.skillName = name; ((Object)obj).name = name; obj.skillNameToken = nameToken; obj.skillDescriptionToken = descToken; obj.icon = icon; obj.activationState = activationState; obj.activationStateMachineName = machineName; obj.baseRechargeInterval = rechargeInterval; obj.baseMaxStock = baseMaxStock; obj.rechargeStock = rechargeStock; obj.requiredStock = ((stockToConsume > 0) ? 1 : 0); obj.stockToConsume = stockToConsume; obj.resetCooldownTimerOnUse = false; obj.fullRestockOnAssign = true; obj.dontAllowPastMaxStocks = false; obj.beginSkillCooldownOnSkillEnd = true; obj.cancelSprintingOnActivation = cancelSprintingOnActivation; obj.forceSprintDuringState = false; obj.canceledFromSprinting = false; obj.isCombatSkill = isCombatSkill; obj.mustKeyPress = mustKeyPress; obj.interruptPriority = interruptPriority; obj.keywordTokens = Array.Empty<string>(); return obj; } public static void ConfigureSkillLocator(GameObject bodyPrefab) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) SkillLocator component = bodyPrefab.GetComponent<SkillLocator>(); component.passiveSkill = new PassiveSkill { enabled = true, skillNameToken = "ULTRON_PASSIVE_NAME", skillDescriptionToken = "ULTRON_PASSIVE_DESC", icon = UltronAssets.LoadSprite("passive.png") }; AssignSkillSlot(component.primary, PrimarySkillDef, "Primary"); AssignSkillSlot(component.secondary, SecondarySkillDef, "Secondary"); AssignSkillSlot(component.utility, UtilitySkillDef, "Utility"); AssignSkillSlot(component.special, SpecialSkillDef, "Special"); } private static void AssignSkillSlot(GenericSkill slot, SkillDef def, string name) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) SkillFamily val = ScriptableObject.CreateInstance<SkillFamily>(); ((Object)val).name = "UltronBody" + name + "Family"; Variant[] array = new Variant[1]; Variant val2 = new Variant { skillDef = def, unlockableDef = null }; ((Variant)(ref val2)).viewableNode = new Node(def.skillNameToken, false, (Node)null); array[0] = val2; val.variants = (Variant[])(object)array; val.defaultVariantIndex = 0u; slot._skillFamily = val; ContentAddition.AddSkillFamily(val); } } } namespace UltronSurvivor.States { [DefaultExecutionOrder(10000)] public sealed class UltronController : MonoBehaviour { public CharacterBody Body; public CharacterMotor Motor; public InputBankTest Input; public UltronModelController ModelCtrl; public float FlightTimer; public float DashLockTimer; public float RageTimer; private float _patchTimer = 4f; private void Awake() { //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0081: 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_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: 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_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: 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) Body = ((Component)this).GetComponent<CharacterBody>(); Motor = ((Component)this).GetComponent<CharacterMotor>(); Input = ((Component)this).GetComponent<InputBankTest>(); ModelCtrl = ((Component)this).GetComponentInChildren<UltronModelController>(); CameraTargetParams component = ((Component)this).GetComponent<CameraTargetParams>(); if (Object.op_Implicit((Object)(object)component)) { Transform val = ((Component)this).transform.Find("CameraPivot"); if (Object.op_Implicit((Object)(object)val)) { component.cameraPivotTransform = val; } CharacterCameraParamsData cameraParamsData = (Object.op_Implicit((Object)(object)component.cameraParams) ? component.cameraParams.data : CharacterCameraParamsData.basic); cameraParamsData.pivotVerticalOffset = BlendableFloat.op_Implicit(1.85f); cameraParamsData.idealLocalCameraPos = BlendableVector3.op_Implicit(new Vector3(1.85f, 0.35f, -7.2f)); component.AddParamsOverride(new CameraParamsOverrideRequest { cameraParamsData = cameraParamsData, priority = 0.5f }, 0f); } } public void ActivateFlight(float duration) { FlightTimer = Mathf.Max(FlightTimer, duration); if (!Object.op_Implicit((Object)(object)ModelCtrl)) { ModelCtrl = ((Component)this).GetComponentInChildren<UltronModelController>(); } ModelCtrl?.SetLoopOverride("102861_Flying_F_Loop", 1.15f, 0.1f); if (NetworkServer.active && Object.op_Implicit((Object)(object)Body) && Object.op_Implicit((Object)(object)UltronSkills.FlightBuff)) { if (Body.HasBuff(UltronSkills.FlightBuff)) { Body.RemoveBuff(UltronSkills.FlightBuff); } Body.AddTimedBuff(UltronSkills.FlightBuff, duration); } } public void BeginDash(float duration) { DashLockTimer = Mathf.Max(DashLockTimer, duration); } private void FixedUpdate() { //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_021d: 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) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_037a: Unknown result type (might be due to invalid IL or missing references) //IL_037f: Unknown result type (might be due to invalid IL or missing references) //IL_0383: Unknown result type (might be due to invalid IL or missing references) //IL_03a6: Unknown result type (might be due to invalid IL or missing references) //IL_03a8: Unknown result type (might be due to invalid IL or missing references) //IL_0314: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: Unknown result type (might be due to invalid IL or missing references) //IL_02e1: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)Body) || !Object.op_Implicit((Object)(object)Motor)) { return; } if (!Object.op_Implicit((Object)(object)ModelCtrl)) { ModelCtrl = ((Component)this).GetComponentInChildren<UltronModelController>(); } float fixedDeltaTime = Time.fixedDeltaTime; if (Object.op_Implicit((Object)(object)Body.healthComponent) && Body.healthComponent.alive) { _patchTimer -= fixedDeltaTime; if (_patchTimer <= 0f) { _patchTimer = 5f; if (Body.healthComponent.health < Body.maxHealth || !Body.outOfCombat) { if (NetworkServer.active) { Body.healthComponent.AddBarrier(Body.maxHealth * 0.05f); if (Body.healthComponent.health < Body.maxHealth) { Body.healthComponent.HealFraction(0.04f, default(ProcChainMask)); } } ModelCtrl?.TriggerDronePulse(0.6f); UltronAudio.Play("drone_patch.wav", 0.55f, Body.corePosition); UltronAudio.PlayRandomVoice(0.3f, 0.85f, Body.corePosition, "vo_patch_1.wav", "vo_patch_2.wav"); } } } if (DashLockTimer > 0f) { DashLockTimer -= fixedDeltaTime; } if (FlightTimer > 0f) { FlightTimer -= fixedDeltaTime; if (Body.hasEffectiveAuthority) { ((BaseCharacterController)Motor).Motor.ForceUnground(0.1f); } if (Body.hasEffectiveAuthority && DashLockTimer <= 0f) { Vector3 val = (Object.op_Implicit((Object)(object)Input) ? Input.moveVector : Vector3.zero); Vector3 val2 = (Object.op_Implicit((Object)(object)Input) ? Input.aimDirection : ((Component)this).transform.forward); float moveSpeed = Body.moveSpeed; Vector3 val3 = val * moveSpeed; if (Object.op_Implicit((Object)(object)Input) && Input.jump.down) { val3.y = moveSpeed * 0.75f; } else if (((Vector3)(ref val)).sqrMagnitude > 0.05f) { val3.y = val2.y * moveSpeed * 0.85f; } else { val3.y = 0.15f; } Motor.velocity = Vector3.Lerp(Motor.velocity, val3, fixedDeltaTime * 8.5f); } if (FlightTimer <= 0f) { ModelCtrl?.ClearLoopOverride(); UltronAudio.Play("flight_end.wav", 0.72f, Body.corePosition); } } else if (Body.hasEffectiveAuthority && !Motor.isGrounded && Object.op_Implicit((Object)(object)Input) && Input.jump.down && Motor.velocity.y < 2.5f) { Vector3 velocity = Motor.velocity; velocity.y = Mathf.MoveTowards(velocity.y, 0f, 55f * fixedDeltaTime); Motor.velocity = velocity; } } } public sealed class FireEncephaloRay : BaseSkillState { public const float BaseDuration = 1.05f; public const float ActiveBeamFraction = 0.44f; public const float FadeOutFraction = 0.56f; public const int TickCount = 4; public const float TickDamageCoeff = 0.9f; public const float BurstDamageCoeff = 4.2f; public const float MaxRange = 110f; private const int BeamNodes = 10; private float _duration; private float _beamActiveDuration; private float _beamFadeEndTime; private float _tickInterval; private float _tickTimer; private int _ticksFired; private bool _burstFired; private UltronModelController _modelCtrl; private GameObject _beamObj; private LineRenderer _outerLine; private LineRenderer _coreLine; private Light _muzzleLight; private Light _impactLight; private static GameObject _hitSparkPrefab; private static GameObject _burstImpactPrefab; private static GameObject _golemTracerPrefab; private static GameObject _golemMuzzleFlashPrefab; public override void OnEnter() { //IL_0169: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); _duration = 1.05f / Mathf.Max(0.5f, ((BaseState)this).attackSpeedStat); _beamActiveDuration = _duration * 0.44f; _beamFadeEndTime = _duration * 0.56f; _tickInterval = _beamActiveDuration * 0.85f / 4f; _tickTimer = 0f; _ticksFired = 0; _burstFired = false; if (!Object.op_Implicit((Object)(object)_hitSparkPrefab)) { _hitSparkPrefab = UltronAssets.LoadAddressablePrefab("RoR2/Base/Golem/ExplosionGolem.prefab") ?? LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/ImpactEffects/Hitspark1"); } if (!Object.op_Implicit((Object)(object)_burstImpactPrefab)) { _burstImpactPrefab = UltronAssets.LoadAddressablePrefab("RoR2/Base/Golem/ExplosionGolem.prefab") ?? LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/OmniEffect/OmniExplosionVFXQuick"); } if (!Object.op_Implicit((Object)(object)_golemTracerPrefab)) { _golemTracerPrefab = UltronAssets.LoadAddressablePrefab("RoR2/Base/Golem/TracerGolem.prefab"); } if (!Object.op_Implicit((Object)(object)_golemMuzzleFlashPrefab)) { _golemMuzzleFlashPrefab = UltronAssets.LoadAddressablePrefab("RoR2/Base/Golem/MuzzleflashGolem.prefab"); } ((BaseState)this).StartAimMode(_duration + 0.8f, false); _modelCtrl = (Object.op_Implicit((Object)(object)((EntityState)this).GetModelTransform()) ? ((Component)((EntityState)this).GetModelTransform()).GetComponent<UltronModelController>() : null); _modelCtrl?.PlayAction("102831_Attack02_Loop", _beamActiveDuration, 1.15f, 0.08f); UltronAudio.Play("primary_beam.wav", 0.82f, ((EntityState)this).transform.position); if (Object.op_Implicit((Object)(object)_golemMuzzleFlashPrefab)) { EffectManager.SimpleMuzzleFlash(_golemMuzzleFlashPrefab, ((EntityState)this).gameObject, "MuzzleRight", false); } CreateBeamVfx(); FireBeamHit(isTerminalBurst: false); _ticksFired = 1; } private void CreateBeamVfx() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Expected O, but got Unknown //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) _beamObj = new GameObject("UltronEncephaloRayVFX"); _outerLine = _beamObj.AddComponent<LineRenderer>(); _outerLine.positionCount = 10; _outerLine.useWorldSpace = true; _outerLine.numCapVertices = 4; _outerLine.alignment = (LineAlignment)0; _outerLine.textureMode = (LineTextureMode)0; ((Renderer)_outerLine).sharedMaterial = UltronAssets.GetRoR2LaserMaterial(outerCorona: true); _outerLine.startColor = new Color(1f, 0.25f, 0.1f, 1f); _outerLine.endColor = new Color(1f, 0.12f, 0.06f, 0.9f); GameObject val = new GameObject("UltronEncephaloRayCore"); val.transform.SetParent(_beamObj.transform, false); _coreLine = val.AddComponent<LineRenderer>(); _coreLine.positionCount = 2; _coreLine.useWorldSpace = true; _coreLine.numCapVertices = 4; _coreLine.alignment = (LineAlignment)0; _coreLine.textureMode = (LineTextureMode)0; ((Renderer)_coreLine).sharedMaterial = UltronAssets.GetRoR2LaserMaterial(); _coreLine.startColor = new Color(1f, 0.9f, 0.75f, 1f); _coreLine.endColor = new Color(1f, 0.45f, 0.18f, 1f); _muzzleLight = _beamObj.AddComponent<Light>(); _muzzleLight.type = (LightType)2; _muzzleLight.color = new Color(1f, 0.26f, 0.1f); _muzzleLight.range = 7.5f; _muzzleLight.intensity = 4.2f; _impactLight = val.AddComponent<Light>(); _impactLight.type = (LightType)2; _impactLight.color = new Color(1f, 0.3f, 0.1f); _impactLight.range = 6f; _impactLight.intensity = 3.8f; } private Vector3 GetBeamOrigin() { //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) if (_modelCtrl?.Rig != null && _modelCtrl.Rig.BoneByName.TryGetValue("hand_r", out var value) && Object.op_Implicit((Object)(object)value)) { return value.position; } if (!Object.op_Implicit((Object)(object)((EntityState)this).characterBody)) { return ((EntityState)this).transform.position + Vector3.up * 2.4f; } return ((EntityState)this).characterBody.corePosition + Vector3.up * 0.65f; } private void UpdateBeamVisual(Ray aimRay) { //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0088: 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_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018c: 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_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_02df: Unknown result type (might be due to invalid IL or missing references) //IL_0312: Unknown result type (might be due to invalid IL or missing references) //IL_0313: Unknown result type (might be due to invalid IL or missing references) //IL_031a: Unknown result type (might be due to invalid IL or missing references) //IL_031f: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)_beamObj) || !Object.op_Implicit((Object)(object)_outerLine) || !Object.op_Implicit((Object)(object)_coreLine)) { return; } if (((EntityState)this).fixedAge >= _beamFadeEndTime) { if (_beamObj.activeSelf) { _beamObj.SetActive(false); } return; } Vector3 beamOrigin = GetBeamOrigin(); Vector3 point = ((Ray)(ref aimRay)).GetPoint(110f); Ray val = aimRay; LayerIndex val2 = LayerIndex.world; int num = LayerMask.op_Implicit(((LayerIndex)(ref val2)).mask); val2 = LayerIndex.entityPrecise; RaycastHit val3 = default(RaycastHit); if (Physics.Raycast(val, ref val3, 110f, num | LayerMask.op_Implicit(((LayerIndex)(ref val2)).mask), (QueryTriggerInteraction)1)) { point = ((RaycastHit)(ref val3)).point; } float num2 = 1f; float num3 = 1f; if (_burstFired) { float num4 = Mathf.Clamp01((((EntityState)this).fixedAge - _beamActiveDuration) / Mathf.Max(0.04f, _beamFadeEndTime - _beamActiveDuration)); num2 = 1f - num4; num3 = Mathf.Lerp(1.85f, 0.15f, num4); } else { float num5 = Mathf.Clamp01(((EntityState)this).fixedAge / Mathf.Max(0.05f, _beamActiveDuration)); num3 = Mathf.Lerp(0.85f, 1.25f, num5); } Vector3 val4 = point - beamOrigin; float magnitude = ((Vector3)(ref val4)).magnitude; Vector3 val5 = ((magnitude > 0.001f) ? (val4 / magnitude) : ((Ray)(ref aimRay)).direction); Vector3 val6 = Vector3.Cross(Vector3.up, val5); Vector3 val7 = ((Vector3)(ref val6)).normalized; if (((Vector3)(ref val7)).sqrMagnitude < 0.01f) { val7 = Vector3.right; } val6 = Vector3.Cross(val5, val7); Vector3 normalized = ((Vector3)(ref val6)).normalized; for (int i = 0; i < 10; i++) { float num6 = (float)i / 9f; Vector3 val8 = Vector3.Lerp(beamOrigin, point, num6); if (i > 0 && i < 9 && !_burstFired) { float num7 = Mathf.Sin(num6 * MathF.PI); float num8 = ((EntityState)this).fixedAge * 38f + (float)i * 1.35f; float num9 = 0.035f * num7 * num2; val8 += (val7 * Mathf.Cos(num8) + normalized * Mathf.Sin(num8)) * num9; } _outerLine.SetPosition(i, val8); } _coreLine.SetPosition(0, beamOrigin); _coreLine.SetPosition(1, point); float num10 = 0.34f * num3 * num2; float num11 = 0.11f * num3 * num2; _outerLine.startWidth = num10; _outerLine.endWidth = num10 * 0.85f; _coreLine.startWidth = num11; _coreLine.endWidth = num11 * 0.9f; if (Object.op_Implicit((Object)(object)_muzzleLight)) { ((Component)_muzzleLight).transform.position = beamOrigin; _muzzleLight.intensity = 4.2f * num3 * num2; } if (Object.op_Implicit((Object)(object)_impactLight)) { ((Component)_impactLight).transform.position = point - val5 * 0.25f; _impactLight.intensity = 3.8f * num3 * num2; } } private void FireBeamHit(bool isTerminalBurst) { //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_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: 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_0034: 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_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_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_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0110: 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_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) Ray aimRay = ((BaseState)this).GetAimRay(); UpdateBeamVisual(aimRay); if (((EntityState)this).isAuthority) { BulletAttack val = new BulletAttack { owner = ((EntityState)this).gameObject, weapon = ((EntityState)this).gameObject, origin = ((Ray)(ref aimRay)).origin, aimVector = ((Ray)(ref aimRay)).direction, muzzleName = "MuzzleRight", tracerEffectPrefab = (isTerminalBurst ? _golemTracerPrefab : null), hitEffectPrefab = (isTerminalBurst ? _burstImpactPrefab : _hitSparkPrefab), minSpread = 0f, maxSpread = 0f, bulletCount = 1u, damage = ((BaseState)this).damageStat * (isTerminalBurst ? 4.2f : 0.9f), force = (isTerminalBurst ? 1100f : 140f), maxDistance = 110f, radius = (isTerminalBurst ? 0.75f : 0.42f), smartCollision = true }; LayerIndex val2 = LayerIndex.world; val.stopperMask = ((LayerIndex)(ref val2)).mask; val2 = LayerIndex.entityPrecise; val.hitMask = ((LayerIndex)(ref val2)).mask; val.isCrit = ((BaseState)this).RollCrit(); val.procCoefficient = (isTerminalBurst ? 1f : 0.4f); val.damageType = new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)(isTerminalBurst ? 128 : 0)), (DamageTypeExtended)0, (DamageSource)1); val.falloffModel = (FalloffModel)0; val.Fire(); } } public override void Update() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).Update(); UpdateBeamVisual(((BaseState)this).GetAimRay()); } public override void FixedUpdate() { //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); _tickTimer += Time.fixedDeltaTime; if (_ticksFired < 4 && _tickTimer >= _tickInterval && ((EntityState)this).fixedAge < _beamActiveDuration) { _tickTimer -= _tickInterval; _ticksFired++; FireBeamHit(isTerminalBurst: false); } if (!_burstFired && ((EntityState)this).fixedAge >= _beamActiveDuration) { _burstFired = true; UltronAudio.Play("primary_burst.wav", 0.88f, ((EntityState)this).transform.position); UltronAudio.Play("primary_reload.wav", 0.55f, ((EntityState)this).transform.position); _modelCtrl?.PlayAction("102831_Attack02_End", _duration - _beamActiveDuration, 1.15f, 0.08f); FireBeamHit(isTerminalBurst: true); } if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= _duration) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { if (Object.op_Implicit((Object)(object)_beamObj)) { Object.Destroy((Object)(object)_beamObj); } ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)1; } } public sealed class CastImperativeFirewall : BaseSkillState { public const float BaseDuration = 0.55f; public const float BlastRadius = 15f; public const float DamageCoeff = 3.8f; public const float BarrierFraction = 0.25f; private float _duration; private UltronModelController _modelCtrl; private GameObject _pulseRing; private LineRenderer _pulseRingLine; private const int RingSegments = 36; public override void OnEnter() { //IL_008f: 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_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: 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_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); _duration = 0.55f / Mathf.Max(0.5f, ((BaseState)this).attackSpeedStat); _modelCtrl = (Object.op_Implicit((Object)(object)((EntityState)this).GetModelTransform()) ? ((Component)((EntityState)this).GetModelTransform()).GetComponent<UltronModelController>() : null); _modelCtrl?.PlayAction("102841_Attack", _duration, 1.35f, 0.08f); _modelCtrl?.TriggerDronePulse(1f); UltronAudio.Play("firewall.wav", 0.88f, ((EntityState)this).transform.position); UltronAudio.PlayRandomVoice(0.65f, 0.92f, ((EntityState)this).transform.position, "vo_firewall_1.wav", "vo_firewall_2.wav"); SpawnPulseVisual(); if (((EntityState)this).isAuthority) { new BlastAttack { attacker = ((EntityState)this).gameObject, inflictor = ((EntityState)this).gameObject, teamIndex = ((BaseState)this).GetTeam(), position = (Object.op_Implicit((Object)(object)((EntityState)this).characterBody) ? ((EntityState)this).characterBody.corePosition : ((EntityState)this).transform.position), radius = 15f, baseDamage = ((BaseState)this).damageStat * 3.8f, baseForce = 1800f, bonusForce = Vector3.up * 450f, crit = ((BaseState)this).RollCrit(), damageType = new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)32), (DamageTypeExtended)0, (DamageSource)2), falloffModel = (FalloffModel)2, procCoefficient = 1f, attackerFiltering = (AttackerFiltering)2 }.Fire(); } if (NetworkServer.active && Object.op_Implicit((Object)(object)((EntityState)this).characterBody)) { GrantTeamBarrier(((EntityState)this).characterBody.corePosition, 21f, ((BaseState)this).GetTeam()); } } private static void GrantTeamBarrier(Vector3 center, float radius, TeamIndex team) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) float num = radius * radius; ReadOnlyCollection<TeamComponent> teamMembers = TeamComponent.GetTeamMembers(team); for (int i = 0; i < teamMembers.Count; i++) { TeamComponent val = teamMembers[i]; if (!Object.op_Implicit((Object)(object)val) || !Object.op_Implicit((Object)(object)val.body) || !Object.op_Implicit((Object)(object)val.body.healthComponent)) { continue; } Vector3 val2 = val.body.corePosition - center; if (((Vector3)(ref val2)).sqrMagnitude <= num) { val.body.healthComponent.AddBarrier(val.body.maxHealth * 0.25f); if (Object.op_Implicit((Object)(object)UltronSkills.GuardBuff)) { val.body.AddTimedBuff(UltronSkills.GuardBuff, 4f); } } } } private void SpawnPulseVisual() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_002e: 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_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) _pulseRing = new GameObject("UltronFirewallPulseRing"); _pulseRing.transform.position = (Object.op_Implicit((Object)(object)((EntityState)this).characterBody) ? ((EntityState)this).characterBody.corePosition : ((EntityState)this).transform.position); _pulseRingLine = _pulseRing.AddComponent<LineRenderer>(); _pulseRingLine.useWorldSpace = true; _pulseRingLine.loop = true; _pulseRingLine.positionCount = 36; _pulseRingLine.startWidth = 0.28f; _pulseRingLine.endWidth = 0.28f; ((Renderer)_pulseRingLine).sharedMaterial = UltronAssets.GetRoR2LaserMaterial(); _pulseRingLine.startColor = new Color(1f, 0.55f, 0.22f, 0.95f); _pulseRingLine.endColor = new Color(1f, 0.25f, 0.08f, 0.95f); Light obj = _pulseRing.AddComponent<Light>(); obj.type = (LightType)2; obj.color = new Color(1f, 0.32f, 0.1f); obj.range = 10f; obj.intensity = 5f; UpdatePulseRing(1.2f); } private void UpdatePulseRing(float radius) { //IL_002e: 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_0033: 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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)_pulseRingLine)) { Vector3 val = (Object.op_Implicit((Object)(object)((EntityState)this).characterBody) ? ((EntityState)this).characterBody.corePosition : ((EntityState)this).transform.position); for (int i = 0; i < 36; i++) { float num = (float)i / 36f * MathF.PI * 2f; _pulseRingLine.SetPosition(i, val + new Vector3(Mathf.Cos(num) * radius, 0.1f, Mathf.Sin(num) * radius)); } } } public override void Update() { //IL_0065: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).Update(); if (Object.op_Implicit((Object)(object)_pulseRing)) { float num = Mathf.Clamp01(((EntityState)this).age / Mathf.Max(0.1f, _duration)); UpdatePulseRing(Mathf.Lerp(1.1f, 15f, num)); if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody)) { _pulseRing.transform.position = ((EntityState)this).characterBody.corePosition; } } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= _duration) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { if (Object.op_Implicit((Object)(object)_pulseRing)) { Object.Destroy((Object)(object)_pulseRing); } ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)2; } } public sealed class DynamicFlightState : BaseSkillState { public const float DashDuration = 0.35f; public const float FreeFlightDuration = 4.5f; private Vector3 _dashDir; private UltronModelController _modelCtrl; private UltronController _ctrl; public override void OnEnter() { //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_006b: 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_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); _modelCtrl = (Object.op_Implicit((Object)(object)((EntityState)this).GetModelTransform()) ? ((Component)((EntityState)this).GetModelTransform()).GetComponent<UltronModelController>() : null); _ctrl = ((EntityState)this).GetComponent<UltronController>(); _dashDir = ((!Object.op_Implicit((Object)(object)((EntityState)this).inputBank)) ? ((EntityState)this).transform.forward : ((((Vector3)(ref ((EntityState)this).inputBank.moveVector)).sqrMagnitude > 0.05f) ? ((Vector3)(ref ((EntityState)this).inputBank.moveVector)).normalized : ((EntityState)this).inputBank.aimDirection)); if (_dashDir.y < 0.25f) { _dashDir.y = 0.28f; } ((Vector3)(ref _dashDir)).Normalize(); _modelCtrl?.PlayAction("102861_Flying_Start", 0.35f, 1.25f, 0.06f); UltronAudio.Play("flight.wav", 0.88f, ((EntityState)this).transform.position); if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground(0.1f); ((EntityState)this).characterMotor.velocity = _dashDir * (((BaseState)this).moveSpeedStat * 3.1f); } if (Object.op_Implicit((Object)(object)_ctrl)) { _ctrl.BeginDash(0.35f); _ctrl.ActivateFlight(4.5f); } } public override void FixedUpdate() { //IL_0044: 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_005a: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && ((EntityState)this).fixedAge < 0.35f) { ((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground(0.1f); ((EntityState)this).characterMotor.velocity = _dashDir * (((BaseState)this).moveSpeedStat * 2.8f); } if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= 0.35f) { ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)2; } } public sealed class RageOfUltronState : BaseSkillState { public const float TotalDuration = 3.2f; public const int SalvoCount = 10; public const float SalvoDamageCoeff = 2.4f; public const float SalvoRadius = 9.5f; public const float MaxRange = 110f; private float _salvoInterval; private float _salvoTimer; private int _salvosFired; private UltronModelController _modelCtrl; private UltronController _ctrl; private readonly List<GameObject> _legionDrones = new List<GameObject>(); private bool _loggedLegionAim; private static GameObject _salvoExplosionPrefab; public override void OnEnter() { //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); _salvoInterval = 0.28500003f; _salvoTimer = 0f; _salvosFired = 0; ((BaseState)this).StartAimMode(3.7f, false); _modelCtrl = (Object.op_Implicit((Object)(object)((EntityState)this).GetModelTransform()) ? ((Component)((EntityState)this).GetModelTransform()).GetComponent<UltronModelController>() : null); _ctrl = ((EntityState)this).GetComponent<UltronController>(); _modelCtrl?.PlayAction("102881_Attack_Start", 0.45f, 1.25f, 0.08f); _modelCtrl?.TriggerDronePulse(3.2f); if (Object.op_Implicit((Object)(object)_ctrl)) { _ctrl.ActivateFlight(3.7f); } UltronAudio.Play("rage_start.wav", 0.9f, ((EntityState)this).transform.position); UltronAudio.PlayRandomVoice(1f, 1f, ((EntityState)this).transform.position, "vo_ult_1.wav", "vo_ult_2.wav"); if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground(0.1f); ((EntityState)this).characterMotor.velocity = new Vector3(((EntityState)this).characterMotor.velocity.x * 0.3f, 1.8f, ((EntityState)this).characterMotor.velocity.z * 0.3f); } if (NetworkServer.active && Object.op_Implicit((Object)(object)((EntityState)this).characterBody)) { HealthComponent healthComponent = ((EntityState)this).characterBody.healthComponent; if (healthComponent != null) { healthComponent.AddBarrier(((EntityState)this).characterBody.maxHealth * 0.35f); } } SpawnFlankingLegionDrones(); UpdateFlankingLegionDrones(snap: true); FirePlasmaSalvo(0); _salvosFired = 1; } private void SpawnFlankingLegionDrones() { //IL_0039: 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_0074: Unknown result type (might be due to invalid IL or missing references) if (UltronAssets.DroneModel == null) { return; } for (int i = 0; i < 2; i++) { UltronDroneVisual ultronDroneVisual = UltronRig.CreateDrone("UltronLegionFlanker_" + i); if (Object.op_Implicit((Object)(object)ultronDroneVisual.Root)) { ultronDroneVisual.Root.localScale = Vector3.one * 0.684f; Light obj = ((Component)ultronDroneVisual.Root).gameObject.AddComponent<Light>(); obj.type = (LightType)2; obj.color = new Color(1f, 0.22f, 0.1f); obj.range = 5.5f; obj.intensity = 3.5f; _legionDrones.Add(((Component)ultronDroneVisual.Root).gameObject); } } } private void UpdateFlankingLegionDrones(bool snap = false) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0044: 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_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0093: 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_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_0113: 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_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_018f: 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_019a: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: 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_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) if (_legionDrones.Count == 0) { return; } Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 val = ((Ray)(ref aimRay)).direction; Vector3 val2; if (!(((Vector3)(ref val)).sqrMagnitude > 0.001f)) { val2 = ((EntityState)this).transform.forward; } else { val = ((Ray)(ref aimRay)).direction; val2 = ((Vector3)(ref val)).normalized; } Vector3 val3 = val2; Vector3 val4 = Vector3.ProjectOnPlane(val3, Vector3.up); if (((Vector3)(ref val4)).sqrMagnitude < 0.001f) { val4 = ((EntityState)this).transform.forward; } ((Vector3)(ref val4)).Normalize(); val = Vector3.Cross(Vector3.up, val4); Vector3 normalized = ((Vector3)(ref val)).normalized; Vector3 point = ((Ray)(ref aimRay)).GetPoint(110f); Ray val5 = aimRay; LayerIndex val6 = LayerIndex.world; int num = LayerMask.op_Implicit(((LayerIndex)(ref val6)).mask); val6 = LayerIndex.entityPrecise; RaycastHit val7 = default(RaycastHit); if (Physics.Raycast(val5, ref val7, 110f, num | LayerMask.op_Implicit(((LayerIndex)(ref val6)).mask), (QueryTriggerInteraction)1)) { point = ((RaycastHit)(ref val7)).point; } Vector3 val8 = (Object.op_Implicit((Object)(object)((EntityState)this).characterBody) ? ((EntityState)this).characterBody.footPosition : (((EntityState)this).transform.position + new Vector3(0f, -0.92f, 0f))); float age = ((EntityState)this).age; for (int i = 0; i < _legionDrones.Count; i++) { GameObject val9 = _legionDrones[i]; if (Object.op_Implicit((Object)(object)val9)) { float num2 = ((i == 0) ? (-1f) : 1f); float num3 = Mathf.Sin(age * 3.2f + (float)i * 1.7f) * 0.09f; float num4 = Mathf.Sin(age * 2.1f + (float)i) * 0.06f; Vector3 val10 = val8 + normalized * (num2 * 1.55f) + Vector3.up * (2.7f + num3) + val4 * (0.35f + num4); val9.transform.position = val10; Vector3 aimDirection = point - val10; if (((Vector3)(ref aimDirection)).sqrMagnitude < 0.01f) { aimDirection = val3; } float bankDegrees = num2 * 8f + Mathf.Sin(age * 2.4f + (float)i) * 3f; Quaternion val11 = UltronRig.AimDrone(aimDirection, bankDegrees); if (snap) { val9.transform.rotation = val11; } else { float num5 = ((Quaternion.Angle(val9.transform.rotation, val11) > 80f) ? 1f : Mathf.Clamp01(Time.deltaTime * 14f)); val9.transform.rotation = Quaternion.Slerp(val9.transform.rotation, val11, num5); } if (!_loggedLegionAim && i == 0) { _loggedLegionAim = true; float num6 = Vector3.Dot(val9.transform.forward, ((Vector3)(ref aimDirection)).normalized); UltronPlugin.Log.LogInfo((object)$"Legion drone forward dot={num6:0.000}"); } } } } private void FirePlasmaSalvo(int index) { //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_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_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_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0096: 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_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //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_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_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_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_0107: 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_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015d: 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_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Unknown result type (might be due to invalid IL or missing references) //IL_0299: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 point = ((Ray)(ref aimRay)).GetPoint(110f); Ray val = aimRay; LayerIndex val2 = LayerIndex.world; int num = LayerMask.op_Implicit(((LayerIndex)(ref val2)).mask); val2 = LayerIndex.entityPrecise; RaycastHit val3 = default(RaycastHit); if (Physics.Raycast(val, ref val3, 110f, num | LayerMask.op_Implicit(((LayerIndex)(ref val2)).mask), (QueryTriggerInteraction)1)) { point = ((RaycastHit)(ref val3)).point; } if (index == 0) { UltronPlugin.Log.LogInfo((object)$"[Ultron] Rage impact {Vector3.Distance(((Ray)(ref aimRay)).origin, point):0.0} m (range {110f:0} m)"); } UltronAudio.Play("rage_shot.wav", 0.68f, ((EntityState)this).transform.position); UltronAudio.Play("rage_explo.wav", 0.62f, point); Vector3 start = (Object.op_Implicit((Object)(object)((EntityState)this).characterBody) ? (((EntityState)this).characterBody.corePosition + Vector3.up * 1.2f) : (((EntityState)this).transform.position + Vector3.up * 2f)); if (_legionDrones.Count > 0) { GameObject val4 = _legionDrones[index % _legionDrones.Count]; if (Object.op_Implicit((Object)(object)val4)) { start = val4.transform.position; } } SpawnSalvoBeamFlash(start, point); if (((EntityState)this).isAuthority) { new BlastAttack { attacker = ((EntityState)this).gameObject, inflictor = ((EntityState)this).gameObject, teamIndex = ((BaseState)this).GetTeam(), position = point, radius = 9.5f, baseDamage = ((BaseState)this).damageStat * 2.4f, baseForce = 750f, crit = ((BaseState)this).RollCrit(), damageType = new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)128), (DamageTypeExtended)0, (DamageSource)8), falloffModel = (FalloffModel)0, procCoefficient = 0.75f, attackerFiltering = (AttackerFiltering)2 }.Fire(); } if (!NetworkServer.active) { return; } float num2 = 182.25f; ReadOnlyCollection<TeamComponent> teamMembers = TeamComponent.GetTeamMembers(((BaseState)this).GetTeam()); for (int i = 0; i < teamMembers.Count; i++) { TeamComponent val5 = teamMembers[i]; if (Object.op_Implicit((Object)(object)val5) && Object.op_Implicit((Object)(object)val5.body) && Object.op_Implicit((Object)(object)val5.body.healthComponent)) { Vector3 val6 = val5.body.corePosition - point; if (((Vector3)(ref val6)).sqrMagnitude <= num2 || (Object)(object)val5.body == (Object)(object)((EntityState)this).characterBody) { val5.body.healthComponent.HealFraction(0.035f, default(ProcChainMask)); val5.body.healthComponent.AddBarrier(val5.body.maxHealth * 0.04f); } } } } private static void SpawnSalvoBeamFlash(Vector3 start, Vector3 end) { //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_005f: 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_00a4: 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_00d6: Expected O, but got Unknown //IL_002c: 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) if (!Object.op_Implicit((Object)(object)_salvoExplosionPrefab)) { _salvoExplosionPrefab = UltronAssets.LoadAddressablePrefab("RoR2/Base/Golem/ExplosionGolem.prefab"); } if (Object.op_Implicit((Object)(object)_salvoExplosionPrefab)) { EffectManager.SimpleEffect(_salvoExplosionPrefab, end, Quaternion.identity, false); } GameObject val = new GameObject("RageOfUltronSalvoBeam"); LineRenderer obj = val.AddComponent<LineRenderer>(); obj.positionCount = 2; obj.numCapVertices = 4; obj.alignment = (LineAlignment)0; obj.SetPosition(0, start); obj.SetPosition(1, end); obj.startWidth = 0.28f; obj.endWidth = 0.36f; ((Renderer)obj).sharedMaterial = UltronAssets.GetRoR2LaserMaterial(); obj.startColor = new Color(1f, 0.85f, 0.55f, 1f); obj.endColor = new Color(1f, 0.2f, 0.08f, 0.95f); Object.Destroy((Object)val, 0.22f); } public override void Update() { ((EntityState)this).Update(); UpdateFlankingLegionDrones(); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= 0.42f && ((EntityState)this).fixedAge < 2.9f) { _modelCtrl?.SetLoopOverride("102881_Attack_Loop", 1.25f, 0.08f); } _salvoTimer += Time.fixedDeltaTime; if (_salvosFired < 10 && _salvoTimer >= _salvoInterval) { _salvoTimer -= _salvoInterval; FirePlasmaSalvo(_salvosFired); _salvosFired++; } if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= 3.2f) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) UltronAudio.Play("rage_end.wav", 0.8f, ((EntityState)this).transform.position); _modelCtrl?.ClearLoopOverride(); _modelCtrl?.PlayAction("102881_Attack_End", 0.35f, 1.2f, 0.08f); foreach (GameObject legionDrone in _legionDrones) { if (Object.op_Implicit((Object)(object)legionDrone)) { Object.Destroy((Object)(object)legionDrone); } } _legionDrones.Clear(); ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)9; } } } namespace UltronSurvivor.Model { public sealed class UltronAnimDriver : MonoBehaviour { private UltronRigInstance _rig; private UltronModelPack _pack; private UltronClipSet _clips; private UltronClip _current; private UltronClip _prev; private float _time; private float _prevTime; private float _speed = 1f; private bool _loop = true; private float _blendDuration; private float _blendElapsed; private readonly Dictionary<string, int> _boneIdx = new Dictionary<string, int>(StringComparer.OrdinalIgnoreCase); private Vector3[] _workPos; private Quaternion[] _workRot; private Vector3[] _workScale; private Vector3[] _prevPos; private Quaternion[] _prevRot; private Vector3[] _prevScale; public string CurrentClipName => _current?.Name ?? ""; public bool IsOneShotPlaying { get { if (_current != null && !_loop) { return _time < _current.Duration; } return false; } } public void Setup(UltronRigInstance rig, UltronModelPack pack, UltronClipSet clips) { //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) _rig = rig; _pack = pack; _clips = clips; _boneIdx.Clear(); int num = pack.BoneNames.Length; _workPos = (Vector3[])(object)new Vector3[num]; _workRot = (Quaternion[])(object)new Quaternion[num]; _workScale = (Vector3[])(object)new Vector3[num]; _prevPos = (Vector3[])(object)new Vector3[num]; _prevRot = (Quaternion[])(object)new Quaternion[num]; _prevScale = (Vector3[])(object)new Vector3[num]; for (int i = 0; i < num; i++) { _boneIdx[pack.BoneNames[i]] = i; _workPos[i] = pack.RestPos[i]; _workRot[i] = pack.RestRot[i]; _workScale[i] = pack.RestScale[i]; } } public bool HasClip(string name) { if (_clips != null && !string.IsNullOrEmpty(name)) { return _clips.Clips.ContainsKey(name); } return false; } public void Play(string clipName, bool loop = true, float speed = 1f, float crossFade = 0.14f, bool forceRestart = false) { if (_clips == null || string.IsNullOrEmpty(clipName) || !_clips.Clips.TryGetValue(clipName, out var value)) { return; } if (!forceRestart && _current == value && _loop == loop) { _speed = speed; return; } if (_current != null && crossFade > 0.001f) { _prev = _current; _prevTime = _time; _blendDuration = crossFade; _blendElapsed = 0f; } else { _prev = null; _blendDuration = 0f; } _current = value; _time = 0f; _loop = loop; _speed = Mathf.Max(0.05f, speed); } pr