using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.IO.Compression; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using BastionMod.Modules; using BastionMod.Modules.Achievements; using BastionMod.Modules.Characters; using BastionMod.Survivors.Bastion; using BastionMod.Survivors.Bastion.Achievements; using BastionMod.Survivors.Bastion.Components; using BastionMod.Survivors.Bastion.SkillStates; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using EntityStates; using EntityStates.AI.Walker; using EntityStates.Commando.CommandoWeapon; using EntityStates.Drone.DroneWeapon; using EntityStates.FalseSonBoss; using EntityStates.Huntress; using HG; using HG.BlendableTypes; using Microsoft.CodeAnalysis; using On.RoR2; using R2API; using R2API.Networking; using R2API.Networking.Interfaces; using R2API.Utils; using RoR2; using RoR2.Achievements; using RoR2.Audio; using RoR2.CharacterAI; using RoR2.ContentManagement; using RoR2.Navigation; using RoR2.Projectile; using RoR2.Skills; using RoR2.UI; using RoR2BepInExPack.GameAssetPathsBetter; using TMPro; 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: AssemblyCompany("BastionMod")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+d3749b505c19c0395cc591c0e46c627b97c2b725")] [assembly: AssemblyProduct("BastionMod")] [assembly: AssemblyTitle("BastionMod")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.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.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace BastionMod { [NetworkCompatibility(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.HasteReapr.BastionMod", "BastionMod", "1.1.4")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class BastionPlugin : BaseUnityPlugin { public const string MODUID = "com.HasteReapr.BastionMod"; public const string MODNAME = "BastionMod"; public const string MODVERSION = "1.1.4"; public const string DEVELOPER_PREFIX = "HASTEREAPR"; public static BastionPlugin instance; internal static string bodyName = "BastionRobot"; internal static BodyIndex bodyIndex => BodyCatalog.FindBodyIndex(bodyName); private void Awake() { instance = this; Log.Init(((BaseUnityPlugin)this).Logger); Language.Init(); new BastionSurvivor().Initialize(); new ContentPacks().Initialize(); Hook(); BastionModdedDisplayHider.Init(); BastionHitboxDiag.Init(); BastionSounds.Init(); BastionCompat.Init(); Language.WriteTranslationTemplate(); } private void Hook() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown CharacterBody.RecalculateStats += new hook_RecalculateStats(CharacterBody_RecalculateStats); SceneDirector.Start += new hook_Start(SceneDirector_Start); } private void SceneDirector_Start(orig_Start orig, SceneDirector self) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_004a: 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) orig.Invoke(self); Scene activeScene = SceneManager.GetActiveScene(); string name = ((Scene)(ref activeScene)).name; if (NetworkServer.active && name == "foggyswamp" && !((Object)(object)BastionAssets.bas10Interactable == (Object)null)) { NetworkServer.Spawn(Object.Instantiate(BastionAssets.bas10Interactable, new Vector3(128.675f, -111.2f, -72.7934f), Quaternion.Euler(0f, 120f, 0f))); } } private void CharacterBody_RecalculateStats(orig_RecalculateStats orig, CharacterBody self) { orig.Invoke(self); if (!Object.op_Implicit((Object)(object)self) || !self.HasBuff(BastionBuffs.turretRootDef)) { return; } if (BastionTank.IsTank(self)) { if (self.isSprinting && self.sprintingSpeedMultiplier > 0f) { self.moveSpeed /= self.sprintingSpeedMultiplier; } self.moveSpeed *= 0.6f; self.jumpPower = 0f; self.maxJumpCount = 0; } else { self.moveSpeed = 0f; } self.acceleration = 80f; } } internal static class Log { internal static ManualLogSource _logSource; internal static void Init(ManualLogSource logSource) { _logSource = logSource; } internal static void Debug(object data) { _logSource.LogDebug(data); } internal static void Error(object data) { _logSource.LogError(data); } internal static void ErrorAssetBundle(string assetName, string bundleName) { Error("failed to load asset, " + assetName + ", because it does not exist in asset bundle, " + bundleName); } internal static void Fatal(object data) { _logSource.LogFatal(data); } internal static void Info(object data) { _logSource.LogInfo(data); } internal static void Message(object data) { _logSource.LogMessage(data); } internal static void Warning(object data) { _logSource.LogWarning(data); } } } namespace BastionMod.Survivors.Bastion { public class ArtilleryEntryGateSkillDef : SkillDef { public override bool CanExecute(GenericSkill skillSlot) { if (ArtilleryGateOpen(skillSlot)) { return ((SkillDef)this).CanExecute(skillSlot); } return false; } public override bool IsReady(GenericSkill skillSlot) { if (((SkillDef)this).IsReady(skillSlot)) { return ArtilleryGateOpen(skillSlot); } return false; } private static bool ArtilleryGateOpen(GenericSkill skillSlot) { BastionController bastionController = (Object.op_Implicit((Object)(object)skillSlot) ? ((Component)skillSlot).GetComponent() : null); if (!Object.op_Implicit((Object)(object)bastionController)) { return true; } return bastionController.GetStoredSpecialCooldownRemaining() <= 0f; } } public static class BastionAI { public static void Init(GameObject bodyPrefab, string masterName) { //IL_0035: 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_00cb: 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_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0170: 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_019e: 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_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_022a: 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_0248: 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_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: 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_02f7: 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_0325: Unknown result type (might be due to invalid IL or missing references) //IL_032b: Unknown result type (might be due to invalid IL or missing references) GameObject obj = Prefabs.CreateBlankMasterPrefab(bodyPrefab, masterName); BaseAI component = obj.GetComponent(); component.aimVectorDampTime = 0.1f; component.aimVectorMaxSpeed = 360f; AISkillDriver obj2 = obj.AddComponent(); obj2.customName = "Use Primary Swing"; obj2.skillSlot = (SkillSlot)0; obj2.requiredSkill = null; obj2.requireSkillReady = false; obj2.requireEquipmentReady = false; obj2.minUserHealthFraction = float.NegativeInfinity; obj2.maxUserHealthFraction = float.PositiveInfinity; obj2.minTargetHealthFraction = float.NegativeInfinity; obj2.maxTargetHealthFraction = float.PositiveInfinity; obj2.minDistance = 0f; obj2.maxDistance = 8f; obj2.selectionRequiresTargetLoS = false; obj2.selectionRequiresOnGround = false; obj2.selectionRequiresAimTarget = false; obj2.maxTimesSelected = -1; obj2.moveTargetType = (TargetType)0; obj2.activationRequiresTargetLoS = false; obj2.activationRequiresAimTargetLoS = false; obj2.activationRequiresAimConfirmation = false; obj2.movementType = (MovementType)1; obj2.moveInputScale = 1f; obj2.aimType = (AimType)1; obj2.ignoreNodeGraph = false; obj2.shouldSprint = false; obj2.shouldFireEquipment = false; obj2.buttonPressType = (ButtonPressType)0; obj2.driverUpdateTimerOverride = -1f; obj2.resetCurrentEnemyOnNextDriverSelection = false; obj2.noRepeat = false; obj2.nextHighPriorityOverride = null; AISkillDriver obj3 = obj.AddComponent(); obj3.customName = "Use Secondary Shoot"; obj3.skillSlot = (SkillSlot)1; obj3.requireSkillReady = true; obj3.minDistance = 0f; obj3.maxDistance = 25f; obj3.selectionRequiresTargetLoS = false; obj3.selectionRequiresOnGround = false; obj3.selectionRequiresAimTarget = false; obj3.maxTimesSelected = -1; obj3.moveTargetType = (TargetType)0; obj3.activationRequiresTargetLoS = false; obj3.activationRequiresAimTargetLoS = false; obj3.activationRequiresAimConfirmation = true; obj3.movementType = (MovementType)1; obj3.moveInputScale = 1f; obj3.aimType = (AimType)1; obj3.buttonPressType = (ButtonPressType)0; AISkillDriver obj4 = obj.AddComponent(); obj4.customName = "Use Utility Roll"; obj4.skillSlot = (SkillSlot)2; obj4.requireSkillReady = true; obj4.minDistance = 8f; obj4.maxDistance = 20f; obj4.selectionRequiresTargetLoS = true; obj4.selectionRequiresOnGround = false; obj4.selectionRequiresAimTarget = false; obj4.maxTimesSelected = -1; obj4.moveTargetType = (TargetType)0; obj4.activationRequiresTargetLoS = false; obj4.activationRequiresAimTargetLoS = false; obj4.activationRequiresAimConfirmation = false; obj4.movementType = (MovementType)2; obj4.moveInputScale = 1f; obj4.aimType = (AimType)1; obj4.buttonPressType = (ButtonPressType)0; AISkillDriver obj5 = obj.AddComponent(); obj5.customName = "Use Special bomb"; obj5.skillSlot = (SkillSlot)3; obj5.requireSkillReady = true; obj5.minDistance = 0f; obj5.maxDistance = 20f; obj5.selectionRequiresTargetLoS = false; obj5.selectionRequiresOnGround = false; obj5.selectionRequiresAimTarget = false; obj5.maxTimesSelected = -1; obj5.moveTargetType = (TargetType)0; obj5.activationRequiresTargetLoS = false; obj5.activationRequiresAimTargetLoS = false; obj5.activationRequiresAimConfirmation = false; obj5.movementType = (MovementType)1; obj5.moveInputScale = 1f; obj5.aimType = (AimType)1; obj5.buttonPressType = (ButtonPressType)0; AISkillDriver obj6 = obj.AddComponent(); obj6.customName = "Chase"; obj6.skillSlot = (SkillSlot)(-1); obj6.requireSkillReady = false; obj6.minDistance = 0f; obj6.maxDistance = float.PositiveInfinity; obj6.moveTargetType = (TargetType)0; obj6.activationRequiresTargetLoS = false; obj6.activationRequiresAimTargetLoS = false; obj6.activationRequiresAimConfirmation = false; obj6.movementType = (MovementType)1; obj6.moveInputScale = 1f; obj6.aimType = (AimType)1; obj6.buttonPressType = (ButtonPressType)0; } } public static class BastionAssets { [RequireComponent(typeof(ProjectileController))] internal class DroneShellImpact : MonoBehaviour, IProjectileImpactBehavior { public int droneCount = 4; public void OnProjectileImpact(ProjectileImpactInfo impactInfo) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0058: 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_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_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_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0080: 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_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) ProjectileController component = ((Component)this).GetComponent(); Vector3 position = ((Component)component).transform.position; int num = droneCount; Vector3 val = default(Vector3); for (int i = 0; i < num; i++) { float num2 = 3f; float num3 = MathF.PI * 2f / (float)num; ((Vector3)(ref val))..ctor(Mathf.Cos(num3 * (float)i) * num2, 0.25f, Mathf.Sin(num3 * (float)i) * num2); Vector3 position2 = position + val; Inventory component2 = ((Component)new MasterSummon { masterPrefab = gunnerDroneMaster, position = position2, rotation = default(Quaternion), summonerBodyObject = component.owner, ignoreTeamMemberLimit = true, useAmbientLevel = true, enablePrintController = true }.Perform()).GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { component2.GiveItemPermanent(Items.HealthDecay, 20); } } Object.Destroy((Object)(object)((Component)this).gameObject); } } private static AssetBundle _assetBundle; public static GameObject explosion; public static GameObject bombardShell; public static GameObject artilleryShell; public static GameObject droneShell; public static GameObject grenadeProjectile; public static GameObject grenadeArcVisualizer; public static GameObject gunnerDroneMaster; public static GameObject gunnerDronePrefab; public static GameObject healVFX; public static GameObject sparksEffect; public static GameObject activateEffect; public static GameObject bas10Interactable; public static GameObject ganymedePrefab; public static RuntimeAnimatorController ganymedeController; public static RuntimeAnimatorController ganymedePerchController; public static void Init(AssetBundle assetBundle) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Expected O, but got Unknown _assetBundle = assetBundle; bas10Interactable = _assetBundle.LoadAsset("BastionUnlockable"); bas10Interactable.AddComponent(); PurchaseInteraction component = bas10Interactable.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.costType = (CostTypeIndex)0; component.cost = 0; component.automaticallyScaleCostWithDifficulty = false; } ganymedePrefab = _assetBundle.LoadAsset("ganamede"); if (Object.op_Implicit((Object)(object)ganymedePrefab)) { Asset.ConvertAllRenderersToHopooShader(ganymedePrefab); } ganymedeController = _assetBundle.LoadAsset("bird"); if ((Object)(object)ganymedeController != (Object)null) { AnimationClip val = null; AnimationClip val2 = null; AnimationClip[] animationClips = ganymedeController.animationClips; foreach (AnimationClip val3 in animationClips) { if (!((Object)(object)val3 == (Object)null)) { if (((Object)val3).name.Contains("Flap")) { val = val3; } else if (((Object)val3).name.Contains("Perch")) { val2 = val3; } } } if ((Object)(object)val != (Object)null && (Object)(object)val2 != (Object)null) { ganymedePerchController = (RuntimeAnimatorController)new AnimatorOverrideController(ganymedeController) { [val] = val2 }; } } CreateEffects(); CreateProjectiles(); CreateMinions(); } private static void CreateMinions() { //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_002d: 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_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_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) gunnerDronePrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)RoR2_Base_Drones.Drone1Body_prefab).WaitForCompletion(), "BastionGunnerDrone", true); Transform transform = gunnerDronePrefab.transform; transform.localScale *= 0.6f; CharacterBody component = gunnerDronePrefab.GetComponent(); component.baseNameToken = "HASTEREAPR_BASTION_TEMPORARY_DRONE"; component.baseMaxHealth = 50f; component.baseAttackSpeed = 5f; component.baseMoveSpeed = 40f; component.baseAcceleration = 24f; component.baseDamage = 2f; gunnerDronePrefab.GetComponent().deathState = new SerializableEntityStateType(typeof(BastionMinionDeath)); gunnerDroneMaster = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)RoR2_Base_Drones.Drone1Master_prefab).WaitForCompletion(), "BastionGunnerDroneMaster", true); gunnerDroneMaster.GetComponent().bodyPrefab = gunnerDronePrefab; } private static void CreateEffects() { //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_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) explosion = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)RoR2_Base_Common_VFX.ExplosionVFX_prefab).WaitForCompletion(), "BastionExplosion", false); Content.CreateAndAddEffectDef(explosion); sparksEffect = Addressables.LoadAssetAsync((object)RoR2_Base_Common_VFX.Hitspark1_prefab).WaitForCompletion(); activateEffect = Addressables.LoadAssetAsync((object)RoR2_Base_Common_VFX.LevelUpEffect_prefab).WaitForCompletion(); CreateHealing(); } private static void CreateHealing() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) healVFX = _assetBundle.LoadEffect("healing"); Material material = Object.Instantiate(Addressables.LoadAssetAsync((object)RoR2_Base_Common_VFX.matHealingCross_mat).WaitForCompletion()); ((Renderer)((Component)healVFX.transform.Find("particle")).GetComponent()).material = material; } private static void CreateProjectiles() { //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) bombardShell = _assetBundle.LoadAsset("bombardShell"); ProjectileImpactExplosion component = bombardShell.GetComponent(); component.impactEffect = explosion; bombardShell.AddComponent(); artilleryShell = PrefabAPI.InstantiateClone(_assetBundle.LoadAsset("bombardShell"), "artilleryShell"); ProjectileImpactExplosion component2 = artilleryShell.GetComponent(); component.impactEffect = explosion; ((ProjectileExplosion)component2).blastRadius = ((ProjectileExplosion)component2).blastRadius * 0.65f; Content.AddProjectilePrefab(bombardShell); droneShell = PrefabAPI.InstantiateClone(_assetBundle.LoadAsset("bombardShell"), "droneShell"); ProjectileImpactExplosion component3 = droneShell.GetComponent(); ((ProjectileExplosion)component3).blastRadius = 0f; ((ProjectileExplosion)component3).blastDamageCoefficient = 0f; droneShell.AddComponent(); Content.AddProjectilePrefab(droneShell); grenadeProjectile = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)RoR2_Base_Commando.CommandoGrenadeProjectile_prefab).WaitForCompletion(), "BastionGrenadeProjectile", true); ProjectileImpactExplosion component4 = grenadeProjectile.GetComponent(); component4.destroyOnEnemy = false; component4.detonateOnEnemy = false; component4.destroyOnWorld = false; component4.timerAfterImpact = false; component4.lifetime = 5f; grenadeProjectile.AddComponent(); Content.AddProjectilePrefab(grenadeProjectile); grenadeArcVisualizer = Addressables.LoadAssetAsync((object)RoR2_Base_Common_VFX.BasicThrowableVisualizer_prefab).WaitForCompletion(); } } public static class BastionAttachmentPoints { private static readonly (string anchor, string bone)[] points = new(string, string)[11] { ("Head", "Head"), ("Chest", "Torso"), ("Back", "Torso"), ("ShoulderL", "Shoulder.L"), ("ShoulderR", "Shoulder.R"), ("Pelvis", "Waist"), ("GunArm", "GunArm"), ("HandArm", "HandArm"), ("Turret", "Turret"), ("FootL", "Ankle.L"), ("FootR", "Ankle.R") }; public static void AddTo(CharacterModel model) { //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Expected O, but got Unknown //IL_0107: 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_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)model)) { return; } ChildLocator component = ((Component)model).GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { Log.Warning("AttachmentPoints: model has no ChildLocator"); return; } List list = new List((IEnumerable)(((object)component.transformPairs) ?? ((object)new NameTransformPair[0]))); (string, string)[] array = points; for (int i = 0; i < array.Length; i++) { var (anchor, text) = array[i]; if (!list.Exists((NameTransformPair p) => p.name == anchor)) { Transform val = FindDeep(((Component)model).transform, text); if (!Object.op_Implicit((Object)(object)val)) { Log.Warning("AttachmentPoints: bone '" + text + "' not found for anchor '" + anchor + "'"); } else { GameObject val2 = new GameObject("IDRS_" + anchor); val2.transform.SetParent(val, false); val2.transform.localPosition = Vector3.zero; val2.transform.localRotation = Quaternion.identity; val2.transform.localScale = Vector3.one; list.Add(new NameTransformPair { name = anchor, transform = val2.transform }); } } } component.transformPairs = list.ToArray(); } private static Transform FindDeep(Transform root, string childName) { if (((Object)root).name == childName) { return root; } for (int i = 0; i < root.childCount; i++) { Transform val = FindDeep(root.GetChild(i), childName); if (Object.op_Implicit((Object)(object)val)) { return val; } } return null; } } public static class BastionBuffs { public static BuffDef turretRootDef; public static BuffDef redLightsDef; public static BuffDef tankDef; public static void Init(AssetBundle assetBundle) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) turretRootDef = Content.CreateAndAddBuff("BastionTurretBuff", LegacyResourcesAPI.Load("BuffDefs/HiddenInvincibility").iconSprite, Color.blue, canStack: false, isDebuff: false); redLightsDef = Content.CreateAndAddBuff("BastionRedLightsBuff", LegacyResourcesAPI.Load("BuffDefs/HiddenInvincibility").iconSprite, Color.red, canStack: false, isDebuff: false); redLightsDef.isHidden = true; tankDef = Content.CreateAndAddBuff("BastionTankBuff", LegacyResourcesAPI.Load("BuffDefs/HiddenInvincibility").iconSprite, new Color(0.82f, 0.6f, 1f), canStack: false, isDebuff: false); tankDef.isHidden = true; } } internal static class BastionCasings { internal enum Kind { Rifle, Minigun, Shotgun, Sniper, Cannon } private struct Spec { public float radius; public float length; public float back; public Color color; public bool big; } internal class Casing : MonoBehaviour { private MeshRenderer meshRenderer; private Rigidbody body; private Vector3 fullScale; private float age; private bool big; private bool clinked; internal void Bind(MeshRenderer renderer, Rigidbody rigidbody) { meshRenderer = renderer; body = rigidbody; } internal void Launch(Kind kind, float radius, float length, bool isBig, Material material, Vector3 position, Quaternion rotation, Vector3 velocity) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003e: 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_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) big = isBig; age = 0f; clinked = false; fullScale = new Vector3(radius, length, radius); ((Component)this).transform.SetPositionAndRotation(position, rotation); ((Component)this).transform.localScale = fullScale; ((Renderer)meshRenderer).sharedMaterial = material; ((Component)this).gameObject.SetActive(true); body.velocity = velocity; body.angularVelocity = Random.insideUnitSphere * 25f; } private void Update() { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) age += Time.deltaTime; if (age >= 3.5f) { ((Component)this).gameObject.SetActive(false); } else if (age > 3.2f) { ((Component)this).transform.localScale = fullScale * ((3.5f - age) / 0.3f); } } private void OnCollisionEnter(Collision collision) { if (!clinked) { clinked = true; if (BastionConfig.casingSounds != null && BastionConfig.casingSounds.Value && !(Time.time - lastClinkTime < 0.07f)) { lastClinkTime = Time.time; Util.PlaySound(big ? "Play_commando_M2_grenade_bounce" : "Play_bandit2_m1_reload_bullet", ((Component)this).gameObject); } } } } private static readonly Color Brass = new Color(0.8f, 0.6f, 0.24f); private static readonly Spec[] Specs = new Spec[5] { new Spec { radius = 0.022f, length = 0.085f, back = 0.45f, color = Brass }, new Spec { radius = 0.02f, length = 0.075f, back = 0.95f, color = Brass }, new Spec { radius = 0.03f, length = 0.1f, back = 0.45f, color = new Color(0.62f, 0.1f, 0.08f) }, new Spec { radius = 0.026f, length = 0.13f, back = 0.45f, color = Brass }, new Spec { radius = 0.075f, length = 0.3f, back = 1.1f, color = new Color(0.66f, 0.5f, 0.22f), big = true } }; private const int MaxCasings = 96; private const float Lifetime = 3.5f; private const float FadeTime = 0.3f; private const float MaxViewDistance = 70f; private const float ClinkGap = 0.07f; private static readonly List pool = new List(); private static int recycleCursor; private static Mesh mesh; private static PhysicMaterial bounce; private static readonly Material[] materials = (Material[])(object)new Material[5]; private static float lastClinkTime; internal static void Eject(CharacterBody body, string muzzleName, Kind kind) { //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_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_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: 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_0143: 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_014a: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0134: 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_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_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0193: 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_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: 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_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0217: 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_024c: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)body) || Application.isBatchMode || BastionConfig.casings == null || !BastionConfig.casings.Value || body.skinIndex == 6) { return; } ModelLocator modelLocator = body.modelLocator; Transform val = (Object.op_Implicit((Object)(object)modelLocator) ? modelLocator.modelTransform : null); ChildLocator val2 = (Object.op_Implicit((Object)(object)val) ? ((Component)val).GetComponent() : null); Transform val3 = (Object.op_Implicit((Object)(object)val2) ? val2.FindChild(muzzleName) : null); if (!Object.op_Implicit((Object)(object)val3)) { return; } Camera main = Camera.main; if (Object.op_Implicit((Object)(object)main)) { Vector3 val4 = ((Component)main).transform.position - val3.position; if (((Vector3)(ref val4)).sqrMagnitude > 4900f) { return; } } Spec spec = Specs[(int)kind]; Vector3 corePosition = body.corePosition; Vector3 val5 = ((!spec.big && Object.op_Implicit((Object)(object)body.inputBank)) ? body.inputBank.aimDirection : (val3.position - corePosition)); if (((Vector3)(ref val5)).sqrMagnitude < 0.0001f) { val5 = val.forward; } ((Vector3)(ref val5)).Normalize(); Vector3 val6 = Vector3.Cross(Vector3.up, val5); if (((Vector3)(ref val6)).sqrMagnitude < 0.0001f) { val6 = val.right; } ((Vector3)(ref val6)).Normalize(); if (Vector3.Dot(val3.position - corePosition, val6) < -0.05f) { val6 = -val6; } Vector3 position = val3.position - val5 * spec.back + val6 * (spec.radius * 2f); Vector3 val7 = val6 * Random.Range(2f, 3.2f) + Vector3.up * Random.Range(1.8f, 3f) - val5 * Random.Range(0f, 0.8f); if (spec.big) { val7 *= 0.7f; } if (Object.op_Implicit((Object)(object)body.characterMotor)) { val7 += body.characterMotor.velocity; } Casing casing = Take(); if (Object.op_Implicit((Object)(object)casing)) { casing.Launch(kind, spec.radius, spec.length, spec.big, GetMaterial(kind), position, Random.rotation, val7); } } private static Casing Take() { //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Expected O, but got Unknown //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00de: 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_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Expected O, but got Unknown //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013b: 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_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Expected O, but got Unknown for (int num = pool.Count - 1; num >= 0; num--) { if (!Object.op_Implicit((Object)(object)pool[num])) { pool.RemoveAt(num); } } foreach (Casing item in pool) { if (!((Component)item).gameObject.activeSelf) { return item; } } if (pool.Count >= 96) { recycleCursor = (recycleCursor + 1) % pool.Count; return pool[recycleCursor]; } if ((Object)Materials.hotpoo == (Object)null) { return null; } GameObject val = new GameObject("BastionCasing") { layer = LayerIndex.debris.intVal }; val.AddComponent().sharedMesh = GetMesh(); MeshRenderer val2 = val.AddComponent(); ((Renderer)val2).shadowCastingMode = (ShadowCastingMode)0; CapsuleCollider obj = val.AddComponent(); obj.direction = 1; obj.radius = 1f; obj.height = 1f; if ((Object)bounce == (Object)null) { bounce = new PhysicMaterial("BastionCasing") { bounciness = 0.35f, dynamicFriction = 0.6f, staticFriction = 0.6f }; } ((Collider)obj).sharedMaterial = bounce; Rigidbody val3 = val.AddComponent(); val3.mass = 0.1f; val3.drag = 0.2f; val3.angularDrag = 1f; val3.maxAngularVelocity = 40f; Casing casing = val.AddComponent(); casing.Bind(val2, val3); pool.Add(casing); return casing; } private static Material GetMaterial(Kind kind) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_004f: Unknown result type (might be due to invalid IL or missing references) Material val = materials[(int)kind]; if ((Object)val == (Object)null) { val = new Material(Materials.hotpoo); ((Object)val).name = "matBastionCasing" + kind; val.SetColor("_Color", Specs[(int)kind].color); val.SetFloat("_EmPower", 0f); val.SetFloat("_SpecularStrength", 0.6f); val.SetFloat("_SpecularExponent", 8f); materials[(int)kind] = val; } return val; } private static Mesh GetMesh() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: 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_0198: 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_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: 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_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: 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_01c7: 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_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: 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_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: 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_023a: Expected O, but got Unknown //IL_0126: Unknown result type (might be due to invalid IL or missing references) if ((Object)mesh != (Object)null) { return mesh; } List list = new List(); List list2 = new List(); for (int i = 0; i < 8; i++) { float num = MathF.PI * 2f * (float)i / 8f; float num2 = Mathf.Cos(num); float num3 = Mathf.Sin(num); list.Add(new Vector3(num2, -0.5f, num3)); list.Add(new Vector3(num2, 0.5f, num3)); } for (int j = 0; j < 8; j++) { int num4 = (j + 1) % 8; list2.AddRange(new int[6] { 2 * j, 2 * j + 1, 2 * num4 + 1, 2 * j, 2 * num4 + 1, 2 * num4 }); } for (int k = 0; k < 2; k++) { float num5 = ((k == 0) ? (-0.5f) : 0.5f); int count = list.Count; list.Add(new Vector3(0f, num5, 0f)); for (int l = 0; l < 8; l++) { float num6 = MathF.PI * 2f * (float)l / 8f; list.Add(new Vector3(Mathf.Cos(num6), num5, Mathf.Sin(num6))); } for (int m = 0; m < 8; m++) { list2.AddRange(new int[3] { count, count + 1 + m, count + 1 + (m + 1) % 8 }); } } for (int n = 0; n < list2.Count; n += 3) { Vector3 val = list[list2[n]]; Vector3 val2 = list[list2[n + 1]]; Vector3 val3 = list[list2[n + 2]]; if (Vector3.Dot(Vector3.Cross(val2 - val, val3 - val), val + val2 + val3) < 0f) { int value = list2[n + 1]; list2[n + 1] = list2[n + 2]; list2[n + 2] = value; } } mesh = new Mesh(); ((Object)mesh).name = "BastionCasing"; mesh.SetVertices(list); mesh.SetTriangles(list2, 0); mesh.RecalculateNormals(); mesh.RecalculateBounds(); return mesh; } } internal static class BastionCompat { private const string BetterUIGuid = "com.xoxfaby.BetterUI"; internal static void Init() { try { AddBetterUIProcCoefficients(); } catch (Exception ex) { Log.Warning("BetterUI proc coefficients not registered: " + ex.Message); } } private static void AddBetterUIProcCoefficients() { MethodInfo addSkill; string prefix; if (Chainloader.PluginInfos.TryGetValue("com.xoxfaby.BetterUI", out var value) && Object.op_Implicit((Object)(object)value.Instance)) { Type type = ((object)value.Instance).GetType().Assembly.GetType("BetterUI.ProcCoefficientCatalog"); addSkill = ((type != null) ? type.GetMethod("AddSkill", new Type[3] { typeof(string), typeof(string), typeof(float) }) : null); if (addSkill == null) { Log.Warning("BetterUI is installed but ProcCoefficientCatalog.AddSkill(string, string, float) was not found."); return; } prefix = "HASTEREAPR_BASTION_"; Add("PRIMARY_RECON_NAME", "PROC_BULLET", new Primary().procCoef); Add("PRIMARY_RECON_SNIPER_NAME", "PROC_BULLET", new SniperPrimary().procCoef); Add("PRIMARY_RECON_SHOTGUN_NAME", "PROC_PELLET", new ShotgunPrimary().procCoef); Add("PRIMARY_ASSAULT_NAME", "PROC_BULLET", new AssaultPrimary().procCoef); Add("PRIMARY_BOMBARD_NAME", "PROC_SHELL", new BombardPrimary().procCoef); Add("PRIMARY_ARTILLERY_NAME", "PROC_SHELL", new ArtilleryPrimary().procCoef); Add("PRIMARY_DRONE_NAME", "PROC_SHELL", new ArtilleryDronePrimary().procCoef); } void Add(string skill, string proc, float coefficient) { addSkill.Invoke(null, new object[3] { prefix + skill, prefix + proc, coefficient }); } } } public static class BastionConfig { public static ConfigEntry harvyMode; public static ConfigEntry shotgunCycle; public static ConfigEntry grenadeCooldown; public static ConfigEntry grenadeKnockForce; public static ConfigEntry artilleryCooldown; public static ConfigEntry heatDecayTime; public static ConfigEntry igniteHeatThreshold; public static ConfigEntry igniteChance; public static ConfigEntry unlockAllSkins; public static ConfigEntry startWithScepter; public static ConfigEntry casings; public static ConfigEntry casingSounds; public static ConfigEntry deployedHitSound; public static ConfigEntry baseHealth; public static ConfigEntry healthGrowth; public static ConfigEntry baseRegen; public static ConfigEntry baseArmor; public static ConfigEntry baseDamage; public static ConfigEntry damageGrowth; public static ConfigEntry baseMoveSpeed; public static ConfigEntry baseCrit; public static float Stat(ConfigEntry entry, float fallback) { return entry?.Value ?? fallback; } public static void Init() { harvyMode = Config.BindAndOptions("Bastion", "Harvy Mode", defaultValue: false, "Overwatch-faithful tweaks: Operation : Repair has no duration cap - hold to keep healing until you cancel it."); unlockAllSkins = Config.BindAndOptions("Bastion", "Unlock All Skins", defaultValue: false, "Makes every BAS-10 skin selectable without earning its achievement (for testing and previewing). Requires restart.", restartRequired: true); startWithScepter = Config.BindAndOptions("Bastion", "Start With Ancient Scepter", defaultValue: false, "Player-controlled BAS-10s are given an Ancient Scepter when they spawn, if they have none - for trying the tank forms. Needs the Ancient Scepter mod installed. Host's setting."); casings = Config.BindAndOptions("Bastion - Effects", "Shell Casings", defaultValue: true, "His weapons throw out spent casings that bounce on the ground. Cosmetic; each player's own setting."); casingSounds = Config.BindAndOptions("Bastion - Effects", "Casing Sounds", defaultValue: true, "Spent casings clink when they land."); deployedHitSound = Config.BindAndOptions("Bastion - Effects", "Deployed Hit Sound", defaultValue: true, "Hits on a deployed BAS-10 ring off his armour."); baseHealth = Config.BindAndOptions("Bastion - Stats", "Base Health", 175f, "Maximum health at level 1.", restartRequired: true); healthGrowth = Config.BindAndOptions("Bastion - Stats", "Health Growth", 25f, "Maximum health gained per level.", restartRequired: true); baseRegen = Config.BindAndOptions("Bastion - Stats", "Base Health Regen", 1.5f, "Health regenerated per second at level 1.", restartRequired: true); baseArmor = Config.BindAndOptions("Bastion - Stats", "Base Armor", 5f, "Armor in recon form. Deployed forms add their own on top.", restartRequired: true); baseDamage = Config.BindAndOptions("Bastion - Stats", "Base Damage", 12f, "Base damage at level 1.", restartRequired: true); damageGrowth = Config.BindAndOptions("Bastion - Stats", "Damage Growth", 2.4f, "Base damage gained per level.", restartRequired: true); baseMoveSpeed = Config.BindAndOptions("Bastion - Stats", "Base Movement Speed", 8f, "Movement speed in recon form.", restartRequired: true); baseCrit = Config.BindAndOptions("Bastion - Stats", "Base Crit", 1f, "Critical strike chance in percent.", restartRequired: true); shotgunCycle = Config.BindAndOptions("Bastion - Balance", "Shotgun Cycle Time", 0.65f, "Seconds between Riot Shotgun shots (before attack speed)."); grenadeCooldown = Config.BindAndOptions("Bastion - Balance", "Concussion Charge Cooldown", 5f, "Concussion Charge cooldown in seconds. Requires restart."); grenadeKnockForce = Config.BindAndOptions("Bastion - Balance", "Concussion Charge Knockback", 8000f, "Self-knockback force of the Concussion Charge blast (grenade-jump strength)."); artilleryCooldown = Config.BindAndOptions("Bastion - Balance", "Artillery Cooldown", 12f, "Cooldown of Configuration : Artillery and Configuration : Deploy in seconds. Requires restart."); heatDecayTime = Config.BindAndOptions("Bastion - Balance", "Heat Decay Time", 5f, "Seconds for the gun barrel to cool from max heat to cold."); igniteHeatThreshold = Config.BindAndOptions("Bastion - Balance", "Overheat Threshold", 0.95f, "Heat level (0-1) at which the barrel counts as overheated: minigun bullets can ignite and the barrel vents smoke."); igniteChance = Config.BindAndOptions("Bastion - Balance", "Overheat Ignite Chance", 20f, "Percent chance per minigun bullet to ignite enemies while the barrel is overheated. 0 disables."); BastionEmotes.InitConfig(); } } internal static class BastionCrosshairs { private static readonly Dictionary keys = new Dictionary { { typeof(ShotgunPrimary), RoR2_Base_Bandit2.Bandit2Crosshair_prefab }, { typeof(SniperPrimary), RoR2_Base_UI.SimpleDotCrosshair_prefab }, { typeof(AssaultPrimary), RoR2_Base_Toolbot.SMGCrosshair_prefab }, { typeof(BombardPrimary), RoR2_Base_Toolbot.ToolbotGrenadeLauncherCrosshair_prefab }, { typeof(ArtilleryPrimary), RoR2_Base_UI.WideBracketCrosshair_prefab }, { typeof(ArtilleryDronePrimary), RoR2_Base_UI.WideBracketCrosshair_prefab } }; private static readonly Dictionary loaded = new Dictionary(); internal static GameObject For(SkillDef primary) { //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) Type type = (Object.op_Implicit((Object)(object)primary) ? ((SerializableEntityStateType)(ref primary.activationState)).stateType : null); if (type == null || !keys.TryGetValue(type, out var value)) { return null; } if (!loaded.TryGetValue(type, out var value2)) { try { value2 = Addressables.LoadAssetAsync((object)value).WaitForCompletion(); } catch (Exception ex) { Log.Warning("Crosshair for " + type.Name + " could not be loaded: " + ex.Message); } loaded[type] = value2; } return value2; } } public static class BastionEmotes { public const int Rest = 0; public const int Dance = 1; public const int Bird = 2; private static readonly string[] names = new string[3] { "rest", "dance", "bird" }; private static readonly BastionEmoteClip[] clips = new BastionEmoteClip[3]; private static readonly bool[] loaded = new bool[3]; public static ConfigEntry[] keys; public static void InitConfig() { //IL_001b: 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_005b: Unknown result type (might be due to invalid IL or missing references) string section = "Bastion - Emotes"; keys = new ConfigEntry[3] { Config.BindAndOptions(section, "Rest", new KeyboardShortcut((KeyCode)49, Array.Empty()), "Key for the Rest emote: BAS-10 settles down and powers off until you move."), Config.BindAndOptions(section, "Robot Dance", new KeyboardShortcut((KeyCode)50, Array.Empty()), "Key for the Robot Dance emote."), Config.BindAndOptions(section, "Bird Moment", new KeyboardShortcut((KeyCode)51, Array.Empty()), "Key for the Bird Moment emote: BAS-10 holds out his hand and his Jade Thrinch perches on it.") }; } public static int PressedEmote() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) if (keys == null) { return -1; } for (int i = 0; i < keys.Length; i++) { if (Config.GetKeyPressed(keys[i].Value)) { return i; } } return -1; } public static BastionEmoteClip GetClip(int index) { if (index < 0 || index >= names.Length) { return null; } if (!loaded[index]) { loaded[index] = true; try { clips[index] = BastionEmoteClip.Load(names[index]); } catch (Exception ex) { Log.Error("Emote '" + names[index] + "' failed to load — " + ex); } } return clips[index]; } } public class BastionEmoteClip { public float fps; public int introFrames; public int loopFrames; public string[] bonePaths; public Vector3[] positions; public Quaternion[] rotations; public Vector3[] scales; public Vector3[] anchorPositions; public Quaternion[] anchorRotations; public bool[] hasAnchor; public int frameCount => introFrames + loopFrames; public void Sample(float time, out int a, out int b, out float t) { float num = Mathf.Max(0f, time) * fps; if (num < (float)introFrames) { a = Mathf.FloorToInt(num); b = Mathf.Min(a + 1, frameCount - 1); t = num - (float)a; } else { float num2 = Mathf.Repeat(num - (float)introFrames, (float)loopFrames); int num3 = Mathf.Min(Mathf.FloorToInt(num2), loopFrames - 1); a = introFrames + num3; b = introFrames + (num3 + 1) % loopFrames; t = num2 - (float)num3; } } public static BastionEmoteClip Load(string name) { //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0156: 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_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_0230: 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_0255: 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_027f: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) using Stream stream = typeof(BastionEmoteClip).Assembly.GetManifestResourceStream("BastionMod.Emotes." + name + ".emote"); if (stream == null) { throw new FileNotFoundException("embedded emote missing: " + name); } using GZipStream gZipStream = new GZipStream(stream, CompressionMode.Decompress); using MemoryStream memoryStream = new MemoryStream(); gZipStream.CopyTo(memoryStream); memoryStream.Position = 0L; using BinaryReader binaryReader = new BinaryReader(memoryStream); if (new string(binaryReader.ReadChars(4)) != "BEM1") { throw new InvalidDataException("bad emote header"); } BastionEmoteClip bastionEmoteClip = new BastionEmoteClip(); bastionEmoteClip.fps = binaryReader.ReadSingle(); bastionEmoteClip.introFrames = binaryReader.ReadInt32(); bastionEmoteClip.loopFrames = binaryReader.ReadInt32(); int num = binaryReader.ReadInt32(); bastionEmoteClip.bonePaths = new string[num]; for (int i = 0; i < num; i++) { bastionEmoteClip.bonePaths[i] = Encoding.UTF8.GetString(binaryReader.ReadBytes(binaryReader.ReadUInt16())); } int num2 = bastionEmoteClip.frameCount; bastionEmoteClip.positions = (Vector3[])(object)new Vector3[num2 * num]; bastionEmoteClip.rotations = (Quaternion[])(object)new Quaternion[num2 * num]; bastionEmoteClip.scales = (Vector3[])(object)new Vector3[num2 * num]; for (int j = 0; j < num2 * num; j++) { bastionEmoteClip.positions[j] = new Vector3(binaryReader.ReadSingle(), binaryReader.ReadSingle(), binaryReader.ReadSingle()); bastionEmoteClip.rotations[j] = new Quaternion(binaryReader.ReadSingle(), binaryReader.ReadSingle(), binaryReader.ReadSingle(), binaryReader.ReadSingle()); bastionEmoteClip.scales[j] = new Vector3(binaryReader.ReadSingle(), binaryReader.ReadSingle(), binaryReader.ReadSingle()); } bastionEmoteClip.anchorPositions = (Vector3[])(object)new Vector3[num2]; bastionEmoteClip.anchorRotations = (Quaternion[])(object)new Quaternion[num2]; bastionEmoteClip.hasAnchor = new bool[num2]; Vector3 val = default(Vector3); Quaternion val2 = default(Quaternion); for (int k = 0; k < num2; k++) { ((Vector3)(ref val))..ctor(binaryReader.ReadSingle(), binaryReader.ReadSingle(), binaryReader.ReadSingle()); ((Quaternion)(ref val2))..ctor(binaryReader.ReadSingle(), binaryReader.ReadSingle(), binaryReader.ReadSingle(), binaryReader.ReadSingle()); bastionEmoteClip.hasAnchor[k] = !float.IsNaN(val.x); bastionEmoteClip.anchorPositions[k] = (bastionEmoteClip.hasAnchor[k] ? val : Vector3.zero); bastionEmoteClip.anchorRotations[k] = (bastionEmoteClip.hasAnchor[k] ? val2 : Quaternion.identity); } return bastionEmoteClip; } } internal static class BastionHitboxDiag { private const float TargetWorldRadius = 0.6f; private const string CoreTransformName = "BastionCoreTransform"; private static bool hooked; private static bool logged; public static void Init() { if (!hooked) { hooked = true; CharacterBody.onBodyStartGlobal += OnBodyStart; } } private static void OnBodyStart(CharacterBody body) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009b: 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_00de: 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_0182: 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_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0137: 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_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_029d: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: 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_02df: Unknown result type (might be due to invalid IL or missing references) //IL_0305: Unknown result type (might be due to invalid IL or missing references) //IL_030a: Unknown result type (might be due to invalid IL or missing references) //IL_030e: Unknown result type (might be due to invalid IL or missing references) //IL_0324: Unknown result type (might be due to invalid IL or missing references) //IL_0329: Unknown result type (might be due to invalid IL or missing references) //IL_032d: Unknown result type (might be due to invalid IL or missing references) //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_039a: Unknown result type (might be due to invalid IL or missing references) //IL_03bc: Unknown result type (might be due to invalid IL or missing references) //IL_03dd: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)body) || body.bodyIndex != BastionPlugin.bodyIndex) { return; } HurtBoxGroup hurtBoxGroup = body.hurtBoxGroup; HurtBox val = (Object.op_Implicit((Object)(object)hurtBoxGroup) ? hurtBoxGroup.mainHurtBox : null); CapsuleCollider val2 = (Object.op_Implicit((Object)(object)val) ? ((Component)val).GetComponent() : null); if (!Object.op_Implicit((Object)(object)val2)) { if (!logged) { logged = true; Log.Warning("[BAS10_HITBOX] main hurtbox has no CapsuleCollider — cannot resize."); } return; } Transform transform = ((Component)val2).transform; Bounds bounds = ((Collider)val2).bounds; string text = F(transform.position); Bounds bounds2 = default(Bounds); bool flag = TryComputeVisibleBounds(body, out bounds2); float num = Mathf.Max(transform.lossyScale.x, transform.lossyScale.z); val2.direction = 1; val2.radius = 0.6f / Mathf.Max(0.0001f, num); if (flag) { Vector3 position = transform.position; position.y = ((Bounds)(ref bounds2)).center.y; transform.position = position; HurtboxAnchor hurtboxAnchor = ((Component)transform).GetComponent(); if ((Object)(object)hurtboxAnchor == (Object)null) { hurtboxAnchor = ((Component)transform).gameObject.AddComponent(); } hurtboxAnchor.anchoredLocalPosition = transform.localPosition; val2.center = transform.InverseTransformPoint(((Bounds)(ref bounds2)).center); val2.height = ((Bounds)(ref bounds2)).size.y / Mathf.Max(0.0001f, transform.lossyScale.y); } string text2 = (((Object)(object)body.coreTransform != (Object)null) ? (((Object)body.coreTransform).name + "@" + F(body.corePosition)) : "(null->transform.position)"); if (flag) { Transform val3 = body.coreTransform; if ((Object)(object)val3 == (Object)null || ((Object)val3).name != "BastionCoreTransform") { val3 = new GameObject("BastionCoreTransform").transform; val3.SetParent(body.transform, false); body.coreTransform = val3; } val3.localPosition = new Vector3(0f, ((Bounds)(ref bounds2)).center.y - body.transform.position.y, 0f); } else if ((Object)(object)body.coreTransform != (Object)null && ((Object)body.coreTransform).name != "BastionCoreTransform") { body.coreTransform = null; } if (!logged) { logged = true; Log.Warning("[BAS10_HITBOX] foot=" + F(body.transform.position) + " core=" + F(body.corePosition)); Log.Warning("[BAS10_HITBOX] visibleMesh " + (flag ? ("worldBounds c=" + F(((Bounds)(ref bounds2)).center) + " size=" + F(((Bounds)(ref bounds2)).size)) : "(no renderers found)")); Log.Warning("[BAS10_HITBOX] hurtbox BEFORE worldBounds c=" + F(((Bounds)(ref bounds)).center) + " size=" + F(((Bounds)(ref bounds)).size)); string[] obj = new string[12] { "[BAS10_HITBOX] hurtbox AFTER worldBounds c=", null, null, null, null, null, null, null, null, null, null, null }; Bounds bounds3 = ((Collider)val2).bounds; obj[1] = F(((Bounds)(ref bounds3)).center); obj[2] = " size="; bounds3 = ((Collider)val2).bounds; obj[3] = F(((Bounds)(ref bounds3)).size); obj[4] = " | local center="; obj[5] = F(val2.center); obj[6] = " h="; obj[7] = val2.height.ToString("F3"); obj[8] = " r="; obj[9] = val2.radius.ToString("F3"); obj[10] = " lossyScale="; obj[11] = F(transform.lossyScale); Log.Warning(string.Concat(obj)); Log.Warning("[BAS10_HITBOX] enemyAimPoint(hurtbox transform) BEFORE " + text + " -> AFTER " + F(transform.position)); Log.Warning("[BAS10_HITBOX] corePosition BEFORE " + text2 + " -> AFTER " + F(body.corePosition)); CharacterDeathBehavior component = ((Component)body).GetComponent(); ModelLocator modelLocator = body.modelLocator; Transform val4 = (Object.op_Implicit((Object)(object)modelLocator) ? modelLocator.modelTransform : null); RagdollController val5 = (Object.op_Implicit((Object)(object)val4) ? ((Component)val4).GetComponent() : null); int num2 = ((Object.op_Implicit((Object)(object)val5) && val5.bones != null) ? val5.bones.Length : (-1)); string text3 = (((Object)(object)component != (Object)null && ((SerializableEntityStateType)(ref component.deathState)).stateType != null) ? ((SerializableEntityStateType)(ref component.deathState)).stateType.FullName : "(none)"); Log.Warning("[BAS10_DEATH] ragdollController=" + Object.op_Implicit((Object)(object)val5) + " boneCount=" + num2 + " deathState=" + text3); } } private static bool TryComputeVisibleBounds(CharacterBody body, out Bounds bounds) { //IL_0001: 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_006b: 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) bounds = default(Bounds); ModelLocator modelLocator = body.modelLocator; Transform val = (Object.op_Implicit((Object)(object)modelLocator) ? modelLocator.modelTransform : null); if (!Object.op_Implicit((Object)(object)val)) { return false; } bool flag = false; Renderer[] componentsInChildren = ((Component)val).GetComponentsInChildren(); foreach (Renderer val2 in componentsInChildren) { if (val2 is SkinnedMeshRenderer || val2 is MeshRenderer) { SkinnedMeshRenderer val3 = (SkinnedMeshRenderer)(object)((val2 is SkinnedMeshRenderer) ? val2 : null); if (val3 != null) { val3.updateWhenOffscreen = true; } if (!flag) { bounds = val2.bounds; flag = true; } else { ((Bounds)(ref bounds)).Encapsulate(val2.bounds); } } } return flag; } private static string F(Vector3 v) { return "(" + v.x.ToString("F3") + "," + v.y.ToString("F3") + "," + v.z.ToString("F3") + ")"; } } internal class HurtboxAnchor : MonoBehaviour { public Vector3 anchoredLocalPosition; private void LateUpdate() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) ((Component)this).transform.localPosition = anchoredLocalPosition; } } public class BastionItemDisplays : ItemDisplaysBase { private static bool dumpedKeyMap; protected override void SetItemDisplayRules(List itemDisplayRules) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_014d: 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_0166: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: 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_01dd: 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_01ec: 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_0245: 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_0263: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Unknown result type (might be due to invalid IL or missing references) //IL_02da: 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_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_0329: Unknown result type (might be due to invalid IL or missing references) //IL_033d: Unknown result type (might be due to invalid IL or missing references) //IL_0351: Unknown result type (might be due to invalid IL or missing references) //IL_0356: Unknown result type (might be due to invalid IL or missing references) //IL_035b: Unknown result type (might be due to invalid IL or missing references) //IL_0360: Unknown result type (might be due to invalid IL or missing references) //IL_03a5: Unknown result type (might be due to invalid IL or missing references) //IL_03b9: Unknown result type (might be due to invalid IL or missing references) //IL_03cd: Unknown result type (might be due to invalid IL or missing references) //IL_03d2: Unknown result type (might be due to invalid IL or missing references) //IL_03d7: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_0421: Unknown result type (might be due to invalid IL or missing references) //IL_0435: Unknown result type (might be due to invalid IL or missing references) //IL_0449: Unknown result type (might be due to invalid IL or missing references) //IL_044e: Unknown result type (might be due to invalid IL or missing references) //IL_0453: Unknown result type (might be due to invalid IL or missing references) //IL_0458: Unknown result type (might be due to invalid IL or missing references) //IL_049d: Unknown result type (might be due to invalid IL or missing references) //IL_04b1: Unknown result type (might be due to invalid IL or missing references) //IL_04c5: Unknown result type (might be due to invalid IL or missing references) //IL_04ca: Unknown result type (might be due to invalid IL or missing references) //IL_04cf: Unknown result type (might be due to invalid IL or missing references) //IL_04d4: Unknown result type (might be due to invalid IL or missing references) //IL_0519: Unknown result type (might be due to invalid IL or missing references) //IL_052d: Unknown result type (might be due to invalid IL or missing references) //IL_0541: Unknown result type (might be due to invalid IL or missing references) //IL_0546: Unknown result type (might be due to invalid IL or missing references) //IL_054b: Unknown result type (might be due to invalid IL or missing references) //IL_0550: Unknown result type (might be due to invalid IL or missing references) //IL_0595: Unknown result type (might be due to invalid IL or missing references) //IL_05a9: Unknown result type (might be due to invalid IL or missing references) //IL_05bd: Unknown result type (might be due to invalid IL or missing references) //IL_05c2: Unknown result type (might be due to invalid IL or missing references) //IL_05c7: Unknown result type (might be due to invalid IL or missing references) //IL_05cc: Unknown result type (might be due to invalid IL or missing references) //IL_0611: Unknown result type (might be due to invalid IL or missing references) //IL_0625: Unknown result type (might be due to invalid IL or missing references) //IL_0639: Unknown result type (might be due to invalid IL or missing references) //IL_063e: Unknown result type (might be due to invalid IL or missing references) //IL_0643: Unknown result type (might be due to invalid IL or missing references) //IL_0648: Unknown result type (might be due to invalid IL or missing references) //IL_068d: Unknown result type (might be due to invalid IL or missing references) //IL_06a1: Unknown result type (might be due to invalid IL or missing references) //IL_06b5: Unknown result type (might be due to invalid IL or missing references) //IL_06ba: Unknown result type (might be due to invalid IL or missing references) //IL_06bf: Unknown result type (might be due to invalid IL or missing references) //IL_06c4: Unknown result type (might be due to invalid IL or missing references) //IL_0709: Unknown result type (might be due to invalid IL or missing references) //IL_071d: Unknown result type (might be due to invalid IL or missing references) //IL_0731: Unknown result type (might be due to invalid IL or missing references) //IL_0736: Unknown result type (might be due to invalid IL or missing references) //IL_073b: Unknown result type (might be due to invalid IL or missing references) //IL_0740: Unknown result type (might be due to invalid IL or missing references) //IL_0785: Unknown result type (might be due to invalid IL or missing references) //IL_0799: Unknown result type (might be due to invalid IL or missing references) //IL_07ad: Unknown result type (might be due to invalid IL or missing references) //IL_07b2: Unknown result type (might be due to invalid IL or missing references) //IL_07b7: Unknown result type (might be due to invalid IL or missing references) //IL_07bc: Unknown result type (might be due to invalid IL or missing references) //IL_0801: Unknown result type (might be due to invalid IL or missing references) //IL_0815: Unknown result type (might be due to invalid IL or missing references) //IL_0829: Unknown result type (might be due to invalid IL or missing references) //IL_082e: Unknown result type (might be due to invalid IL or missing references) //IL_0833: Unknown result type (might be due to invalid IL or missing references) //IL_0858: Unknown result type (might be due to invalid IL or missing references) //IL_086c: Unknown result type (might be due to invalid IL or missing references) //IL_0880: Unknown result type (might be due to invalid IL or missing references) //IL_0885: Unknown result type (might be due to invalid IL or missing references) //IL_088a: Unknown result type (might be due to invalid IL or missing references) //IL_088f: Unknown result type (might be due to invalid IL or missing references) //IL_08d4: Unknown result type (might be due to invalid IL or missing references) //IL_08e8: Unknown result type (might be due to invalid IL or missing references) //IL_08fc: Unknown result type (might be due to invalid IL or missing references) //IL_0901: Unknown result type (might be due to invalid IL or missing references) //IL_0906: Unknown result type (might be due to invalid IL or missing references) //IL_090b: Unknown result type (might be due to invalid IL or missing references) //IL_0950: Unknown result type (might be due to invalid IL or missing references) //IL_0964: Unknown result type (might be due to invalid IL or missing references) //IL_0978: Unknown result type (might be due to invalid IL or missing references) //IL_097d: Unknown result type (might be due to invalid IL or missing references) //IL_0982: Unknown result type (might be due to invalid IL or missing references) //IL_0987: Unknown result type (might be due to invalid IL or missing references) //IL_09cc: Unknown result type (might be due to invalid IL or missing references) //IL_09e0: Unknown result type (might be due to invalid IL or missing references) //IL_09f4: Unknown result type (might be due to invalid IL or missing references) //IL_09f9: Unknown result type (might be due to invalid IL or missing references) //IL_09fe: Unknown result type (might be due to invalid IL or missing references) //IL_0a03: Unknown result type (might be due to invalid IL or missing references) //IL_0a48: Unknown result type (might be due to invalid IL or missing references) //IL_0a5c: Unknown result type (might be due to invalid IL or missing references) //IL_0a70: Unknown result type (might be due to invalid IL or missing references) //IL_0a75: Unknown result type (might be due to invalid IL or missing references) //IL_0a7a: Unknown result type (might be due to invalid IL or missing references) //IL_0a7f: Unknown result type (might be due to invalid IL or missing references) //IL_0ac4: Unknown result type (might be due to invalid IL or missing references) //IL_0ad8: Unknown result type (might be due to invalid IL or missing references) //IL_0aec: Unknown result type (might be due to invalid IL or missing references) //IL_0af1: Unknown result type (might be due to invalid IL or missing references) //IL_0af6: Unknown result type (might be due to invalid IL or missing references) //IL_0afb: Unknown result type (might be due to invalid IL or missing references) //IL_0b40: Unknown result type (might be due to invalid IL or missing references) //IL_0b54: Unknown result type (might be due to invalid IL or missing references) //IL_0b68: Unknown result type (might be due to invalid IL or missing references) //IL_0b6d: Unknown result type (might be due to invalid IL or missing references) //IL_0b72: Unknown result type (might be due to invalid IL or missing references) //IL_0b77: Unknown result type (might be due to invalid IL or missing references) //IL_0bbc: Unknown result type (might be due to invalid IL or missing references) //IL_0bd0: Unknown result type (might be due to invalid IL or missing references) //IL_0be4: Unknown result type (might be due to invalid IL or missing references) //IL_0be9: Unknown result type (might be due to invalid IL or missing references) //IL_0bee: Unknown result type (might be due to invalid IL or missing references) //IL_0bf3: Unknown result type (might be due to invalid IL or missing references) //IL_0c38: Unknown result type (might be due to invalid IL or missing references) //IL_0c4c: Unknown result type (might be due to invalid IL or missing references) //IL_0c60: Unknown result type (might be due to invalid IL or missing references) //IL_0c65: Unknown result type (might be due to invalid IL or missing references) //IL_0c6a: Unknown result type (might be due to invalid IL or missing references) //IL_0c6f: Unknown result type (might be due to invalid IL or missing references) //IL_0cb4: Unknown result type (might be due to invalid IL or missing references) //IL_0cc8: Unknown result type (might be due to invalid IL or missing references) //IL_0cdc: Unknown result type (might be due to invalid IL or missing references) //IL_0ce1: Unknown result type (might be due to invalid IL or missing references) //IL_0ce6: Unknown result type (might be due to invalid IL or missing references) //IL_0ceb: Unknown result type (might be due to invalid IL or missing references) //IL_0d30: Unknown result type (might be due to invalid IL or missing references) //IL_0d44: Unknown result type (might be due to invalid IL or missing references) //IL_0d58: Unknown result type (might be due to invalid IL or missing references) //IL_0d5d: Unknown result type (might be due to invalid IL or missing references) //IL_0d62: Unknown result type (might be due to invalid IL or missing references) //IL_0d67: Unknown result type (might be due to invalid IL or missing references) //IL_0dac: Unknown result type (might be due to invalid IL or missing references) //IL_0dc0: Unknown result type (might be due to invalid IL or missing references) //IL_0dd4: Unknown result type (might be due to invalid IL or missing references) //IL_0dd9: Unknown result type (might be due to invalid IL or missing references) //IL_0dde: Unknown result type (might be due to invalid IL or missing references) //IL_0de3: Unknown result type (might be due to invalid IL or missing references) //IL_0e28: Unknown result type (might be due to invalid IL or missing references) //IL_0e3c: Unknown result type (might be due to invalid IL or missing references) //IL_0e50: Unknown result type (might be due to invalid IL or missing references) //IL_0e55: Unknown result type (might be due to invalid IL or missing references) //IL_0e5a: Unknown result type (might be due to invalid IL or missing references) //IL_0e7f: Unknown result type (might be due to invalid IL or missing references) //IL_0e93: Unknown result type (might be due to invalid IL or missing references) //IL_0ea7: Unknown result type (might be due to invalid IL or missing references) //IL_0eac: Unknown result type (might be due to invalid IL or missing references) //IL_0eb1: Unknown result type (might be due to invalid IL or missing references) //IL_0eb6: Unknown result type (might be due to invalid IL or missing references) //IL_0efb: Unknown result type (might be due to invalid IL or missing references) //IL_0f0f: Unknown result type (might be due to invalid IL or missing references) //IL_0f23: Unknown result type (might be due to invalid IL or missing references) //IL_0f28: Unknown result type (might be due to invalid IL or missing references) //IL_0f2d: Unknown result type (might be due to invalid IL or missing references) //IL_0f32: Unknown result type (might be due to invalid IL or missing references) //IL_0f77: Unknown result type (might be due to invalid IL or missing references) //IL_0f8b: Unknown result type (might be due to invalid IL or missing references) //IL_0f9f: Unknown result type (might be due to invalid IL or missing references) //IL_0fa4: Unknown result type (might be due to invalid IL or missing references) //IL_0fa9: Unknown result type (might be due to invalid IL or missing references) //IL_0fae: Unknown result type (might be due to invalid IL or missing references) //IL_0ff3: Unknown result type (might be due to invalid IL or missing references) //IL_1007: Unknown result type (might be due to invalid IL or missing references) //IL_101b: Unknown result type (might be due to invalid IL or missing references) //IL_1020: Unknown result type (might be due to invalid IL or missing references) //IL_1025: Unknown result type (might be due to invalid IL or missing references) //IL_102a: Unknown result type (might be due to invalid IL or missing references) //IL_106f: Unknown result type (might be due to invalid IL or missing references) //IL_1083: Unknown result type (might be due to invalid IL or missing references) //IL_1097: Unknown result type (might be due to invalid IL or missing references) //IL_109c: Unknown result type (might be due to invalid IL or missing references) //IL_10a1: Unknown result type (might be due to invalid IL or missing references) //IL_10a6: Unknown result type (might be due to invalid IL or missing references) //IL_10eb: Unknown result type (might be due to invalid IL or missing references) //IL_10ff: Unknown result type (might be due to invalid IL or missing references) //IL_1113: Unknown result type (might be due to invalid IL or missing references) //IL_1118: Unknown result type (might be due to invalid IL or missing references) //IL_111d: Unknown result type (might be due to invalid IL or missing references) //IL_1122: Unknown result type (might be due to invalid IL or missing references) //IL_1167: Unknown result type (might be due to invalid IL or missing references) //IL_117b: Unknown result type (might be due to invalid IL or missing references) //IL_118f: Unknown result type (might be due to invalid IL or missing references) //IL_1194: Unknown result type (might be due to invalid IL or missing references) //IL_1199: Unknown result type (might be due to invalid IL or missing references) //IL_119e: Unknown result type (might be due to invalid IL or missing references) //IL_11e3: Unknown result type (might be due to invalid IL or missing references) //IL_11f7: Unknown result type (might be due to invalid IL or missing references) //IL_120b: Unknown result type (might be due to invalid IL or missing references) //IL_1210: Unknown result type (might be due to invalid IL or missing references) //IL_1215: Unknown result type (might be due to invalid IL or missing references) //IL_121a: Unknown result type (might be due to invalid IL or missing references) SafeAdd("BFG", "DisplayBFG", "ShoulderL", new Vector3(-0.00112f, -0.00023f, -0.00105f), new Vector3(357.9245f, 86.66082f, 270.8715f), new Vector3(0.006f, 0.006f, 0.006f)); SafeAdd("Jetpack", "DisplayBugWings", "Back", new Vector3(-1E-05f, -0.00077f, -1E-05f), new Vector3(320.449f, 90.59616f, 179.8104f), new Vector3(0.01f, 0.002f, 0.002f)); AddFromBody("CommandoBody", "Crowdfunder", "Turret", new Vector3(-0.00034f, 0.00396f, 0.00962f), new Vector3(273.4358f, 179.3558f, 0.60108f), new Vector3(0.002f, 0.002f, 0.002f)); itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["ArmorPlate"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayRepulsionArmorPlate"), "Head", new Vector3(-0.00038f, 0.00362f, 0.00031f), new Vector3(348.1421f, 180f, 178.3234f), new Vector3(0.0045f, 0.0045f, 0.003f)))); itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["ArmorReductionOnHit"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayWarhammer"), "HandArm", new Vector3(-0.00051f, 0.00807f, 0.00565f), new Vector3(1E-05f, 0f, 90f), new Vector3(0.002f, 0.002f, 0.002f)))); itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["AttackSpeedOnCrit"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayWolfPelt"), "Head", new Vector3(-1E-05f, 0.00372f, 0.00054f), new Vector3(0f, 0f, 0f), new Vector3(0.007f, 0.007f, 0.007f)))); itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["Bandolier"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayBandolier"), "Chest", new Vector3(-0.00029f, 0.00037f, -0.00025f), new Vector3(1.91232f, 52.00823f, 1.3357f), new Vector3(0.009f, 0.011f, 0.011f)))); itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["BarrierOnOverHeal"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayAegis"), "GunArm", new Vector3(-0.00121f, 0.00424f, -0.00023f), new Vector3(276.2267f, 90.87523f, 179.0724f), new Vector3(0.003f, 0.003f, 0.004f)))); itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["Behemoth"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayBehemoth"), "GunArm", new Vector3(-0.00013f, 0.0059f, 0.00011f), new Vector3(0.10061f, 0.05675f, 180.0234f), new Vector3(0.0011f, 0.001f, 0.0011f)))); itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["BleedOnHit"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayTriTip"), "ArtilleryMuzzle", new Vector3(3E-05f, 0.00016f, 0f), new Vector3(270f, 0f, 0f), new Vector3(0.005f, 0.005f, 0.005f)))); itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["BounceNearby"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayHook"), "Back", new Vector3(0.00132f, -0.00201f, 0f), new Vector3(270f, 271.6931f, 0f), new Vector3(0.008f, 0.008f, 0.008f)))); itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["Clover"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayClover"), "Head", new Vector3(1E-05f, 0.00408f, 9E-05f), new Vector3(0f, 0f, 0f), new Vector3(0.008f, 0.008f, 0.008f)))); itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["CritDamage"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayLaserSight"), "Turret", new Vector3(0.00117f, 0.00584f, -0.00063f), new Vector3(0f, 180f, 0f), new Vector3(0.002f, 0.002f, 0.002f)))); itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["CritGlasses"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayGlasses"), "Turret", new Vector3(0.00223f, 0.00541f, -0.00051f), new Vector3(0f, 90f, 0f), new Vector3(0.0042f, 0.004f, 0.004f)))); itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["CritGlassesVoid"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayGlassesVoid"), "Head", new Vector3(-2E-05f, 0.00261f, 0.00129f), new Vector3(0f, 0f, 0f), new Vector3(0.0015f, 0.0028f, 0.002f)))); itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["Dagger"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayDagger"), "Chest", new Vector3(-0.00079f, 2E-05f, 0.0021f), new Vector3(270f, 270f, 0f), new Vector3(0.008f, 0.008f, 0.008f)))); itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["EquipmentMagazine"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayBattery"), "Chest", new Vector3(0.00107f, 0.00338f, 7E-05f), new Vector3(292.1796f, 85.54549f, 305.8578f), new Vector3(0.0032f, 0.0032f, 0.0018f)))); itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["FallBoots"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayGravBoots"), "FootL", new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0.007f, 0.007f, 0.007f)), ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayGravBoots"), "FootR", new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0.007f, 0.007f, 0.007f)))); itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["HealWhileSafe"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplaySnail"), "Chest", new Vector3(0.00089f, -3E-05f, -0.00195f), new Vector3(1.54873f, 12.65052f, 268.7562f), new Vector3(0.001f, 0.001f, 0.001f)))); itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["LunarPrimaryReplacement"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayBirdEye"), "Head", new Vector3(0f, 0.0027f, 0.00107f), new Vector3(277.3237f, 354.4643f, 5.18912f), new Vector3(0.0025f, 0.0025f, 0.0025f)))); itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["Mushroom"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayMushroom"), "ShoulderL", new Vector3(0.00045f, 0.00318f, -0.00214f), new Vector3(0f, 90f, 270f), new Vector3(0.001f, 0.001f, 0.001f)))); itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["MushroomVoid"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayMushroomVoid"), "ShoulderL", new Vector3(0.00045f, 0.00318f, -0.00214f), new Vector3(0f, 90f, 270f), new Vector3(0.001f, 0.001f, 0.001f)))); itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["PersonalShield"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayShieldGenerator"), "Chest", new Vector3(-0.00212f, 0.00268f, 3E-05f), new Vector3(11.91875f, 269.9003f, 179.9076f), new Vector3(0.002f, 0.002f, 0.002f)))); itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["Phasing"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayStealthkit"), "Pelvis", new Vector3(0.00143f, 0.0011f, 4E-05f), new Vector3(90f, 270f, 0f), new Vector3(0.0031f, 0.005f, 0.0031f)))); itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["ShockNearby"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayTeslaCoil"), "Pelvis", new Vector3(-0.00024f, 0.00034f, 0f), new Vector3(0f, 0f, 180f), new Vector3(0.0055f, 0.004f, 0.0055f)))); itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["UtilitySkillMagazine"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayAfterburnerShoulderRing"), "Turret", new Vector3(-0.0031f, 0.0041f, -0.0006f), new Vector3(0f, 0f, 270f), new Vector3(0.009f, 0.008f, 0.009f)))); itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["BossHunter"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayTricornGhost"), "Head", new Vector3(0.00012f, 0.00456f, 0.00075f), new Vector3(0f, 180f, 0f), new Vector3(0.008f, 0.008f, 0.008f)))); itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["BossHunterConsumed"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayTricornUsed"), "Head", new Vector3(0.00012f, 0.00456f, 0.00075f), new Vector3(0f, 180f, 0f), new Vector3(0.008f, 0.008f, 0.008f)))); itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["Cleanse"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayWaterPack"), "Back", new Vector3(-0.00594f, -0.00195f, 3E-05f), new Vector3(90f, 80f, 0f), new Vector3(0.0013f, 0.0013f, 0.0013f)))); itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["EliteFireEquipment"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayEliteHorn"), "Head", new Vector3(0.00023f, 0.00326f, 8E-05f), new Vector3(79.30444f, 229.0373f, 173.918f), new Vector3(0.001f, 0.001f, 0.001f)), ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayEliteHorn"), "Head", new Vector3(-5E-05f, 0.00342f, -0.00017f), new Vector3(79.99999f, 91.65634f, 180f), new Vector3(0.001f, 0.001f, 0.001f)))); itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["EliteHauntedEquipment"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayEliteStealthCrown"), "Head", new Vector3(-0.00011f, 0.00801f, -0.00039f), new Vector3(0f, 0f, 0f), new Vector3(0.001f, 0.001f, 0.001f)))); itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["EliteIceEquipment"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayEliteIceCrown"), "Head", new Vector3(-5E-05f, 0.00409f, -0.0002f), new Vector3(270f, 0f, 0f), new Vector3(0.0003f, 0.0003f, 0.0003f)))); itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["EliteLunarEquipment"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayEliteLunar,Eye"), "Head", new Vector3(-4E-05f, 0.00345f, -0.00197f), new Vector3(90f, 0f, 0f), new Vector3(0.008f, 0.009f, 0.008f)))); itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["ElitePoisonEquipment"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayEliteUrchinCrown"), "Head", new Vector3(-4E-05f, 0.00415f, -4E-05f), new Vector3(270f, 1E-05f, 0f), new Vector3(0.0005f, 0.0005f, 0.0005f)))); itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["QuestVolatileBattery"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayBatteryArray"), "Turret", new Vector3(-0.00027f, 0.00671f, -0.00064f), new Vector3(270f, 0f, 0f), new Vector3(0.0023f, 0.0023f, 0.0022f)))); itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["Saw"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplaySawmerangFollower"), "Chest", new Vector3(0.00197f, -0.01323f, -0.00353f), new Vector3(359.0983f, 264.1153f, 0.04938f), new Vector3(0.002f, 0.002f, 0.002f)))); itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets["Scanner"], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay("DisplayScanner"), "ShoulderR", new Vector3(0f, 0f, 0f), new Vector3(0f, 270f, 90f), new Vector3(0.004f, 0.004f, 0.004f)))); void AddFromBody(string bodyName, string keyName, string child, Vector3 pos, Vector3 rot, Vector3 scale) { //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_007b: 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_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: 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_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_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) try { GameObject val = LegacyResourcesAPI.Load("Prefabs/CharacterBodies/" + bodyName); object obj; if (!Object.op_Implicit((Object)(object)val)) { obj = null; } else { ModelLocator component = val.GetComponent(); obj = ((component == null) ? null : ((Component)component.modelTransform).GetComponent()?.itemDisplayRuleSet); } ItemDisplayRuleSet val2 = (ItemDisplayRuleSet)obj; if ((Object)(object)val2 == (Object)null) { Log.Warning("IDRS: " + bodyName + " has no IDRS for " + keyName); } else { KeyAssetRuleGroup[] keyAssetRuleGroups = val2.keyAssetRuleGroups; foreach (KeyAssetRuleGroup val3 in keyAssetRuleGroups) { Object val4 = ItemDisplays.ResolveKeyAsset(val3); if (Object.op_Implicit(val4) && val4.name == keyName && val3.displayRuleGroup.rules != null && val3.displayRuleGroup.rules.Length != 0) { itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(val4, ItemDisplays.CreateDisplayRule(ItemDisplays.ResolveFollower(val3.displayRuleGroup.rules[0]), child, pos, rot, scale))); return; } } Log.Warning("IDRS: '" + keyName + "' not found in " + bodyName + " IDRS"); } } catch (Exception ex) { Log.Warning("IDRS AddFromBody failed for " + keyName + ": " + ex.Message); } } void SafeAdd(string keyName, string displayPrefab, string child, Vector3 pos, Vector3 rot, Vector3 scale) { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) if (!ItemDisplays.KeyAssets.ContainsKey(keyName) || ItemDisplays.KeyAssets[keyName] == (Object)null) { Log.Warning("IDRS: key '" + keyName + "' not available (Loader doesn't display it) — skipped."); } else { itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets[keyName], ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay(displayPrefab), child, pos, rot, scale))); } } } private static void DumpKeyMap() { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) if (dumpedKeyMap) { return; } dumpedKeyMap = true; try { StringBuilder stringBuilder = new StringBuilder(); foreach (KeyValuePair keyAsset in ItemDisplays.KeyAssets) { string text = ""; if (ItemDisplays.KeyAssetDisplayPrefabs.TryGetValue(keyAsset.Value, out var value) && value != null) { ItemDisplayRule[] array = value; foreach (ItemDisplayRule val in array) { text = text + " " + (Object.op_Implicit((Object)(object)val.followerPrefab) ? ((Object)val.followerPrefab).name : "null"); } } stringBuilder.AppendLine(keyAsset.Key + " =>" + text); } File.WriteAllText("C:/Users/Overcash-PC/IdeaProjects/BastionRiskofRain2/idrs_keymap.txt", stringBuilder.ToString()); Log.Message("[BastionIDRS] wrote idrs_keymap.txt (" + ItemDisplays.KeyAssets.Count + " keys)"); } catch (Exception ex) { Log.Error("keymap dump failed: " + ex); } } } public static class BastionItems { [CompilerGenerated] private static class <>O { public static Action <0>__OnBodyStartGlobal; public static Action <1>__OnRunStartGlobal; public static StatHookEventHandler <2>__OnGetStatCoefficients; public static hook_CanBeAffordedByInteractor <3>__CanAffordBastionUnlock; public static hook_OnInteractionBegin <4>__GateBastionUnlock; public static hook_AddMessage_string <5>__SwallowBirdPingChat; } public static ItemDef ganymedeItem; private static bool hooked; private static readonly HashSet grantedStartingBirdMasterIds = new HashSet(); private const int iconSize = 256; private const float iconYaw = 70f; private const float iconZoom = 1f; private const float iconPoseTime = 0.2f; private const float iconLightIntensity = 1.4f; public static void Init() { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Expected O, but got Unknown //IL_013f: 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_014a: Expected O, but got Unknown //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Expected O, but got Unknown //IL_017f: 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_018a: Expected O, but got Unknown //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_01aa: Expected O, but got Unknown ganymedeItem = ScriptableObject.CreateInstance(); ((Object)ganymedeItem).name = "BASTION_GANYMEDE"; ganymedeItem.nameToken = "BASTION_GANYMEDE_NAME"; ganymedeItem.pickupToken = "BASTION_GANYMEDE_PICKUP"; ganymedeItem.descriptionToken = "BASTION_GANYMEDE_DESC"; ganymedeItem.loreToken = "BASTION_GANYMEDE_LORE"; ganymedeItem.deprecatedTier = (ItemTier)4; ItemDef obj = ganymedeItem; ItemTag[] array = new ItemTag[3]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); obj.tags = (ItemTag[])(object)array; ganymedeItem.canRemove = true; ganymedeItem.hidden = false; Sprite val = RenderIconFromPrefab(BastionAssets.ganymedePrefab); ganymedeItem.pickupIconSprite = (((Object)val != (Object)null) ? val : Asset.MainAssetBundle.LoadAsset("iconHeal")); ganymedeItem.pickupModelPrefab = BastionAssets.ganymedePrefab; Content.AddItemDef(ganymedeItem); if (!hooked) { hooked = true; CharacterBody.onBodyStartGlobal += OnBodyStartGlobal; Run.onRunStartGlobal += OnRunStartGlobal; object obj2 = <>O.<2>__OnGetStatCoefficients; if (obj2 == null) { StatHookEventHandler val2 = OnGetStatCoefficients; <>O.<2>__OnGetStatCoefficients = val2; obj2 = (object)val2; } RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)obj2; object obj3 = <>O.<3>__CanAffordBastionUnlock; if (obj3 == null) { hook_CanBeAffordedByInteractor val3 = CanAffordBastionUnlock; <>O.<3>__CanAffordBastionUnlock = val3; obj3 = (object)val3; } PurchaseInteraction.CanBeAffordedByInteractor += (hook_CanBeAffordedByInteractor)obj3; object obj4 = <>O.<4>__GateBastionUnlock; if (obj4 == null) { hook_OnInteractionBegin val4 = GateBastionUnlock; <>O.<4>__GateBastionUnlock = val4; obj4 = (object)val4; } PurchaseInteraction.OnInteractionBegin += (hook_OnInteractionBegin)obj4; object obj5 = <>O.<5>__SwallowBirdPingChat; if (obj5 == null) { hook_AddMessage_string val5 = SwallowBirdPingChat; <>O.<5>__SwallowBirdPingChat = val5; obj5 = (object)val5; } Chat.AddMessage_string += (hook_AddMessage_string)obj5; NetworkingAPI.RegisterMessageType(); } } private static bool CanAffordBastionUnlock(orig_CanBeAffordedByInteractor orig, PurchaseInteraction self, Interactor activator) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Expected O, but got Unknown if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)((Component)self).GetComponent())) { CharacterBody val = (Object.op_Implicit((Object)(object)activator) ? ((Component)activator).GetComponent() : null); if (Object.op_Implicit((Object)(object)val) && val.bodyIndex == BastionPlugin.bodyIndex) { return true; } if (HasBastionUnlocked(val)) { return true; } if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.inventory) && (Object)ganymedeItem != (Object)null) { return val.inventory.GetItemCountPermanent(ganymedeItem) > 0; } return false; } return orig.Invoke(self, activator); } private static void SwallowBirdPingChat(orig_AddMessage_string orig, string message) { if (!GanymedeFollower.SuppressVanillaPingChat) { orig.Invoke(message); } } internal static bool HasBastionUnlocked(CharacterBody body) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown if (!Object.op_Implicit((Object)(object)body) || (Object)BastionUnlockables.CharacterUnlock == (Object)null) { return false; } NetworkUser val = Util.LookUpBodyNetworkUser(body); if ((Object)(object)val != (Object)null) { return val.unlockables.Contains(BastionUnlockables.CharacterUnlock); } return false; } private static void GateBastionUnlock(orig_OnInteractionBegin orig, PurchaseInteraction self, Interactor activator) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Expected O, but got Unknown int num; object obj; if (Object.op_Implicit((Object)(object)self)) { num = (Object.op_Implicit((Object)(object)((Component)self).GetComponent()) ? 1 : 0); if (num != 0 && Object.op_Implicit((Object)(object)activator)) { obj = ((Component)activator).GetComponent(); goto IL_002a; } } else { num = 0; } obj = null; goto IL_002a; IL_002a: CharacterBody val = (CharacterBody)obj; orig.Invoke(self, activator); if (num != 0) { if (Object.op_Implicit((Object)(object)val) && val.bodyIndex != BastionPlugin.bodyIndex && Object.op_Implicit((Object)(object)val.inventory) && (Object)ganymedeItem != (Object)null && val.inventory.GetItemCountPermanent(ganymedeItem) > 0) { val.inventory.RemoveItemPermanent(ganymedeItem, 1); } if (NetworkServer.active) { self.SetAvailable(false); } } } private static void OnGetStatCoefficients(CharacterBody sender, StatHookEventArgs args) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown if (Object.op_Implicit((Object)(object)sender) && Object.op_Implicit((Object)(object)sender.inventory) && !((Object)ganymedeItem == (Object)null)) { int itemCount = sender.inventory.GetItemCount(ganymedeItem); if (itemCount > 0) { args.baseRegenAdd += 1f * (float)itemCount; args.armorAdd += 5f * (float)itemCount; args.baseDamageAdd += 2f * (float)itemCount; args.baseHealthAdd += 20f * (float)itemCount; args.baseMoveSpeedAdd += 0.4f * (float)itemCount; args.baseAttackSpeedAdd += 0.04f * (float)itemCount; } } } private static Sprite RenderIconFromPrefab(GameObject prefab) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_02e1: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: Expected O, but got Unknown //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_0300: Expected O, but got Unknown //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_003a: 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_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Expected O, but got Unknown //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: 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_0117: 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_015f: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_0299: 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_02b2: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Expected O, but got Unknown if ((Object)prefab == (Object)null) { return null; } GameObject val = null; RenderTexture val2 = null; RenderTexture active = RenderTexture.active; try { val = new GameObject("GanymedeIconRig"); val.transform.position = new Vector3(0f, 6000f, 0f); GameObject obj = Object.Instantiate(prefab, val.transform); obj.transform.localPosition = Vector3.zero; obj.transform.localRotation = Quaternion.Euler(0f, 70f, 0f); Animator componentInChildren = obj.GetComponentInChildren(); if ((Object)componentInChildren != (Object)null && (Object)BastionAssets.ganymedeController != (Object)null) { componentInChildren.runtimeAnimatorController = BastionAssets.ganymedeController; componentInChildren.Rebind(); componentInChildren.Update(0.2f); } Bounds val3 = ComputeRendererBounds(obj); Camera val4 = new GameObject("GanymedeIconCam").AddComponent(); ((Component)val4).transform.parent = val.transform; ((Behaviour)val4).enabled = false; val4.orthographic = true; val4.orthographicSize = Mathf.Max(new float[3] { ((Bounds)(ref val3)).extents.x, ((Bounds)(ref val3)).extents.y, ((Bounds)(ref val3)).extents.z }) * 1f; val4.clearFlags = (CameraClearFlags)2; val4.backgroundColor = new Color(0f, 0f, 0f, 0f); val4.nearClipPlane = 0.01f; val4.farClipPlane = 5000f; ((Component)val4).transform.position = ((Bounds)(ref val3)).center + new Vector3(0f, ((Bounds)(ref val3)).extents.y * 0.35f, -100f); ((Component)val4).transform.LookAt(((Bounds)(ref val3)).center); Light obj2 = new GameObject("GanymedeIconLight").AddComponent(); ((Component)obj2).transform.parent = val.transform; obj2.type = (LightType)1; ((Component)obj2).transform.rotation = Quaternion.Euler(35f, 35f, 0f); obj2.intensity = 1.4f; val2 = (val4.targetTexture = RenderTexture.GetTemporary(256, 256, 16, (RenderTextureFormat)0)); val4.Render(); RenderTexture.active = val2; Texture2D val5 = new Texture2D(256, 256, (TextureFormat)4, false); val5.ReadPixels(new Rect(0f, 0f, 256f, 256f), 0, 0); val5.Apply(); val4.targetTexture = null; return Sprite.Create(val5, new Rect(0f, 0f, 256f, 256f), new Vector2(0.5f, 0.5f)); } catch (Exception ex) { Log.Error("Ganymede icon render failed: " + ex); return null; } finally { RenderTexture.active = active; if ((Object)val2 != (Object)null) { RenderTexture.ReleaseTemporary(val2); } if ((Object)val != (Object)null) { Object.Destroy((Object)(object)val); } } } private static Bounds ComputeRendererBounds(GameObject go) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0063: 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) Renderer[] componentsInChildren = go.GetComponentsInChildren(); bool flag = false; Bounds bounds = default(Bounds); ((Bounds)(ref bounds))..ctor(go.transform.position, Vector3.zero); Renderer[] array = componentsInChildren; foreach (Renderer val in array) { if (val is SkinnedMeshRenderer || val is MeshRenderer) { SkinnedMeshRenderer val2 = (SkinnedMeshRenderer)(object)((val is SkinnedMeshRenderer) ? val : null); if (val2 != null) { val2.updateWhenOffscreen = true; } if (!flag) { bounds = val.bounds; flag = true; } else { ((Bounds)(ref bounds)).Encapsulate(val.bounds); } } } if (!flag) { return new Bounds(go.transform.position, Vector3.one); } return bounds; } private static void OnRunStartGlobal(Run run) { grantedStartingBirdMasterIds.Clear(); } private static void OnBodyStartGlobal(CharacterBody body) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Expected O, but got Unknown //IL_0066: 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) if (!Object.op_Implicit((Object)(object)body)) { return; } bool flag = Object.op_Implicit((Object)(object)body.inventory) && (Object)ganymedeItem != (Object)null && body.inventory.GetItemCount(ganymedeItem) > 0; if (NetworkServer.active && Object.op_Implicit((Object)(object)body.inventory) && (Object)ganymedeItem != (Object)null && body.bodyIndex == BastionPlugin.bodyIndex && !flag) { CharacterMaster master = body.master; int item = (Object.op_Implicit((Object)(object)master) ? ((Object)master).GetInstanceID() : ((Object)body).GetInstanceID()); if (grantedStartingBirdMasterIds.Add(item)) { body.inventory.GiveItem(ganymedeItem, 1); flag = true; } } if ((body.isPlayerControlled || flag) && !Object.op_Implicit((Object)(object)((Component)body).GetComponent())) { ((Component)body).gameObject.AddComponent(); } } } internal static class BastionModdedDisplayHider { private static readonly string[] hiddenItemNameFragments = new string[1] { "scepter" }; private static bool hooked; public static void Init() { if (!hooked) { hooked = true; Run.onRunStartGlobal += OnRunStartGlobal; } } private static void OnRunStartGlobal(Run run) { //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_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Invalid comparison between Unknown and I4 //IL_0010: 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_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Invalid comparison between Unknown and I4 //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Expected O, but got Unknown //IL_013c: 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) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Expected I4, but got Unknown //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) BodyIndex val = BodyCatalog.FindBodyIndex(BastionPlugin.bodyName); if ((int)val == -1) { return; } GameObject bodyPrefab = BodyCatalog.GetBodyPrefab(val); CharacterModel val2 = (Object.op_Implicit((Object)(object)bodyPrefab) ? bodyPrefab.GetComponentInChildren() : null); ItemDisplayRuleSet val3 = (Object.op_Implicit((Object)(object)val2) ? val2.itemDisplayRuleSet : null); if (!Object.op_Implicit((Object)(object)val3)) { return; } int itemCount = ItemCatalog.itemCount; for (ItemIndex val4 = (ItemIndex)0; (int)val4 < itemCount; val4 = (ItemIndex)(val4 + 1)) { ItemDef itemDef = ItemCatalog.GetItemDef(val4); if ((Object)itemDef == (Object)null || string.IsNullOrEmpty(((Object)itemDef).name)) { continue; } string text = ((Object)itemDef).name.ToLowerInvariant(); bool flag = false; string[] array = hiddenItemNameFragments; foreach (string value in array) { if (text.Contains(value)) { flag = true; break; } } if (flag) { val3.SetDisplayRuleGroup((Object)(object)itemDef, DisplayRuleGroup.empty); DisplayRuleGroup[] runtimeItemRuleGroups = val3.runtimeItemRuleGroups; int num = (int)itemDef.itemIndex; if (runtimeItemRuleGroups != null && num >= 0 && num < runtimeItemRuleGroups.Length) { runtimeItemRuleGroups[num] = DisplayRuleGroup.empty; } Log.Debug("IDRS: blanked modded item display '" + ((Object)itemDef).name + "' on " + BastionPlugin.bodyName + "."); } } } } internal static class BastionPurgeKit { internal class Piece { internal string name; internal Mesh mesh; internal Material material; internal bool stow; } private class Builder { internal readonly List positions = new List(); internal readonly List normals = new List(); internal readonly List tangents = new List(); internal readonly List uvs = new List(); internal readonly List weights = new List(); internal readonly List triangles = new List(); internal Mesh ToMesh(string name, bool hasTangents, Matrix4x4[] bindposes, Bounds bounds) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) Mesh val = new Mesh(); ((Object)val).name = name; val.indexFormat = (IndexFormat)(positions.Count > 65535); val.SetVertices(positions); val.SetNormals(normals); if (hasTangents) { val.SetTangents(tangents); } val.SetUVs(0, uvs); val.boneWeights = weights.ToArray(); val.bindposes = bindposes; val.SetTriangles(triangles, 0); val.bounds = bounds; val.UploadMeshData(true); return val; } } internal const string BodyRecipe = "purge.kit.bin"; private static readonly Dictionary> cache = new Dictionary>(); internal static List Get(string recipe, Matrix4x4[] bindposes, Bounds bounds) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) if (cache.TryGetValue(recipe, out var value)) { return value; } List list = new List(); try { if (!Build(recipe, list, bindposes, bounds)) { list.Clear(); } } catch (Exception ex) { Log.Error("Purge skin: failed to assemble the borrowed parts (" + recipe + ") — " + ex); list.Clear(); } cache[recipe] = list; return list; } private static bool Build(string recipe, List pieces, Matrix4x4[] bindposes, Bounds bounds) { //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Unknown result type (might be due to invalid IL or missing references) //IL_028e: Unknown result type (might be due to invalid IL or missing references) //IL_0293: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Unknown result type (might be due to invalid IL or missing references) //IL_03c5: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_0312: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Unknown result type (might be due to invalid IL or missing references) //IL_02b9: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: Unknown result type (might be due to invalid IL or missing references) //IL_02d0: Unknown result type (might be due to invalid IL or missing references) //IL_02d7: Unknown result type (might be due to invalid IL or missing references) //IL_02de: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: Unknown result type (might be due to invalid IL or missing references) using Stream stream = typeof(BastionPurgeKit).Assembly.GetManifestResourceStream("BastionMod.Skins." + recipe); if (stream == null || bindposes == null) { return false; } using GZipStream gZipStream = new GZipStream(stream, CompressionMode.Decompress); using MemoryStream memoryStream = new MemoryStream(); gZipStream.CopyTo(memoryStream); memoryStream.Position = 0L; using BinaryReader binaryReader = new BinaryReader(memoryStream); if (new string(binaryReader.ReadChars(4)) != "BPK2") { throw new InvalidDataException("bad purge kit header"); } int num = binaryReader.ReadInt32(); for (int i = 0; i < num; i++) { string text = binaryReader.ReadString(); string text2 = binaryReader.ReadString(); int num2 = binaryReader.ReadInt32(); int num3 = binaryReader.ReadInt32(); int num4 = binaryReader.ReadInt32(); Mesh val = Addressables.LoadAssetAsync((object)text).WaitForCompletion(); Material val2 = Addressables.LoadAssetAsync((object)text2).WaitForCompletion(); if (!Object.op_Implicit((Object)(object)val) || !Object.op_Implicit((Object)(object)val2) || !val.isReadable || val.vertexCount != num2) { Log.Warning("Purge skin: official mesh " + text + " is missing, unreadable or has changed."); return false; } int[] triangles = val.triangles; if (triangles.Length != num3 * 3) { Log.Warning("Purge skin: official mesh " + text + " has changed."); return false; } Vector3[] vertices = val.vertices; Vector3[] normals = val.normals; Vector4[] tangents = val.tangents; Vector2[] uv = val.uv; bool flag = tangents.Length == vertices.Length; Builder[] array = new Builder[2] { new Builder(), new Builder() }; Dictionary dictionary = new Dictionary(); for (int j = 0; j < num4; j++) { int boneIndex = binaryReader.ReadByte(); Builder builder = array[(binaryReader.ReadByte() != 0) ? 1u : 0u]; Matrix4x4 identity = Matrix4x4.identity; for (int k = 0; k < 3; k++) { for (int l = 0; l < 4; l++) { ((Matrix4x4)(ref identity))[k, l] = binaryReader.ReadSingle(); } } BoneWeight item = default(BoneWeight); ((BoneWeight)(ref item)).boneIndex0 = boneIndex; ((BoneWeight)(ref item)).weight0 = 1f; dictionary.Clear(); int num5 = binaryReader.ReadInt32(); for (int m = 0; m < num5; m++) { int num6 = binaryReader.ReadInt32(); for (int n = 0; n < 3; n++) { int num7 = triangles[num6 * 3 + n]; if (!dictionary.TryGetValue(num7, out var value)) { value = (dictionary[num7] = builder.positions.Count); builder.positions.Add(((Matrix4x4)(ref identity)).MultiplyPoint3x4(vertices[num7])); List normals2 = builder.normals; Vector3 val3 = ((Matrix4x4)(ref identity)).MultiplyVector(normals[num7]); normals2.Add(((Vector3)(ref val3)).normalized); if (flag) { Vector4 val4 = tangents[num7]; val3 = ((Matrix4x4)(ref identity)).MultiplyVector(Vector4.op_Implicit(val4)); Vector3 normalized = ((Vector3)(ref val3)).normalized; builder.tangents.Add(new Vector4(normalized.x, normalized.y, normalized.z, val4.w)); } builder.uvs.Add(uv[num7]); builder.weights.Add(item); } builder.triangles.Add(value); } } } for (int num8 = 0; num8 < array.Length; num8++) { if (array[num8].triangles.Count != 0) { bool flag2 = num8 == 1; pieces.Add(new Piece { name = ((Object)val).name + (flag2 ? "Stow" : ""), mesh = array[num8].ToMesh("BastionPurge." + ((Object)val).name + (flag2 ? ".Stow" : ""), flag, bindposes, bounds), material = val2, stow = flag2 }); } } } return pieces.Count > 0; } } internal static class BastionSounds { internal const string SniperShootRemote = "Play_MULT_m1_snipe_shoot"; internal const string TreadLoopStart = "Play_MULT_move_loop"; internal const string TreadLoopStop = "Stop_MULT_move_loop"; internal const string EmoteRest = "Play_MULT_shift_end"; internal const string EmoteBird = "Play_MULT_R_toSnipe"; internal const string EmoteDanceBeat = "Play_engi_R_walkingTurret_step"; internal const string CasingSmall = "Play_bandit2_m1_reload_bullet"; internal const string CasingBig = "Play_commando_M2_grenade_bounce"; internal const string DeployedHit = "Play_item_proc_repulsionArmor"; private const float DeployedHitGap = 0.3f; private static float lastDeployedHitTime; internal const float DanceBeatInterval = 0.5f; internal static void Init() { GlobalEventManager.onClientDamageNotified += OnClientDamageNotified; } private static void OnClientDamageNotified(DamageDealtMessage message) { //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_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) if (BastionConfig.deployedHitSound != null && BastionConfig.deployedHitSound.Value && Object.op_Implicit((Object)(object)message.victim) && !(message.damage <= 0f) && !(Time.time - lastDeployedHitTime < 0.3f) && !((Object)(object)message.attacker == (Object)(object)message.victim) && (message.damageType.damageType & 0x4000000) == 0) { CharacterBody component = message.victim.GetComponent(); if (Object.op_Implicit((Object)(object)component) && component.bodyIndex == BastionPlugin.bodyIndex && component.HasBuff(BastionBuffs.turretRootDef)) { lastDeployedHitTime = Time.time; Util.PlaySound("Play_item_proc_repulsionArmor", message.victim); } } } internal static bool IsLocalPlayers(CharacterBody body) { if (Object.op_Implicit((Object)(object)body) && body.hasEffectiveAuthority) { return body.isPlayerControlled; } return false; } } public static class BastionStates { public static void Init() { Content.AddEntityState(typeof(Primary)); Content.AddEntityState(typeof(SniperPrimary)); Content.AddEntityState(typeof(ShotgunPrimary)); Content.AddEntityState(typeof(ReconToArtillery)); Content.AddEntityState(typeof(ReconToDroneArtillery)); Content.AddEntityState(typeof(ReconToBombard)); Content.AddEntityState(typeof(ReconToAssault)); Content.AddEntityState(typeof(HealSelf)); Content.AddEntityState(typeof(BastionGrenadeAim)); Content.AddEntityState(typeof(AssaultPrimary)); Content.AddEntityState(typeof(AssaultToArtillery)); Content.AddEntityState(typeof(AssaultToRecon)); Content.AddEntityState(typeof(BombardPrimary)); Content.AddEntityState(typeof(BombardToArtillery)); Content.AddEntityState(typeof(ArtilleryToBombard)); Content.AddEntityState(typeof(BombardToRecon)); Content.AddEntityState(typeof(ArtilleryPrimary)); Content.AddEntityState(typeof(ArtilleryDronePrimary)); Content.AddEntityState(typeof(ArtilleryToAssault)); Content.AddEntityState(typeof(ArtilleryToRecon)); Content.AddEntityState(typeof(BastionMinionDeath)); Content.AddEntityState(typeof(BastionDeath)); Content.AddEntityState(typeof(BastionEmote)); Content.AddEntityState(typeof(TankDeploy)); } } public static class BastionStaticValues { public const float primaryCoef = 0.7f; public const float sniperCoef = 3.5f; public const float shotgunCoef = 2.4f; public const float assaultCoef = 1.75f; public const int droneLifeTime = 15; public const float healPerSecond = 10f; public const float healPerLevel = 3f; public const float grenadeCoef = 2.5f; public const float cannonCoef = 3.25f; public const float artilleryCoef = 10f; internal static BastionStateDef TurretDef; internal static BastionStateDef ArtilleryDef; internal static BastionSkills BastionSkillList; internal static SkillDef specialSkillDef; } public class BastionSurvivor : SurvivorBase { public enum BodyAnimatorLayer { Assault = 1, Artillery = 2, Bombard = 3, Pitch = 7, Yaw = 8, Flinch = 9 } private delegate bool PixelRemap(float h, float s, float v, out float nh, out float ns, out float nv); public const string Bastion_PREFIX = "HASTEREAPR_BASTION_"; private static UnlockableDef survivorUnlock; private static Texture2D veteranTexture; private static Texture2D purgeTexture; private const bool VeteranRequiresMastery = true; private static readonly Dictionary veteranMaterialCache = new Dictionary(); private static readonly Dictionary gildedMaterialCache = new Dictionary(); private static readonly Dictionary recoloredTextureCache = new Dictionary(); private static readonly Dictionary alloyedMaterials = new Dictionary(); private static readonly Dictionary purgeMaterialCache = new Dictionary(); private static readonly Color purgeLightColor = new Color(1f, 0.32f, 0.68f); private static readonly Dictionary meridianMaterialCache = new Dictionary(); private static Texture2D meridianTexture; private static readonly Color meridianLightColor = new Color(1f, 0.5f, 0.1f); private static readonly Dictionary hollowMaterialCache = new Dictionary(); private static Texture2D hollowTexture; private static readonly Color hollowLightColor = new Color(0.3f, 1f, 0.45f); private static Material hollowTarMaterial; private static bool hollowTarLoaded; private const float HollowTarVertexScale = 60000f; public override string assetBundleName => "bastionbundle"; public override string bodyName => BastionPlugin.bodyName; public override string masterName => "BastionMonsterMaster"; public override string modelPrefabName => "mdlBastion"; public override string displayPrefabName => "displayBastion"; public override string survivorTokenPrefix => "HASTEREAPR_BASTION_"; public override BodyInfo bodyInfo => new BodyInfo { bodyName = bodyName, bodyNameToken = "HASTEREAPR_BASTION_NAME", subtitleNameToken = "HASTEREAPR_BASTION_SUBTITLE", characterPortrait = assetBundle.LoadAsset("texBastionIcon"), bodyColor = new Color(0.23137255f, 0.5568628f, 58f / 85f), sortPosition = 6f, crosshair = Addressables.LoadAssetAsync((object)RoR2_Base_Commando.CommandoBody_prefab).WaitForCompletion().GetComponent() .defaultCrosshairPrefab, podPrefab = LegacyResourcesAPI.Load("Prefabs/NetworkedObjects/SurvivorPod"), maxHealth = BastionConfig.Stat(BastionConfig.baseHealth, 175f), healthRegen = BastionConfig.Stat(BastionConfig.baseRegen, 1.5f), armor = BastionConfig.Stat(BastionConfig.baseArmor, 5f), healthGrowth = BastionConfig.Stat(BastionConfig.healthGrowth, 25f), damage = BastionConfig.Stat(BastionConfig.baseDamage, 12f), damageGrowth = BastionConfig.Stat(BastionConfig.damageGrowth, 2.4f), crit = BastionConfig.Stat(BastionConfig.baseCrit, 1f), moveSpeedGrowth = 0.25f, jumpCount = 1, moveSpeed = BastionConfig.Stat(BastionConfig.baseMoveSpeed, 8f), attackSpeed = 1f }; public override CustomRendererInfo[] customRendererInfos => new CustomRendererInfo[2] { new CustomRendererInfo { childName = "body", material = assetBundle.LoadMaterial("matBastion") }, new CustomRendererInfo { childName = "barrel", material = assetBundle.LoadMaterial("matBastionTurret") } }; public override UnlockableDef characterUnlockableDef => BastionUnlockables.CharacterUnlock; public override ItemDisplaysBase itemDisplays => new BastionItemDisplays(); public override AssetBundle assetBundle { get; protected set; } public override GameObject bodyPrefab { get; protected set; } public override CharacterBody prefabCharacterBody { get; protected set; } public override GameObject characterModelObject { get; protected set; } public override CharacterModel prefabCharacterModel { get; protected set; } public override GameObject displayPrefab { get; protected set; } public override void Initialize() { //IL_003e: Unknown result type (might be due to invalid IL or missing references) base.Initialize(); BastionUnlockables.Init(); BastionConfig.Init(); BastionStates.Init(); BastionTokens.Init(); InitializeCharacterBodyPrefab(); InitializeItemDisplays(); InitializeDisplayPrefab(); Content.CreateSurvivor(bodyPrefab, displayPrefab, bodyInfo.bodyColor, survivorTokenPrefix, BastionUnlockables.CharacterUnlock, bodyInfo.sortPosition); InitializeCharacter(); } public override void InitializeCharacter() { //IL_00a8: 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) BastionAssets.Init(assetBundle); BastionItems.Init(); BastionWildThrinch.Init(); BastionBuffs.Init(assetBundle); BastionAttachmentPoints.AddTo(prefabCharacterModel); InitializeEntityStateMachines(); InitializeSkills(); BastionTank.Init(bodyPrefab); InitializeSkins(); InitializeCharacterMaster(); AddHooks(); bodyPrefab.AddComponent(); ((Component)prefabCharacterModel).gameObject.AddComponent(); bodyPrefab.AddComponent(); bodyPrefab.AddComponent(); CharacterDeathBehavior component = bodyPrefab.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.deathState = new SerializableEntityStateType(typeof(BastionDeath)); } if (Object.op_Implicit((Object)(object)prefabCharacterModel)) { Transform val = ((Component)prefabCharacterModel).transform.Find("Ganamede"); if (Object.op_Implicit((Object)(object)val)) { ((Component)val).gameObject.SetActive(false); } } bodyPrefab.GetComponent().mass = 250f; bodyPrefab.GetComponent().jumpPower = 30f; CharacterBodyAPI.SetCustomSprintIcon(bodyPrefab.GetComponent(), Asset.MainAssetBundle.LoadAsset("iconPrimary")); if (Object.op_Implicit((Object)(object)displayPrefab)) { ((CharacterSelectSurvivorPreviewDisplayController)displayPrefab.AddComponent()).bodyPrefab = bodyPrefab; } } public override void InitializeEntityStateMachines() { Prefabs.ClearEntityStateMachines(bodyPrefab); Prefabs.AddMainEntityStateMachine(bodyPrefab, "Body", typeof(GenericCharacterMain), typeof(SpawnTeleporterState)); Prefabs.AddEntityStateMachine(bodyPrefab, "Bastion"); Prefabs.AddEntityStateMachine(bodyPrefab, "Healing"); } public override void InitializeSkills() { Skills.ClearGenericSkills(bodyPrefab); BastionStaticValues.TurretDef = new BastionStateDef(); BastionStaticValues.ArtilleryDef = new BastionStateDef(); BastionStaticValues.BastionSkillList = new BastionSkills(); AddGenericTrackingSkills(); AddPrimarySkills(); AddSecondarySkills(); AddUtiitySkills(); AddSpecialSkills(); } private void AddGenericTrackingSkills() { GenericSkill obj = Skills.CreateGenericSkillWithSkillFamily(bodyPrefab, "TrackingSkillTurret", hidden: true); obj.hideInCharacterSelect = true; obj.hideInLoadoutSelect = true; SkillDef val = Skills.CreateSkillDef(new SkillDefInfo { skillName = "TurretCooldownTracker", skillNameToken = "HASTEREAPR_BASTION_NULL", skillDescriptionToken = "HASTEREAPR_BASTION_NULL", keywordTokens = new string[0], skillIcon = assetBundle.LoadAsset("a"), stockToConsume = 1, baseRechargeInterval = 10f }); Skills.AddSkillsToFamily(obj.skillFamily, val); GenericSkill obj2 = Skills.CreateGenericSkillWithSkillFamily(bodyPrefab, "TrackingSkillArtillery", hidden: true); obj2.hideInCharacterSelect = true; obj2.hideInLoadoutSelect = true; SkillDef val2 = Skills.CreateSkillDef(new SkillDefInfo { skillName = "ArtilleryCooldownTracker", skillNameToken = "HASTEREAPR_BASTION_NULL", skillDescriptionToken = "HASTEREAPR_BASTION_NULL", keywordTokens = new string[0], skillIcon = assetBundle.LoadAsset("a"), stockToConsume = 1, baseRechargeInterval = 20f }); Skills.AddSkillsToFamily(obj2.skillFamily, val2); } private void AddPrimarySkills() { //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) //IL_006c: 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_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_016d: 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_0184: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Unknown result type (might be due to invalid IL or missing references) //IL_0349: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0360: Unknown result type (might be due to invalid IL or missing references) //IL_041a: Unknown result type (might be due to invalid IL or missing references) //IL_041f: Unknown result type (might be due to invalid IL or missing references) //IL_0431: Unknown result type (might be due to invalid IL or missing references) Skills.CreateGenericSkillWithSkillFamily(bodyPrefab, (SkillSlot)0); SteppedSkillDef val = Skills.CreateSkillDef(new SkillDefInfo { skillName = "BastionReconPrimary", skillNameToken = "HASTEREAPR_BASTION_PRIMARY_RECON_NAME", skillDescriptionToken = "HASTEREAPR_BASTION_PRIMARY_RECON_DESCRIPTION", skillIcon = assetBundle.LoadAsset("iconPrimary"), activationState = new SerializableEntityStateType(typeof(Primary)), activationStateMachineName = "Bastion", interruptPriority = (InterruptPriority)1, canceledFromSprinting = false, cancelSprintingOnActivation = false, forceSprintDuringState = false, requiredStock = 0, stockToConsume = 0 }); SteppedSkillDef val2 = Skills.CreateSkillDef(new SkillDefInfo { skillName = "BastionReconSniperPrimary", skillNameToken = "HASTEREAPR_BASTION_PRIMARY_RECON_SNIPER_NAME", skillDescriptionToken = "HASTEREAPR_BASTION_PRIMARY_RECON_SNIPER_DESCRIPTION", skillIcon = assetBundle.LoadAsset("iconSniper"), activationState = new SerializableEntityStateType(typeof(SniperPrimary)), activationStateMachineName = "Bastion", interruptPriority = (InterruptPriority)1, canceledFromSprinting = false, cancelSprintingOnActivation = false, forceSprintDuringState = false, requiredStock = 0, stockToConsume = 0 }); SteppedSkillDef skillDef = Skills.CreateSkillDef(new SkillDefInfo { skillName = "BastionReconShotgunPrimary", skillNameToken = "HASTEREAPR_BASTION_PRIMARY_RECON_SHOTGUN_NAME", skillDescriptionToken = "HASTEREAPR_BASTION_PRIMARY_RECON_SHOTGUN_DESCRIPTION", skillIcon = assetBundle.LoadAsset("iconShotgun"), activationState = new SerializableEntityStateType(typeof(ShotgunPrimary)), activationStateMachineName = "Bastion", interruptPriority = (InterruptPriority)1, canceledFromSprinting = false, cancelSprintingOnActivation = false, forceSprintDuringState = false, requiredStock = 0, stockToConsume = 0 }); SteppedSkillDef val3 = Skills.CreateSkillDef(new SkillDefInfo { skillName = "BastionReconPrimary", skillNameToken = "HASTEREAPR_BASTION_PRIMARY_BOMBARD_NAME", skillDescriptionToken = "HASTEREAPR_BASTION_PRIMARY_BOMBARD_DESCRIPTION", skillIcon = assetBundle.LoadAsset("iconMortar"), activationState = new SerializableEntityStateType(typeof(BombardPrimary)), activationStateMachineName = "Bastion", interruptPriority = (InterruptPriority)2, canceledFromSprinting = false, cancelSprintingOnActivation = false, forceSprintDuringState = false, requiredStock = 0, stockToConsume = 0 }); val3.stepResetTimer = 2.1474836E+09f; val3.stepGraceDuration = 2.1474836E+09f; val3.stepCount = int.MaxValue; SteppedSkillDef val4 = Skills.CreateSkillDef(new SkillDefInfo { skillName = "BastionReconPrimary", skillNameToken = "HASTEREAPR_BASTION_PRIMARY_ASSAULT_NAME", skillDescriptionToken = "HASTEREAPR_BASTION_PRIMARY_ASSAULT_DESCRIPTION", skillIcon = assetBundle.LoadAsset("iconChain"), activationState = new SerializableEntityStateType(typeof(AssaultPrimary)), activationStateMachineName = "Bastion", interruptPriority = (InterruptPriority)2, canceledFromSprinting = false, cancelSprintingOnActivation = false, forceSprintDuringState = false }); val4.stepResetTimer = 2.1474836E+09f; val4.stepGraceDuration = 2.1474836E+09f; val4.stepCount = int.MaxValue; SteppedSkillDef val5 = Skills.CreateSkillDef(new SkillDefInfo { skillName = "ArtilleryBombDef", skillNameToken = "HASTEREAPR_BASTION_PRIMARY_ARTILLERY_NAME", skillDescriptionToken = "HASTEREAPR_BASTION_PRIMARY_ARTILLERY_DESCRIPTION", skillIcon = assetBundle.LoadAsset("iconAirstrike"), activationState = new SerializableEntityStateType(typeof(ArtilleryPrimary)), activationStateMachineName = "Bastion", interruptPriority = (InterruptPriority)2, canceledFromSprinting = false, cancelSprintingOnActivation = false, forceSprintDuringState = false, requiredStock = 1, stockToConsume = 1, baseMaxStock = 3, rechargeStock = 3, baseRechargeInterval = 6f, dontAllowPastMaxStocks = true }); val5.stepResetTimer = 2.1474836E+09f; val5.stepGraceDuration = 2.1474836E+09f; val5.stepCount = int.MaxValue; SteppedSkillDef artilleryDronePrimary = Skills.CreateSkillDef(new SkillDefInfo { skillName = "ArtilleryDroneDef", skillNameToken = "HASTEREAPR_BASTION_PRIMARY_DRONE_NAME", skillDescriptionToken = "HASTEREAPR_BASTION_PRIMARY_DRONE_DESCRIPTION", skillIcon = assetBundle.LoadAsset("iconAirstrike"), activationState = new SerializableEntityStateType(typeof(ArtilleryDronePrimary)), activationStateMachineName = "Bastion", interruptPriority = (InterruptPriority)2, canceledFromSprinting = false, cancelSprintingOnActivation = false, forceSprintDuringState = false, requiredStock = 1, stockToConsume = 1, baseMaxStock = 1, rechargeStock = 1, baseRechargeInterval = 5f, dontAllowPastMaxStocks = true }); BastionStaticValues.TurretDef.primary = (SkillDef)(object)val4; BastionStaticValues.ArtilleryDef.primary = (SkillDef)(object)val5; BastionStaticValues.BastionSkillList.reconPrimary = (SkillDef)(object)val; BastionStaticValues.BastionSkillList.reconSniperPrimary = (SkillDef)(object)val2; BastionStaticValues.BastionSkillList.assaultPrimary = (SkillDef)(object)val4; BastionStaticValues.BastionSkillList.bombardPrimary = (SkillDef)(object)val3; BastionStaticValues.BastionSkillList.artilleryPrimary = (SkillDef)(object)val5; BastionStaticValues.BastionSkillList.artilleryDronePrimary = (SkillDef)(object)artilleryDronePrimary; SkillLocator component = bodyPrefab.GetComponent(); UnlockableDef sniperUnlock = BastionUnlockables.SniperUnlock; Skills.AddPrimarySkills(bodyPrefab, (SkillDef)val); Skills.AddSkillToFamily(component.primary.skillFamily, (SkillDef)(object)skillDef, BastionUnlockables.ShotgunUnlock); Skills.AddSkillToFamily(component.primary.skillFamily, (SkillDef)(object)val2, sniperUnlock); } private void AddSecondarySkills() { //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_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_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_0182: Unknown result type (might be due to invalid IL or missing references) Skills.CreateGenericSkillWithSkillFamily(bodyPrefab, (SkillSlot)1); SkillDefInfo skillDefInfo = new SkillDefInfo(); skillDefInfo.skillName = "BastionKick"; skillDefInfo.skillNameToken = "HASTEREAPR_BASTION_SECONDARY_HEAL_NAME"; skillDefInfo.skillDescriptionToken = "HASTEREAPR_BASTION_SECONDARY_HEAL_DESCRIPTION"; skillDefInfo.keywordTokens = new string[1] { "" }; skillDefInfo.skillIcon = assetBundle.LoadAsset("iconHeal"); skillDefInfo.activationState = new SerializableEntityStateType(typeof(HealSelf)); skillDefInfo.activationStateMachineName = "Healing"; skillDefInfo.interruptPriority = (InterruptPriority)2; skillDefInfo.baseRechargeInterval = 6f; skillDefInfo.baseMaxStock = 1; skillDefInfo.rechargeStock = 1; skillDefInfo.requiredStock = 1; skillDefInfo.stockToConsume = 1; skillDefInfo.resetCooldownTimerOnUse = false; skillDefInfo.fullRestockOnAssign = true; skillDefInfo.dontAllowPastMaxStocks = false; skillDefInfo.mustKeyPress = false; skillDefInfo.beginSkillCooldownOnSkillEnd = true; skillDefInfo.isCombatSkill = false; skillDefInfo.canceledFromSprinting = false; skillDefInfo.cancelSprintingOnActivation = false; skillDefInfo.forceSprintDuringState = false; SkillDef val = Skills.CreateSkillDef(skillDefInfo); Skills.AddSecondarySkills(bodyPrefab, val); skillDefInfo = new SkillDefInfo(); skillDefInfo.skillName = "BastionGrenade"; skillDefInfo.skillNameToken = "HASTEREAPR_BASTION_SECONDARY_GRENADE_NAME"; skillDefInfo.skillDescriptionToken = "HASTEREAPR_BASTION_SECONDARY_GRENADE_DESCRIPTION"; skillDefInfo.keywordTokens = new string[1] { "KEYWORD_AGILE" }; skillDefInfo.skillIcon = Addressables.LoadAssetAsync((object)RoR2_Base_Commando.ThrowGrenade_asset).WaitForCompletion().icon; skillDefInfo.activationState = new SerializableEntityStateType(typeof(BastionGrenadeAim)); skillDefInfo.activationStateMachineName = "Bastion"; skillDefInfo.interruptPriority = (InterruptPriority)2; skillDefInfo.baseRechargeInterval = ((BastionConfig.grenadeCooldown != null) ? BastionConfig.grenadeCooldown.Value : 5f); skillDefInfo.baseMaxStock = 1; skillDefInfo.rechargeStock = 1; skillDefInfo.requiredStock = 1; skillDefInfo.stockToConsume = 1; skillDefInfo.beginSkillCooldownOnSkillEnd = true; skillDefInfo.isCombatSkill = true; skillDefInfo.canceledFromSprinting = false; skillDefInfo.cancelSprintingOnActivation = false; skillDefInfo.forceSprintDuringState = false; SkillDef skillDef = Skills.CreateSkillDef(skillDefInfo); Skills.AddSkillToFamily(bodyPrefab.GetComponent().secondary.skillFamily, skillDef, BastionUnlockables.GrenadeUnlock); } private void AddUtiitySkills() { //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_0081: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0240: 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_02c0: Unknown result type (might be due to invalid IL or missing references) Skills.CreateGenericSkillWithSkillFamily(bodyPrefab, (SkillSlot)2); SkillDefInfo skillDefInfo = new SkillDefInfo(); skillDefInfo.skillName = "BastionAssaultMode"; skillDefInfo.skillNameToken = "HASTEREAPR_BASTION_RECON_TO_ASSAULT_NAME"; skillDefInfo.skillDescriptionToken = "HASTEREAPR_BASTION_RECON_TO_ASSAULT_DESCRIPTION"; skillDefInfo.keywordTokens = new string[1] { "KEYWORD_AGILE" }; skillDefInfo.skillIcon = assetBundle.LoadAsset("iconAssault"); skillDefInfo.activationState = new SerializableEntityStateType(typeof(ReconToAssault)); skillDefInfo.activationStateMachineName = "Bastion"; skillDefInfo.interruptPriority = (InterruptPriority)2; skillDefInfo.baseRechargeInterval = 0f; skillDefInfo.baseMaxStock = 1; skillDefInfo.rechargeStock = 1; skillDefInfo.requiredStock = 1; skillDefInfo.stockToConsume = 1; skillDefInfo.resetCooldownTimerOnUse = false; skillDefInfo.fullRestockOnAssign = true; skillDefInfo.dontAllowPastMaxStocks = true; skillDefInfo.mustKeyPress = false; skillDefInfo.beginSkillCooldownOnSkillEnd = true; skillDefInfo.isCombatSkill = true; skillDefInfo.canceledFromSprinting = true; skillDefInfo.cancelSprintingOnActivation = true; skillDefInfo.forceSprintDuringState = false; SkillDef val = Skills.CreateSkillDef(skillDefInfo); skillDefInfo = new SkillDefInfo(); skillDefInfo.skillName = "BastionBombardMode"; skillDefInfo.skillNameToken = "HASTEREAPR_BASTION_RECON_TO_BOMBARD_NAME"; skillDefInfo.skillDescriptionToken = "HASTEREAPR_BASTION_RECON_TO_BOMBARD_DESCRIPTION"; skillDefInfo.keywordTokens = new string[1] { "KEYWORD_AGILE" }; skillDefInfo.skillIcon = assetBundle.LoadAsset("iconBombard"); skillDefInfo.activationState = new SerializableEntityStateType(typeof(ReconToBombard)); skillDefInfo.activationStateMachineName = "Bastion"; skillDefInfo.interruptPriority = (InterruptPriority)2; skillDefInfo.baseRechargeInterval = 0f; skillDefInfo.baseMaxStock = 1; skillDefInfo.rechargeStock = 1; skillDefInfo.requiredStock = 1; skillDefInfo.stockToConsume = 1; skillDefInfo.resetCooldownTimerOnUse = false; skillDefInfo.fullRestockOnAssign = true; skillDefInfo.dontAllowPastMaxStocks = true; skillDefInfo.mustKeyPress = false; skillDefInfo.beginSkillCooldownOnSkillEnd = true; skillDefInfo.isCombatSkill = true; skillDefInfo.canceledFromSprinting = true; skillDefInfo.cancelSprintingOnActivation = true; skillDefInfo.forceSprintDuringState = false; SkillDef val2 = Skills.CreateSkillDef(skillDefInfo); SkillDef val3 = Skills.CreateSkillDef(new SkillDefInfo("BastionReconPrimary", "HASTEREAPR_BASTION_UTILITY_ASSAULTTORECON_NAME", "HASTEREAPR_BASTION_UTILITY_ASSAULTTORECON_DESCRIPTION", assetBundle.LoadAsset("iconShift"), new SerializableEntityStateType(typeof(AssaultToRecon)), "Bastion")); SkillDef val4 = Skills.CreateSkillDef(new SkillDefInfo("BastionReconPrimary", "HASTEREAPR_BASTION_UTILITY_ASSAULTTORECON_NAME", "HASTEREAPR_BASTION_UTILITY_ASSAULTTORECON_DESCRIPTION", assetBundle.LoadAsset("iconAssault"), new SerializableEntityStateType(typeof(ArtilleryToAssault)), "Bastion")); SkillDef bombardToRecon = Skills.CreateSkillDef(new SkillDefInfo("BastionReconPrimary", "HASTEREAPR_BASTION_UTILITY_ASSAULTTORECON_NAME", "HASTEREAPR_BASTION_UTILITY_ASSAULTTORECON_DESCRIPTION", assetBundle.LoadAsset("iconShift"), new SerializableEntityStateType(typeof(BombardToRecon)), "Bastion")); SkillDef artilleryToBombard = Skills.CreateSkillDef(new SkillDefInfo("BastionReconPrimary", "HASTEREAPR_BASTION_UTILITY_ASSAULTTORECON_NAME", "HASTEREAPR_BASTION_UTILITY_ASSAULTTORECON_DESCRIPTION", assetBundle.LoadAsset("iconBombard"), new SerializableEntityStateType(typeof(ArtilleryToBombard)), "Bastion")); BastionStaticValues.TurretDef.utility = val3; BastionStaticValues.ArtilleryDef.utility = val4; BastionStaticValues.BastionSkillList.reconToAssault = val; BastionStaticValues.BastionSkillList.reconToBombard = val2; BastionStaticValues.BastionSkillList.assaultToRecon = val3; BastionStaticValues.BastionSkillList.bombardToRecon = bombardToRecon; BastionStaticValues.BastionSkillList.artilleryToAssault = val4; BastionStaticValues.BastionSkillList.artilleryToBombard = artilleryToBombard; SkillLocator component = bodyPrefab.GetComponent(); UnlockableDef bombardUnlock = BastionUnlockables.BombardUnlock; Skills.AddUtilitySkills(bodyPrefab, val); Skills.AddSkillToFamily(component.utility.skillFamily, val2, bombardUnlock); } private void AddSpecialSkills() { //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_0081: 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_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Unknown result type (might be due to invalid IL or missing references) Skills.CreateGenericSkillWithSkillFamily(bodyPrefab, (SkillSlot)3); SkillDefInfo skillDefInfo = new SkillDefInfo(); skillDefInfo.skillName = "BastionArtilleryBomb"; skillDefInfo.skillNameToken = "HASTEREAPR_BASTION_ARTILLERY_NAME"; skillDefInfo.skillDescriptionToken = "HASTEREAPR_BASTION_ARTILLERY_DESCRIPTION"; skillDefInfo.keywordTokens = new string[1] { "KEYWORD_STUNNING" }; skillDefInfo.skillIcon = assetBundle.LoadAsset("iconArtillery"); skillDefInfo.activationState = new SerializableEntityStateType(typeof(ReconToArtillery)); skillDefInfo.activationStateMachineName = "Bastion"; skillDefInfo.interruptPriority = (InterruptPriority)3; skillDefInfo.baseRechargeInterval = ((BastionConfig.artilleryCooldown != null) ? BastionConfig.artilleryCooldown.Value : 12f); skillDefInfo.baseMaxStock = 1; skillDefInfo.rechargeStock = 1; skillDefInfo.requiredStock = 1; skillDefInfo.stockToConsume = 1; skillDefInfo.resetCooldownTimerOnUse = false; skillDefInfo.fullRestockOnAssign = false; skillDefInfo.dontAllowPastMaxStocks = true; skillDefInfo.mustKeyPress = false; skillDefInfo.beginSkillCooldownOnSkillEnd = false; skillDefInfo.isCombatSkill = true; skillDefInfo.canceledFromSprinting = true; skillDefInfo.cancelSprintingOnActivation = true; skillDefInfo.forceSprintDuringState = false; SkillDef val = Skills.CreateSkillDef(skillDefInfo); skillDefInfo = new SkillDefInfo(); skillDefInfo.skillName = "BastionArtilleryDrone"; skillDefInfo.skillNameToken = "HASTEREAPR_BASTION_DRONE_ARTILLERY_NAME"; skillDefInfo.skillDescriptionToken = "HASTEREAPR_BASTION_DRONE_ARTILLERY_DESCRIPTION"; skillDefInfo.keywordTokens = new string[1] { "DRONE_DESCRIPTION" }; skillDefInfo.skillIcon = assetBundle.LoadAsset("iconArtillery"); skillDefInfo.activationState = new SerializableEntityStateType(typeof(ReconToDroneArtillery)); skillDefInfo.activationStateMachineName = "Bastion"; skillDefInfo.interruptPriority = (InterruptPriority)3; skillDefInfo.baseRechargeInterval = ((BastionConfig.artilleryCooldown != null) ? BastionConfig.artilleryCooldown.Value : 12f); skillDefInfo.baseMaxStock = 1; skillDefInfo.rechargeStock = 1; skillDefInfo.requiredStock = 1; skillDefInfo.stockToConsume = 1; skillDefInfo.resetCooldownTimerOnUse = false; skillDefInfo.fullRestockOnAssign = false; skillDefInfo.dontAllowPastMaxStocks = true; skillDefInfo.mustKeyPress = false; skillDefInfo.beginSkillCooldownOnSkillEnd = false; skillDefInfo.isCombatSkill = true; skillDefInfo.canceledFromSprinting = true; skillDefInfo.cancelSprintingOnActivation = true; skillDefInfo.forceSprintDuringState = false; SkillDef val2 = Skills.CreateSkillDef(skillDefInfo); SkillDef val3 = Skills.CreateSkillDef(new SkillDefInfo("BastionReconPrimary", "HASTEREAPR_BASTION_UTILITY_ASSAULTTORECON_NAME", "HASTEREAPR_BASTION_UTILITY_ASSAULTTORECON_DESCRIPTION", assetBundle.LoadAsset("iconShift"), new SerializableEntityStateType(typeof(ArtilleryToRecon)), "Bastion", agile: true)); SkillDef val4 = (SkillDef)(object)Skills.CreateSkillDef(new SkillDefInfo("BastionReconPrimary", "HASTEREAPR_BASTION_UTILITY_ASSAULTTORECON_NAME", "HASTEREAPR_BASTION_UTILITY_ASSAULTTORECON_DESCRIPTION", assetBundle.LoadAsset("iconArtillery"), new SerializableEntityStateType(typeof(AssaultToArtillery)), "Bastion", agile: true)); SkillDef bombardToArtillery = (SkillDef)(object)Skills.CreateSkillDef(new SkillDefInfo("BastionReconPrimary", "HASTEREAPR_BASTION_UTILITY_ASSAULTTORECON_NAME", "HASTEREAPR_BASTION_UTILITY_ASSAULTTORECON_DESCRIPTION", assetBundle.LoadAsset("iconArtillery"), new SerializableEntityStateType(typeof(BombardToArtillery)), "Bastion", agile: true)); BastionStaticValues.TurretDef.special = val4; BastionStaticValues.ArtilleryDef.special = val3; BastionStaticValues.BastionSkillList.reconToArtillery = val; BastionStaticValues.BastionSkillList.reconToDroneArtillery = val2; BastionStaticValues.BastionSkillList.assaultToArtillery = val4; BastionStaticValues.BastionSkillList.bombardToArtillery = bombardToArtillery; BastionStaticValues.BastionSkillList.artilleryToRecon = val3; Skills.AddSpecialSkills(bodyPrefab, val); SkillLocator component = bodyPrefab.GetComponent(); Skills.AddSkillToFamily(unlockableDef: BastionUnlockables.DroneUnlock, skillFamily: component.special.skillFamily, skillDef: val2); } private static Texture2D LoadVeteranTexture() { if (!Object.op_Implicit((Object)(object)veteranTexture)) { veteranTexture = LoadSkinTexture("veteran", "texBastionVeteran"); } return veteranTexture; } private static Texture2D LoadSkinTexture(string file, string name) { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Expected O, but got Unknown using Stream stream = typeof(BastionSurvivor).Assembly.GetManifestResourceStream("BastionMod.Skins." + file + ".png"); if (stream == null) { Log.Error(file + " skin texture resource missing"); return null; } byte[] array = new byte[stream.Length]; stream.Read(array, 0, array.Length); Texture2D val = new Texture2D(2, 2, (TextureFormat)4, true); ImageConversion.LoadImage(val, array); ((Object)val).name = name; return val; } private static Material VeteranMaterial(Material source) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown if ((Object)(object)source == (Object)null) { return source; } if (veteranMaterialCache.TryGetValue(source, out var value)) { return value; } Material val = new Material(source); ((Object)val).name = ((Object)source).name + "Veteran"; Texture2D val2 = LoadVeteranTexture(); if (Object.op_Implicit((Object)(object)val2) && source.HasProperty("_MainTex")) { val.SetTexture("_MainTex", (Texture)(object)val2); } veteranMaterialCache[source] = val; return val; } private static bool GildedRemap(float h, float s, float v, out float nh, out float ns, out float nv) { nh = h; ns = s; nv = v; if (s > 0.12f && h >= 0.42f && h <= 0.72f) { float num = Mathf.InverseLerp(0.42f, 0.72f, h); nh = Mathf.Lerp(0.23f, 0.085f, num); ns = s * 0.65f; return true; } return false; } private static Texture2D ReadTextureReadable(Texture source) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0053: 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_0072: Expected O, but got Unknown RenderTexture temporary = RenderTexture.GetTemporary(source.width, source.height, 0, (RenderTextureFormat)0); Graphics.Blit(source, temporary); RenderTexture active = RenderTexture.active; RenderTexture.active = temporary; Texture2D val = new Texture2D(source.width, source.height, (TextureFormat)4, true); val.ReadPixels(new Rect(0f, 0f, (float)source.width, (float)source.height), 0, 0); val.Apply(); RenderTexture.active = active; RenderTexture.ReleaseTemporary(temporary); return val; } private static Material RecolorMaterial(Material source, Dictionary cache, string suffix, PixelRemap remap) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: 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_00eb: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)source == (Object)null) { return source; } if (cache.TryGetValue(source, out var value)) { return value; } Material val = new Material(source); ((Object)val).name = ((Object)source).name + suffix; Texture val2 = (source.HasProperty("_MainTex") ? source.GetTexture("_MainTex") : null); if (Object.op_Implicit((Object)(object)val2)) { string key = ((Object)val2).GetInstanceID() + "|" + suffix; if (!recoloredTextureCache.TryGetValue(key, out var value2)) { value2 = ReadTextureReadable(val2); Color[] pixels = value2.GetPixels(); float h = default(float); float s = default(float); float v = default(float); for (int i = 0; i < pixels.Length; i++) { Color.RGBToHSV(pixels[i], ref h, ref s, ref v); if (remap(h, s, v, out var nh, out var ns, out var nv)) { Color val3 = Color.HSVToRGB(nh, ns, nv); val3.a = pixels[i].a; pixels[i] = val3; } } value2.SetPixels(pixels); value2.Apply(); recoloredTextureCache[key] = value2; } val.SetTexture("_MainTex", (Texture)(object)value2); } cache[source] = val; return val; } private static RendererInfo[] BuildRecoloredRendererInfos(RendererInfo[] baseInfos, Dictionary cache, string suffix, PixelRemap remap) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) RendererInfo[] array = (RendererInfo[])(object)new RendererInfo[baseInfos.Length]; for (int i = 0; i < baseInfos.Length; i++) { array[i] = baseInfos[i]; array[i].defaultMaterial = RecolorMaterial(baseInfos[i].defaultMaterial, cache, suffix, remap); } return array; } private static RendererInfo[] BuildVeteranRendererInfos(RendererInfo[] baseInfos) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) RendererInfo[] array = (RendererInfo[])(object)new RendererInfo[baseInfos.Length]; for (int i = 0; i < baseInfos.Length; i++) { array[i] = baseInfos[i]; array[i].defaultMaterial = VeteranMaterial(baseInfos[i].defaultMaterial); } return array; } private static RendererInfo[] BuildGildedRendererInfos(RendererInfo[] baseInfos) { return BuildRecoloredRendererInfos(baseInfos, gildedMaterialCache, "Gilded", GildedRemap); } private static Material GetAlloyedMaterial(string group) { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown if (alloyedMaterials.TryGetValue(group, out var value)) { return value; } string text = group switch { "frame" => RoR2_Base_Treebot.matTreebotAltSolus_Mech_mat, "weapon" => RoR2_Base_Loader.matLoaderAltSolus_mat, "optic" => RoR2_Base_Treebot.matTreebotAltSolus_Eye_mat, _ => RoR2_Base_Loader.matLoaderAltSolusGear_mat, }; Material val = null; try { Material val2 = Addressables.LoadAssetAsync((object)text).WaitForCompletion(); if (Object.op_Implicit((Object)(object)val2)) { val = new Material(val2); ((Object)val).name = "matBastionAlloyed_" + group; } } catch (Exception ex) { Log.Warning("Alloyed skin: could not load the Solus material for " + group + " — " + ex.Message); } alloyedMaterials[group] = val; return val; } private static string AlloyedPrimaryGroup(Renderer renderer) { SkinnedMeshRenderer val = (SkinnedMeshRenderer)(object)((renderer is SkinnedMeshRenderer) ? renderer : null); if (!Object.op_Implicit((Object)(object)val) || !Object.op_Implicit((Object)(object)val.sharedMesh)) { return null; } if (Object.op_Implicit((Object)(object)BastionWireMesh.Get(val.sharedMesh, "armor"))) { return "armor"; } if (!Object.op_Implicit((Object)(object)BastionWireMesh.Get(val.sharedMesh, "weapon"))) { return null; } return "weapon"; } private static RendererInfo[] AddAlloyedPartRenderers(RendererInfo[] infos) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: 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_00d9: 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_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: 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_010f: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018a: 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) List list = new List(); for (int i = 0; i < infos.Length; i++) { string text = AlloyedPrimaryGroup(infos[i].renderer); if (text == null) { continue; } SkinnedMeshRenderer val = (SkinnedMeshRenderer)infos[i].renderer; string[] array = new string[3] { "frame", "weapon", "optic" }; foreach (string text2 in array) { Mesh val2 = BastionWireMesh.Get(val.sharedMesh, text2); if (!(text2 == text) && Object.op_Implicit((Object)(object)val2)) { GameObject val3 = new GameObject(((Object)val).name + "Alloyed" + text2) { layer = ((Component)val).gameObject.layer }; val3.transform.SetParent(((Component)val).transform.parent, false); val3.transform.localPosition = ((Component)val).transform.localPosition; val3.transform.localRotation = ((Component)val).transform.localRotation; val3.transform.localScale = ((Component)val).transform.localScale; SkinnedMeshRenderer val4 = val3.AddComponent(); val4.sharedMesh = val2; val4.bones = val.bones; val4.rootBone = val.rootBone; ((Renderer)val4).localBounds = ((Renderer)val).localBounds; val4.updateWhenOffscreen = val.updateWhenOffscreen; val4.quality = val.quality; ((Renderer)val4).sharedMaterial = GetAlloyedMaterial(text2) ?? GetAlloyedMaterial("armor"); val3.SetActive(false); RendererInfo item = infos[i]; item.renderer = (Renderer)(object)val4; item.defaultMaterial = ((Renderer)val4).sharedMaterial; list.Add(item); } } } return list.ToArray(); } private static RendererInfo[] BuildAlloyedRendererInfos(RendererInfo[] baseInfos) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) RendererInfo[] array = (RendererInfo[])(object)new RendererInfo[baseInfos.Length]; for (int i = 0; i < baseInfos.Length; i++) { array[i] = baseInfos[i]; string text = AlloyedPrimaryGroup(baseInfos[i].renderer); if (text != null) { array[i].defaultMaterial = GetAlloyedMaterial(text) ?? GetAlloyedMaterial("armor"); } } return array; } private static Material PurgeMaterial(Material source) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)source == (Object)null) { return source; } if (purgeMaterialCache.TryGetValue(source, out var value)) { return value; } Material val = new Material(source); ((Object)val).name = ((Object)source).name + "Purge"; if (!Object.op_Implicit((Object)(object)purgeTexture)) { purgeTexture = LoadSkinTexture("purge", "texBastionPurge"); } if (Object.op_Implicit((Object)(object)purgeTexture) && source.HasProperty("_MainTex")) { val.SetTexture("_MainTex", (Texture)(object)purgeTexture); } if (source.HasProperty("_EmColor")) { Color val2 = purgeLightColor; Color color = source.GetColor("_EmColor"); val.SetColor("_EmColor", val2 * Mathf.Max(1f, ((Color)(ref color)).maxColorComponent)); } purgeMaterialCache[source] = val; return val; } private static RendererInfo[] BuildPurgeRendererInfos(RendererInfo[] baseInfos) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) RendererInfo[] array = (RendererInfo[])(object)new RendererInfo[baseInfos.Length]; for (int i = 0; i < baseInfos.Length; i++) { array[i] = baseInfos[i]; array[i].defaultMaterial = PurgeMaterial(baseInfos[i].defaultMaterial); } return array; } private static Material MeridianMaterial(Material source) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)source == (Object)null) { return source; } if (meridianMaterialCache.TryGetValue(source, out var value)) { return value; } Material val = new Material(source); ((Object)val).name = ((Object)source).name + "Meridian"; if (!Object.op_Implicit((Object)(object)meridianTexture)) { meridianTexture = LoadSkinTexture("meridian", "texBastionMeridian"); } if (Object.op_Implicit((Object)(object)meridianTexture) && source.HasProperty("_MainTex")) { val.SetTexture("_MainTex", (Texture)(object)meridianTexture); } if (source.HasProperty("_EmColor")) { Color val2 = meridianLightColor; Color color = source.GetColor("_EmColor"); val.SetColor("_EmColor", val2 * Mathf.Max(1f, ((Color)(ref color)).maxColorComponent)); } meridianMaterialCache[source] = val; return val; } private static RendererInfo[] BuildMeridianRendererInfos(RendererInfo[] baseInfos) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) RendererInfo[] array = (RendererInfo[])(object)new RendererInfo[baseInfos.Length]; for (int i = 0; i < baseInfos.Length; i++) { array[i] = baseInfos[i]; array[i].defaultMaterial = MeridianMaterial(baseInfos[i].defaultMaterial); } return array; } private static Material HollowMaterial(Material source) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)source == (Object)null) { return source; } if (hollowMaterialCache.TryGetValue(source, out var value)) { return value; } Material val = new Material(source); ((Object)val).name = ((Object)source).name + "Bitumen"; if (!Object.op_Implicit((Object)(object)hollowTexture)) { hollowTexture = LoadSkinTexture("hollow", "texBastionBitumen"); } if (Object.op_Implicit((Object)(object)hollowTexture) && source.HasProperty("_MainTex")) { val.SetTexture("_MainTex", (Texture)(object)hollowTexture); } if (source.HasProperty("_EmColor")) { Color val2 = hollowLightColor; Color color = source.GetColor("_EmColor"); val.SetColor("_EmColor", val2 * Mathf.Max(1f, ((Color)(ref color)).maxColorComponent)); } hollowMaterialCache[source] = val; return val; } private static Material HollowTarMaterial() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown if (!hollowTarLoaded) { hollowTarLoaded = true; try { Material val = Addressables.LoadAssetAsync((object)RoR2_Base_Treebot.matTreebotAltHollowTar_mat).WaitForCompletion(); if (Object.op_Implicit((Object)(object)val)) { hollowTarMaterial = new Material(val); ((Object)hollowTarMaterial).name = "matBastionBitumenTar"; hollowTarMaterial.SetFloat("_VertexScale", 60000f); } } catch (Exception ex) { Log.Warning("Bitumen skin: could not load REX's tar material — " + ex.Message); } } return hollowTarMaterial; } private static RendererInfo[] BuildHollowRendererInfos(RendererInfo[] baseInfos) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) RendererInfo[] array = (RendererInfo[])(object)new RendererInfo[baseInfos.Length]; for (int i = 0; i < baseInfos.Length; i++) { array[i] = baseInfos[i]; array[i].defaultMaterial = HollowMaterial(baseInfos[i].defaultMaterial); } return array; } private static RendererInfo[] AddHollowPartRenderers(RendererInfo[] infos) { //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0127: 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_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0169: 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_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) List list = new List(); for (int i = 0; i < infos.Length; i++) { Renderer renderer = infos[i].renderer; SkinnedMeshRenderer val = (SkinnedMeshRenderer)(object)((renderer is SkinnedMeshRenderer) ? renderer : null); if (!Object.op_Implicit((Object)(object)val) || !Object.op_Implicit((Object)(object)BastionWireMesh.Get(val.sharedMesh, "hollow"))) { continue; } Material val2 = HollowMaterial(infos[i].defaultMaterial); Material item = HollowTarMaterial() ?? val2; (string, Material, bool)[] array = new(string, Material, bool)[3] { ("hollowtar", item, false), ("hollowtarstow", item, true), ("hollowfloat", val2, true) }; for (int j = 0; j < array.Length; j++) { (string, Material, bool) tuple = array[j]; string item2 = tuple.Item1; Material item3 = tuple.Item2; bool item4 = tuple.Item3; Mesh val3 = BastionWireMesh.Get(val.sharedMesh, item2); if (!Object.op_Implicit((Object)(object)val3)) { continue; } GameObject val4 = new GameObject(((Object)val).name + "Bitumen" + item2) { layer = ((Component)val).gameObject.layer }; val4.transform.SetParent(((Component)val).transform.parent, false); val4.transform.localPosition = ((Component)val).transform.localPosition; val4.transform.localRotation = ((Component)val).transform.localRotation; val4.transform.localScale = ((Component)val).transform.localScale; SkinnedMeshRenderer val5 = val4.AddComponent(); val5.sharedMesh = val3; val5.bones = val.bones; val5.rootBone = val.rootBone; ((Renderer)val5).localBounds = ((Renderer)val).localBounds; val5.updateWhenOffscreen = val.updateWhenOffscreen; val5.quality = val.quality; ((Renderer)val5).sharedMaterial = item3; val4.SetActive(false); RendererInfo item5 = infos[i]; item5.renderer = (Renderer)(object)val5; item5.defaultMaterial = item3; list.Add(item5); if (item4) { BastionPurgeStow bastionPurgeStow = ((Component)((Component)val).transform.parent).GetComponent(); if (!Object.op_Implicit((Object)(object)bastionPurgeStow)) { bastionPurgeStow = ((Component)((Component)val).transform.parent).gameObject.AddComponent(); bastionPurgeStow.skeleton = val; } bastionPurgeStow.stowed.Add((Renderer)(object)val5); } } } return list.ToArray(); } private static RendererInfo[] AddPurgePartRenderers(RendererInfo[] infos, string group = "purge", string recipe = "purge.kit.bin", string tag = "Purge") { //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: 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_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0129: 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_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0168: 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) List list = new List(); for (int i = 0; i < infos.Length; i++) { Renderer renderer = infos[i].renderer; SkinnedMeshRenderer val = (SkinnedMeshRenderer)(object)((renderer is SkinnedMeshRenderer) ? renderer : null); if (!Object.op_Implicit((Object)(object)val) || !Object.op_Implicit((Object)(object)BastionWireMesh.Get(val.sharedMesh, group))) { continue; } Matrix4x4[] bindposes = BastionWireMesh.GetBindposes(val.sharedMesh, group); foreach (BastionPurgeKit.Piece item2 in BastionPurgeKit.Get(recipe, bindposes, val.sharedMesh.bounds)) { GameObject val2 = new GameObject(((Object)val).name + tag + item2.name) { layer = ((Component)val).gameObject.layer }; val2.transform.SetParent(((Component)val).transform.parent, false); val2.transform.localPosition = ((Component)val).transform.localPosition; val2.transform.localRotation = ((Component)val).transform.localRotation; val2.transform.localScale = ((Component)val).transform.localScale; SkinnedMeshRenderer val3 = val2.AddComponent(); val3.sharedMesh = item2.mesh; val3.bones = val.bones; val3.rootBone = val.rootBone; ((Renderer)val3).localBounds = ((Renderer)val).localBounds; val3.updateWhenOffscreen = val.updateWhenOffscreen; val3.quality = val.quality; ((Renderer)val3).sharedMaterial = item2.material; val2.SetActive(false); RendererInfo item = infos[i]; item.renderer = (Renderer)(object)val3; item.defaultMaterial = item2.material; list.Add(item); if (item2.stow) { BastionPurgeStow bastionPurgeStow = ((Component)((Component)val).transform.parent).GetComponent(); if (!Object.op_Implicit((Object)(object)bastionPurgeStow)) { bastionPurgeStow = ((Component)((Component)val).transform.parent).gameObject.AddComponent(); bastionPurgeStow.skeleton = val; } bastionPurgeStow.stowed.Add((Renderer)(object)val3); } } } return list.ToArray(); } private static MeshReplacement[] BuildPurgeMeshReplacements(RendererInfo[] infos, string group = "purge") { MeshReplacement[] array = BuildMeshReplacements(infos, wire: false); for (int i = 0; i < array.Length; i++) { Mesh val = BastionWireMesh.Get(array[i].mesh, group); if (Object.op_Implicit((Object)(object)val)) { array[i].mesh = val; } } return array; } private static T[] Concat(T[] first, T[] second) { T[] array = new T[first.Length + second.Length]; first.CopyTo(array, 0); second.CopyTo(array, first.Length); return array; } private static MeshReplacement[] BuildMeshReplacements(RendererInfo[] infos, bool wire) { //IL_0041: 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) List list = new List(); for (int i = 0; i < infos.Length; i++) { Renderer renderer = infos[i].renderer; SkinnedMeshRenderer val = (SkinnedMeshRenderer)(object)((renderer is SkinnedMeshRenderer) ? renderer : null); if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.sharedMesh)) { string text = (wire ? AlloyedPrimaryGroup((Renderer)(object)val) : null); list.Add(new MeshReplacement { renderer = (Renderer)(object)val, mesh = ((text != null) ? BastionWireMesh.Get(val.sharedMesh, text) : val.sharedMesh) }); } } return list.ToArray(); } private static GameObjectActivation[] BuildPartActivations(RendererInfo[] partInfos, bool active) { //IL_0011: 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_0038: Unknown result type (might be due to invalid IL or missing references) GameObjectActivation[] array = (GameObjectActivation[])(object)new GameObjectActivation[partInfos.Length]; for (int i = 0; i < partInfos.Length; i++) { array[i] = new GameObjectActivation { gameObject = ((Component)partInfos[i].renderer).gameObject, shouldActivate = active }; } return array; } private static RendererInfo[] RemapRendererInfosToModel(RendererInfo[] sourceInfos, Transform modelRoot) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0049: 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_0089: Unknown result type (might be due to invalid IL or missing references) List list = new List(sourceInfos.Length); Renderer[] componentsInChildren = ((Component)modelRoot).GetComponentsInChildren(true); for (int i = 0; i < sourceInfos.Length; i++) { RendererInfo val = sourceInfos[i]; if (!Object.op_Implicit((Object)(object)val.renderer)) { continue; } if (((Component)val.renderer).transform.IsChildOf(modelRoot)) { list.Add(val); continue; } string name = ((Object)((Component)val.renderer).gameObject).name; Renderer[] array = componentsInChildren; foreach (Renderer val2 in array) { if (((Object)((Component)val2).gameObject).name == name) { val.renderer = val2; list.Add(val); break; } } } return list.ToArray(); } public override void InitializeSkins() { ((Component)prefabCharacterModel).gameObject.AddComponent().skins = BuildSkins(prefabCharacterModel, prefabCharacterModel.baseRendererInfos); if (Object.op_Implicit((Object)(object)displayPrefab)) { CharacterModel componentInChildren = displayPrefab.GetComponentInChildren(); if (Object.op_Implicit((Object)(object)componentInChildren) && !Object.op_Implicit((Object)(object)((Component)componentInChildren).GetComponent())) { RendererInfo[] infos = RemapRendererInfosToModel(componentInChildren.baseRendererInfos, ((Component)componentInChildren).transform); ((Component)componentInChildren).gameObject.AddComponent().skins = BuildSkins(componentInChildren, infos); ((Component)componentInChildren).gameObject.AddComponent(); } } } private static SkinDef[] BuildSkins(CharacterModel model, RendererInfo[] infos) { //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0186: 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_01ae: 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_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_024e: 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_02b4: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: 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_035d: Unknown result type (might be due to invalid IL or missing references) //IL_0371: Unknown result type (might be due to invalid IL or missing references) //IL_0385: Unknown result type (might be due to invalid IL or missing references) //IL_0399: Unknown result type (might be due to invalid IL or missing references) //IL_041e: Unknown result type (might be due to invalid IL or missing references) //IL_0432: Unknown result type (might be due to invalid IL or missing references) //IL_0446: Unknown result type (might be due to invalid IL or missing references) //IL_045a: Unknown result type (might be due to invalid IL or missing references) //IL_04e0: Unknown result type (might be due to invalid IL or missing references) //IL_04f4: Unknown result type (might be due to invalid IL or missing references) //IL_0508: Unknown result type (might be due to invalid IL or missing references) //IL_051c: Unknown result type (might be due to invalid IL or missing references) GameObject gameObject = ((Component)model).gameObject; bool flag = Object.op_Implicit((Object)(object)GetAlloyedMaterial("armor")); RendererInfo[] array = (RendererInfo[])(flag ? ((Array)AddAlloyedPartRenderers(infos)) : ((Array)new RendererInfo[0])); RendererInfo[] array2 = AddPurgePartRenderers(infos); RendererInfo[] array3 = (RendererInfo[])(object)new RendererInfo[0]; bool flag2 = false; for (int i = 0; i < infos.Length; i++) { Renderer renderer = infos[i].renderer; SkinnedMeshRenderer val = (SkinnedMeshRenderer)(object)((renderer is SkinnedMeshRenderer) ? renderer : null); if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.sharedMesh) && Object.op_Implicit((Object)(object)BastionWireMesh.Get(val.sharedMesh, "meridian"))) { flag2 = true; } } RendererInfo[] array4 = AddHollowPartRenderers(infos); GameObjectActivation[] second = BuildPartActivations(array4, active: false); RendererInfo[] array5 = Concat(Concat(Concat(array, array2), array3), array4); model.baseRendererInfos = Concat(infos, array5); MeshReplacement[] meshReplacements = BuildMeshReplacements(infos, wire: false); GameObjectActivation[] gameObjectActivations = BuildPartActivations(array5, active: false); bool value = BastionConfig.unlockAllSkins.Value; List list = new List(); Sprite skinIcon = Skins.CreateSkinIcon(new Color(0.231f, 0.557f, 0.682f), new Color(0.42f, 0.47f, 0.52f), new Color(0.1f, 0.18f, 0.26f), new Color(0.16f, 0.38f, 0.44f)); list.Add(Skins.CreateSkinDef("DEFAULT_SKIN", skinIcon, Concat(infos, array5), gameObject, null, meshReplacements, gameObjectActivations)); Sprite skinIcon2 = Skins.CreateSkinIcon(new Color(0.8f, 0.74f, 0.6f), new Color(0.36f, 0.42f, 0.24f), new Color(0.2f, 0.21f, 0.2f), new Color(0.66f, 0.33f, 0.17f)); UnlockableDef unlockableDef = ((!value) ? BastionUnlockables.masterySkinUnlockableDef : null); list.Add(Skins.CreateSkinDef("HASTEREAPR_BASTION_MASTERY_SKIN_NAME", skinIcon2, Concat(BuildVeteranRendererInfos(infos), array5), gameObject, unlockableDef, meshReplacements, gameObjectActivations)); Sprite skinIcon3 = Skins.CreateSkinIcon(new Color(0.8f, 0.64f, 0.36f), new Color(0.55f, 0.42f, 0.22f), new Color(0.3f, 0.23f, 0.13f), new Color(0.66f, 0.56f, 0.34f)); list.Add(Skins.CreateSkinDef("HASTEREAPR_BASTION_GILDED_SKIN_NAME", skinIcon3, Concat(BuildGildedRendererInfos(infos), array5), gameObject, value ? null : BastionUnlockables.GildedSkinUnlock, meshReplacements, gameObjectActivations)); if (flag) { Sprite skinIcon4 = Skins.CreateSkinIcon(new Color(0.35f, 0.85f, 0.95f), new Color(0.95f, 0.6f, 0.12f), new Color(0.06f, 0.12f, 0.2f), new Color(0.7f, 0.72f, 0.5f)); GameObjectActivation[] gameObjectActivations2 = Concat(Concat(BuildPartActivations(array, active: true), BuildPartActivations(array2, active: false)), Concat(BuildPartActivations(array3, active: false), second)); list.Add(Skins.CreateSkinDef("HASTEREAPR_BASTION_ALLOYED_SKIN_NAME", skinIcon4, Concat(BuildAlloyedRendererInfos(infos), array5), gameObject, value ? null : BastionUnlockables.DecompileSkinUnlock, BuildMeshReplacements(infos, wire: true), gameObjectActivations2)); } if (array2.Length != 0) { Sprite skinIcon5 = Skins.CreateSkinIcon(new Color(0.17f, 0.26f, 0.45f), new Color(0.14f, 0.3f, 0.2f), new Color(0.05f, 0.06f, 0.11f), new Color(1f, 0.42f, 0.72f)); GameObjectActivation[] gameObjectActivations3 = Concat(Concat(BuildPartActivations(array, active: false), BuildPartActivations(array2, active: true)), Concat(BuildPartActivations(array3, active: false), second)); list.Add(Skins.CreateSkinDef("HASTEREAPR_BASTION_PURGE_SKIN_NAME", skinIcon5, Concat(BuildPurgeRendererInfos(infos), array5), gameObject, value ? null : BastionUnlockables.PurgeSkinUnlock, BuildPurgeMeshReplacements(infos), gameObjectActivations3)); } if (flag2) { Sprite skinIcon6 = Skins.CreateSkinIcon(new Color(0.93f, 0.95f, 0.96f), new Color(0.49f, 0.52f, 0.57f), new Color(0.12f, 0.13f, 0.15f), new Color(1f, 0.54f, 0.12f)); GameObjectActivation[] gameObjectActivations4 = Concat(Concat(BuildPartActivations(array, active: false), BuildPartActivations(array2, active: false)), Concat(BuildPartActivations(array3, active: true), second)); list.Add(Skins.CreateSkinDef("HASTEREAPR_BASTION_MERIDIAN_SKIN_NAME", skinIcon6, Concat(BuildMeridianRendererInfos(infos), array5), gameObject, value ? null : BastionUnlockables.MeridianSkinUnlock, BuildPurgeMeshReplacements(infos, "meridian"), gameObjectActivations4)); } if (array4.Length != 0) { Sprite skinIcon7 = Skins.CreateSkinIcon(new Color(0.11f, 0.19f, 0.25f), new Color(0.17f, 0.3f, 0.39f), new Color(0.03f, 0.04f, 0.05f), new Color(0.3f, 1f, 0.45f)); GameObjectActivation[] gameObjectActivations5 = Concat(Concat(BuildPartActivations(array, active: false), BuildPartActivations(array2, active: false)), Concat(BuildPartActivations(array3, active: false), BuildPartActivations(array4, active: true))); list.Add(Skins.CreateSkinDef("HASTEREAPR_BASTION_HOLLOW_SKIN_NAME", skinIcon7, Concat(BuildHollowRendererInfos(infos), array5), gameObject, value ? null : BastionUnlockables.HollowSkinUnlock, BuildPurgeMeshReplacements(infos, "hollow"), gameObjectActivations5)); } AddTreads(model, infos, list); return list.ToArray(); } private static void AddTreads(CharacterModel model, RendererInfo[] infos, List skins) { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown //IL_0066: 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_0083: 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_00b1: 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_00d1: 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_00e4: 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_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) int num = -1; for (int i = 0; i < infos.Length; i++) { if (AlloyedPrimaryGroup(infos[i].renderer) == "armor") { num = i; break; } } if (num < 0 || Object.op_Implicit((Object)(object)((Component)model).GetComponent())) { return; } SkinnedMeshRenderer val = BastionTreads.AddTo(model, (SkinnedMeshRenderer)infos[num].renderer); if (!Object.op_Implicit((Object)(object)val)) { return; } RendererInfo val2 = infos[num]; val2.renderer = (Renderer)(object)val; model.baseRendererInfos = Concat(model.baseRendererInfos, (RendererInfo[])(object)new RendererInfo[1] { val2 }); foreach (SkinDef skin in skins) { RendererInfo val3 = skin.rendererInfos[num]; val3.renderer = (Renderer)(object)val; skin.rendererInfos = Concat(skin.rendererInfos, (RendererInfo[])(object)new RendererInfo[1] { val3 }); MeshReplacement val4 = new MeshReplacement { renderer = (Renderer)(object)val, mesh = BastionTreads.GetMesh(BastionWireMesh.IsWireMaterial(val3.defaultMaterial)) }; skin.meshReplacements = Concat(skin.meshReplacements, (MeshReplacement[])(object)new MeshReplacement[1] { val4 }); if (Object.op_Implicit((Object)(object)skin.skinDefParams)) { skin.skinDefParams.rendererInfos = skin.rendererInfos; skin.skinDefParams.meshReplacements = Concat(skin.skinDefParams.meshReplacements, (MeshReplacement[])(object)new MeshReplacement[1] { MeshReplacement.op_Implicit(val4) }); } } } public override void InitializeCharacterMaster() { BastionAI.Init(bodyPrefab, masterName); } private void AddHooks() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients); } private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args) { if (sender.HasBuff(BastionBuffs.turretRootDef)) { args.armorAdd += 50f; if (BastionTank.IsTank(sender)) { args.armorAdd += 30f; } } } } internal static class BastionTank { internal const float MoveSpeedFraction = 0.6f; internal const float BonusArmor = 30f; private const string ScepterGuid = "com.DestroyedClone.AncientScepter"; private static ItemIndex scepterIndex = (ItemIndex)(-1); private static bool scepterLookedUp; internal static readonly Dictionary deployStates = new Dictionary(); internal static bool IsTank(CharacterBody body) { if (Object.op_Implicit((Object)(object)body) && BastionBuffs.tankDef != null && body.HasBuff(BastionBuffs.tankDef)) { return body.HasBuff(BastionBuffs.turretRootDef); } return false; } internal static bool HasScepter(CharacterBody body) { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Invalid comparison between Unknown and I4 //IL_0029: 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_0041: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.inventory)) { return false; } if (!scepterLookedUp) { scepterLookedUp = true; scepterIndex = ItemCatalog.FindItemIndex("ITEM_ANCIENT_SCEPTER"); } if ((int)scepterIndex != -1) { return body.inventory.GetItemCountEffective(scepterIndex) > 0; } return false; } internal static bool TryGiveStarterScepter(CharacterBody body) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Invalid comparison between Unknown and I4 //IL_0048: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active || !Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.inventory)) { return false; } if (BastionConfig.startWithScepter.Value && body.isPlayerControlled && !HasScepter(body) && (int)scepterIndex != -1) { body.inventory.GiveItemPermanent(scepterIndex, 1); } return true; } private static Sprite LoadTankIcon(Sprite plain) { //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Expected O, but got Unknown //IL_00c1: 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) if (!Object.op_Implicit((Object)(object)plain)) { return null; } string text = ((Object)plain).name + "Tank"; using Stream stream = typeof(BastionTank).Assembly.GetManifestResourceStream("BastionMod.Icons." + text + ".png"); if (stream == null) { return null; } byte[] array = new byte[stream.Length]; int num; for (int i = 0; i < array.Length; i += num) { num = stream.Read(array, i, array.Length - i); if (num <= 0) { break; } } Texture2D val = new Texture2D(2, 2, (TextureFormat)4, true); ((Object)val).name = text; if (!ImageConversion.LoadImage(val, array)) { return null; } ((Texture)val).wrapMode = (TextureWrapMode)1; Sprite obj = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f), plain.pixelsPerUnit); ((Object)obj).name = text; return obj; } internal static void Init(GameObject bodyPrefab) { //IL_016e: 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_0189: Unknown result type (might be due to invalid IL or missing references) if (!Chainloader.PluginInfos.ContainsKey("com.DestroyedClone.AncientScepter")) { return; } try { Type? type = Type.GetType("AncientScepter.AncientScepterItem, AncientScepter"); object obj = type?.BaseType?.GetProperty("instance", BindingFlags.Static | BindingFlags.Public | BindingFlags.FlattenHierarchy)?.GetValue(null); MethodInfo methodInfo = type?.GetMethod("RegisterScepterSkill", new Type[3] { typeof(SkillDef), typeof(string), typeof(SkillDef) }); if (obj == null || methodInfo == null) { Log.Warning("Tank form: Ancient Scepter is installed but its registration API was not found."); return; } SkillFamily skillFamily = bodyPrefab.GetComponent().utility.skillFamily; for (int i = 0; i < skillFamily.variants.Length; i++) { SkillDef skillDef = skillFamily.variants[i].skillDef; if (Object.op_Implicit((Object)(object)skillDef)) { SkillDef val = Object.Instantiate(skillDef); val.skillName = skillDef.skillName + "Tank"; ((Object)val).name = val.skillName; val.skillNameToken = skillDef.skillNameToken.Replace("_NAME", "_TANK_NAME"); val.skillDescriptionToken = skillDef.skillDescriptionToken.Replace("_DESCRIPTION", "_TANK_DESCRIPTION"); Sprite val2 = LoadTankIcon(skillDef.icon); if (Object.op_Implicit((Object)(object)val2)) { val.icon = val2; } deployStates[val] = skillDef.activationState; val.activationState = new SerializableEntityStateType(typeof(TankDeploy)); Content.AddSkillDef(val); methodInfo.Invoke(obj, new object[3] { val, BastionPlugin.bodyName, skillDef }); } } } catch (Exception ex) { Log.Warning("Tank form: could not register the Ancient Scepter skills — " + ex); } } } public static class BastionTokens { public static void Init() { AddBastionTokens(); } public static void AddBastionTokens() { string text = "HASTEREAPR_BASTION_"; string text2 = "BAS-10 is a UES combat machine that trades mobility for overwhelming firepower; able to reconfigure between a mobile recon form and devastating stationary emplacements." + Environment.NewLine + Environment.NewLine + "< ! > Recon form is your only mobile form — use it to reposition, retreat or just to stay on the move when needed." + Environment.NewLine + Environment.NewLine + "< ! > Assault form's minigun spins up over sustained fire. Keep the trigger held to reach full output." + Environment.NewLine + Environment.NewLine + "< ! > Bombard form fires explosive shells in a fixed arc in front of where you deploy — face your target BEFORE transforming." + Environment.NewLine + Environment.NewLine + "< ! > Artillery form rains shells wherever you aim, even over walls." + Environment.NewLine + Environment.NewLine; string text3 = "..and so it left, in search of new life."; string text4 = "..and so it powered down, dreaming of a small green bird."; Language.Add(text + "NAME", "BAS-10"); Language.Add(text + "DESCRIPTION", text2); Language.Add(text + "SUBTITLE", "The Slumbering Sentry"); Language.Add(text + "LORE", "// RECOVERED AUDIO LOG — UES Safe Travels, cargo bay 4 //" + Environment.NewLine + Environment.NewLine + "\"Manifest says 'BAS-10, decommissioned UES combat automaton. Inert.' Inert, sure — but the chassis hums if you put your hand on it. Like it's listening." + Environment.NewLine + Environment.NewLine + "Ramirez wanted to scrap it for parts. The little green bird that's been nesting in the barrel housing had other opinions. Three eyes, all of them judgmental. Pecked him twice." + Environment.NewLine + Environment.NewLine + "We're leaving them both. Whatever purpose that machine was built for is long past, and honestly? The bird seems to have the situation handled.\"" + Environment.NewLine + Environment.NewLine + "// END LOG //"); Language.Add(text + "OUTRO_FLAVOR", text3); Language.Add(text + "OUTRO_FAILURE", text4); Language.Add("LOCKEDBAS10_NAME", "Dormant BAS-10 Unit"); Language.Add("LOCKEDBAS10_CONTEXT", "Awaken?"); Language.Add("LOCKEDBAS10_CONTEXT_OFFER", "Offer the Jade Thrinch and awaken?"); Language.Add("LOCKEDBAS10_CONTEXT_NEEDBIRD", "Awaken? (Requires a Jade Thrinch)"); Language.Add(text + "MASTERY_SKIN_NAME", "Veteran"); Language.Add(text + "GILDED_SKIN_NAME", "Gilded"); Language.Add(text + "ALLOYED_SKIN_NAME", "Config"); Language.Add(text + "PURGE_SKIN_NAME", "Roost"); Language.Add(text + "MERIDIAN_SKIN_NAME", "Mk. II"); Language.Add(text + "HOLLOW_SKIN_NAME", "Bitumen"); Language.Add(text + "NULL", ""); Language.Add(text + "PRIMARY_RECON_NAME", "Assault Rifle"); Language.Add(text + "PRIMARY_RECON_DESCRIPTION", "Agile. Rapidly fire an assault rifle for 80% damage."); Language.Add(text + "PRIMARY_RECON_SNIPER_NAME", "Marksman Rifle"); Language.Add(text + "PRIMARY_RECON_SNIPER_DESCRIPTION", "Agile. Fire a precise round for 350% damage."); Language.Add(text + "PRIMARY_RECON_SHOTGUN_NAME", "Riot Shotgun"); Language.Add(text + "PRIMARY_RECON_SHOTGUN_DESCRIPTION", "Agile. Fire a close-range blast of 16 pellets for 16x60% damage."); Language.Add(text + "PRIMARY_ASSAULT_NAME", "Suppression Minigun"); Language.Add(text + "PRIMARY_ASSAULT_DESCRIPTION", "Unleash a minigun that spins up to full speed over sustained fire, dealing 87.5% damage per bullet. Attack speed increases damage instead of fire rate. Sustained fire overheats the barrel, letting bullets ignite."); Language.Add(text + "PRIMARY_BOMBARD_NAME", "Siege Cannon"); Language.Add(text + "PRIMARY_BOMBARD_DESCRIPTION", "Fire an explosive shell for 325% damage within a fixed firing arc. A trajectory line predicts the impact point."); Language.Add(text + "PRIMARY_ARTILLERY_NAME", "Artillery Shell"); Language.Add(text + "PRIMARY_ARTILLERY_DESCRIPTION", "Fire a shell that rains down on the targeted position for 1000% damage. Holds 3 shells."); Language.Add(text + "PRIMARY_DRONE_NAME", "Support Capsule"); Language.Add(text + "PRIMARY_DRONE_DESCRIPTION", "Launch a support capsule containing 4 GN-4T drones at the targeted position, then return to recon form."); Language.Add(text + "PROC_BULLET", "Bullet"); Language.Add(text + "PROC_PELLET", "Pellet"); Language.Add(text + "PROC_SHELL", "Shell"); Language.Add(text + "SECONDARY_HEAL_NAME", "Operation : Repair"); Language.Add(text + "SECONDARY_HEAL_DESCRIPTION", $"Begin repairing BAS-10 Unit for {10f} + 5% max health per second, plus an additional {3f} health per level for up to 6 seconds."); Language.Add(text + "SECONDARY_GRENADE_NAME", "Concussion Charge"); Language.Add(text + "SECONDARY_GRENADE_DESCRIPTION", "Agile. Hold to aim, release to throw an A-36 Tactical Concussion Grenade for 700% damage on detonation. The blast has high knockback — usable offensively and as a positioning tool."); Language.Add(text + "RECON_TO_ASSAULT_NAME", "Configuration : Assault"); Language.Add(text + "RECON_TO_ASSAULT_DESCRIPTION", "Deploy into a stationary assault emplacement with bonus armor and a minigun."); Language.Add(text + "RECON_TO_BOMBARD_NAME", "Configuration : Bombard"); Language.Add(text + "RECON_TO_BOMBARD_DESCRIPTION", "Deploy into a stationary siege emplacement with bonus armor, firing explosive shells in a fixed frontal arc."); string text5 = Tokens.ScepterDescription("Grow treads. You can drive while deployed at " + 60 + "% speed, and gain " + 30 + " more armor."); Language.Add(text + "RECON_TO_ASSAULT_TANK_NAME", "Configuration : Assault Tank"); Language.Add(text + "RECON_TO_ASSAULT_TANK_DESCRIPTION", "Deploy into an assault emplacement with bonus armor and a minigun." + text5); Language.Add(text + "RECON_TO_BOMBARD_TANK_NAME", "Configuration : Siege Tank"); Language.Add(text + "RECON_TO_BOMBARD_TANK_DESCRIPTION", "Deploy into a siege emplacement with bonus armor, firing explosive shells in an arc ahead of the chassis." + text5); Language.Add(text + "UTILITY_ASSAULTTORECON_NAME", "Configuration : Recon"); Language.Add(text + "UTILITY_ASSAULTTORECON_DESCRIPTION", "Reconfigure back into the mobile recon form."); Language.Add(text + "ARTILLERY_NAME", "Configuration : Artillery"); Language.Add(text + "ARTILLERY_DESCRIPTION", "Deploy into a stationary artillery emplacement. Fire up to 3 shells that rain down on the targeted position for 1000% damage each."); Language.Add(text + "DRONE_ARTILLERY_NAME", "Configuration : Deploy"); Language.Add(text + "DRONE_ARTILLERY_DESCRIPTION", "Deploy into artillery configuration and launch a single support capsule containing 4 GN-4T drones, then automatically return to recon form."); Language.Add(text + "TEMPORARY_DRONE", "GN-4T"); Language.Add("DRONE_DESCRIPTION", $"[ GN-4T ] \nDrones have a lifetime of {20} seconds.\nThese drones are smaller, faster, and faster firing than regular gunner drones, at the cost of having smaller caliber bullets.\nIncreasing special stocks increases the amount of drones in a capsule."); Language.Add(Tokens.GetAchievementNameToken("HASTEREAPR_BASTION_MASTERY_ACHIEVEMENT"), "BAS-10: Mastery"); Language.Add(Tokens.GetAchievementDescriptionToken("HASTEREAPR_BASTION_MASTERY_ACHIEVEMENT"), "As BAS-10, beat the game or obliterate on Monsoon."); Language.Add("HASTEREAPR_BASTION_MASTERY_UNLOCKABLE", "As BAS-10, beat the game or obliterate on Monsoon."); Language.Add(Tokens.GetAchievementNameToken("HASTEREAPR_BASTION_UNLOCK_ACHIEVMENT"), "Electric Sheep"); Language.Add(Tokens.GetAchievementDescriptionToken("HASTEREAPR_BASTION_UNLOCK_ACHIEVMENT"), "Awaken the sleeping robot on Wetland Aspect with a friendly bird."); Language.Add("HASTEREAPR_BASTION_CHARACTER_UNLOCKABLE", "Awaken the sleeping robot in Wetland Aspect with a friendly bird."); Language.Add(Tokens.GetAchievementNameToken("HASTEREAPR_BASTION_QUICK_KILL_ACHIEVEMENT"), "Protocol : Threat Assessment"); Language.Add(Tokens.GetAchievementDescriptionToken("HASTEREAPR_BASTION_QUICK_KILL_ACHIEVEMENT"), "As BAS-10, kill a teleporter boss within 10 seconds of summoning."); Language.Add("HASTEREAPR_BASTION_QUICK_KILL_UNLOCKABLE", "As BAS-10, kill a teleporter boss within 10 seconds of summoning."); Language.Add(Tokens.GetAchievementNameToken("HASTEREAPR_BASTION_CONSERVATION_ACHIEVEMENT"), "Protocol : Lead Conservation"); Language.Add(Tokens.GetAchievementDescriptionToken("HASTEREAPR_BASTION_CONSERVATION_ACHIEVEMENT"), "As BAS-10, clear a stage without reconfiguring."); Language.Add("HASTEREAPR_BASTION_CONSERVATION_UNLOCKABLE", "As BAS-10, clear a stage without reconfiguring."); Language.Add(Tokens.GetAchievementNameToken("HASTEREAPR_BASTION_DRONEBUDDY_ACHIEVEMENT"), "Protocol : Reinforcements"); Language.Add(Tokens.GetAchievementDescriptionToken("HASTEREAPR_BASTION_DRONEBUDDY_ACHIEVEMENT"), "As BAS-10, activate The Back-up with 2 or more mechanical allies."); Language.Add("HASTEREAPR_BASTION_DRONEBUDDY_UNLOCKABLE", "As BAS-10, activate The Back-up with 2 or more mechanical allies."); Language.Add(Tokens.GetAchievementNameToken("HASTEREAPR_BASTION_BOMBARDMULTI_ACHIEVEMENT"), "Protocol : Area Denial"); Language.Add(Tokens.GetAchievementDescriptionToken("HASTEREAPR_BASTION_BOMBARDMULTI_ACHIEVEMENT"), "As BAS-10, kill 5 or more enemies with a single bombard or artillery shell."); Language.Add("HASTEREAPR_BASTION_BOMBARDMULTI_UNLOCKABLE", "As BAS-10, kill 5 or more enemies with a single bombard or artillery shell."); Language.Add(Tokens.GetAchievementNameToken("HASTEREAPR_BASTION_CROWDFUNDER_ACHIEVEMENT"), "All That Glitters"); Language.Add(Tokens.GetAchievementDescriptionToken("HASTEREAPR_BASTION_CROWDFUNDER_ACHIEVEMENT"), "As BAS-10, deliver the killing blow to Aurelionite with the Crowdfunder."); Language.Add("HASTEREAPR_BASTION_CROWDFUNDER_UNLOCKABLE", "As BAS-10, deliver the killing blow to Aurelionite with the Crowdfunder."); Language.Add(Tokens.GetAchievementNameToken("HASTEREAPR_BASTION_DECOMPILE_ACHIEVEMENT"), "BAS-10: Accept and Decompile"); Language.Add(Tokens.GetAchievementDescriptionToken("HASTEREAPR_BASTION_DECOMPILE_ACHIEVEMENT"), "As BAS-10, accept the offering of the Collective."); Language.Add("HASTEREAPR_BASTION_DECOMPILE_UNLOCKABLE", "As BAS-10, accept the offering of the Collective."); Language.Add(Tokens.GetAchievementNameToken("HASTEREAPR_BASTION_MERIDIAN_ACHIEVEMENT"), "BAS-10: Cleared Prime Meridian"); Language.Add(Tokens.GetAchievementDescriptionToken("HASTEREAPR_BASTION_MERIDIAN_ACHIEVEMENT"), "As BAS-10, complete the Event on Prime Meridian."); Language.Add("HASTEREAPR_BASTION_MERIDIAN_UNLOCKABLE", "As BAS-10, complete the Event on Prime Meridian."); Language.Add(Tokens.GetAchievementNameToken("HASTEREAPR_BASTION_ULTIMA_ACHIEVEMENT"), "BAS-10: Memento Mori"); Language.Add(Tokens.GetAchievementDescriptionToken("HASTEREAPR_BASTION_ULTIMA_ACHIEVEMENT"), "As BAS-10, defeat what lies beyond the door of Soulbound Threshold."); Language.Add("HASTEREAPR_BASTION_ULTIMA_UNLOCKABLE", "As BAS-10, defeat what lies beyond the door of Soulbound Threshold."); Language.Add(Tokens.GetAchievementNameToken("HASTEREAPR_BASTION_PURGE_ACHIEVEMENT"), "BAS-10: Purge"); Language.Add(Tokens.GetAchievementDescriptionToken("HASTEREAPR_BASTION_PURGE_ACHIEVEMENT"), "As BAS-10, reject the offering of the Collective."); Language.Add("HASTEREAPR_BASTION_PURGE_UNLOCKABLE", "As BAS-10, reject the offering of the Collective."); Language.Add(Tokens.GetAchievementNameToken("HASTEREAPR_BASTION_LASTRESORT_ACHIEVEMENT"), "Protocol : Last Resort"); Language.Add(Tokens.GetAchievementDescriptionToken("HASTEREAPR_BASTION_LASTRESORT_ACHIEVEMENT"), "As BAS-10, kill 5 enemies while below 25% health."); Language.Add("HASTEREAPR_BASTION_LASTRESORT_UNLOCKABLE", "As BAS-10, kill 5 enemies while below 25% health."); Language.Add("BASTION_GANYMEDE_NAME", "Jade Thrinch"); Language.Add("BASTION_GANYMEDE_PICKUP", "Grants a minor bonus to all stats. Also, pings interactables around the player on occasion."); Language.Add("BASTION_GANYMEDE_DESC", "A jade finch follows you. Every so often it flies off to scout the nearest interactable and ping it, will perch on a nearby pressure plate to hold it down, and grants a small boost to all stats."); Language.Add("BASTION_GANYMEDE_LORE", "// RECOVERED AUDIO LOG — UES Contact Light, Drone Control Bay //" + Environment.NewLine + "''The hell is it..?''" + Environment.NewLine + Environment.NewLine + "''What, did the damn thing reboot itself again? I swear, the data terminals are more reliable than that bucket of bolts. Company's gonna have a fun time RMAing these things when they hit store shelves.''" + Environment.NewLine + Environment.NewLine + "''Not just that, but now it's... got a friend?''" + Environment.NewLine + Environment.NewLine + "''The Company sent that prototype along for the mission so we could send it out to explore and scan things. That's it. So, who decided to give this thing social skills? What the hell has it found, anyway?''" + Environment.NewLine + Environment.NewLine + "''It's this flying creature that's been sticking around the bot. Almost looks like a normal bird from back home.''" + Environment.NewLine + Environment.NewLine + "''And why didn't it just scan the bird and move on?''" + Environment.NewLine + Environment.NewLine + "''It did, actually. Added the bird to its wildlife catalog under the name 'Jade Thrinch'. Behaviors and beak structure suggest that the creature poses an incalculable existential threat to uh, small arthropods, soft-skinned fruits, and seeds. Slightly less so to us. But there's some behavioral feedback loops going on that are making the bot 'like' having it around: Bird sticks around BAS-10, bird gets passively scanned by the cameras, bot's AI is rewarded for a successful scan; ergo, bot likes the bird. Happens over and over, a few thousand times so far. What's really fascinating is that the reinforcement loop seems to persist through full resets, no matter how many it runs itself through. It's like whatever bug or... feature, maybe? It's like it's baseline, or something at the hardware le-''" + Environment.NewLine + Environment.NewLine + "''And we didn't check for this kind of thing before dropping it on the planet? UES didn't test for it before saddling us with the damned thing?''" + Environment.NewLine + Environment.NewLine + "''You wanted it out the door ASAP, techs didn't have time to run a full diag after getting it out of the crate. I'd have loved to pick its 'brain' about this subroutine it's running, do you think maybe I could insp-''" + Environment.NewLine + Environment.NewLine + "''Subroutine? Great, so our pet robot is doing side quests instead of what we sent it out there for.''" + Environment.NewLine + Environment.NewLine + "''Progress is slow but it's still performing its tasks - when it's not going through a hard reset cycle, at least.''" + Environment.NewLine + Environment.NewLine + "''Reboots and attachment issues. Guess we'll send it to the techs if it ever makes it back onboard. Or a therapist, I guess.''"); Language.Add("HASTEREAPR_BASTION_NEEDS_BIRD", "The dormant machine stirs... then settles. Perhaps a friendly bird could rouse it."); Language.Add("BASTION_WILD_THRINCH_NAME", "Friendly Bird"); Language.Add("BASTION_WILD_THRINCH_CONTEXT", "Greet the friendly bird?"); Language.Add("BASTION_GANYMEDE_PING_MSG", "Jade Thrinch found {0}!"); Language.Add("BASTION_GANYMEDE_PLATE_NAME", "Pressure Plate"); Language.Add("BASTION_WILD_THRINCH_FEATHER_MSG", "The friendly bird offers you a feather."); Language.Add("BASTION_WILD_THRINCH_SEED_MSG", "The friendly bird offers you a strange seed."); } } public static class BastionUnlockables { public static List unlockableDefs = new List(); public static UnlockableDef CharacterUnlock = null; public static UnlockableDef ShotgunUnlock = null; public static UnlockableDef SniperUnlock = null; public static UnlockableDef GrenadeUnlock = null; public static UnlockableDef BombardUnlock = null; public static UnlockableDef DroneUnlock = null; public static UnlockableDef masterySkinUnlockableDef = null; public static UnlockableDef GildedSkinUnlock = null; public static UnlockableDef DecompileSkinUnlock = null; public static UnlockableDef PurgeSkinUnlock = null; public static UnlockableDef MeridianSkinUnlock = null; public static UnlockableDef HollowSkinUnlock = null; public static void Init() { //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0118: 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_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0168: 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_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: 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_021c: 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_0244: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: Unknown result type (might be due to invalid IL or missing references) CharacterUnlock = CreateAndAddUnlockbleDef("HASTEREAPR_BASTION_CHARACTER_UNLOCKABLE", BastionUnlockAchievement.Sprite); SniperUnlock = CreateAndAddUnlockbleDef("HASTEREAPR_BASTION_CONSERVATION_UNLOCKABLE", Asset.MainAssetBundle.LoadAsset("iconSniper")); BombardUnlock = CreateAndAddUnlockbleDef("HASTEREAPR_BASTION_QUICK_KILL_UNLOCKABLE", Asset.MainAssetBundle.LoadAsset("iconBombard")); DroneUnlock = CreateAndAddUnlockbleDef("HASTEREAPR_BASTION_DRONEBUDDY_UNLOCKABLE", Asset.MainAssetBundle.LoadAsset("iconArtillery")); ShotgunUnlock = CreateAndAddUnlockbleDef("HASTEREAPR_BASTION_BOMBARDMULTI_UNLOCKABLE", Asset.MainAssetBundle.LoadAsset("iconShotgun")); GrenadeUnlock = CreateAndAddUnlockbleDef("HASTEREAPR_BASTION_LASTRESORT_UNLOCKABLE", Asset.MainAssetBundle.LoadAsset("iconHeal")); masterySkinUnlockableDef = CreateAndAddUnlockbleDef("HASTEREAPR_BASTION_MASTERY_UNLOCKABLE", Asset.MainAssetBundle.LoadAsset("texBastionIcon")); GildedSkinUnlock = CreateAndAddUnlockbleDef("HASTEREAPR_BASTION_CROWDFUNDER_UNLOCKABLE", Skins.CreateSkinIcon(new Color(0.8f, 0.64f, 0.36f), new Color(0.55f, 0.42f, 0.22f), new Color(0.3f, 0.23f, 0.13f), new Color(0.66f, 0.56f, 0.34f))); DecompileSkinUnlock = CreateAndAddUnlockbleDef("HASTEREAPR_BASTION_DECOMPILE_UNLOCKABLE", Skins.CreateSkinIcon(new Color(0.35f, 0.85f, 0.95f), new Color(0.95f, 0.6f, 0.12f), new Color(0.06f, 0.12f, 0.2f), new Color(0.7f, 0.72f, 0.5f))); MeridianSkinUnlock = CreateAndAddUnlockbleDef("HASTEREAPR_BASTION_MERIDIAN_UNLOCKABLE", Skins.CreateSkinIcon(new Color(0.93f, 0.95f, 0.96f), new Color(0.49f, 0.52f, 0.57f), new Color(0.12f, 0.13f, 0.15f), new Color(1f, 0.54f, 0.12f))); HollowSkinUnlock = CreateAndAddUnlockbleDef("HASTEREAPR_BASTION_ULTIMA_UNLOCKABLE", Skins.CreateSkinIcon(new Color(0.11f, 0.19f, 0.25f), new Color(0.17f, 0.3f, 0.39f), new Color(0.03f, 0.04f, 0.05f), new Color(0.3f, 1f, 0.45f))); PurgeSkinUnlock = CreateAndAddUnlockbleDef("HASTEREAPR_BASTION_PURGE_UNLOCKABLE", Skins.CreateSkinIcon(new Color(0.17f, 0.26f, 0.45f), new Color(0.14f, 0.3f, 0.2f), new Color(0.05f, 0.06f, 0.11f), new Color(1f, 0.42f, 0.72f))); } internal static UnlockableDef CreateAndAddUnlockbleDef(string identifier, Sprite achievementIcon) { UnlockableDef val = ScriptableObject.CreateInstance(); val.cachedName = identifier.ToUpperInvariant(); val.nameToken = "ACHIEVEMENT_" + identifier.ToUpperInvariant() + "_NAME"; val.achievementIcon = achievementIcon; unlockableDefs.Add(val); return val; } } public static class BastionWildThrinch { [CompilerGenerated] private static class <>O { public static Action <0>__OnServerStageBegin; public static hook_OnInteractionBegin <1>__OnWildThrinchInteraction; } public static GameObject wildThrinchPrefab; private static bool hooked; private static readonly Vector3[] conifPerchLocals = (Vector3[])(object)new Vector3[5] { new Vector3(2.68f, 18.85f, 0.21f), new Vector3(-0.34f, 21.19f, -3.74f), new Vector3(-2.2f, 25.16f, 0.52f), new Vector3(-1.76f, 31.21f, -3.37f), new Vector3(1.2f, 31.37f, -1.91f) }; public static void Init() { //IL_0042: 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_004d: Expected O, but got Unknown BuildPrefab(); if (!hooked) { hooked = true; Stage.onServerStageBegin += OnServerStageBegin; object obj = <>O.<1>__OnWildThrinchInteraction; if (obj == null) { hook_OnInteractionBegin val = OnWildThrinchInteraction; <>O.<1>__OnWildThrinchInteraction = val; obj = (object)val; } PurchaseInteraction.OnInteractionBegin += (hook_OnInteractionBegin)obj; } } private static void BuildPrefab() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown //IL_0044: Expected O, but got Unknown //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: 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_0113: Unknown result type (might be due to invalid IL or missing references) if ((Object)BastionAssets.ganymedePrefab == (Object)null) { Log.Error("WildThrinch: ganymede prefab missing"); return; } GameObject val = new GameObject("WildJadeThrinchTemp"); val.AddComponent(); wildThrinchPrefab = PrefabAPI.InstantiateClone(val, "WildJadeThrinch", true); Object.Destroy((Object)val); GameObject val2 = Object.Instantiate(BastionAssets.ganymedePrefab, wildThrinchPrefab.transform); ((Object)val2).name = "Visual"; val2.transform.localPosition = Vector3.zero; val2.transform.localScale = Vector3.one * 1.35f; PurchaseInteraction obj = wildThrinchPrefab.AddComponent(); obj.displayNameToken = "BASTION_WILD_THRINCH_NAME"; obj.contextToken = "BASTION_WILD_THRINCH_CONTEXT"; obj.costType = (CostTypeIndex)0; obj.cost = 0; obj.automaticallyScaleCostWithDifficulty = false; obj.available = true; wildThrinchPrefab.AddComponent().radius = 1f; wildThrinchPrefab.AddComponent().entity = wildThrinchPrefab; Highlight obj2 = wildThrinchPrefab.AddComponent(); obj2.targetRenderer = val2.GetComponentInChildren(); obj2.strength = 1f; obj2.highlightColor = (HighlightColor)0; wildThrinchPrefab.AddComponent(); } private unsafe static void OnServerStageBegin(Stage stage) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //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_006d: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_007e: 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_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) if ((Object)wildThrinchPrefab == (Object)null || (Object)(object)stage == (Object)null || (Object)(object)stage.sceneDef == (Object)null) { return; } string cachedName = stage.sceneDef.cachedName; if (!(cachedName != "blackbeach") || !(cachedName != "blackbeach2")) { Quaternion rotation = Quaternion.identity; if (!TryFindConiferPerch(out var position, out rotation)) { position = HighestGroundNode(); } NetworkServer.Spawn(Object.Instantiate(wildThrinchPrefab, position, rotation)); Vector3 val = position; Log.Debug("WildThrinch spawned at " + ((object)(*(Vector3*)(&val))/*cast due to .constrained prefix*/).ToString()); } } private static bool TryFindConiferPerch(out Vector3 position, out Quaternion rotation) { //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_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: 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_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: 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_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) position = Vector3.zero; rotation = Quaternion.identity; List list = new List(); MeshFilter[] array = Object.FindObjectsOfType(); foreach (MeshFilter val in array) { if (Object.op_Implicit((Object)(object)val.sharedMesh) && ((Object)val.sharedMesh).name == "spmBbConif_LOD0") { list.Add(((Component)val).transform); } } SceneInfo instance = SceneInfo.instance; NodeGraph val2 = (Object.op_Implicit((Object)(object)instance) ? instance.groundNodes : null); if ((Object)(object)val2 != (Object)null && list.Count > 0) { Node[] nodes = val2.nodes; List list2 = new List(); foreach (Transform item in list) { Vector3 position2 = item.position; Node[] array2 = nodes; for (int i = 0; i < array2.Length; i++) { Vector3 val3 = array2[i].position - position2; if (((Vector3)(ref val3)).sqrMagnitude <= 900f) { list2.Add(item); break; } } } Log.Debug($"WildThrinch: {list2.Count}/{list.Count} conifers in playable area"); list = list2; } if (list.Count == 0) { Log.Warning("WildThrinch: no playable-area conifers found, falling back to highest node"); return false; } Xoroshiro128Plus val4 = (((Object)(object)Run.instance != (Object)null) ? Run.instance.stageRng : null); Transform val5 = list[(val4 != null) ? val4.RangeInt(0, list.Count) : 0]; Vector3 val6 = conifPerchLocals[(val4 != null) ? val4.RangeInt(0, conifPerchLocals.Length) : 0]; position = val5.TransformPoint(val6); Vector3 val7 = position - val5.TransformPoint(new Vector3(0f, val6.y, 0f)); val7.y = 0f; if (((Vector3)(ref val7)).sqrMagnitude > 0.01f) { rotation = Quaternion.LookRotation(((Vector3)(ref val7)).normalized); } return true; } private static Vector3 HighestGroundNode() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0083: 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_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0073: 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: 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_0050: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.zero; bool flag = false; SceneInfo instance = SceneInfo.instance; NodeGraph val2 = (Object.op_Implicit((Object)(object)instance) ? instance.groundNodes : null); if ((Object)(object)val2 != (Object)null) { Node[] nodes = val2.nodes; foreach (Node val3 in nodes) { if (!flag || val3.position.y > val.y) { val = val3.position; flag = true; } } } if (!flag) { return Vector3.up * 10f; } return val + Vector3.up * 1.5f; } private static void OnWildThrinchInteraction(orig_OnInteractionBegin orig, PurchaseInteraction self, Interactor activator) { //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Expected O, but got Unknown //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Expected O, but got Unknown //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Expected O, but got Unknown //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: 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_0116: Expected O, but got Unknown //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_00b9: 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_015a: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Expected O, but got Unknown //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) WildThrinchBehavior wildThrinchBehavior = (Object.op_Implicit((Object)(object)self) ? ((Component)self).GetComponent() : null); orig.Invoke(self, activator); if (!Object.op_Implicit((Object)(object)wildThrinchBehavior) || !NetworkServer.active) { return; } bool flag = false; CharacterBody val = (Object.op_Implicit((Object)(object)activator) ? ((Component)activator).GetComponent() : null); if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.inventory) && (Object)BastionItems.ganymedeItem != (Object)null) { if (val.inventory.GetItemCount(BastionItems.ganymedeItem) <= 0) { flag = true; val.inventory.GiveItem(BastionItems.ganymedeItem, 1); if (Object.op_Implicit((Object)(object)val.master)) { GenericPickupController.SendPickupMessage(val.master, new UniquePickup(PickupCatalog.FindPickupIndex(BastionItems.ganymedeItem.itemIndex))); } } else { EquipmentDef val2 = TryGetSeedOfLife(); if ((Object)(object)val2 != (Object)null) { PickupDropletController.CreatePickupDroplet(PickupCatalog.FindPickupIndex(val2.equipmentIndex), ((Component)self).transform.position, Vector3.up * 12f); Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage { baseToken = "BASTION_WILD_THRINCH_SEED_MSG" }); } else { val.inventory.GiveItem(Items.Feather, 1); if (Object.op_Implicit((Object)(object)val.master)) { GenericPickupController.SendPickupMessage(val.master, new UniquePickup(PickupCatalog.FindPickupIndex(Items.Feather.itemIndex))); } Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage { baseToken = "BASTION_WILD_THRINCH_FEATHER_MSG" }); } } } if ((Object)BastionAssets.activateEffect != (Object)null) { EffectManager.SpawnEffect(BastionAssets.activateEffect, new EffectData { origin = ((Component)self).transform.position, scale = 0.6f }, true); } self.SetAvailable(false); if (flag) { NetworkServer.Destroy(((Component)self).gameObject); } else { wildThrinchBehavior.FlyAway(); } } private static EquipmentDef TryGetSeedOfLife() { //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) EquipmentDef val = Addressables.LoadAssetAsync((object)RoR2_DLC2_HealAndRevive.HealAndRevive_asset).WaitForCompletion(); if ((Object)(object)val == (Object)null) { return null; } if ((Object)(object)val.requiredExpansion != (Object)null && ((Object)(object)Run.instance == (Object)null || !Run.instance.IsExpansionEnabled(val.requiredExpansion))) { return null; } return val; } } internal static class BastionWireMesh { private static readonly Dictionary cache = new Dictionary(); internal const string Armor = "armor"; internal const string Frame = "frame"; internal const string Weapon = "weapon"; internal const string Optic = "optic"; internal const string Purge = "purge"; internal const string Meridian = "meridian"; internal const string Hollow = "hollow"; internal const string HollowTar = "hollowtar"; internal const string HollowTarStow = "hollowtarstow"; internal const string HollowFloat = "hollowfloat"; private static readonly Dictionary bindposeCache = new Dictionary(); internal static Matrix4x4[] GetBindposes(Mesh stock, string group) { if (!Object.op_Implicit((Object)(object)stock) || !bindposeCache.TryGetValue(((Object)stock).name + "." + group, out var value)) { return null; } return value; } internal static Mesh Get(Mesh stock, string group) { if (!Object.op_Implicit((Object)(object)stock)) { return null; } string text = ((Object)stock).name + "." + group; if (cache.TryGetValue(text, out var value)) { return value; } Mesh val = null; try { val = Load(stock, text); } catch (Exception ex) { Log.Error("Alloyed skin: failed to build the wire mesh " + text + " — " + ex); } cache[text] = val; return val; } internal static bool IsWireMaterial(Material material) { if (Object.op_Implicit((Object)(object)material) && Object.op_Implicit((Object)(object)material.shader)) { return ((Object)material.shader).name.Contains("Wireframe"); } return false; } private static Mesh Load(Mesh stock, string key) { //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_025d: 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_02e3: Unknown result type (might be due to invalid IL or missing references) //IL_02e8: Unknown result type (might be due to invalid IL or missing references) //IL_02f9: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_030c: 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_031c: Unknown result type (might be due to invalid IL or missing references) //IL_0324: Unknown result type (might be due to invalid IL or missing references) //IL_032c: Unknown result type (might be due to invalid IL or missing references) //IL_0334: Unknown result type (might be due to invalid IL or missing references) //IL_033c: Unknown result type (might be due to invalid IL or missing references) //IL_0344: Unknown result type (might be due to invalid IL or missing references) //IL_034c: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_0361: Expected O, but got Unknown using Stream stream = typeof(BastionWireMesh).Assembly.GetManifestResourceStream("BastionMod.Skins." + key + ".wire.bin"); if (stream == null) { return null; } using GZipStream gZipStream = new GZipStream(stream, CompressionMode.Decompress); using MemoryStream memoryStream = new MemoryStream(); gZipStream.CopyTo(memoryStream); memoryStream.Position = 0L; using BinaryReader binaryReader = new BinaryReader(memoryStream); if (new string(binaryReader.ReadChars(4)) != "BWM1") { throw new InvalidDataException("bad wire mesh header"); } int num = binaryReader.ReadInt32(); int num2 = binaryReader.ReadInt32(); Vector3[] array = (Vector3[])(object)new Vector3[num]; Vector3[] array2 = (Vector3[])(object)new Vector3[num]; Vector4[] array3 = (Vector4[])(object)new Vector4[num]; Vector2[] array4 = (Vector2[])(object)new Vector2[num]; Color32[] array5 = (Color32[])(object)new Color32[num]; BoneWeight[] array6 = (BoneWeight[])(object)new BoneWeight[num]; int[] array7 = new int[num]; for (int i = 0; i < num; i++) { array[i] = new Vector3(binaryReader.ReadSingle(), binaryReader.ReadSingle(), binaryReader.ReadSingle()); } for (int j = 0; j < num; j++) { array2[j] = new Vector3(binaryReader.ReadSingle(), binaryReader.ReadSingle(), binaryReader.ReadSingle()); } for (int k = 0; k < num; k++) { array3[k] = new Vector4(binaryReader.ReadSingle(), binaryReader.ReadSingle(), binaryReader.ReadSingle(), binaryReader.ReadSingle()); } for (int l = 0; l < num; l++) { array4[l] = new Vector2(binaryReader.ReadSingle(), binaryReader.ReadSingle()); } for (int m = 0; m < num; m++) { ((BoneWeight)(ref array6[m])).boneIndex0 = binaryReader.ReadByte(); ((BoneWeight)(ref array6[m])).boneIndex1 = binaryReader.ReadByte(); ((BoneWeight)(ref array6[m])).boneIndex2 = binaryReader.ReadByte(); ((BoneWeight)(ref array6[m])).boneIndex3 = binaryReader.ReadByte(); } for (int n = 0; n < num; n++) { ((BoneWeight)(ref array6[n])).weight0 = binaryReader.ReadSingle(); ((BoneWeight)(ref array6[n])).weight1 = binaryReader.ReadSingle(); ((BoneWeight)(ref array6[n])).weight2 = binaryReader.ReadSingle(); ((BoneWeight)(ref array6[n])).weight3 = binaryReader.ReadSingle(); array5[n] = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue); array7[n] = n; } Matrix4x4[] array8 = (Matrix4x4[])(object)new Matrix4x4[num2]; for (int num3 = 0; num3 < num2; num3++) { Matrix4x4 val = default(Matrix4x4); for (int num4 = 0; num4 < 4; num4++) { for (int num5 = 0; num5 < 4; num5++) { ((Matrix4x4)(ref val))[num4, num5] = binaryReader.ReadSingle(); } } array8[num3] = val; } bindposeCache[key] = array8; Mesh val2 = new Mesh { name = key + ".Wire", indexFormat = (IndexFormat)(num > 65535), vertices = array, normals = array2, tangents = array3, uv = array4, colors32 = array5, boneWeights = array6, bindposes = array8, triangles = array7, bounds = stock.bounds }; val2.UploadMeshData(true); return val2; } } public class RedLightsMessage : INetMessage, ISerializableObject { private NetworkInstanceId bodyNetId; private bool red; public RedLightsMessage() { } public RedLightsMessage(NetworkInstanceId bodyNetId, bool red) { //IL_0007: 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) this.bodyNetId = bodyNetId; this.red = red; } public void Serialize(NetworkWriter writer) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) writer.Write(bodyNetId); writer.Write(red); } public void Deserialize(NetworkReader reader) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) bodyNetId = reader.ReadNetworkId(); red = reader.ReadBoolean(); } public void OnReceived() { //IL_0009: 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_003e: Expected O, but got Unknown if (!NetworkServer.active) { return; } GameObject val = NetworkServer.FindLocalObject(bodyNetId); CharacterBody val2 = (Object.op_Implicit((Object)(object)val) ? val.GetComponent() : null); if (Object.op_Implicit((Object)(object)val2) && !((Object)BastionBuffs.redLightsDef == (Object)null)) { bool flag = val2.HasBuff(BastionBuffs.redLightsDef); if (red && !flag) { val2.AddBuff(BastionBuffs.redLightsDef); } else if (!red && flag) { val2.RemoveBuff(BastionBuffs.redLightsDef); } } } } } namespace BastionMod.Survivors.Bastion.SkillStates { public class ArtilleryDronePrimary : BaseSkillState, IStepSetter { public float baseDuration = 0.5f; public float procCoef = 1f; public float damageCoef = 10f; public int useIndex; public int maxAmmo = 1; private float duration; private float fireTimePercent = 0.5f; private bool hasImpact; private float recoil = 1.25f; private bool hasFired; public static GameObject tracerEffectPrefab = LegacyResourcesAPI.Load("Prefabs/Effects/Tracers/TracerGoldGat"); private string muzzleString = "ArtilleryMuzzle"; public float revertDelay = 0.5f; private RaycastHit rayHit; public override void OnEnter() { ((BaseState)this).OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; ((EntityState)this).PlayAnimation("FullBody, Override", "ArtilleryFire"); ((EntityState)this).GetComponent().AddHeat(0.25f); Util.PlaySound("BAS10_PlayArtilleryShoot", ((EntityState)this).gameObject); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (!hasFired) { ShootTracer(); } if (((EntityState)this).fixedAge > duration * fireTimePercent && !hasImpact) { Fire(); } if (((EntityState)this).fixedAge > duration * fireTimePercent + revertDelay && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextState((EntityState)(object)new ArtilleryToRecon()); } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)7; } private void ShootTracer() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Expected O, but got Unknown //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: 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_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_014d: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) hasFired = true; ((EntityState)this).characterBody.AddSpreadBloom(1.5f); EffectManager.SimpleMuzzleFlash(FirePistol2.muzzleEffectPrefab, ((EntityState)this).gameObject, muzzleString, false); EffectData val = new EffectData(); val.origin = ((EntityState)this).GetModelChildLocator().FindChild(muzzleString).position + new Vector3(0f, 999f, 0f); val.start = ((EntityState)this).GetModelChildLocator().FindChild(muzzleString).position; EffectManager.SpawnEffect(tracerEffectPrefab, val, true); Ray aimRay = ((BaseState)this).GetAimRay(); Transform val2 = ((EntityState)this).GetModelChildLocator().FindChild(muzzleString); if (Object.op_Implicit((Object)(object)val2)) { ((Ray)(ref aimRay)).origin = val2.position; } rayHit = default(RaycastHit); ((RaycastHit)(ref rayHit)).point = ((Ray)(ref aimRay)).GetPoint(500f); RaycastHit[] array = Physics.RaycastAll(aimRay, 500f, LayerMask.op_Implicit(CommonMasks.bullet)); float num = float.MaxValue; RaycastHit[] array2 = array; for (int i = 0; i < array2.Length; i++) { RaycastHit val3 = array2[i]; if (!(((RaycastHit)(ref val3)).distance >= num)) { HurtBox component = ((Component)((RaycastHit)(ref val3)).collider).GetComponent(); if (!Object.op_Implicit((Object)(object)component) || !((Object)(object)component.healthComponent == (Object)(object)((EntityState)this).healthComponent)) { num = ((RaycastHit)(ref val3)).distance; rayHit = val3; } } } } private void Fire() { //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_002e: 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_0043: 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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0075: 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_007e: 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_0086: 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_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0132: 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_0094: 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) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) hasImpact = true; if (((EntityState)this).isAuthority) { Ray val = default(Ray); ((Ray)(ref val)).direction = Vector3.up; ((Ray)(ref val)).origin = ((RaycastHit)(ref rayHit)).point; Ray val2 = val; float num = 300f; RaycastHit val3 = default(RaycastHit); Physics.Raycast(val2, ref val3, num, LayerMask.op_Implicit(CommonMasks.bullet)); ref RaycastHit reference = ref rayHit; Vector3 val4 = (((RaycastHit)(ref reference)).point = ((RaycastHit)(ref reference)).point + new Vector3(0f, num, 0f)); Vector3 position = val4; if (((RaycastHit)(ref val3)).point != Vector3.zero) { position = ((RaycastHit)(ref val3)).point - new Vector3(0f, 5f, 0f); } FireProjectileInfo val6 = new FireProjectileInfo { owner = ((EntityState)this).gameObject, damage = damageCoef * ((EntityState)this).characterBody.damage, force = 0f, position = position, crit = ((EntityState)this).characterBody.RollCrit(), rotation = Util.QuaternionSafeLookRotation(Vector3.down), projectilePrefab = BastionAssets.droneShell }; ((FireProjectileInfo)(ref val6)).speedOverride = 500f; FireProjectileInfo val7 = val6; ProjectileManager.instance.FireProjectile(val7); } } public void SetStep(int i) { useIndex = i; } } public class ArtilleryPrimary : BaseSkillState, IStepSetter { public float baseDuration = 0.45f; public float procCoef = 1f; public float damageCoef = 10f; public int useIndex; public int maxAmmo = 5; private float duration; private float fireTimePercent = 0.75f; private bool hasImpact; private float recoil = 1.25f; private bool hasFired; public static GameObject tracerEffectPrefab = LegacyResourcesAPI.Load("Prefabs/Effects/Tracers/TracerGoldGat"); private string muzzleString = "ArtilleryMuzzle"; private RaycastHit rayHit; public override void OnEnter() { ((BaseState)this).OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; ((EntityState)this).PlayAnimation("FullBody, Override", "ArtilleryFire"); ((EntityState)this).GetComponent().AddHeat(0.2f); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (!hasFired) { ShootTracer(); } if (((EntityState)this).fixedAge > duration * fireTimePercent && !hasImpact) { Fire(); } if (((EntityState)this).fixedAge > duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)7; } private void ShootTracer() { //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown //IL_0069: 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_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: 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_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: 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_0172: Unknown result type (might be due to invalid IL or missing references) hasFired = true; Util.PlaySound("BAS10_PlayArtilleryShoot", ((EntityState)this).gameObject); BastionCasings.Eject(((EntityState)this).characterBody, muzzleString, BastionCasings.Kind.Cannon); ((EntityState)this).characterBody.AddSpreadBloom(1.5f); EffectManager.SimpleMuzzleFlash(FirePistol2.muzzleEffectPrefab, ((EntityState)this).gameObject, muzzleString, false); EffectData val = new EffectData(); val.origin = ((EntityState)this).GetModelChildLocator().FindChild(muzzleString).position + new Vector3(0f, 999f, 0f); val.start = ((EntityState)this).GetModelChildLocator().FindChild(muzzleString).position; EffectManager.SpawnEffect(tracerEffectPrefab, val, true); Ray aimRay = ((BaseState)this).GetAimRay(); Transform val2 = ((EntityState)this).GetModelChildLocator().FindChild(muzzleString); if (Object.op_Implicit((Object)(object)val2)) { ((Ray)(ref aimRay)).origin = val2.position; } rayHit = default(RaycastHit); ((RaycastHit)(ref rayHit)).point = ((Ray)(ref aimRay)).GetPoint(500f); RaycastHit[] array = Physics.RaycastAll(aimRay, 500f, LayerMask.op_Implicit(CommonMasks.bullet)); float num = float.MaxValue; RaycastHit[] array2 = array; for (int i = 0; i < array2.Length; i++) { RaycastHit val3 = array2[i]; if (!(((RaycastHit)(ref val3)).distance >= num)) { HurtBox component = ((Component)((RaycastHit)(ref val3)).collider).GetComponent(); if (!Object.op_Implicit((Object)(object)component) || !((Object)(object)component.healthComponent == (Object)(object)((EntityState)this).healthComponent)) { num = ((RaycastHit)(ref val3)).distance; rayHit = val3; } } } } private void Fire() { //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_002e: 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_0043: 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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0075: 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_007e: 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_0086: 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_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0132: 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_0094: 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) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) hasImpact = true; if (((EntityState)this).isAuthority) { Ray val = default(Ray); ((Ray)(ref val)).direction = Vector3.up; ((Ray)(ref val)).origin = ((RaycastHit)(ref rayHit)).point; Ray val2 = val; float num = 300f; RaycastHit val3 = default(RaycastHit); Physics.Raycast(val2, ref val3, num, LayerMask.op_Implicit(CommonMasks.bullet)); ref RaycastHit reference = ref rayHit; Vector3 val4 = (((RaycastHit)(ref reference)).point = ((RaycastHit)(ref reference)).point + new Vector3(0f, num, 0f)); Vector3 position = val4; if (((RaycastHit)(ref val3)).point != Vector3.zero) { position = ((RaycastHit)(ref val3)).point - new Vector3(0f, 5f, 0f); } FireProjectileInfo val6 = new FireProjectileInfo { owner = ((EntityState)this).gameObject, damage = damageCoef * ((EntityState)this).characterBody.damage, force = 0f, position = position, crit = ((EntityState)this).characterBody.RollCrit(), rotation = Util.QuaternionSafeLookRotation(Vector3.down), projectilePrefab = BastionAssets.bombardShell }; ((FireProjectileInfo)(ref val6)).speedOverride = 500f; FireProjectileInfo val7 = val6; ProjectileManager.instance.FireProjectile(val7); } } public void SetStep(int i) { useIndex = i; } } public class ArtilleryToAssault : BaseSkillState { public static float Duration = 0.55f; public override void OnEnter() { ((BaseState)this).OnEnter(); ((EntityState)this).GetComponent().TurretDeployed = true; ((EntityState)this).PlayAnimation("FullBody, Override", "ArtilleryToAssault"); ((EntityState)this).GetModelAnimator().SetLayerWeight(2, 0f); ((EntityState)this).GetModelAnimator().SetLayerWeight(9, 0f); ((EntityState)this).outer.UnsetStateSkills(((EntityState)this).skillLocator, ((EntityState)this).GetComponent(), BastionStaticValues.ArtilleryDef, (SkillOverridePriority)3); ((EntityState)this).skillLocator.special.isCooldownBlocked = false; ((EntityState)this).PlayAnimation("AimPitch", "PitchControl Assault"); ((EntityState)this).PlayAnimation("AimYaw", "YawControl Assault"); ((EntityState)this).GetModelAnimator().SetLayerWeight(1, 1f); ((EntityState)this).GetModelAnimator().SetLayerWeight(8, 1f); ((EntityState)this).GetModelAnimator().SetLayerWeight(7, 1f); ((EntityState)this).outer.SetStateSkills(((EntityState)this).skillLocator, ((EntityState)this).GetComponent(), BastionStaticValues.TurretDef, (SkillOverridePriority)3); ((EntityState)this).skillLocator.utility.isCooldownBlocked = true; ((EntityState)this).GetAimAnimator().fullYaw = true; ((EntityState)this).GetAimAnimator().yawRangeMin = -180f; ((EntityState)this).GetAimAnimator().yawRangeMax = 180f; Util.PlaySound("BAS10_Transform", ((EntityState)this).gameObject); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= Duration) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)7; } } public class ArtilleryToBombard : BaseSkillState { public static float Duration = 0.55f; public override void OnEnter() { //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); ((EntityState)this).GetComponent().TurretDeployed = true; ((EntityState)this).PlayAnimation("FullBody, Override", "ArtilleryToBombard"); ((EntityState)this).GetModelAnimator().SetLayerWeight(2, 0f); ((EntityState)this).GetModelAnimator().SetLayerWeight(9, 0f); ((EntityState)this).outer.UnsetStateSkills(((EntityState)this).skillLocator, ((EntityState)this).GetComponent(), BastionStaticValues.ArtilleryDef, (SkillOverridePriority)3); ((EntityState)this).PlayAnimation("AimPitch", "PitchControl Bombard"); ((EntityState)this).PlayAnimation("AimYaw", "YawControl Bombard"); ((EntityState)this).GetModelAnimator().SetLayerWeight(3, 1f); ((EntityState)this).GetModelAnimator().SetLayerWeight(8, 1f); ((EntityState)this).GetModelAnimator().SetLayerWeight(7, 1f); ((EntityState)this).outer.SetStateSkills(((EntityState)this).skillLocator, ((EntityState)this).GetComponent(), BastionStaticValues.TurretDef, (SkillOverridePriority)3); Vector3 val = (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection) ? ((EntityState)this).characterDirection.forward : ((EntityState)this).inputBank.aimDirection); val.y = 0f; ((EntityState)this).GetComponent().BombardFacing = ((((Vector3)(ref val)).sqrMagnitude > 0.001f) ? ((Vector3)(ref val)).normalized : ((EntityState)this).transform.forward); ((EntityState)this).GetAimAnimator().fullYaw = true; ((EntityState)this).GetAimAnimator().yawRangeMin = -180f; ((EntityState)this).GetAimAnimator().yawRangeMax = 180f; Util.PlaySound("BAS10_Transform", ((EntityState)this).gameObject); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= Duration) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)7; } } public class ArtilleryToRecon : BaseSkillState { public static float Duration = 0.55f; public override void OnEnter() { ((BaseState)this).OnEnter(); ((EntityState)this).PlayAnimation("FullBody, Override", "ArtilleryToRecon"); ((EntityState)this).characterBody.RemoveBuff(BastionBuffs.turretRootDef); ((EntityState)this).outer.UnsetStateSkills(((EntityState)this).skillLocator, ((EntityState)this).GetComponent(), BastionStaticValues.ArtilleryDef, (SkillOverridePriority)3); ((EntityState)this).skillLocator.special.isCooldownBlocked = false; ((EntityState)this).GetModelAnimator().SetLayerWeight(2, 0f); ((EntityState)this).PlayAnimation("AimPitch", "PitchControl"); ((EntityState)this).PlayAnimation("AimYaw", "YawControl"); ((EntityState)this).GetModelAnimator().SetLayerWeight(8, 1f); ((EntityState)this).GetModelAnimator().SetLayerWeight(7, 1f); ((EntityState)this).GetModelAnimator().SetLayerWeight(9, 1f); Util.PlaySound("BAS10_Transform", ((EntityState)this).gameObject); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= Duration) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)7; } } public class AssaultPrimary : BaseSkillState, IStepSetter { public float baseDuration = 0.1f; public float procCoef = 0.4f; public float damageCoef = 1.75f; public int useIndex; public int maxAmmo = 30; public float duration; public float recoil = 0.01f; public float range = 1024f; public float fireInterval; public int fireCount = 2; public float fireLog; public static GameObject tracerEffectPrefab = LegacyResourcesAPI.Load("Prefabs/Effects/Tracers/TracerGoldGat"); private string muzzleString = "AssaultMuzzle"; private string fireSound; public override void OnEnter() { ((BaseState)this).OnEnter(); BastionController component = ((EntityState)this).GetComponent(); float num = (Object.op_Implicit((Object)(object)component) ? Mathf.Lerp(0.25f, 1f, component.MinigunSpin) : 1f); duration = baseDuration / num; if (Object.op_Implicit((Object)(object)component)) { component.NotifyMinigunFired(duration); component.AddHeat(duration / 3f); } fireInterval = duration / (float)fireCount; damageCoef = damageCoef * ((BaseState)this).attackSpeedStat / (float)fireCount; ((EntityState)this).PlayAnimation("FullBody, Override", "AssaultFire"); fireSound = FireGatling.fireGatlingSoundString; if (string.IsNullOrEmpty(fireSound)) { fireSound = "BAS10_PlayTurretShoot"; } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= fireLog) { Fire(); fireLog = ((EntityState)this).fixedAge + fireInterval; } if (((EntityState)this).fixedAge > duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)7; } public void Fire() { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Expected O, but got Unknown //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: 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_00c8: 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_0119: 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_0143: 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_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) Util.PlaySound(fireSound, ((EntityState)this).gameObject); ((EntityState)this).characterBody.AddSpreadBloom(1.5f); EffectManager.SimpleMuzzleFlash(FirePistol2.muzzleEffectPrefab, ((EntityState)this).gameObject, muzzleString, false); BastionCasings.Eject(((EntityState)this).characterBody, muzzleString, BastionCasings.Kind.Minigun); if (((EntityState)this).isAuthority) { Ray aimRay = ((BaseState)this).GetAimRay(); BulletAttack val = new BulletAttack(); val.bulletCount = 1u; val.aimVector = ((Ray)(ref aimRay)).direction; val.origin = ((Ray)(ref aimRay)).origin; val.damage = damageCoef * ((BaseState)this).damageStat; val.damageColorIndex = (DamageColorIndex)0; val.damageType = DamageTypeCombo.GenericSecondary; val.falloffModel = (FalloffModel)0; val.maxDistance = range; val.force = 0f; val.hitMask = CommonMasks.bullet; val.minSpread = 0f; val.maxSpread = 2f; val.isCrit = ((BaseState)this).RollCrit(); val.owner = ((EntityState)this).gameObject; val.muzzleName = muzzleString; val.smartCollision = true; val.procChainMask = default(ProcChainMask); val.procCoefficient = procCoef; val.radius = 0.25f; val.sniper = false; val.stopperMask = CommonMasks.bullet; val.weapon = null; val.tracerEffectPrefab = tracerEffectPrefab; val.spreadPitchScale = 1f; val.spreadYawScale = 1f; val.queryTriggerInteraction = (QueryTriggerInteraction)0; val.hitEffectPrefab = FirePistol2.hitEffectPrefab; BastionController component = ((EntityState)this).GetComponent(); float num = ((BastionConfig.igniteChance != null) ? BastionConfig.igniteChance.Value : 20f); if (Object.op_Implicit((Object)(object)component) && component.Overheated && num > 0f && Util.CheckRoll(num, ((EntityState)this).characterBody.master)) { val.damageType = DamageTypeCombo.op_Implicit((DamageType)128); } val.Fire(); } } public void SetStep(int i) { useIndex = i; } } public class AssaultToArtillery : BaseSkillState { public static float Duration = 0.55f; public override void OnEnter() { ((BaseState)this).OnEnter(); ((EntityState)this).GetComponent().TurretDeployed = false; ((EntityState)this).PlayAnimation("FullBody, Override", "AssaultToArtillery"); ((EntityState)this).GetModelAnimator().SetLayerWeight(1, 0f); ((EntityState)this).GetModelAnimator().SetLayerWeight(8, 0f); ((EntityState)this).GetModelAnimator().SetLayerWeight(7, 0f); ((EntityState)this).GetModelAnimator().SetLayerWeight(9, 0f); ((EntityState)this).outer.UnsetStateSkills(((EntityState)this).skillLocator, ((EntityState)this).GetComponent(), BastionStaticValues.TurretDef, (SkillOverridePriority)3); ((EntityState)this).skillLocator.utility.isCooldownBlocked = false; ((EntityState)this).GetModelAnimator().SetLayerWeight(2, 1f); ((EntityState)this).outer.SetStateSkills(((EntityState)this).skillLocator, ((EntityState)this).GetComponent(), BastionStaticValues.ArtilleryDef, (SkillOverridePriority)3); ((EntityState)this).GetComponent().NotifyInFormArtilleryEntry(); ((EntityState)this).skillLocator.special.isCooldownBlocked = true; ((EntityState)this).GetAimAnimator().fullYaw = false; ((EntityState)this).GetAimAnimator().yawRangeMin = -80f; ((EntityState)this).GetAimAnimator().yawRangeMax = 80f; Util.PlaySound("BAS10_Transform", ((EntityState)this).gameObject); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= Duration) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)7; } } public class AssaultToRecon : BaseSkillState { public static float Duration = 0.3f; public override void OnEnter() { ((BaseState)this).OnEnter(); ((EntityState)this).GetComponent().TurretDeployed = false; ((EntityState)this).PlayAnimation("FullBody, Override", "AssaultToRecon"); ((EntityState)this).PlayAnimation("AimPitch", "PitchControl"); ((EntityState)this).PlayAnimation("AimYaw", "YawControl"); ((EntityState)this).outer.UnsetStateSkills(((EntityState)this).skillLocator, ((EntityState)this).GetComponent(), BastionStaticValues.TurretDef, (SkillOverridePriority)3); ((EntityState)this).skillLocator.utility.isCooldownBlocked = false; ((EntityState)this).characterBody.RemoveBuff(BastionBuffs.turretRootDef); ((EntityState)this).GetAimAnimator().fullYaw = false; ((EntityState)this).GetAimAnimator().yawRangeMin = -80f; ((EntityState)this).GetAimAnimator().yawRangeMax = 80f; ((EntityState)this).GetModelAnimator().SetLayerWeight(1, 0f); ((EntityState)this).GetModelAnimator().SetLayerWeight(9, 1f); Util.PlaySound("BAS10_Transform", ((EntityState)this).gameObject); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= Duration) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)7; } } internal class BaseTransformState : BaseSkillState { public BastionStateDef stateDef; public override void OnEnter() { ((BaseState)this).OnEnter(); } public override void Update() { ((EntityState)this).Update(); } public override void OnExit() { ((EntityState)this).OnExit(); } } public class BastionEmote : BaseState { public int emoteIndex; private BastionEmotePlayer player; private CameraParamsOverrideHandle cameraHandle; private float beatTimer; public override void OnEnter() { //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_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_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); Transform modelTransform = ((EntityState)this).GetModelTransform(); player = (Object.op_Implicit((Object)(object)modelTransform) ? ((Component)modelTransform).GetComponent() : null); if (Object.op_Implicit((Object)(object)player)) { player.Play(BastionEmotes.GetClip(emoteIndex)); } if (emoteIndex == 0) { Util.PlaySound("Play_MULT_shift_end", ((EntityState)this).gameObject); } else if (emoteIndex == 2) { Util.PlaySound("Play_MULT_R_toSnipe", ((EntityState)this).gameObject); } if (Object.op_Implicit((Object)(object)((EntityState)this).cameraTargetParams)) { CharacterCameraParamsData currentCameraParamsData = ((EntityState)this).cameraTargetParams.currentCameraParamsData; currentCameraParamsData.idealLocalCameraPos = BlendableVector3.op_Implicit(new Vector3(0f, 0.5f, -11f)); cameraHandle = ((EntityState)this).cameraTargetParams.AddParamsOverride(new CameraParamsOverrideRequest { cameraParamsData = currentCameraParamsData, priority = 1f }, 0.6f); } } public override void FixedUpdate() { //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); if (emoteIndex == 1) { beatTimer -= Time.fixedDeltaTime; if (beatTimer <= 0f) { beatTimer += 0.5f; Util.PlaySound("Play_engi_R_walkingTurret_step", ((EntityState)this).gameObject); } } if (((EntityState)this).isAuthority) { bool flag = Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.isGrounded; if (Object.op_Implicit((Object)(object)((EntityState)this).inputBank)) { flag |= ((EntityState)this).inputBank.moveVector != Vector3.zero || ((EntityState)this).inputBank.jump.down || ((EntityState)this).inputBank.skill1.down || ((EntityState)this).inputBank.skill2.down || ((EntityState)this).inputBank.skill3.down || ((EntityState)this).inputBank.skill4.down; } if (flag) { ((EntityState)this).outer.SetNextStateToMain(); } } } public override void OnExit() { //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) if (Object.op_Implicit((Object)(object)player)) { player.Stop(); } if (Object.op_Implicit((Object)(object)((EntityState)this).cameraTargetParams) && ((CameraParamsOverrideHandle)(ref cameraHandle)).isValid) { ((EntityState)this).cameraTargetParams.RemoveParamsOverride(cameraHandle, 0.4f); } ((EntityState)this).OnExit(); } public override void OnSerialize(NetworkWriter writer) { ((EntityState)this).OnSerialize(writer); writer.Write((byte)emoteIndex); } public override void OnDeserialize(NetworkReader reader) { ((EntityState)this).OnDeserialize(reader); emoteIndex = reader.ReadByte(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)0; } } public class BastionGrenadeAim : AimThrowableBase { public static float grenadeDamageCoefficient = 7f; public override void OnEnter() { ((AimThrowableBaseAimOnly)this).maxDistance = 35f; ((AimThrowableBaseAimOnly)this).rayRadius = 1f; ((AimThrowableBaseAimOnly)this).arcVisualizerPrefab = BastionAssets.grenadeArcVisualizer; ((AimThrowableBaseAimOnly)this).endpointVisualizerPrefab = null; ((AimThrowableBaseAimOnly)this).projectilePrefab = BastionAssets.grenadeProjectile; ((AimThrowableBaseAimOnly)this).setFuse = false; base.damageCoefficient = grenadeDamageCoefficient; ((AimThrowableBaseAimOnly)this).baseMinimumDuration = 0.15f; ((AimThrowableBaseAimOnly)this).originOverrideString = ""; ((AimThrowableBaseAimOnly)this).OnEnter(); if (((AimThrowableBaseAimOnly)this).projectileBaseSpeed <= 0f) { ((AimThrowableBaseAimOnly)this).projectileBaseSpeed = 55f; } } public override void OnProjectileFiredLocal() { Util.PlaySound("BAS10_PlayBombardShoot", ((EntityState)this).gameObject); } } public class BastionSkills { public SkillDef reconPrimary; public SkillDef reconSniperPrimary; public SkillDef assaultPrimary; public SkillDef bombardPrimary; public SkillDef artilleryPrimary; public SkillDef artilleryDronePrimary; public SkillDef reconToAssault; public SkillDef reconToBombard; public SkillDef assaultToRecon; public SkillDef bombardToRecon; public SkillDef artilleryToAssault; public SkillDef artilleryToBombard; public SkillDef reconToArtillery; public SkillDef reconToDroneArtillery; public SkillDef assaultToArtillery; public SkillDef bombardToArtillery; public SkillDef artilleryToRecon; } public class BastionStateDef { public SkillDef primary; public SkillDef utility; public SkillDef special; } public class BombardPrimary : BaseSkillState, IStepSetter { public float baseDuration = 0.75f; public float procCoef = 1f; public float damageCoef = 3.25f; public int useIndex; public int maxAmmo = 5; private float duration; private float recoil = 1.25f; private bool hasFired; public static GameObject tracerEffectPrefab = LegacyResourcesAPI.Load("Prefabs/Effects/Tracers/TracerGoldGat"); private string muzzleString = "BombardMuzzle"; private Vector3 cachedFirePosition; private bool hasCachedFirePosition; public override void OnEnter() { //IL_0067: 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_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; Transform val = ((EntityState)this).GetModelChildLocator().FindChild(muzzleString); if (!Object.op_Implicit((Object)(object)val)) { val = ((EntityState)this).GetModelChildLocator().FindChild("CannonMuzzle"); } if (!Object.op_Implicit((Object)(object)val)) { val = ((EntityState)this).GetModelChildLocator().FindChild("TurretMuzzle"); } if (Object.op_Implicit((Object)(object)val)) { cachedFirePosition = val.position + Vector3.up * 0.75f; hasCachedFirePosition = true; } ((EntityState)this).PlayAnimation("FullBody, Override", "BombardFire"); ((EntityState)this).GetComponent().AddHeat(0.25f); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (!hasFired) { Fire(); } if (((EntityState)this).fixedAge > duration && ((EntityState)this).isAuthority && hasFired) { ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)7; } private void Fire() { //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_0066: 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_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: 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_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_0198: 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_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: 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_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_0222: 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) hasFired = true; Util.PlaySound("BAS10_PlayBombardShoot", ((EntityState)this).gameObject); BastionCasings.Eject(((EntityState)this).characterBody, muzzleString, BastionCasings.Kind.Cannon); EffectManager.SimpleMuzzleFlash(FirePistol2.muzzleEffectPrefab, ((EntityState)this).gameObject, muzzleString, false); if (!((EntityState)this).isAuthority) { return; } Ray aimRay = ((BaseState)this).GetAimRay(); BastionController component = ((EntityState)this).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { ((Ray)(ref aimRay)).direction = BastionController.ClampToBombardArc(((Ray)(ref aimRay)).direction, component.BombardFacing); } ((BaseState)this).AddRecoil(-1f * recoil, -2f * recoil, -0.5f * recoil, 0.5f * recoil); Vector3 val = (hasCachedFirePosition ? cachedFirePosition : (((Ray)(ref aimRay)).origin + Vector3.up * 0.75f)); Ray val2 = default(Ray); ((Ray)(ref val2))..ctor(val, ((Ray)(ref aimRay)).direction); Vector3 point = ((Ray)(ref val2)).GetPoint(1000f); RaycastHit[] array = Physics.RaycastAll(val2, 1000f, LayerMask.op_Implicit(CommonMasks.bullet)); float num = float.MaxValue; RaycastHit[] array2 = array; for (int i = 0; i < array2.Length; i++) { RaycastHit val3 = array2[i]; if (!(((RaycastHit)(ref val3)).distance >= num)) { HurtBox component2 = ((Component)((RaycastHit)(ref val3)).collider).GetComponent(); if (!Object.op_Implicit((Object)(object)component2) || !((Object)(object)component2.healthComponent == (Object)(object)((EntityState)this).healthComponent)) { num = ((RaycastHit)(ref val3)).distance; point = ((RaycastHit)(ref val3)).point; } } } Vector3 val4 = point - val; val4 = ((((Vector3)(ref val4)).sqrMagnitude > 4f) ? ((Vector3)(ref val4)).normalized : ((Ray)(ref aimRay)).direction); FireProjectileInfo val5 = new FireProjectileInfo { owner = ((EntityState)this).gameObject, damage = damageCoef * ((EntityState)this).characterBody.damage, force = 0f, position = val, crit = ((EntityState)this).characterBody.RollCrit(), rotation = Util.QuaternionSafeLookRotation(val4), projectilePrefab = BastionAssets.bombardShell }; ((FireProjectileInfo)(ref val5)).speedOverride = 200f; FireProjectileInfo val6 = val5; ProjectileManager.instance.FireProjectile(val6); } public void SetStep(int i) { useIndex = i; } } public class BombardToArtillery : BaseSkillState { public static float Duration = 0.55f; public override void OnEnter() { ((BaseState)this).OnEnter(); ((EntityState)this).GetComponent().TurretDeployed = false; ((EntityState)this).PlayAnimation("FullBody, Override", "BombardToArtillery"); ((EntityState)this).GetModelAnimator().SetLayerWeight(3, 0f); ((EntityState)this).GetModelAnimator().SetLayerWeight(8, 0f); ((EntityState)this).GetModelAnimator().SetLayerWeight(7, 0f); ((EntityState)this).GetModelAnimator().SetLayerWeight(9, 0f); ((EntityState)this).outer.UnsetStateSkills(((EntityState)this).skillLocator, ((EntityState)this).GetComponent(), BastionStaticValues.TurretDef, (SkillOverridePriority)3); ((EntityState)this).GetModelAnimator().SetLayerWeight(2, 1f); ((EntityState)this).outer.SetStateSkills(((EntityState)this).skillLocator, ((EntityState)this).GetComponent(), BastionStaticValues.ArtilleryDef, (SkillOverridePriority)3); ((EntityState)this).GetComponent().NotifyInFormArtilleryEntry(); ((EntityState)this).GetAimAnimator().fullYaw = false; ((EntityState)this).GetAimAnimator().yawRangeMin = -80f; ((EntityState)this).GetAimAnimator().yawRangeMax = 80f; Util.PlaySound("BAS10_Transform", ((EntityState)this).gameObject); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= Duration) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)7; } } public class BombardToRecon : BaseSkillState { public static float Duration = 0.3f; public override void OnEnter() { ((BaseState)this).OnEnter(); ((EntityState)this).GetComponent().TurretDeployed = false; ((EntityState)this).PlayAnimation("FullBody, Override", "BombardToRecon"); ((EntityState)this).PlayAnimation("AimPitch", "PitchControl"); ((EntityState)this).PlayAnimation("AimYaw", "YawControl"); ((EntityState)this).outer.UnsetStateSkills(((EntityState)this).skillLocator, ((EntityState)this).GetComponent(), BastionStaticValues.TurretDef, (SkillOverridePriority)3); ((EntityState)this).characterBody.RemoveBuff(BastionBuffs.turretRootDef); ((EntityState)this).GetAimAnimator().fullYaw = false; ((EntityState)this).GetAimAnimator().yawRangeMin = -80f; ((EntityState)this).GetAimAnimator().yawRangeMax = 80f; Util.PlaySound("BAS10_Transform", ((EntityState)this).gameObject); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= Duration) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { ((EntityState)this).OnExit(); ((EntityState)this).GetModelAnimator().SetLayerWeight(3, 0f); ((EntityState)this).GetModelAnimator().SetLayerWeight(9, 1f); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)7; } } public class HealSelf : BaseSkillState { public float minDuration = 0.5f; public float maximumDuration = 6f; public float healAmount; public float healStopWatch; public float healInterval = 0.125f; public float outroTime; public float outroClock = 0.15f; public bool canExit; private ChildLocator childLoc; private const float baseHealAmount = 10f; private const float healPerLevel = 10f; private const float percentHealthPerHeal = 0.05f; private bool harvyMode = BastionConfig.harvyMode.Value; public override void OnEnter() { //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Expected O, but got Unknown //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: 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: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Expected O, but got Unknown ((BaseState)this).OnEnter(); childLoc = ((EntityState)this).GetModelChildLocator(); healAmount = 10f + ((EntityState)this).characterBody.level * 10f; healAmount += ((EntityState)this).healthComponent.fullHealth * 0.05f; healAmount *= healInterval; SetHealRingActive(active: true); ((EntityState)this).PlayAnimation("HealRing", "Activate"); Util.PlaySound("BAS10_PlayHeal", ((EntityState)this).gameObject); if ((Object)BastionAssets.healVFX != (Object)null) { EffectManager.SpawnEffect(BastionAssets.healVFX, new EffectData { scale = 1f, origin = ((EntityState)this).characterBody.corePosition }, true); } } public override void FixedUpdate() { //IL_0035: 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) ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= healStopWatch) { healStopWatch = ((EntityState)this).fixedAge + healInterval; ((EntityState)this).healthComponent.Heal(healAmount, default(ProcChainMask), true); } if (!harvyMode && ((EntityState)this).fixedAge >= maximumDuration) { BeginExit(); } if (((EntityState)this).fixedAge >= minDuration && ((ButtonState)(ref ((EntityState)this).inputBank.skill2)).justReleased) { BeginExit(); } if (((EntityState)this).fixedAge >= outroTime && canExit) { ((EntityState)this).outer.SetNextStateToMain(); } } private void BeginExit() { if (!canExit) { ((EntityState)this).PlayAnimation("HealRing", "Deactivate"); outroTime = ((EntityState)this).fixedAge + outroClock; Util.PlaySound("Stop_emergency_drone_heal_loop", ((EntityState)this).gameObject); } canExit = true; } public override void OnExit() { ((EntityState)this).OnExit(); SetHealRingActive(active: false); } private void SetHealRingActive(bool active) { if (!Object.op_Implicit((Object)(object)childLoc)) { childLoc = ((EntityState)this).GetModelChildLocator(); } Transform val = (Object.op_Implicit((Object)(object)childLoc) ? childLoc.FindChild("healring") : null); if (Object.op_Implicit((Object)(object)val)) { ((Component)val).gameObject.SetActive(active); } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)3; } } public class Primary : BaseSkillState { public float baseDuration = 0.2f; public float procCoef = 1f; public float damageCoef = 0.8f; private float duration = 0.15f; private float recoil = 0.4f; private float range = 256f; private bool hasFired; public static GameObject tracerEffectPrefab = LegacyResourcesAPI.Load("Prefabs/Effects/Tracers/TracerGoldGat"); private string muzzleString = "PrimaryMuzzle"; public override void OnEnter() { ((BaseState)this).OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; ((EntityState)this).characterBody.SetAimTimer(0.05f); ((EntityState)this).PlayAnimation("Gesture, Override", "Primary"); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (!hasFired) { Fire(); } if (((EntityState)this).fixedAge > duration && ((EntityState)this).isAuthority && hasFired) { ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)2; } private void Fire() { //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_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_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: 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_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0102: 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_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0123: 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_013a: 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_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0171: 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_0183: 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_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0195: 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_01ab: 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_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) if (!hasFired) { hasFired = true; Util.PlaySound("BAS10_PlayReconShoot", ((EntityState)this).gameObject); ((EntityState)this).characterBody.AddSpreadBloom(1.5f); EffectManager.SimpleMuzzleFlash(FirePistol2.muzzleEffectPrefab, ((EntityState)this).gameObject, muzzleString, false); BastionCasings.Eject(((EntityState)this).characterBody, muzzleString, BastionCasings.Kind.Rifle); if (((EntityState)this).isAuthority) { Ray aimRay = ((BaseState)this).GetAimRay(); ((BaseState)this).AddRecoil(-1f * recoil, -2f * recoil, -0.5f * recoil, 0.5f * recoil); new BulletAttack { bulletCount = 1u, aimVector = ((Ray)(ref aimRay)).direction, origin = ((Ray)(ref aimRay)).origin, damage = damageCoef * ((BaseState)this).damageStat, damageColorIndex = (DamageColorIndex)0, damageType = DamageTypeCombo.GenericSecondary, falloffModel = (FalloffModel)0, maxDistance = range, force = 225f, hitMask = CommonMasks.bullet, minSpread = 0f, maxSpread = 0f, isCrit = ((BaseState)this).RollCrit(), owner = ((EntityState)this).gameObject, muzzleName = muzzleString, smartCollision = true, procChainMask = default(ProcChainMask), procCoefficient = procCoef, radius = 0.25f, sniper = false, stopperMask = CommonMasks.bullet, weapon = null, tracerEffectPrefab = tracerEffectPrefab, spreadPitchScale = 1f, spreadYawScale = 1f, queryTriggerInteraction = (QueryTriggerInteraction)0, hitEffectPrefab = FirePistol2.hitEffectPrefab }.Fire(); } } } } public class ReconToArtillery : BaseSkillState { public static float baseDuration = 0.35f; public override void OnEnter() { ((BaseState)this).OnEnter(); ((EntityState)this).GetComponent().HasTransformedThisStage = true; ((EntityState)this).PlayAnimation("FullBody, Override", "ReconToArtillery"); ((EntityState)this).skillLocator.special.isCooldownBlocked = true; ((EntityState)this).outer.SetStateSkills(((EntityState)this).skillLocator, ((EntityState)this).GetComponent(), BastionStaticValues.ArtilleryDef, (SkillOverridePriority)3); ((EntityState)this).characterBody.AddBuff(BastionBuffs.turretRootDef); Util.PlaySound("BAS10_Transform", ((EntityState)this).gameObject); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= baseDuration) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { ((EntityState)this).OnExit(); ((EntityState)this).GetModelAnimator().SetLayerWeight(2, 1f); ((EntityState)this).GetModelAnimator().SetLayerWeight(8, 0f); ((EntityState)this).GetModelAnimator().SetLayerWeight(7, 0f); ((EntityState)this).GetModelAnimator().SetLayerWeight(9, 0f); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)7; } } public class ReconToAssault : BaseSkillState { public static float baseDuration = 0.65f; public override void OnEnter() { ((BaseState)this).OnEnter(); ((EntityState)this).GetComponent().TurretDeployed = true; ((EntityState)this).GetComponent().HasTransformedThisStage = true; ((EntityState)this).PlayAnimation("FullBody, Override", "ReconToAssault"); ((EntityState)this).PlayAnimation("AimPitch", "PitchControl Assault"); ((EntityState)this).PlayAnimation("AimYaw", "YawControl Assault"); ((EntityState)this).skillLocator.utility.isCooldownBlocked = true; ((EntityState)this).outer.SetStateSkills(((EntityState)this).skillLocator, ((EntityState)this).GetComponent(), BastionStaticValues.TurretDef, (SkillOverridePriority)3); ((EntityState)this).characterBody.AddBuff(BastionBuffs.turretRootDef); ((EntityState)this).GetAimAnimator().fullYaw = true; ((EntityState)this).GetAimAnimator().yawRangeMin = -180f; ((EntityState)this).GetAimAnimator().yawRangeMax = 180f; ((EntityState)this).GetModelAnimator().SetLayerWeight(1, 1f); ((EntityState)this).GetModelAnimator().SetLayerWeight(9, 0f); Util.PlaySound("BAS10_Transform", ((EntityState)this).gameObject); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= baseDuration) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)7; } } public class ReconToBombard : BaseSkillState { public static float baseDuration = 0.65f; public override void OnEnter() { //IL_009b: 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_00a0: 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_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); ((EntityState)this).GetComponent().TurretDeployed = true; ((EntityState)this).GetComponent().HasTransformedThisStage = true; ((EntityState)this).PlayAnimation("FullBody, Override", "ReconToBombard"); ((EntityState)this).PlayAnimation("AimPitch", "PitchControl Bombard"); ((EntityState)this).PlayAnimation("AimYaw", "YawControl Bombard"); ((EntityState)this).outer.SetStateSkills(((EntityState)this).skillLocator, ((EntityState)this).GetComponent(), BastionStaticValues.TurretDef, (SkillOverridePriority)3); ((EntityState)this).characterBody.AddBuff(BastionBuffs.turretRootDef); Vector3 val = (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection) ? ((EntityState)this).characterDirection.forward : ((EntityState)this).inputBank.aimDirection); val.y = 0f; ((EntityState)this).GetComponent().BombardFacing = ((((Vector3)(ref val)).sqrMagnitude > 0.001f) ? ((Vector3)(ref val)).normalized : ((EntityState)this).transform.forward); ((EntityState)this).GetAimAnimator().fullYaw = true; ((EntityState)this).GetAimAnimator().yawRangeMin = -180f; ((EntityState)this).GetAimAnimator().yawRangeMax = 180f; Util.PlaySound("BAS10_Transform", ((EntityState)this).gameObject); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= baseDuration) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { ((EntityState)this).OnExit(); ((EntityState)this).GetModelAnimator().SetLayerWeight(3, 1f); ((EntityState)this).GetModelAnimator().SetLayerWeight(9, 0f); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)7; } } public class ReconToDroneArtillery : ReconToArtillery { } public class ShotgunPrimary : BaseSkillState { public float baseDuration = ((BastionConfig.shotgunCycle != null) ? BastionConfig.shotgunCycle.Value : 0.65f); public float procCoef = 0.5f; public float damageCoef = 0.6f; private float duration = 0.6f; private float recoil = 3f; private float range = 64f; private bool hasFired; public static GameObject tracerEffectPrefab = LegacyResourcesAPI.Load("Prefabs/Effects/Tracers/TracerGoldGat"); private string muzzleString = "PrimaryMuzzle"; private uint bulletCount = 16u; public override void OnEnter() { ((BaseState)this).OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; ((EntityState)this).characterBody.SetAimTimer(duration + 0.1f); ((EntityState)this).PlayAnimation("Gesture, Override", "Primary"); Util.PlaySound("BAS10_ShotgunShoot", ((EntityState)this).gameObject); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (!hasFired) { Fire(); } if (((EntityState)this).fixedAge > duration && ((EntityState)this).isAuthority && hasFired) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { Util.PlaySound("BAS10_ShotgunReady", ((EntityState)this).gameObject); ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)2; } private void Fire() { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_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_00a4: 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_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: 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_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: 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_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_010c: 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_0122: 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_013a: 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_014d: 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_0159: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0170: 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_017d: 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_0187: 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_0199: 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_01af: 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) if (!hasFired) { hasFired = true; ((EntityState)this).characterBody.AddSpreadBloom(1.5f); EffectManager.SimpleMuzzleFlash(FirePistol2.muzzleEffectPrefab, ((EntityState)this).gameObject, muzzleString, false); BastionCasings.Eject(((EntityState)this).characterBody, muzzleString, BastionCasings.Kind.Shotgun); if (((EntityState)this).isAuthority) { Ray aimRay = ((BaseState)this).GetAimRay(); ((BaseState)this).AddRecoil(-1f * recoil, -2f * recoil, -0.5f * recoil, 0.5f * recoil); new BulletAttack { bulletCount = bulletCount, aimVector = ((Ray)(ref aimRay)).direction, origin = ((Ray)(ref aimRay)).origin, damage = damageCoef * ((BaseState)this).damageStat, damageColorIndex = (DamageColorIndex)0, damageType = DamageTypeCombo.GenericSecondary, falloffModel = (FalloffModel)2, maxDistance = range, force = 15f, hitMask = CommonMasks.bullet, minSpread = 0f, maxSpread = 1.6f, isCrit = ((BaseState)this).RollCrit(), owner = ((EntityState)this).gameObject, muzzleName = muzzleString, smartCollision = true, procChainMask = default(ProcChainMask), procCoefficient = procCoef, radius = 0.25f, sniper = false, stopperMask = ((LayerIndex)(ref LayerIndex.world)).mask, weapon = null, tracerEffectPrefab = tracerEffectPrefab, spreadPitchScale = 1f, spreadYawScale = 1f, queryTriggerInteraction = (QueryTriggerInteraction)0, hitEffectPrefab = FirePistol2.hitEffectPrefab }.Fire(); } } } } public class SniperPrimary : BaseSkillState { public float baseDuration = 1.5f; public float procCoef = 1f; public float damageCoef = 3.5f; private float duration = 0.6f; private float recoil = 5f; private float range = 1024f; private bool hasFired; public static GameObject tracerEffectPrefab = LegacyResourcesAPI.Load("Prefabs/Effects/Tracers/TracerGoldGat"); private string muzzleString = "PrimaryMuzzle"; public override void OnEnter() { ((BaseState)this).OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; ((EntityState)this).characterBody.SetAimTimer(duration + 0.1f); ((EntityState)this).PlayAnimation("Gesture, Override", "Primary"); Util.PlaySound(BastionSounds.IsLocalPlayers(((EntityState)this).characterBody) ? "BAS10_PlaySniperShoot" : "Play_MULT_m1_snipe_shoot", ((EntityState)this).gameObject); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (!hasFired) { Fire(); } if (((EntityState)this).fixedAge > duration && ((EntityState)this).isAuthority && hasFired) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { if (BastionSounds.IsLocalPlayers(((EntityState)this).characterBody)) { Util.PlaySound("BAS10_PlaySniperReady", ((EntityState)this).gameObject); } ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)2; } private void Fire() { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_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_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: 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_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: 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_0112: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0129: 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_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0148: 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_0154: 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_016b: 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_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_0194: 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_01aa: 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_01b1: Unknown result type (might be due to invalid IL or missing references) if (!hasFired) { hasFired = true; ((EntityState)this).characterBody.AddSpreadBloom(1.5f); EffectManager.SimpleMuzzleFlash(FirePistol2.muzzleEffectPrefab, ((EntityState)this).gameObject, muzzleString, false); BastionCasings.Eject(((EntityState)this).characterBody, muzzleString, BastionCasings.Kind.Sniper); if (((EntityState)this).isAuthority) { Ray aimRay = ((BaseState)this).GetAimRay(); ((BaseState)this).AddRecoil(-1f * recoil, -2f * recoil, -0.5f * recoil, 0.5f * recoil); new BulletAttack { bulletCount = 1u, aimVector = ((Ray)(ref aimRay)).direction, origin = ((Ray)(ref aimRay)).origin, damage = damageCoef * ((BaseState)this).damageStat, damageColorIndex = (DamageColorIndex)0, damageType = DamageTypeCombo.GenericSecondary, falloffModel = (FalloffModel)0, maxDistance = range, force = 225f, hitMask = CommonMasks.bullet, minSpread = 0f, maxSpread = 0f, isCrit = ((BaseState)this).RollCrit(), owner = ((EntityState)this).gameObject, muzzleName = muzzleString, smartCollision = true, procChainMask = default(ProcChainMask), procCoefficient = procCoef, radius = 0.25f, sniper = true, stopperMask = ((LayerIndex)(ref LayerIndex.world)).collisionMask, weapon = null, tracerEffectPrefab = tracerEffectPrefab, spreadPitchScale = 1f, spreadYawScale = 1f, queryTriggerInteraction = (QueryTriggerInteraction)0, hitEffectPrefab = FirePistol2.hitEffectPrefab }.Fire(); } } } } public class TankDeploy : BaseSkillState { public override void OnEnter() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); SerializableEntityStateType value; if (((EntityState)this).characterBody.HasBuff(BastionBuffs.turretRootDef)) { BastionController component = ((EntityState)this).GetComponent(); value = ((!Object.op_Implicit((Object)(object)component) || component.TurretDeployed) ? BastionStaticValues.TurretDef : BastionStaticValues.ArtilleryDef).utility.activationState; } else { SkillDef val = (Object.op_Implicit((Object)(object)((BaseSkillState)this).activatorSkillSlot) ? ((BaseSkillState)this).activatorSkillSlot.skillDef : null); if (!Object.op_Implicit((Object)(object)val) || !BastionTank.deployStates.TryGetValue(val, out value)) { ((EntityState)this).outer.SetNextStateToMain(); return; } } EntityState val2 = EntityStateCatalog.InstantiateState(ref value); BaseSkillState val3 = (BaseSkillState)(object)((val2 is BaseSkillState) ? val2 : null); if (val3 != null) { val3.activatorSkillSlot = ((BaseSkillState)this).activatorSkillSlot; } ((EntityState)this).outer.SetNextState(val2); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)7; } } internal class TransformationDef : SkillDef { public enum TransformationStates { recon, assault, bombard, artillery } public class InstanceData : BaseSkillInstanceData { public TransformationStates currentState; } public interface ISetTransformState { void SetState(TransformationStates state); } public string entryAnimState; public string exitAnimState; public string formName; public override BaseSkillInstanceData OnAssigned(GenericSkill skillSlot) { return (BaseSkillInstanceData)(object)new InstanceData { currentState = TransformationStates.recon }; } public override void OnUnassigned(GenericSkill skillSlot) { ((SkillDef)this).OnUnassigned(skillSlot); } } internal class UnlockableIdle : BaseSkillState { public override void OnEnter() { ((BaseState)this).OnEnter(); Chat.AddMessage("Unlockable Idle"); } } internal class UnlockableMain : GenericCharacterMain { public override void OnEnter() { ((GenericCharacterMain)this).OnEnter(); Chat.AddMessage("Main"); ((EntityState)this).PlayAnimation("Gesture, Override", "Idle"); } } } namespace BastionMod.Survivors.Bastion.Components { public class ArtilleryImpactIndicator : MonoBehaviour { private const float CapsuleMarkerRadius = 3f; private const float Range = 500f; private CharacterBody body; private GameObject indicator; private bool triedPrefab; private Transform cachedMuzzle; private readonly RaycastHit[] raycastBuffer = (RaycastHit[])(object)new RaycastHit[16]; private void Start() { body = ((Component)this).GetComponent(); } private float WantedRadius() { //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Expected O, but got Unknown //IL_0067: Expected O, but got Unknown //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Expected O, but got Unknown //IL_009f: Expected O, but got Unknown //IL_00de: 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_00f7: Expected O, but got Unknown //IL_00f7: Expected O, but got Unknown if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.skillLocator) || !Object.op_Implicit((Object)(object)body.skillLocator.primary) || BastionStaticValues.BastionSkillList == null) { return 0f; } LocalUser firstLocalUser = LocalUserManager.GetFirstLocalUser(); if (firstLocalUser == null || (Object)firstLocalUser.cachedBody != (Object)body) { return 0f; } SkillDef skillDef = body.skillLocator.primary.skillDef; if ((Object)skillDef == (Object)BastionStaticValues.BastionSkillList.artilleryPrimary) { ProjectileImpactExplosion val = (Object.op_Implicit((Object)(object)BastionAssets.bombardShell) ? BastionAssets.bombardShell.GetComponent() : null); if (!Object.op_Implicit((Object)(object)val) || !(((ProjectileExplosion)val).blastRadius > 0f)) { return 3f; } return ((ProjectileExplosion)val).blastRadius; } if ((Object)skillDef == (Object)BastionStaticValues.BastionSkillList.artilleryDronePrimary) { return 3f; } return 0f; } private void Update() { //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) float num = WantedRadius(); if (num <= 0f || !FindImpact(out var point, out var normal)) { if (Object.op_Implicit((Object)(object)indicator) && indicator.activeSelf) { indicator.SetActive(false); } return; } if (!Object.op_Implicit((Object)(object)indicator)) { if (triedPrefab) { return; } triedPrefab = true; GameObject val = ArrowRain.areaIndicatorPrefab; if (!Object.op_Implicit((Object)(object)val)) { val = LegacyResourcesAPI.Load("Prefabs/HuntressArrowRainIndicator"); } if (!Object.op_Implicit((Object)(object)val)) { Log.Warning("Artillery impact circle: the game's area marker could not be found."); return; } indicator = Object.Instantiate(val); } if (!indicator.activeSelf) { indicator.SetActive(true); } indicator.transform.position = point; indicator.transform.up = normal; indicator.transform.localScale = new Vector3(num, num, num); } private bool FindImpact(out Vector3 point, out Vector3 normal) { //IL_0001: 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_000d: 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_009e: 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_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: 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_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_018a: 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_0194: 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_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_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) point = default(Vector3); normal = Vector3.up; if (!Object.op_Implicit((Object)(object)body.inputBank)) { return false; } if (!Object.op_Implicit((Object)(object)cachedMuzzle)) { ModelLocator modelLocator = body.modelLocator; ChildLocator val = ((Object.op_Implicit((Object)(object)modelLocator) && Object.op_Implicit((Object)(object)modelLocator.modelTransform)) ? ((Component)modelLocator.modelTransform).GetComponent() : null); cachedMuzzle = (Object.op_Implicit((Object)(object)val) ? val.FindChild("ArtilleryMuzzle") : null); } Vector3 val2 = (Object.op_Implicit((Object)(object)cachedMuzzle) ? cachedMuzzle.position : body.inputBank.aimOrigin); int num = Physics.RaycastNonAlloc(new Ray(val2, body.inputBank.aimDirection), raycastBuffer, 500f, LayerMask.op_Implicit(CommonMasks.bullet)); float num2 = float.MaxValue; bool flag = false; for (int i = 0; i < num; i++) { RaycastHit val3 = raycastBuffer[i]; if (!(((RaycastHit)(ref val3)).distance >= num2)) { HurtBox component = ((Component)((RaycastHit)(ref val3)).collider).GetComponent(); if (!Object.op_Implicit((Object)(object)component) || !((Object)(object)component.healthComponent == (Object)(object)body.healthComponent)) { num2 = ((RaycastHit)(ref val3)).distance; point = ((RaycastHit)(ref val3)).point; normal = ((RaycastHit)(ref val3)).normal; flag = true; } } } if (!flag) { return false; } RaycastHit val4 = default(RaycastHit); if (normal.y < 0.5f && Physics.Raycast(point + normal * 0.5f, Vector3.down, ref val4, 200f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask))) { point = ((RaycastHit)(ref val4)).point; normal = ((RaycastHit)(ref val4)).normal; } return true; } private void OnDisable() { if (Object.op_Implicit((Object)(object)indicator)) { indicator.SetActive(false); } } private void OnDestroy() { if (Object.op_Implicit((Object)(object)indicator)) { Object.Destroy((Object)(object)indicator); } } } public class BastionBabyVulture : MonoBehaviour { private SkinnedMeshRenderer stock; private Mesh stockMesh; private List parts; internal static void Set(Renderer birdRenderer, bool wanted) { SkinnedMeshRenderer val = (SkinnedMeshRenderer)(object)((birdRenderer is SkinnedMeshRenderer) ? birdRenderer : null); if (!Object.op_Implicit((Object)(object)val)) { return; } BastionBabyVulture bastionBabyVulture = ((Component)val).GetComponent(); if (!Object.op_Implicit((Object)(object)bastionBabyVulture)) { if (!wanted) { return; } bastionBabyVulture = ((Component)val).gameObject.AddComponent(); bastionBabyVulture.stock = val; bastionBabyVulture.stockMesh = val.sharedMesh; } bastionBabyVulture.Apply(wanted); } private void Apply(bool wanted) { //IL_0054: 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_008a: Expected O, but got Unknown //IL_00f6: 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) Mesh val = BastionWireMesh.Get(stockMesh, "purge"); if (parts == null && wanted && Object.op_Implicit((Object)(object)val)) { parts = new List(); Matrix4x4[] bindposes = BastionWireMesh.GetBindposes(stockMesh, "purge"); foreach (BastionPurgeKit.Piece item in BastionPurgeKit.Get("purge.bird.kit.bin", bindposes, stockMesh.bounds)) { GameObject val2 = new GameObject("BabyVulture" + item.name); val2.layer = ((Component)stock).gameObject.layer; val2.transform.SetParent(((Component)stock).transform, false); SkinnedMeshRenderer obj = val2.AddComponent(); obj.sharedMesh = item.mesh; obj.bones = stock.bones; obj.rootBone = stock.rootBone; ((Renderer)obj).localBounds = ((Renderer)stock).localBounds; obj.updateWhenOffscreen = stock.updateWhenOffscreen; obj.quality = stock.quality; ((Renderer)obj).sharedMaterial = item.material; parts.Add(val2); } } bool flag = wanted && parts != null && parts.Count > 0; stock.sharedMesh = (flag ? val : stockMesh); if (parts == null) { return; } foreach (GameObject part in parts) { part.SetActive(flag); } } } internal class BastionBombardShellComponent : MonoBehaviour { } [DefaultExecutionOrder(50)] public class BastionController : MonoBehaviour { public bool HasTransformedThisStage; public bool TurretDeployed; public SkillDef PrimaryStorage; public SkillDef UtilityStorage; public SkillDef SpecialStorage; public bool StanceSkillsStored; public int UtilityStockStored; public float UtilityStopwatchStored; public int SpecialStockStored; public float SpecialStopwatchStored; public float SkillsCapturedAt; public float MinigunSpin; private float lastMinigunFireTime; public const float MinigunSpinUpTime = 2f; public const float MinigunSpinDownTime = 1f; public const float MinigunSpinGrace = 0.25f; public const float MinigunMinRate = 0.25f; public Vector3 BombardFacing = Vector3.forward; public const float BombardMaxYaw = 45f; public const float BombardMuzzleLift = 0.75f; private CharacterBody cachedBody; private CharacterDirection cachedDirection; private SkillDef crosshairFor; private OverrideRequest crosshairRequest; private bool starterScepterDone; private Animator cachedModelAnimator; private bool setUnmovable; private AimAnimator cachedAimAnimator; private static readonly int aimPitchCycleParam = Animator.StringToHash("aimPitchCycle"); private static readonly int aimWeightParam = Animator.StringToHash("aimWeight"); private Renderer cachedBodyRenderer; private Material lastBodyMaterial; private Color bodyBaseEmColor; public float Heat; public const float HeatGlowMax = 1f; public const float HeatDecayTime = 5f; private Renderer cachedBarrelRenderer; private float steamClock; private static GameObject steamEffect; private bool capturedBarrelEmColor; private Color barrelBaseEmColor; private static readonly Color barrelHotColor = new Color(1f, 0.32f, 0.06f); public bool Overheated => Heat >= ((BastionConfig.igniteHeatThreshold != null) ? BastionConfig.igniteHeatThreshold.Value : 0.95f); public float GetStoredSpecialCooldownRemaining() { if (!StanceSkillsStored || SpecialStockStored > 0 || !Object.op_Implicit((Object)(object)SpecialStorage)) { return 0f; } float num = SpecialStopwatchStored + (Time.fixedTime - SkillsCapturedAt); return Mathf.Max(0f, SpecialStorage.baseRechargeInterval - num); } public void NotifyInFormArtilleryEntry() { if (StanceSkillsStored) { SpecialStockStored = 0; SpecialStopwatchStored = 0f; SkillsCapturedAt = Time.fixedTime; } } public void NotifyMinigunFired(float cycleDuration) { MinigunSpin = Mathf.Min(1f, MinigunSpin + cycleDuration / 2f); lastMinigunFireTime = Time.time; } public static Vector3 ClampToBombardArc(Vector3 aimDirection, Vector3 deployedFacing) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000e: 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_0038: 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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0070: 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_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: 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) Vector3 val = deployedFacing; val.y = 0f; Vector3 val2 = aimDirection; val2.y = 0f; if (((Vector3)(ref val)).sqrMagnitude < 0.0001f || ((Vector3)(ref val2)).sqrMagnitude < 0.0001f) { return aimDirection; } float num = Vector3.SignedAngle(((Vector3)(ref val)).normalized, ((Vector3)(ref val2)).normalized, Vector3.up); float num2 = Mathf.Clamp(num, -45f, 45f); if (Mathf.Approximately(num2, num)) { return aimDirection; } Vector3 val3 = Quaternion.AngleAxis(num2, Vector3.up) * ((Vector3)(ref val)).normalized; float y = ((Vector3)(ref aimDirection)).normalized.y; float num3 = Mathf.Sqrt(Mathf.Max(0f, 1f - y * y)); Vector3 val4 = val3 * num3 + Vector3.up * y; return ((Vector3)(ref val4)).normalized; } private void UpdateCrosshair() { //IL_0041: 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_0056: Expected O, but got Unknown //IL_0056: Expected O, but got Unknown SkillLocator val = (Object.op_Implicit((Object)(object)cachedBody) ? cachedBody.skillLocator : null); GenericSkill val2 = (Object.op_Implicit((Object)(object)val) ? val.primary : null); SkillDef val3 = (Object.op_Implicit((Object)(object)val2) ? val2.skillDef : null); if (!((Object)val3 == (Object)crosshairFor)) { crosshairFor = val3; OverrideRequest obj = crosshairRequest; if (obj != null) { obj.Dispose(); } crosshairRequest = null; GameObject val4 = BastionCrosshairs.For(val3); if (Object.op_Implicit((Object)(object)val4)) { crosshairRequest = CrosshairUtils.RequestOverrideForBody(cachedBody, val4, (OverridePriority)1); } } } private void OnDestroy() { OverrideRequest obj = crosshairRequest; if (obj != null) { obj.Dispose(); } crosshairRequest = null; } public void Awake() { SkillLocator component = ((Component)this).gameObject.GetComponent(); PrimaryStorage = component.primary.skillDef; UtilityStorage = component.utility.skillDef; SpecialStorage = component.special.skillDef; cachedBody = ((Component)this).gameObject.GetComponent(); cachedDirection = ((Component)this).gameObject.GetComponent(); } private void HoldFacingWhileRooted() { //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_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_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Expected O, but got Unknown //IL_00bd: Expected O, but got Unknown if (!Object.op_Implicit((Object)(object)cachedBody) || !Object.op_Implicit((Object)(object)cachedDirection) || !cachedBody.HasBuff(BastionBuffs.turretRootDef)) { return; } if (BastionTank.IsTank(cachedBody)) { Vector3 forward = cachedDirection.forward; forward.y = 0f; if (((Vector3)(ref forward)).sqrMagnitude > 0.001f) { BombardFacing = ((Vector3)(ref forward)).normalized; } SkillLocator skillLocator = cachedBody.skillLocator; if (Object.op_Implicit((Object)(object)skillLocator) && Object.op_Implicit((Object)(object)skillLocator.primary) && (Object)skillLocator.primary.skillDef == (Object)BastionStaticValues.BastionSkillList.bombardPrimary) { cachedBody.SetAimTimer(0.5f); } } else { cachedDirection.moveVector = Vector3.zero; } } private void SyncTankBuff() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown if (NetworkServer.active && Object.op_Implicit((Object)(object)cachedBody) && !((Object)BastionBuffs.tankDef == (Object)null)) { if (!starterScepterDone) { starterScepterDone = BastionTank.TryGiveStarterScepter(cachedBody); } bool num = cachedBody.HasBuff(BastionBuffs.turretRootDef); if (!num) { TurretDeployed = false; } bool flag = num && TurretDeployed && BastionTank.HasScepter(cachedBody); bool flag2 = cachedBody.HasBuff(BastionBuffs.tankDef); if (flag && !flag2) { cachedBody.AddBuff(BastionBuffs.tankDef); } else if (!flag && flag2) { cachedBody.RemoveBuff(BastionBuffs.tankDef); } } } private void HoldUnmovableWhileRooted() { //IL_0031: 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_003c: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0065: 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) if (Object.op_Implicit((Object)(object)cachedBody)) { bool flag = cachedBody.HasBuff(BastionBuffs.turretRootDef); if (flag && !setUnmovable) { CharacterBody obj = cachedBody; obj.bodyFlags = (BodyFlags)(obj.bodyFlags | 0x10000); setUnmovable = true; } else if (!flag && setUnmovable) { CharacterBody obj2 = cachedBody; obj2.bodyFlags = (BodyFlags)(obj2.bodyFlags & -65537); setUnmovable = false; } } } private void HoldGroundedAnimWhileRooted() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Expected O, but got Unknown if (!Object.op_Implicit((Object)(object)cachedBody) || !cachedBody.HasBuff(BastionBuffs.turretRootDef)) { return; } if ((Object)cachedModelAnimator == (Object)null) { ModelLocator modelLocator = cachedBody.modelLocator; Transform val = (Object.op_Implicit((Object)(object)modelLocator) ? modelLocator.modelTransform : null); cachedModelAnimator = (((Object)val != (Object)null) ? ((Component)val).GetComponent() : null); if ((Object)cachedModelAnimator == (Object)null) { return; } } cachedModelAnimator.SetBool("isGrounded", true); cachedModelAnimator.SetFloat("upSpeed", 0f); cachedModelAnimator.SetBool("isSprinting", false); cachedModelAnimator.SetBool("isMoving", false); if (!cachedModelAnimator.IsInTransition(0)) { AnimatorStateInfo currentAnimatorStateInfo = cachedModelAnimator.GetCurrentAnimatorStateInfo(0); if (!((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("Idle")) { cachedModelAnimator.CrossFadeInFixedTime("Idle", 0.1f, 0); } } } private void FixAimPitchInversionWhileRooted() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006b: 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) if (!Object.op_Implicit((Object)(object)cachedBody) || !cachedBody.HasBuff(BastionBuffs.turretRootDef) || (Object)cachedModelAnimator == (Object)null) { return; } if (!Object.op_Implicit((Object)(object)cachedAimAnimator)) { cachedAimAnimator = ((Component)cachedModelAnimator).GetComponentInChildren(); if (!Object.op_Implicit((Object)(object)cachedAimAnimator)) { return; } } AimAngles currentLocalAngles = cachedAimAnimator.currentLocalAngles; float num = Mathf.Cos(currentLocalAngles.yaw * (MathF.PI / 180f)); if (!(num >= -0.05f)) { float num2 = Mathf.Clamp(currentLocalAngles.pitch / num, cachedAimAnimator.pitchRangeMin, cachedAimAnimator.pitchRangeMax); float num3 = (cachedAimAnimator.enableAimWeight ? cachedModelAnimator.GetFloat(aimWeightParam) : 1f); float num4 = (num2 * num3 - cachedAimAnimator.pitchRangeMin) / (cachedAimAnimator.pitchRangeMax - cachedAimAnimator.pitchRangeMin); cachedModelAnimator.SetFloat(aimPitchCycleParam, Mathf.LerpUnclamped(0.999f, 0f, num4)); } } private void HandleLightToggle() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Expected O, but got Unknown //IL_006b: Unknown result type (might be due to invalid IL or missing references) if (!Input.GetKeyDown((KeyCode)301)) { return; } LocalUser firstLocalUser = LocalUserManager.GetFirstLocalUser(); if (firstLocalUser == null || (Object)firstLocalUser.cachedBody != (Object)(object)cachedBody) { return; } NetworkIdentity component = ((Component)cachedBody).GetComponent(); if (Object.op_Implicit((Object)(object)component) && !((Object)BastionBuffs.redLightsDef == (Object)null)) { bool red = !cachedBody.HasBuff(BastionBuffs.redLightsDef); RedLightsMessage redLightsMessage = new RedLightsMessage(component.netId, red); if (NetworkServer.active) { redLightsMessage.OnReceived(); } else { NetMessageExtensions.Send((INetMessage)(object)redLightsMessage, (NetworkDestination)2); } } } private void ApplyLightTint() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Expected O, but got Unknown //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Expected O, but got Unknown //IL_00d3: Expected O, but got Unknown //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)cachedBody) || (Object)BastionBuffs.redLightsDef == (Object)null) { return; } if (!Object.op_Implicit((Object)(object)cachedBodyRenderer)) { ModelLocator modelLocator = cachedBody.modelLocator; Transform val = (Object.op_Implicit((Object)(object)modelLocator) ? modelLocator.modelTransform : null); ChildLocator val2 = (Object.op_Implicit((Object)(object)val) ? ((Component)val).GetComponent() : null); Transform val3 = (Object.op_Implicit((Object)(object)val2) ? val2.FindChild("body") : null); cachedBodyRenderer = (Object.op_Implicit((Object)(object)val3) ? ((Component)val3).GetComponent() : null); if (!Object.op_Implicit((Object)(object)cachedBodyRenderer)) { return; } } Material material = cachedBodyRenderer.material; if (!((Object)material == (Object)null)) { if ((Object)material != (Object)lastBodyMaterial) { lastBodyMaterial = material; bodyBaseEmColor = material.GetColor("_EmColor"); } bool flag = cachedBody.HasBuff(BastionBuffs.redLightsDef); Color val4 = new Color(1f, 0.07f, 0.04f) * Mathf.Max(1f, ((Color)(ref bodyBaseEmColor)).maxColorComponent); material.SetColor("_EmColor", flag ? val4 : bodyBaseEmColor); } } private void Update() { SyncTankBuff(); HoldFacingWhileRooted(); HoldGroundedAnimWhileRooted(); FixAimPitchInversionWhileRooted(); HandleLightToggle(); ApplyLightTint(); UpdateCrosshair(); HandleEmoteInput(); } private void HandleEmoteInput() { //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Expected O, but got Unknown //IL_009c: Expected O, but got Unknown int num = BastionEmotes.PressedEmote(); if (num < 0 || !Object.op_Implicit((Object)(object)cachedBody) || !cachedBody.hasEffectiveAuthority || !cachedBody.isPlayerControlled || cachedBody.HasBuff(BastionBuffs.turretRootDef) || (Object.op_Implicit((Object)(object)cachedBody.characterMotor) && !cachedBody.characterMotor.isGrounded)) { return; } LocalUser val = null; foreach (LocalUser readOnlyLocalUsers in LocalUserManager.readOnlyLocalUsersList) { if ((Object)readOnlyLocalUsers.cachedBody == (Object)cachedBody) { val = readOnlyLocalUsers; break; } } if (val != null && !val.isUIFocused) { EntityStateMachine val2 = EntityStateMachine.FindByCustomName(((Component)this).gameObject, "Body"); if (Object.op_Implicit((Object)(object)val2) && (val2.IsInMainState() || val2.state is BastionEmote)) { val2.SetInterruptState((EntityState)(object)new BastionEmote { emoteIndex = num }, (InterruptPriority)0); } } } public void OnEnter() { HasTransformedThisStage = false; } public void AddHeat(float amount) { Heat = Mathf.Min(1f, Heat + amount); } private bool TryCacheBarrelRenderer() { if (Object.op_Implicit((Object)(object)cachedBarrelRenderer)) { return true; } ModelLocator val = (Object.op_Implicit((Object)(object)cachedBody) ? cachedBody.modelLocator : null); Transform val2 = (Object.op_Implicit((Object)(object)val) ? val.modelTransform : null); ChildLocator val3 = (Object.op_Implicit((Object)(object)val2) ? ((Component)val2).GetComponent() : null); Transform val4 = (Object.op_Implicit((Object)(object)val3) ? val3.FindChild("barrel") : null); cachedBarrelRenderer = (Object.op_Implicit((Object)(object)val4) ? ((Component)val4).GetComponent() : null); return Object.op_Implicit((Object)(object)cachedBarrelRenderer); } private void DriveHeatGlow() { //IL_0088: 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_016f: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Expected O, but got Unknown //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Expected O, but got Unknown //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0186: 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_01c9: 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_01f1: 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_00b2: 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_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: 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_00f2: Unknown result type (might be due to invalid IL or missing references) float num = ((BastionConfig.heatDecayTime != null && BastionConfig.heatDecayTime.Value > 0.1f) ? BastionConfig.heatDecayTime.Value : 5f); Heat = Mathf.Max(0f, Heat - Time.fixedDeltaTime / num); if (!TryCacheBarrelRenderer()) { return; } if (!BastionWireMesh.IsWireMaterial(cachedBarrelRenderer.sharedMaterial)) { Material material = cachedBarrelRenderer.material; if (!capturedBarrelEmColor) { capturedBarrelEmColor = true; barrelBaseEmColor = material.GetColor("_EmColor"); } Color val = ((!Object.op_Implicit((Object)(object)cachedBody) || cachedBody.skinIndex == 0) ? barrelBaseEmColor : barrelHotColor); if (Object.op_Implicit((Object)(object)cachedBody) && cachedBody.skinIndex == 5) { Color white = Color.white; Color val2 = barrelHotColor; val = white * ((Color)(ref val2)).maxColorComponent; } material.SetColor("_EmColor", Color.Lerp(barrelBaseEmColor, val, Mathf.Clamp01(Heat * 1.4f))); material.SetFloat("_EmPower", Heat * 1f); } if (!Overheated) { return; } steamClock -= Time.fixedDeltaTime; if (!(steamClock <= 0f)) { return; } steamClock = 0.6f; if ((Object)steamEffect == (Object)null) { steamEffect = Addressables.LoadAssetAsync((object)RoR2_Base_Common_VFX.MuzzleflashSmokeRing_prefab).WaitForCompletion(); } if ((Object)steamEffect != (Object)null) { GameObject val3 = Object.Instantiate(steamEffect, ((Component)cachedBarrelRenderer).transform.position, ((Component)cachedBarrelRenderer).transform.rotation, ((Component)cachedBarrelRenderer).transform); val3.transform.localScale = Vector3.one * 0.5f; ShakeEmitter[] componentsInChildren = val3.GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { Object.Destroy((Object)(object)componentsInChildren[i]); } Object.Destroy((Object)(object)val3, 2f); } } public void FixedUpdate() { HoldFacingWhileRooted(); HoldGroundedAnimWhileRooted(); HoldUnmovableWhileRooted(); if (MinigunSpin > 0f && Time.time - lastMinigunFireTime > 0.25f) { MinigunSpin = Mathf.Max(0f, MinigunSpin - Time.fixedDeltaTime / 1f); } DriveHeatGlow(); } public bool CheckForTransformation() { return HasTransformedThisStage; } } public class BastionCSS : CharacterSelectSurvivorPreviewDisplayController { private SkillLocator skillLocator; private BodyIndex bastionBodyIndex; private const float PulseTime = 1.2f; private const float PulseBoost = 2.5f; private Renderer momentRenderer; private Material momentMaterial; private Color momentBaseColor; private void OnEnable() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) skillLocator = base.bodyPrefab.GetComponent(); base.currentLoadout = Loadout.RequestInstance(); bastionBodyIndex = BastionPlugin.bodyIndex; Log.Message($"BodyIndex {bastionBodyIndex}"); NetworkUser.onLoadoutChangedGlobal += OnLoadoutChangedGlobal; RoR2Application.onNextUpdate += Refresh; PlaySelectSound(); ((MonoBehaviour)this).StartCoroutine(SelectMoment()); } private IEnumerator SelectMoment() { float time = 0f; while (time < 1.2f) { time += Time.deltaTime; float num = Mathf.Sin(time / 1.2f * 3f * MathF.PI); SetLightBoost(1f + 2.5f * num * num); yield return null; } SetLightBoost(1f); yield return (object)new WaitForSeconds(0.4f); GameObject val = (((Object)(object)Camera.main != (Object)null) ? ((Component)Camera.main).gameObject : ((Component)this).gameObject); if (Object.op_Implicit((Object)(object)val)) { Util.PlaySound("BAS10_ShotgunReady", val); } } private void SetLightBoost(float factor) { //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Expected O, but got Unknown //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Expected O, but got Unknown //IL_00af: Expected O, but got Unknown //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) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)momentRenderer)) { ChildLocator componentInChildren = ((Component)this).GetComponentInChildren(); Transform val = (Object.op_Implicit((Object)(object)componentInChildren) ? componentInChildren.FindChild("body") : null); momentRenderer = (Object.op_Implicit((Object)(object)val) ? ((Component)val).GetComponent() : null); if (!Object.op_Implicit((Object)(object)momentRenderer)) { momentRenderer = (Renderer)(object)((Component)this).GetComponentInChildren(); } if (!Object.op_Implicit((Object)(object)momentRenderer)) { return; } } Material material = momentRenderer.material; if (!((Object)material == (Object)null) && !BastionWireMesh.IsWireMaterial(material) && material.HasProperty("_EmColor")) { if ((Object)material != (Object)momentMaterial) { momentMaterial = material; momentBaseColor = material.GetColor("_EmColor"); } material.SetColor("_EmColor", momentBaseColor * factor); } } private void RestoreLights() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_001f: Unknown result type (might be due to invalid IL or missing references) if ((Object)momentMaterial != (Object)null) { momentMaterial.SetColor("_EmColor", momentBaseColor); } momentMaterial = null; } private void PlaySelectSound() { GameObject val = (((Object)(object)Camera.main != (Object)null) ? ((Component)Camera.main).gameObject : ((Component)this).gameObject); if (Object.op_Implicit((Object)(object)val)) { Util.PlaySound("BAS10_Transform", val); } } private void OnDisable() { RestoreLights(); NetworkUser.onLoadoutChangedGlobal -= OnLoadoutChangedGlobal; base.currentLoadout = Loadout.ReturnInstance(base.currentLoadout); } private void Refresh() { if (Object.op_Implicit((Object)(object)this) && Object.op_Implicit((Object)(object)((CharacterSelectSurvivorPreviewDisplayController)this).networkUser)) { Log.Message("Changed characters"); OnLoadoutChangedGlobal(((CharacterSelectSurvivorPreviewDisplayController)this).networkUser); } } private void OnLoadoutChangedGlobal(NetworkUser changedNetworkUser) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Invalid comparison between Unknown and I4 //IL_003f: 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_0139: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)changedNetworkUser != (Object)(object)((CharacterSelectSurvivorPreviewDisplayController)this).networkUser) && (int)bastionBodyIndex != -1) { Log.Message("Changed loadout"); changedNetworkUser.networkLoadout.CopyLoadout(base.currentLoadout); if (CharacterSelectSurvivorPreviewDisplayController.HasSkillVariantEnabled(base.currentLoadout, bastionBodyIndex, skillLocator.utility.skillFamily, BastionStaticValues.BastionSkillList.reconToAssault)) { BastionStaticValues.TurretDef.primary = BastionStaticValues.BastionSkillList.assaultPrimary; BastionStaticValues.TurretDef.utility = BastionStaticValues.BastionSkillList.assaultToRecon; BastionStaticValues.TurretDef.special = BastionStaticValues.BastionSkillList.assaultToArtillery; BastionStaticValues.ArtilleryDef.utility = BastionStaticValues.BastionSkillList.artilleryToAssault; } if (CharacterSelectSurvivorPreviewDisplayController.HasSkillVariantEnabled(base.currentLoadout, bastionBodyIndex, skillLocator.utility.skillFamily, BastionStaticValues.BastionSkillList.reconToBombard)) { BastionStaticValues.TurretDef.primary = BastionStaticValues.BastionSkillList.bombardPrimary; BastionStaticValues.TurretDef.utility = BastionStaticValues.BastionSkillList.bombardToRecon; BastionStaticValues.TurretDef.special = BastionStaticValues.BastionSkillList.bombardToArtillery; BastionStaticValues.ArtilleryDef.utility = BastionStaticValues.BastionSkillList.artilleryToBombard; } if (CharacterSelectSurvivorPreviewDisplayController.HasSkillVariantEnabled(base.currentLoadout, bastionBodyIndex, skillLocator.special.skillFamily, BastionStaticValues.BastionSkillList.reconToArtillery)) { BastionStaticValues.ArtilleryDef.primary = BastionStaticValues.BastionSkillList.artilleryPrimary; } if (CharacterSelectSurvivorPreviewDisplayController.HasSkillVariantEnabled(base.currentLoadout, bastionBodyIndex, skillLocator.special.skillFamily, BastionStaticValues.BastionSkillList.reconToDroneArtillery)) { BastionStaticValues.ArtilleryDef.primary = BastionStaticValues.BastionSkillList.artilleryDronePrimary; } RoR2Application.onNextUpdate += SetModelVisuals; } } private void SetModelVisuals() { } } public class BastionDeath : GenericCharacterDeath { private const float explosionScale = 2.5f; private const float sparksScale = 3f; public override void OnEnter() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Expected O, but got Unknown //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but got Unknown //IL_007e: 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_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Expected O, but got Unknown //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0050: 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_0067: Expected O, but got Unknown ((GenericCharacterDeath)this).OnEnter(); Vector3 origin = (Object.op_Implicit((Object)(object)((EntityState)this).characterBody) ? ((EntityState)this).characterBody.corePosition : ((EntityState)this).transform.position); if (NetworkServer.active && (Object)BastionAssets.explosion != (Object)null) { EffectManager.SpawnEffect(BastionAssets.explosion, new EffectData { origin = origin, scale = 2.5f }, true); } if ((Object)BastionAssets.sparksEffect != (Object)null) { EffectManager.SpawnEffect(BastionAssets.sparksEffect, new EffectData { origin = origin, scale = 3f }, false); } if (Object.op_Implicit((Object)(object)((GenericCharacterDeath)this).cachedModelTransform)) { Renderer[] componentsInChildren = ((Component)((GenericCharacterDeath)this).cachedModelTransform).GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].enabled = false; } } } } public class BastionDisplayCosmetics : MonoBehaviour { private ModelSkinController skinController; private Renderer birdRenderer; private Material originalBirdMaterial; private Renderer barrelRenderer; private int lastSkinIndex = int.MinValue; private void Start() { skinController = ((Component)this).GetComponent(); if (!Object.op_Implicit((Object)(object)skinController)) { skinController = ((Component)this).GetComponentInChildren(); } Transform val = FindDeep(((Component)this).transform, "Ganamede"); if (Object.op_Implicit((Object)(object)val)) { birdRenderer = ((Component)val).GetComponentInChildren(true); } if (Object.op_Implicit((Object)(object)birdRenderer)) { originalBirdMaterial = birdRenderer.sharedMaterial; } Renderer[] componentsInChildren = ((Component)this).GetComponentsInChildren(true); foreach (Renderer val2 in componentsInChildren) { if (Object.op_Implicit((Object)(object)val2.sharedMaterial) && ((Object)val2.sharedMaterial).name.Contains("Turret")) { barrelRenderer = val2; break; } } } private void Update() { //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Expected O, but got Unknown if (Object.op_Implicit((Object)(object)barrelRenderer) && !BastionWireMesh.IsWireMaterial(barrelRenderer.sharedMaterial) && Object.op_Implicit((Object)(object)barrelRenderer.material)) { barrelRenderer.material.SetFloat("_EmPower", 0f); } if (!Object.op_Implicit((Object)(object)birdRenderer) || !Object.op_Implicit((Object)(object)skinController) || (Object)originalBirdMaterial == (Object)null) { return; } int currentSkinIndex = skinController.currentSkinIndex; if (currentSkinIndex != lastSkinIndex) { lastSkinIndex = currentSkinIndex; BastionBabyVulture.Set(birdRenderer, currentSkinIndex == 4); Material tintedBirdMaterial = GanymedeFollower.GetTintedBirdMaterial(currentSkinIndex, originalBirdMaterial); if (Object.op_Implicit((Object)(object)tintedBirdMaterial)) { birdRenderer.material = tintedBirdMaterial; } } } private static Transform FindDeep(Transform root, string childName) { if (((Object)root).name == childName) { return root; } for (int i = 0; i < root.childCount; i++) { Transform val = FindDeep(root.GetChild(i), childName); if (Object.op_Implicit((Object)(object)val)) { return val; } } return null; } } [DefaultExecutionOrder(200)] public class BastionEmotePlayer : MonoBehaviour { private const float BlendTime = 0.3f; private BastionEmoteClip clip; private Transform[] bones; private float time; private float weight; private bool playing; public bool isPlaying => playing; public void Play(BastionEmoteClip newClip) { if (newClip != null) { clip = newClip; time = 0f; playing = true; bones = (Transform[])(object)new Transform[clip.bonePaths.Length]; for (int i = 0; i < bones.Length; i++) { bones[i] = ((Component)this).transform.Find(clip.bonePaths[i]); } } } public void Stop() { playing = false; } private void LateUpdate() { //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_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_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_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_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017e: 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_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: 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_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) if (clip == null) { return; } weight = Mathf.MoveTowards(weight, playing ? 1f : 0f, Time.deltaTime / 0.3f); if (!playing && weight <= 0f) { clip = null; return; } if (playing) { time += Time.deltaTime; } clip.Sample(time, out var a, out var b, out var t); int num = bones.Length; for (int i = 0; i < num; i++) { Transform val = bones[i]; if (Object.op_Implicit((Object)(object)val)) { int num2 = a * num + i; int num3 = b * num + i; Vector3 val2 = Vector3.LerpUnclamped(clip.positions[num2], clip.positions[num3], t); Quaternion val3 = Quaternion.SlerpUnclamped(clip.rotations[num2], clip.rotations[num3], t); Vector3 val4 = Vector3.LerpUnclamped(clip.scales[num2], clip.scales[num3], t); if (weight >= 1f) { val.localPosition = val2; val.localRotation = val3; val.localScale = val4; } else { val.localPosition = Vector3.Lerp(val.localPosition, val2, weight); val.localRotation = Quaternion.Slerp(val.localRotation, val3, weight); val.localScale = Vector3.Lerp(val.localScale, val4, weight); } } } } public bool TryGetPerch(out Vector3 position) { //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_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007e: 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) position = Vector3.zero; if (clip == null || !playing) { return false; } clip.Sample(time, out var a, out var b, out var t); if (!clip.hasAnchor[a] || !clip.hasAnchor[b]) { return false; } position = ((Component)this).transform.TransformPoint(Vector3.LerpUnclamped(clip.anchorPositions[a], clip.anchorPositions[b], t)); return true; } } [RequireComponent(typeof(ProjectileController))] public class BastionGrenadeKnockback : MonoBehaviour { public const float FuseAfterStick = 1f; public float knockRadius = 12f; public float knockForce = 8000f; private const float ArmTime = 0.04f; private const float StickCheckRadius = 0.45f; private float age; private bool stuck; private float fuseStopwatch; private bool detonated; private Rigidbody rb; private ProjectileController controller; private void Awake() { rb = ((Component)this).GetComponent(); controller = ((Component)this).GetComponent(); if (BastionConfig.grenadeKnockForce != null) { knockForce = BastionConfig.grenadeKnockForce.Value; } } private void FixedUpdate() { if (!NetworkServer.active || detonated) { return; } if (!stuck) { age += Time.fixedDeltaTime; if (age >= 0.04f) { TryStick(); } return; } fuseStopwatch += Time.fixedDeltaTime; if (fuseStopwatch >= 1f) { detonated = true; ApplyOwnerKnockback(); Detonate(); } } private void TryStick() { //IL_0006: 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_0099: 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) //IL_006a: 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) Collider[] array = Physics.OverlapSphere(((Component)this).transform.position, 0.6f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask)); CharacterBody ownerBody = GetOwnerBody(); Collider[] array2 = array; for (int i = 0; i < array2.Length; i++) { HurtBox component = ((Component)array2[i]).GetComponent(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.healthComponent) && (!Object.op_Implicit((Object)(object)ownerBody) || (!((Object)(object)component.healthComponent == (Object)(object)ownerBody.healthComponent) && component.teamIndex != ownerBody.teamComponent.teamIndex))) { StickTo(((Component)component).transform); return; } } if (Physics.CheckSphere(((Component)this).transform.position, 0.45f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) { StickTo(null); } } private void StickTo(Transform rideTarget) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) stuck = true; if (Object.op_Implicit((Object)(object)rb)) { rb.velocity = Vector3.zero; rb.angularVelocity = Vector3.zero; rb.detectCollisions = false; rb.isKinematic = true; } if (Object.op_Implicit((Object)(object)rideTarget)) { ((Component)this).transform.SetParent(rideTarget, true); } } private void Detonate() { ProjectileImpactExplosion component = ((Component)this).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { if (Object.op_Implicit((Object)(object)component.impactEffect)) { ((ProjectileExplosion)component).explosionEffect = component.impactEffect; } ((ProjectileExplosion)component).Detonate(); } else { Object.Destroy((Object)(object)((Component)this).gameObject); } } private CharacterBody GetOwnerBody() { GameObject val = (Object.op_Implicit((Object)(object)controller) ? controller.owner : null); if (!Object.op_Implicit((Object)(object)val)) { return null; } return val.GetComponent(); } private void ApplyOwnerKnockback() { //IL_0023: 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_0033: 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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_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_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) CharacterBody ownerBody = GetOwnerBody(); CharacterMotor val = (Object.op_Implicit((Object)(object)ownerBody) ? ownerBody.characterMotor : null); if (Object.op_Implicit((Object)(object)val)) { Vector3 val2 = ownerBody.corePosition - ((Component)this).transform.position; float magnitude = ((Vector3)(ref val2)).magnitude; if (!(magnitude > knockRadius)) { float num = 1f - magnitude / knockRadius; Vector3 val3 = ((magnitude > 0.1f) ? (val2 / magnitude) : Vector3.up); Vector3 val4 = val3 + Vector3.up * 0.6f; val3 = ((Vector3)(ref val4)).normalized; val.ApplyForce(val3 * (knockForce * (0.4f + 0.6f * num)), true, false); } } } } internal class BastionInteractableComponent : MonoBehaviour { private PurchaseInteraction purchaseInteraction; private bool wasAvailable; private bool perched; private bool activating; private float activationClock; private float sparkTrailClock; private Vector3 restPosition; private Quaternion restRotation; private const float activationDelay = 0.5f; private const float trailDuration = 1.4f; private float contextPromptClock; private void Start() { purchaseInteraction = ((Component)this).GetComponent(); wasAvailable = Object.op_Implicit((Object)(object)purchaseInteraction) && purchaseInteraction.available; } private void Update() { if (activating) { AdvanceActivation(); } if (!perched && Object.op_Implicit((Object)(object)purchaseInteraction)) { UpdateContextPrompt(); bool available = purchaseInteraction.available; if (wasAvailable && !available) { perched = true; activating = true; activationClock = 0f; } wasAvailable = available; } } private void UpdateContextPrompt() { //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_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Expected O, but got Unknown contextPromptClock -= Time.deltaTime; if (contextPromptClock > 0f) { return; } contextPromptClock = 0.5f; LocalUser firstLocalUser = LocalUserManager.GetFirstLocalUser(); CharacterBody val = ((firstLocalUser != null) ? firstLocalUser.cachedBody : null); string text = "LOCKEDBAS10_CONTEXT_NEEDBIRD"; if (Object.op_Implicit((Object)(object)val)) { if (val.bodyIndex == BastionPlugin.bodyIndex) { text = "LOCKEDBAS10_CONTEXT"; } else if (Object.op_Implicit((Object)(object)val.inventory) && (Object)BastionItems.ganymedeItem != (Object)null && val.inventory.GetItemCountPermanent(BastionItems.ganymedeItem) > 0) { text = "LOCKEDBAS10_CONTEXT_OFFER"; } else if (BastionItems.HasBastionUnlocked(val)) { text = "LOCKEDBAS10_CONTEXT"; } } if (purchaseInteraction.contextToken != text) { purchaseInteraction.contextToken = text; } } private static Transform FindDeep(Transform root, string childName) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown if (((Object)root).name == childName) { return root; } for (int i = 0; i < root.childCount; i++) { Transform val = FindDeep(root.GetChild(i), childName); if ((Object)val != (Object)null) { return val; } } return null; } private void AdvanceActivation() { //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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0164: 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_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: 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_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) float num = activationClock; activationClock += Time.deltaTime; if (num < 0.5f && activationClock >= 0.5f) { Util.PlaySound("BAS10_Transform", ((Component)this).gameObject); SpawnEffectAt(BastionAssets.activateEffect, 1.5f); SpawnEffectAt(BastionAssets.sparksEffect, 2f); SpawnPerch(); restPosition = ((Component)this).transform.position; restRotation = ((Component)this).transform.rotation; } else if (activationClock >= 0.5f && activationClock < 1.9f) { sparkTrailClock += Time.deltaTime; if (sparkTrailClock >= 0.18f) { sparkTrailClock = 0f; SpawnEffectAt(BastionAssets.sparksEffect, 1f); } float num2 = 1f - (activationClock - 0.5f) / 1.4f; ((Component)this).transform.position = restPosition + Random.insideUnitSphere * (0.05f * num2); ((Component)this).transform.rotation = restRotation * Quaternion.Euler(Random.insideUnitSphere * (3f * num2)); } if (activationClock >= 1.9f) { ((Component)this).transform.position = restPosition; ((Component)this).transform.rotation = restRotation; activating = false; } } private void SpawnEffectAt(GameObject effect, float scale) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //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_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: 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_004c: Expected O, but got Unknown //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_005c: 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_006f: Expected O, but got Unknown //IL_004f: 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) if (!((Object)effect == (Object)null)) { Vector3 origin = ((Component)this).transform.position + Vector3.up * 1.5f; Transform val = FindDeep(((Component)this).transform, "Head"); if ((Object)val != (Object)null) { origin = val.position; } EffectManager.SpawnEffect(effect, new EffectData { origin = origin, scale = scale }, false); } } private void SpawnPerch() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Expected O, but got Unknown //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Expected O, but got Unknown //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Expected O, but got Unknown if ((Object)BastionAssets.ganymedePrefab == (Object)null) { return; } GameObject val = Object.Instantiate(BastionAssets.ganymedePrefab, ((Component)this).transform); Collider[] componentsInChildren = val.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].enabled = false; } Transform val2 = FindDeep(((Component)this).transform, "Shoulder.R"); if ((Object)val2 != (Object)null) { val.AddComponent().anchor = val2; val.transform.position = val2.position + Vector3.up * 0.1f; } else { val.transform.localPosition = new Vector3(0.45f, 1.42f, 0.15f); } val.transform.localRotation = Quaternion.Euler(0f, 180f, 0f); Animator componentInChildren = val.GetComponentInChildren(); if ((Object)componentInChildren != (Object)null) { RuntimeAnimatorController val3 = (((Object)BastionAssets.ganymedePerchController != (Object)null) ? BastionAssets.ganymedePerchController : BastionAssets.ganymedeController); if ((Object)val3 != (Object)null) { componentInChildren.runtimeAnimatorController = val3; } componentInChildren.cullingMode = (AnimatorCullingMode)0; componentInChildren.applyRootMotion = false; componentInChildren.Rebind(); componentInChildren.Update(0f); } } } public class BastionMinionDeath : GenericCharacterDeath { private float forceAmount = 20f; private const float killTimer = 0.5f; public override void OnEnter() { //IL_0040: 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) ((GenericCharacterDeath)this).OnEnter(); if (Object.op_Implicit((Object)(object)((EntityState)this).rigidbodyMotor)) { ((Behaviour)((EntityState)this).rigidbodyMotor.forcePID).enabled = false; ((EntityState)this).rigidbodyMotor.rigid.useGravity = true; ((EntityState)this).rigidbodyMotor.rigid.AddForce(Vector3.up * forceAmount, (ForceMode)0); ((EntityState)this).rigidbodyMotor.rigid.collisionDetectionMode = (CollisionDetectionMode)1; } } public override void FixedUpdate() { ((GenericCharacterDeath)this).FixedUpdate(); if (((EntityState)this).fixedAge >= 0.5f) { Detonate(); } } private void Detonate() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_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_0068: 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_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: 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_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Expected O, but got Unknown new BlastAttack { baseDamage = ((EntityState)this).characterBody.damage * 2f, radius = 2f, baseForce = 50f, crit = true, procCoefficient = 0f, attacker = ((EntityState)this).gameObject, inflictor = ((EntityState)this).gameObject, damageType = DamageTypeCombo.op_Implicit((DamageType)0), damageColorIndex = (DamageColorIndex)3, teamIndex = ((EntityState)this).GetComponent().teamIndex, falloffModel = (FalloffModel)0, position = ((EntityState)this).characterBody.corePosition }.Fire(); EffectData val = new EffectData { origin = ((EntityState)this).characterBody.corePosition, scale = 2f }; EffectManager.SpawnEffect(BastionAssets.explosion, val, true); EntityState.Destroy((Object)(object)((EntityState)this).gameObject); } public override void OnExit() { ((GenericCharacterDeath)this).OnExit(); } } public class BastionPurgeStow : MonoBehaviour { public SkinnedMeshRenderer skeleton; public List stowed = new List(); private Transform head; private void Start() { if (!Object.op_Implicit((Object)(object)skeleton)) { return; } Transform[] bones = skeleton.bones; foreach (Transform val in bones) { if (Object.op_Implicit((Object)(object)val) && ((Object)val).name == "Head") { head = val; break; } } } private void LateUpdate() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)head)) { return; } Vector3 localScale = head.localScale; bool flag = localScale.y < localScale.x * 0.8f; for (int i = 0; i < stowed.Count; i++) { if (Object.op_Implicit((Object)(object)stowed[i]) && stowed[i].forceRenderingOff != flag) { stowed[i].forceRenderingOff = flag; } } } } public class BastionSkillDef : SkillDef { public string IntroAnimationString; public string IntroAnimationLayerString; public string OutroAnimationString; public string OutroAnimationLayerString; public string YawControlString; public string YawControlLayerString; public string PitchControlString; public string PitchControlLayerString; } public class BastionTreads : MonoBehaviour { public SkinnedMeshRenderer treadRenderer; public Transform[] roots; public Vector3[] beltCentre; public Transform[] wheels; public float[] wheelRadius; public int[] wheelSide; public Transform[] lugs; public float[] lugDistance; public int[] lugSide; public Transform[] stilts; public Transform[] feet; private bool stiltsHidden; public float radius; public float halfLength; private CharacterModel characterModel; private float grow; private float growVelocity; private readonly float[] travelled = new float[2]; private Vector3 lastPosition; private Vector3 lastForward; private bool hasLast; private bool rolling; private float stillTime; private static Mesh treadMesh; private static Mesh treadWireMesh; private static readonly Vector2[] wireCorners = (Vector2[])(object)new Vector2[3] { new Vector2(0.0104f, 0.008f), new Vector2(0.0104f, 0.9886f), new Vector2(0.9891f, 0.9886f) }; internal static Mesh GetMesh(bool wire) { if (!wire) { return treadMesh; } return treadWireMesh; } internal static SkinnedMeshRenderer AddTo(CharacterModel model, SkinnedMeshRenderer body) { try { return Build(model, body); } catch (Exception ex) { Log.Error("Tank form: could not build the treads — " + ex); return null; } } private static SkinnedMeshRenderer Build(CharacterModel model, SkinnedMeshRenderer body) { //IL_00a0: 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_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_042f: Unknown result type (might be due to invalid IL or missing references) //IL_0434: Unknown result type (might be due to invalid IL or missing references) //IL_0460: Unknown result type (might be due to invalid IL or missing references) //IL_0465: Unknown result type (might be due to invalid IL or missing references) //IL_048b: Unknown result type (might be due to invalid IL or missing references) //IL_0490: Unknown result type (might be due to invalid IL or missing references) //IL_04a2: Unknown result type (might be due to invalid IL or missing references) //IL_04a7: Unknown result type (might be due to invalid IL or missing references) //IL_04c4: Unknown result type (might be due to invalid IL or missing references) //IL_04c9: Unknown result type (might be due to invalid IL or missing references) //IL_051b: Unknown result type (might be due to invalid IL or missing references) //IL_0524: Unknown result type (might be due to invalid IL or missing references) //IL_0529: Unknown result type (might be due to invalid IL or missing references) //IL_052e: Unknown result type (might be due to invalid IL or missing references) //IL_0555: Unknown result type (might be due to invalid IL or missing references) //IL_055a: Unknown result type (might be due to invalid IL or missing references) //IL_055f: Unknown result type (might be due to invalid IL or missing references) //IL_0564: Unknown result type (might be due to invalid IL or missing references) //IL_05f7: Unknown result type (might be due to invalid IL or missing references) //IL_060b: Unknown result type (might be due to invalid IL or missing references) //IL_0610: Unknown result type (might be due to invalid IL or missing references) //IL_0656: Unknown result type (might be due to invalid IL or missing references) //IL_0669: Unknown result type (might be due to invalid IL or missing references) using Stream stream = typeof(BastionTreads).Assembly.GetManifestResourceStream("BastionMod.Skins.treads.bin"); if (stream == null) { return null; } using GZipStream gZipStream = new GZipStream(stream, CompressionMode.Decompress); using MemoryStream memoryStream = new MemoryStream(); gZipStream.CopyTo(memoryStream); memoryStream.Position = 0L; using BinaryReader binaryReader = new BinaryReader(memoryStream); if (new string(binaryReader.ReadChars(4)) != "BTR1") { throw new InvalidDataException("bad tread model header"); } BastionTreads bastionTreads = ((Component)model).gameObject.AddComponent(); bastionTreads.radius = binaryReader.ReadSingle(); bastionTreads.halfLength = binaryReader.ReadSingle(); int num = binaryReader.ReadInt32(); Transform transform = new GameObject("TankTreads").transform; transform.SetParent(((Component)model).transform, false); ((Component)transform).gameObject.layer = ((Component)body).gameObject.layer; Transform[] array = (Transform[])(object)new Transform[num]; Vector3[] array2 = (Vector3[])(object)new Vector3[num]; bastionTreads.roots = (Transform[])(object)new Transform[2]; bastionTreads.beltCentre = (Vector3[])(object)new Vector3[2]; bool[] array3 = new bool[2]; List list = new List(); List list2 = new List(); List list3 = new List(); List list4 = new List(); List list5 = new List(); List list6 = new List(); Vector3 val = default(Vector3); for (int i = 0; i < num; i++) { int num2 = binaryReader.ReadByte(); int num3 = binaryReader.ReadByte(); ((Vector3)(ref val))..ctor(binaryReader.ReadSingle(), binaryReader.ReadSingle(), binaryReader.ReadSingle()); float num4 = binaryReader.ReadSingle(); Transform transform2 = new GameObject(num2 switch { 1 => "TreadWheel", 0 => "TreadRoot", _ => "TreadLug", } + num3).transform; ((Component)transform2).gameObject.layer = ((Component)body).gameObject.layer; if (num2 == 0) { transform2.SetParent(transform, false); bastionTreads.roots[num3] = transform2; array2[i] = val; } else { transform2.SetParent(bastionTreads.roots[num3], false); array2[i] = bastionTreads.roots[num3].localPosition + val; if (num2 == 1) { list.Add(transform2); list2.Add(num4); list3.Add(num3); } else { list4.Add(transform2); list5.Add(num4); list6.Add(num3); if (!array3[num3]) { bastionTreads.PathPoint(num4, out var point, out var _); bastionTreads.beltCentre[num3] = val - point; array3[num3] = true; } } } transform2.localPosition = val; array[i] = transform2; } bastionTreads.wheels = list.ToArray(); bastionTreads.wheelRadius = list2.ToArray(); bastionTreads.wheelSide = list3.ToArray(); bastionTreads.lugs = list4.ToArray(); bastionTreads.lugDistance = list5.ToArray(); bastionTreads.lugSide = list6.ToArray(); List list7 = new List(); Transform[] bones = body.bones; foreach (Transform val2 in bones) { if (Object.op_Implicit((Object)(object)val2) && (((Object)val2).name == "RearLeg.L" || ((Object)val2).name == "RearLeg.R")) { list7.Add(val2); } } bastionTreads.stilts = list7.ToArray(); List list8 = new List(); bones = body.bones; foreach (Transform val3 in bones) { if (Object.op_Implicit((Object)(object)val3) && (((Object)val3).name == "Ankle.L" || ((Object)val3).name == "Ankle.R")) { list8.Add(val3); } } bastionTreads.feet = list8.ToArray(); int num5 = binaryReader.ReadInt32(); Vector3[] array4 = (Vector3[])(object)new Vector3[num5]; Vector3[] array5 = (Vector3[])(object)new Vector3[num5]; Vector2[] array6 = (Vector2[])(object)new Vector2[num5]; Vector2[] array7 = (Vector2[])(object)new Vector2[num5]; Color32[] array8 = (Color32[])(object)new Color32[num5]; BoneWeight[] array9 = (BoneWeight[])(object)new BoneWeight[num5]; int[] array10 = new int[num5]; for (int k = 0; k < num5; k++) { array4[k] = new Vector3(binaryReader.ReadSingle(), binaryReader.ReadSingle(), binaryReader.ReadSingle()); } for (int l = 0; l < num5; l++) { array5[l] = new Vector3(binaryReader.ReadSingle(), binaryReader.ReadSingle(), binaryReader.ReadSingle()); } for (int m = 0; m < num5; m++) { array6[m] = new Vector2(binaryReader.ReadSingle(), binaryReader.ReadSingle()); array7[m] = wireCorners[m % 3]; array8[m] = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue); array10[m] = m; } for (int n = 0; n < num5; n++) { int num6 = binaryReader.ReadByte(); ((BoneWeight)(ref array9[n])).boneIndex0 = num6; ((BoneWeight)(ref array9[n])).weight0 = 1f; ref Vector3 reference = ref array4[n]; reference += array2[num6]; } Matrix4x4[] array11 = (Matrix4x4[])(object)new Matrix4x4[num]; for (int num7 = 0; num7 < num; num7++) { array11[num7] = Matrix4x4.Translate(-array2[num7]); } if (!Object.op_Implicit((Object)(object)treadMesh)) { treadMesh = MakeMesh("BastionTreads", array4, array5, array6, null, array9, array11, array10); treadWireMesh = MakeMesh("BastionTreads.Wire", array4, array5, array7, array8, array9, array11, array10); } SkinnedMeshRenderer val4 = ((Component)transform).gameObject.AddComponent(); val4.sharedMesh = treadMesh; val4.bones = array; val4.rootBone = transform; ((Renderer)val4).localBounds = new Bounds(new Vector3(0f, 0.4f, -0.3f), new Vector3(3f, 2f, 3.5f)); val4.updateWhenOffscreen = body.updateWhenOffscreen; val4.quality = (SkinQuality)1; ((Renderer)val4).sharedMaterial = ((Renderer)body).sharedMaterial; ((Renderer)val4).forceRenderingOff = true; bastionTreads.treadRenderer = val4; bastionTreads.roots[0].localScale = Vector3.zero; bastionTreads.roots[1].localScale = Vector3.zero; return val4; } private static Mesh MakeMesh(string name, Vector3[] positions, Vector3[] normals, Vector2[] uvs, Color32[] colors, BoneWeight[] weights, Matrix4x4[] bindposes, int[] triangles) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown Mesh val = new Mesh(); ((Object)val).name = name; val.indexFormat = (IndexFormat)(positions.Length > 65535); val.vertices = positions; val.normals = normals; val.uv = uvs; if (colors != null) { val.colors32 = colors; } val.boneWeights = weights; val.bindposes = bindposes; val.triangles = triangles; val.RecalculateTangents(); val.RecalculateBounds(); val.UploadMeshData(true); return val; } private void PathPoint(float distance, out Vector3 point, out Vector3 outward) { //IL_004f: 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_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: 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_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_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_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) float num = 2f * halfLength; float num2 = MathF.PI * radius; distance = Mathf.Repeat(distance, 2f * num + 2f * num2); if (distance < num) { point = new Vector3(0f, radius, 0f - halfLength + distance); outward = Vector3.up; return; } distance -= num; if (distance < num2) { float num3 = MathF.PI / 2f - distance / radius; outward = new Vector3(0f, Mathf.Sin(num3), Mathf.Cos(num3)); point = new Vector3(0f, 0f, halfLength) + outward * radius; return; } distance -= num2; if (distance < num) { point = new Vector3(0f, 0f - radius, halfLength - distance); outward = Vector3.down; return; } distance -= num; float num4 = -MathF.PI / 2f - distance / radius; outward = new Vector3(0f, Mathf.Sin(num4), Mathf.Cos(num4)); point = new Vector3(0f, 0f, 0f - halfLength) + outward * radius; } private void Awake() { characterModel = ((Component)this).GetComponent(); } private void SetRolling(bool wanted) { if (wanted != rolling) { rolling = wanted; Util.PlaySound(wanted ? "Play_MULT_move_loop" : "Stop_MULT_move_loop", ((Component)this).gameObject); } } private void OnDisable() { SetRolling(wanted: false); } private void LateUpdate() { //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0207: 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_0220: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0232: 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_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_034c: Unknown result type (might be due to invalid IL or missing references) //IL_0351: 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_0359: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_0285: 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_0198: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_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_03ad: Unknown result type (might be due to invalid IL or missing references) //IL_03ca: Unknown result type (might be due to invalid IL or missing references) //IL_03d2: Unknown result type (might be due to invalid IL or missing references) //IL_03d9: Unknown result type (might be due to invalid IL or missing references) //IL_03de: Unknown result type (might be due to invalid IL or missing references) //IL_03e0: 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_0445: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_0302: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)treadRenderer) || roots == null || roots.Length < 2) { return; } bool flag = BastionTank.IsTank(Object.op_Implicit((Object)(object)characterModel) ? characterModel.body : null); float num = (flag ? 1f : 0f); float num2 = Mathf.Min(Time.deltaTime, 0.05f); growVelocity += ((num - grow) * 60f - growVelocity * 11f) * num2; grow = Mathf.Max(0f, grow + growVelocity * num2); if (!flag && grow < 0.01f) { grow = 0f; growVelocity = 0f; } bool flag2 = grow > 0f; if (((Renderer)treadRenderer).forceRenderingOff == flag2) { ((Renderer)treadRenderer).forceRenderingOff = !flag2; } if (stilts != null && (flag2 || stiltsHidden)) { Vector3 localScale = Vector3.one * Mathf.Clamp01(1f - grow); for (int i = 0; i < stilts.Length; i++) { if (Object.op_Implicit((Object)(object)stilts[i])) { stilts[i].localScale = localScale; } } Vector3 localScale2 = Vector3.one * (1f - Mathf.SmoothStep(0f, 1f, Mathf.InverseLerp(0.6f, 1f, grow))); int num3 = 0; while (feet != null && num3 < feet.Length) { if (Object.op_Implicit((Object)(object)feet[num3])) { feet[num3].localScale = localScale2; } num3++; } stiltsHidden = flag2; } if (!flag2) { hasLast = false; SetRolling(wanted: false); return; } Vector3 localScale3 = Vector3.one * grow; roots[0].localScale = localScale3; roots[1].localScale = localScale3; Vector3 forward = ((Component)this).transform.forward; if (hasLast) { float num4 = Mathf.Max(((Component)this).transform.lossyScale.x, 0.0001f); float num5 = Vector3.Dot(((Component)this).transform.position - lastPosition, forward) / num4; float num6 = Vector3.SignedAngle(lastForward, forward, Vector3.up) * (MathF.PI / 180f); bool flag3 = flag && (Mathf.Abs(num5) > 0.4f * num2 || Mathf.Abs(num6) > 0.3f * num2); stillTime = (flag3 ? 0f : (stillTime + num2)); SetRolling(flag && stillTime < 0.15f); for (int j = 0; j < 2; j++) { float num7 = roots[j].localPosition.x + beltCentre[j].x; travelled[j] += num5 - num6 * num7; } } lastPosition = ((Component)this).transform.position; lastForward = forward; hasLast = true; for (int k = 0; k < lugs.Length; k++) { int num8 = lugSide[k]; PathPoint(lugDistance[k] + travelled[num8], out var point, out var outward); lugs[k].localPosition = beltCentre[num8] + point; lugs[k].localRotation = Quaternion.LookRotation(new Vector3(0f, 0f - outward.z, outward.y), outward); } for (int l = 0; l < wheels.Length; l++) { float num9 = travelled[wheelSide[l]] / Mathf.Max(wheelRadius[l], 0.001f) * 57.29578f; wheels[l].localRotation = Quaternion.Euler(num9, 0f, 0f); } } } public class BombardTrajectoryVisualizer : MonoBehaviour { private CharacterBody body; private LineRenderer line; private bool shellUsesGravity; private bool probed; private const float shellSpeed = 200f; private const float simStep = 0.04f; private const float simMaxTime = 3f; private BastionController controller; private Transform cachedMuzzle; private readonly RaycastHit[] raycastBuffer = (RaycastHit[])(object)new RaycastHit[16]; private Vector3[] pointsBuffer; private void Start() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_00b4: 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) body = ((Component)this).GetComponent(); controller = ((Component)this).GetComponent(); GameObject val = new GameObject("BombardTrajectoryLine"); val.transform.SetParent(((Component)this).transform, false); line = val.AddComponent(); line.startWidth = 0.4f; line.endWidth = 0.15f; line.useWorldSpace = true; Material val2 = Addressables.LoadAssetAsync((object)RoR2_Base_Common_VFX.matLaserPointerBeam_mat).WaitForCompletion(); if ((Object)val2 != (Object)null) { ((Renderer)line).material = val2; } line.startColor = new Color(1f, 0.75f, 0.2f, 1f); line.endColor = new Color(1f, 0.45f, 0f, 0.6f); ((Renderer)line).enabled = false; } private bool IsLocalPlayerInBombard() { //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.skillLocator) || !Object.op_Implicit((Object)(object)body.skillLocator.primary)) { return false; } LocalUser firstLocalUser = LocalUserManager.GetFirstLocalUser(); if (firstLocalUser == null || (Object)firstLocalUser.cachedBody != (Object)(object)body) { return false; } return (Object)(object)body.skillLocator.primary.skillDef == (Object)(object)BastionStaticValues.BastionSkillList?.bombardPrimary; } private void ProbeShellPhysics() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown probed = true; shellUsesGravity = false; GameObject bombardShell = BastionAssets.bombardShell; if (!((Object)bombardShell == (Object)null)) { Rigidbody component = bombardShell.GetComponent(); ProjectileSimple component2 = bombardShell.GetComponent(); shellUsesGravity = Object.op_Implicit((Object)(object)component) && component.useGravity && (!Object.op_Implicit((Object)(object)component2) || !component2.updateAfterFiring); } } private void Update() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0042: 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_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected O, but got Unknown //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_005b: 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_006c: 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) //IL_0132: 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_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_015b: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0176: 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_01a7: 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_0214: 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_0217: 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_0237: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_0201: 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_023c: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_024d: 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_028a: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02b9: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_02ca: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_02d0: Unknown result type (might be due to invalid IL or missing references) //IL_02d7: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_02db: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: 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) //IL_02a1: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0350: Unknown result type (might be due to invalid IL or missing references) //IL_035b: Unknown result type (might be due to invalid IL or missing references) //IL_035d: Unknown result type (might be due to invalid IL or missing references) //IL_038f: Unknown result type (might be due to invalid IL or missing references) //IL_0342: Unknown result type (might be due to invalid IL or missing references) //IL_0347: Unknown result type (might be due to invalid IL or missing references) if ((Object)line == (Object)null) { return; } if (!IsLocalPlayerInBombard()) { ((Renderer)line).enabled = false; return; } if (!probed) { ProbeShellPhysics(); } Vector3 val = body.inputBank.aimDirection; if ((Object)controller != (Object)null) { val = BastionController.ClampToBombardArc(val, controller.BombardFacing); } Ray val2 = default(Ray); ((Ray)(ref val2))..ctor(body.inputBank.aimOrigin, val); if (!Object.op_Implicit((Object)(object)cachedMuzzle)) { ModelLocator modelLocator = body.modelLocator; ChildLocator val3 = ((Object.op_Implicit((Object)(object)modelLocator) && Object.op_Implicit((Object)(object)modelLocator.modelTransform)) ? ((Component)modelLocator.modelTransform).GetComponent() : null); if (Object.op_Implicit((Object)(object)val3)) { cachedMuzzle = val3.FindChild("BombardMuzzle"); if (!Object.op_Implicit((Object)(object)cachedMuzzle)) { cachedMuzzle = val3.FindChild("CannonMuzzle"); } if (!Object.op_Implicit((Object)(object)cachedMuzzle)) { cachedMuzzle = val3.FindChild("TurretMuzzle"); } } } Vector3 val4 = (Object.op_Implicit((Object)(object)cachedMuzzle) ? cachedMuzzle.position : ((Ray)(ref val2)).origin) + Vector3.up * 0.75f; Ray val5 = default(Ray); ((Ray)(ref val5))..ctor(val4, ((Ray)(ref val2)).direction); Vector3 point = ((Ray)(ref val5)).GetPoint(1000f); int num = Physics.RaycastNonAlloc(val5, raycastBuffer, 1000f, LayerMask.op_Implicit(CommonMasks.bullet)); float num2 = float.MaxValue; for (int i = 0; i < num; i++) { RaycastHit val6 = raycastBuffer[i]; if (!(((RaycastHit)(ref val6)).distance >= num2)) { HurtBox component = ((Component)((RaycastHit)(ref val6)).collider).GetComponent(); if (!Object.op_Implicit((Object)(object)component) || !Object.op_Implicit((Object)(object)body) || !((Object)(object)component.healthComponent == (Object)(object)body.healthComponent)) { num2 = ((RaycastHit)(ref val6)).distance; point = ((RaycastHit)(ref val6)).point; } } } Vector3 val7 = point - val4; val7 = ((((Vector3)(ref val7)).sqrMagnitude > 4f) ? ((Vector3)(ref val7)).normalized : ((Ray)(ref val2)).direction); Vector3 val8 = val7 * 200f; Vector3 val9 = val4; int num3 = 75; if (pointsBuffer == null || pointsBuffer.Length != num3) { pointsBuffer = (Vector3[])(object)new Vector3[num3]; } Vector3[] array = pointsBuffer; int num4 = 0; array[num4++] = val9; RaycastHit val13 = default(RaycastHit); for (int j = 1; j < num3; j++) { if (shellUsesGravity) { val8 += Physics.gravity * 0.04f; } Vector3 val10 = val9 + val8 * 0.04f; Vector3 val11 = val9; Vector3 normalized = ((Vector3)(ref val8)).normalized; Vector3 val12 = val10 - val9; if (Physics.Raycast(val11, normalized, ref val13, ((Vector3)(ref val12)).magnitude, LayerMask.op_Implicit(CommonMasks.bullet))) { HurtBox component2 = ((Component)((RaycastHit)(ref val13)).collider).GetComponent(); if (!Object.op_Implicit((Object)(object)component2) || !Object.op_Implicit((Object)(object)body) || !((Object)(object)component2.healthComponent == (Object)(object)body.healthComponent)) { array[num4++] = ((RaycastHit)(ref val13)).point; break; } } val9 = val10; array[num4++] = val9; } line.positionCount = num4; for (int k = 0; k < num4; k++) { line.SetPosition(k, array[k]); } ((Renderer)line).enabled = true; } private void OnDestroy() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown if ((Object)line != (Object)null) { Object.Destroy((Object)(object)((Component)line).gameObject); } } } public class GanymedeFollower : MonoBehaviour { private CharacterBody body; private Transform birdTransform; private float bobTimer; private bool subscribed; private Vector3 followVel; private int sweepPhase; private PurchaseInteraction sweepInteraction; private PressurePlateController sweepPlate; private GameObject platePresser; private float sweepCooldown; private float sweepClock; private const float hoverHeight = 3f; private const float baseSweepInterval = 30f; private const float sweepMinRange = 15f; private const float sweepMaxRange = 60f; private const float flySpeed = 10f; private const float arriveDist = 2.5f; private const float lingerDuration = 1f; private const float plateHoldDuration = 10f; private const float maxSweepDuration = 20f; private Animator birdAnimator; private static readonly Dictionary tintedBirdMaterials = new Dictionary(); internal const int VeteranSkinIndex = 1; internal const int GildedSkinIndex = 2; internal const int PurgeSkinIndex = 4; internal const int MeridianSkinIndex = 5; internal const int HollowSkinIndex = 6; private BastionEmotePlayer emotePlayer; private bool perchedForEmote; private const float emoteFlySpeed = 4.5f; private const float emoteLandSpeed = 1.2f; public static bool SuppressVanillaPingChat; private void Start() { body = ((Component)this).GetComponent(); if (Object.op_Implicit((Object)(object)body)) { body.onInventoryChanged += OnInventoryChanged; subscribed = true; } sweepCooldown = 30f; Refresh(); } private void OnInventoryChanged() { Refresh(); } private int GanymedeCount() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.inventory) && (Object)BastionItems.ganymedeItem != (Object)null) { return body.inventory.GetItemCount(BastionItems.ganymedeItem); } return 0; } private void Refresh() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown int num = GanymedeCount(); if (num > 0 && (Object)birdTransform == (Object)null) { SpawnBird(); } else if (num <= 0 && (Object)birdTransform != (Object)null) { DespawnBird(); } } private void SpawnBird() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Expected O, but got Unknown //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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Expected O, but got Unknown if ((Object)BastionAssets.ganymedePrefab == (Object)null) { return; } GameObject val = Object.Instantiate(BastionAssets.ganymedePrefab); Collider[] componentsInChildren = val.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].enabled = false; } birdTransform = val.transform; if (Object.op_Implicit((Object)(object)body)) { birdTransform.position = body.corePosition + Vector3.up * 3f; } birdAnimator = val.GetComponentInChildren(); if ((Object)birdAnimator != (Object)null) { if ((Object)BastionAssets.ganymedeController != (Object)null) { birdAnimator.runtimeAnimatorController = BastionAssets.ganymedeController; } birdAnimator.cullingMode = (AnimatorCullingMode)0; birdAnimator.applyRootMotion = false; birdAnimator.Rebind(); birdAnimator.Update(0f); } ApplyBirdSkinTint(val); } private static bool RecolorsBird(int skinIndex) { if (skinIndex != 1 && skinIndex != 2) { return skinIndex == 4; } return true; } internal static Material GetTintedBirdMaterial(int skinIndex, Material baseMaterial) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown if (!RecolorsBird(skinIndex) || (Object)baseMaterial == (Object)null) { return baseMaterial; } if (!tintedBirdMaterials.TryGetValue(skinIndex, out var value)) { value = BuildRecoloredBirdMaterial(baseMaterial, skinIndex == 1, skinIndex == 4); tintedBirdMaterials[skinIndex] = value; } return value; } private void ApplyBirdSkinTint(GameObject birdObject) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Expected O, but got Unknown if (!Object.op_Implicit((Object)(object)body) || body.bodyIndex != BastionPlugin.bodyIndex) { return; } int skinIndex = (int)body.skinIndex; if (!RecolorsBird(skinIndex)) { return; } Renderer componentInChildren = birdObject.GetComponentInChildren(); if (Object.op_Implicit((Object)(object)componentInChildren) && !((Object)componentInChildren.sharedMaterial == (Object)null)) { Material tintedBirdMaterial = GetTintedBirdMaterial(skinIndex, componentInChildren.sharedMaterial); if (Object.op_Implicit((Object)(object)tintedBirdMaterial)) { componentInChildren.material = tintedBirdMaterial; } if (skinIndex == 4) { BastionBabyVulture.Set(componentInChildren, wanted: true); } } } private static Material BuildRecoloredBirdMaterial(Material baseMaterial, bool ganymede, bool vulture) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected O, but got Unknown //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Expected O, but got Unknown //IL_00b0: 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_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0196: 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_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_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_031e: Unknown result type (might be due to invalid IL or missing references) //IL_0323: Unknown result type (might be due to invalid IL or missing references) //IL_033e: Unknown result type (might be due to invalid IL or missing references) //IL_0340: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Unknown result type (might be due to invalid IL or missing references) //IL_029d: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: Unknown result type (might be due to invalid IL or missing references) Material val = new Material(baseMaterial); ((Object)val).name = ((Object)baseMaterial).name + (vulture ? "Vulture" : (ganymede ? "Ganymede" : "Gold")); Texture val2 = (baseMaterial.HasProperty("_MainTex") ? baseMaterial.GetTexture("_MainTex") : null); if ((Object)val2 == (Object)null) { return val; } RenderTexture temporary = RenderTexture.GetTemporary(val2.width, val2.height, 0, (RenderTextureFormat)0); Graphics.Blit(val2, temporary); RenderTexture active = RenderTexture.active; RenderTexture.active = temporary; Texture2D val3 = new Texture2D(val2.width, val2.height, (TextureFormat)4, true); val3.ReadPixels(new Rect(0f, 0f, (float)val2.width, (float)val2.height), 0, 0); val3.Apply(); RenderTexture.active = active; RenderTexture.ReleaseTemporary(temporary); Color[] pixels = val3.GetPixels(); float num = default(float); float num2 = default(float); float num3 = default(float); for (int i = 0; i < pixels.Length; i++) { Color.RGBToHSV(pixels[i], ref num, ref num2, ref num3); if (vulture) { if (num2 > 0.12f && num <= 0.5f) { float num4 = Mathf.Clamp01(Mathf.InverseLerp(0.105f, 0.135f, num)); float num5 = Mathf.Clamp01(Mathf.InverseLerp(0.15f, 0.35f, num)); Color val4 = Color.HSVToRGB(0.55f, Mathf.Lerp(0.3f, 0.22f, num5), Mathf.Min(1f, num3 * Mathf.Lerp(0.3f, 0.46f, num5))); Color val5 = Color.Lerp(Color.HSVToRGB(0.66f, 0.07f, Mathf.Min(1f, num3 * 1.3f)), val4, num4); val5.a = pixels[i].a; pixels[i] = val5; } } else if (ganymede) { if (num2 > 0.12f && num2 < 0.9f && num > 0.105f && num <= 0.5f) { float num6 = Mathf.SmoothStep(0f, 1f, Mathf.InverseLerp(0.105f, 0.135f, num)); float num7 = Mathf.SmoothStep(0f, 1f, Mathf.InverseLerp(0.15f, 0.35f, num)); Color val6 = Color.HSVToRGB(Mathf.Lerp(0.135f, 0.15f, num7), Mathf.Lerp(Mathf.Min(0.7f, num2 * 1.6f), 0.82f, num7), Mathf.Min(1f, num3 * Mathf.Lerp(1.2f, 1.42f, num7))); Color val7 = Color.Lerp(pixels[i], val6, num6); val7.a = pixels[i].a; pixels[i] = val7; } } else if (num2 > 0.12f && num >= 0.13f && num <= 0.5f) { Color val8 = Color.HSVToRGB(Mathf.Lerp(0.1f, 0.15f, Mathf.InverseLerp(0.15f, 0.4f, num)), Mathf.Min(1f, num2 * 1.1f), num3); val8.a = pixels[i].a; pixels[i] = val8; } } val3.SetPixels(pixels); val3.Apply(); val.SetTexture("_MainTex", (Texture)(object)val3); return val; } private void DespawnBird() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown if ((Object)birdTransform != (Object)null) { Object.Destroy((Object)(object)((Component)birdTransform).gameObject); } birdTransform = null; sweepPhase = 0; sweepInteraction = null; sweepPlate = null; DestroyPresser(); } private bool TryGetEmotePerch(out Vector3 perch) { //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) perch = Vector3.zero; if (!Object.op_Implicit((Object)(object)emotePlayer) && Object.op_Implicit((Object)(object)body.modelLocator) && Object.op_Implicit((Object)(object)body.modelLocator.modelTransform)) { emotePlayer = ((Component)body.modelLocator.modelTransform).GetComponent(); } if (Object.op_Implicit((Object)(object)emotePlayer)) { return emotePlayer.TryGetPerch(out perch); } return false; } private Vector3 HoverPosition() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0029: 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_0044: 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_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_007c: 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_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: 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_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: 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_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) Vector3 val = (Object.op_Implicit((Object)(object)body.inputBank) ? body.inputBank.aimDirection : Vector3.forward); val.y = 0f; val = ((((Vector3)(ref val)).sqrMagnitude > 0.001f) ? ((Vector3)(ref val)).normalized : Vector3.zero); Vector3 val2 = (Object.op_Implicit((Object)(object)body.characterMotor) ? body.characterMotor.velocity : Vector3.zero); Vector3 val3 = default(Vector3); ((Vector3)(ref val3))..ctor(val2.x, 0f, val2.z); Vector3 val4 = ((((Vector3)(ref val3)).sqrMagnitude > 1f) ? (-((Vector3)(ref val3)).normalized * 1.1f) : Vector3.zero); Vector3 val5 = Vector3.Cross(Vector3.up, val); float num = Mathf.Sin(bobTimer * 4f) * 0.12f; return body.corePosition + Vector3.up * (3f + num) + val5 * 1.6f - val * 0.4f + val4; } private PurchaseInteraction FindNearestInteractable(ref float bestSqr) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_003f: 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) Vector3 corePosition = body.corePosition; PurchaseInteraction result = null; foreach (PurchaseInteraction instances in InstanceTracker.GetInstancesList()) { if (Object.op_Implicit((Object)(object)instances) && instances.available) { Vector3 val = ((Component)instances).transform.position - corePosition; float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude; if (!(sqrMagnitude < 225f) && !(sqrMagnitude >= bestSqr)) { bestSqr = sqrMagnitude; result = instances; } } } return result; } private PressurePlateController FindNearestPlate(ref float bestSqr) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_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) Vector3 corePosition = body.corePosition; PressurePlateController result = null; PressurePlateController[] array = Object.FindObjectsOfType(); foreach (PressurePlateController val in array) { if (Object.op_Implicit((Object)(object)val) && val.enableOverlapSphere) { Vector3 val2 = ((Component)val).transform.position - corePosition; float sqrMagnitude = ((Vector3)(ref val2)).sqrMagnitude; if (!(sqrMagnitude < 225f) && !(sqrMagnitude >= bestSqr)) { bestSqr = sqrMagnitude; result = val; } } } return result; } private void SpawnPresser(Vector3 platePosition) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)platePresser)) { platePresser.transform.position = platePosition; return; } platePresser = new GameObject("GanymedePlatePresser") { layer = LayerIndex.fakeActor.intVal }; platePresser.transform.position = platePosition; SphereCollider obj = platePresser.AddComponent(); obj.radius = 0.5f; ((Collider)obj).isTrigger = true; } private void DestroyPresser() { if (Object.op_Implicit((Object)(object)platePresser)) { Object.Destroy((Object)(object)platePresser); } platePresser = null; } private void Update() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Expected O, but got Unknown //IL_00d6: 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_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_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_0069: 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_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_0491: Unknown result type (might be due to invalid IL or missing references) //IL_0496: Unknown result type (might be due to invalid IL or missing references) //IL_049e: Unknown result type (might be due to invalid IL or missing references) //IL_049f: Unknown result type (might be due to invalid IL or missing references) //IL_04ac: Unknown result type (might be due to invalid IL or missing references) //IL_04bc: Unknown result type (might be due to invalid IL or missing references) //IL_04c1: Unknown result type (might be due to invalid IL or missing references) //IL_04c3: Unknown result type (might be due to invalid IL or missing references) //IL_04c8: Unknown result type (might be due to invalid IL or missing references) //IL_030f: Unknown result type (might be due to invalid IL or missing references) //IL_031a: Expected O, but got Unknown //IL_032b: Unknown result type (might be due to invalid IL or missing references) //IL_0340: Unknown result type (might be due to invalid IL or missing references) //IL_0345: Unknown result type (might be due to invalid IL or missing references) //IL_0367: Unknown result type (might be due to invalid IL or missing references) //IL_036c: Unknown result type (might be due to invalid IL or missing references) //IL_0371: Unknown result type (might be due to invalid IL or missing references) //IL_0379: 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_0387: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Expected O, but got Unknown //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Expected O, but got Unknown //IL_03e7: Unknown result type (might be due to invalid IL or missing references) //IL_03ec: Unknown result type (might be due to invalid IL or missing references) //IL_040e: Unknown result type (might be due to invalid IL or missing references) //IL_0413: Unknown result type (might be due to invalid IL or missing references) //IL_042b: Unknown result type (might be due to invalid IL or missing references) //IL_0435: Unknown result type (might be due to invalid IL or missing references) //IL_043a: Unknown result type (might be due to invalid IL or missing references) //IL_043f: Unknown result type (might be due to invalid IL or missing references) //IL_0447: Unknown result type (might be due to invalid IL or missing references) //IL_0448: Unknown result type (might be due to invalid IL or missing references) //IL_0455: 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) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_0252: 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_026f: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_0276: 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_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Expected O, but got Unknown //IL_0526: Unknown result type (might be due to invalid IL or missing references) //IL_052b: Unknown result type (might be due to invalid IL or missing references) //IL_052c: Unknown result type (might be due to invalid IL or missing references) //IL_0531: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_0587: Unknown result type (might be due to invalid IL or missing references) //IL_058c: Unknown result type (might be due to invalid IL or missing references) //IL_058d: Unknown result type (might be due to invalid IL or missing references) //IL_0592: Unknown result type (might be due to invalid IL or missing references) //IL_05a9: Unknown result type (might be due to invalid IL or missing references) //IL_05b4: Unknown result type (might be due to invalid IL or missing references) //IL_05b9: Unknown result type (might be due to invalid IL or missing references) //IL_05be: Unknown result type (might be due to invalid IL or missing references) //IL_05de: Unknown result type (might be due to invalid IL or missing references) //IL_05e3: Unknown result type (might be due to invalid IL or missing references) //IL_0611: Unknown result type (might be due to invalid IL or missing references) //IL_05ff: Unknown result type (might be due to invalid IL or missing references) //IL_0634: Unknown result type (might be due to invalid IL or missing references) //IL_0639: Unknown result type (might be due to invalid IL or missing references) //IL_063e: Unknown result type (might be due to invalid IL or missing references) //IL_0643: Unknown result type (might be due to invalid IL or missing references) //IL_0648: Unknown result type (might be due to invalid IL or missing references) //IL_0656: Unknown result type (might be due to invalid IL or missing references) //IL_065b: Unknown result type (might be due to invalid IL or missing references) //IL_0668: Unknown result type (might be due to invalid IL or missing references) //IL_0616: Unknown result type (might be due to invalid IL or missing references) if ((Object)birdTransform == (Object)null || !Object.op_Implicit((Object)(object)body)) { return; } bobTimer += Time.deltaTime; Vector3 position = birdTransform.position; int num = Mathf.Max(1, GanymedeCount()); Vector3 val; if (sweepPhase == 0) { if (TryGetEmotePerch(out var perch)) { val = perch - position; float magnitude = ((Vector3)(ref val)).magnitude; float num2 = Mathf.Lerp(1.2f, 4.5f, Mathf.Clamp01(magnitude / 1.5f)); birdTransform.position = Vector3.MoveTowards(position, perch, num2 * Time.deltaTime); followVel = Vector3.zero; sweepCooldown = Mathf.Max(sweepCooldown, 1f); } else { birdTransform.position = Vector3.SmoothDamp(position, HoverPosition(), ref followVel, 0.28f); } sweepCooldown -= Time.deltaTime; if (sweepCooldown <= 0f) { float bestSqr = 3600f; PurchaseInteraction val2 = FindNearestInteractable(ref bestSqr); PressurePlateController val3 = FindNearestPlate(ref bestSqr); if ((Object)val3 != (Object)null) { sweepPlate = val3; sweepInteraction = null; sweepPhase = 1; sweepClock = 0f; } else if ((Object)val2 != (Object)null) { sweepInteraction = val2; sweepPlate = null; sweepPhase = 1; sweepClock = 0f; } else { sweepCooldown = 5f; } } } else { sweepClock += Time.deltaTime; if (sweepPhase == 1) { bool flag = (Object)sweepPlate != (Object)null; Transform val4 = (flag ? ((Component)sweepPlate).transform : (Object.op_Implicit((Object)(object)sweepInteraction) ? ((Component)sweepInteraction).transform : null)); if ((Object)val4 == (Object)null) { sweepPhase = 3; sweepClock = 0f; } else { Vector3 val5 = val4.position + Vector3.up * 1.4f; birdTransform.position = Vector3.MoveTowards(position, val5, 10f * Time.deltaTime); val = birdTransform.position - val5; if (((Vector3)(ref val)).sqrMagnitude < 6.25f) { if (flag) { SpawnPresser(((Component)sweepPlate).transform.position); PingPlate(sweepPlate); } else { PingInteractable(sweepInteraction); } sweepPhase = 2; sweepClock = 0f; } else if (sweepClock > 20f) { sweepPhase = 3; sweepClock = 0f; } } } else if (sweepPhase == 2) { if ((Object)sweepPlate != (Object)null) { SpawnPresser(((Component)sweepPlate).transform.position); Vector3 val6 = ((Component)sweepPlate).transform.position + Vector3.up * (0.9f + Mathf.Sin(sweepClock * 4f) * 0.06f); birdTransform.position = Vector3.MoveTowards(position, val6, 10f * Time.deltaTime); if (sweepClock >= 10f) { DestroyPresser(); sweepPhase = 3; sweepClock = 0f; } } else { if (Object.op_Implicit((Object)(object)sweepInteraction)) { float num3 = sweepClock * 3f; Vector3 val7 = ((Component)sweepInteraction).transform.position + Vector3.up * (1.4f + Mathf.Sin(sweepClock * 5f) * 0.2f) + new Vector3(Mathf.Cos(num3), 0f, Mathf.Sin(num3)) * 0.8f; birdTransform.position = Vector3.MoveTowards(position, val7, 10f * Time.deltaTime); } if (sweepClock >= 1f || !Object.op_Implicit((Object)(object)sweepInteraction)) { sweepPhase = 3; sweepClock = 0f; } } } else { Vector3 val8 = HoverPosition(); birdTransform.position = Vector3.MoveTowards(position, val8, 10f * Time.deltaTime); val = birdTransform.position - val8; if (((Vector3)(ref val)).sqrMagnitude < 6.25f || sweepClock > 20f) { DestroyPresser(); sweepPhase = 0; sweepInteraction = null; sweepPlate = null; sweepCooldown = 30f / (float)num; } } } int num4; if (sweepPhase == 0 && TryGetEmotePerch(out var perch2)) { val = birdTransform.position - perch2; num4 = ((((Vector3)(ref val)).sqrMagnitude < 0.0025f) ? 1 : 0); } else { num4 = 0; } bool flag2 = (byte)num4 != 0; if (flag2 != perchedForEmote) { perchedForEmote = flag2; if (Object.op_Implicit((Object)(object)birdAnimator)) { birdAnimator.CrossFadeInFixedTime(flag2 ? "IdleLoop" : "FlyLoop", 0.2f); } } Vector3 val9 = birdTransform.position - position; val9.y = 0f; Vector3 val10; if (flag2) { val10 = body.corePosition - birdTransform.position; val10.y = 0f; } else if (((Vector3)(ref val9)).sqrMagnitude > 0.0006f) { val10 = ((Vector3)(ref val9)).normalized; } else { val10 = (Object.op_Implicit((Object)(object)body.inputBank) ? body.inputBank.aimDirection : birdTransform.forward); val10.y = 0f; } if (((Vector3)(ref val10)).sqrMagnitude > 0.0001f) { Quaternion val11 = Quaternion.LookRotation(-((Vector3)(ref val10)).normalized, Vector3.up); birdTransform.rotation = Quaternion.Slerp(birdTransform.rotation, val11, Time.deltaTime * 5f); } } private void PingInteractable(PurchaseInteraction pi) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)pi)) { PingTarget(((Component)pi).gameObject, ((Component)pi).transform.position, string.Format(Language.GetString("BASTION_GANYMEDE_PING_MSG"), Language.GetString(pi.displayNameToken))); } } private void PingPlate(PressurePlateController plate) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)plate)) { PingTarget(((Component)plate).gameObject, ((Component)plate).transform.position, string.Format(Language.GetString("BASTION_GANYMEDE_PING_MSG"), Language.GetString("BASTION_GANYMEDE_PLATE_NAME"))); } } private void PingTarget(GameObject target, Vector3 origin, string chatMessage) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) LocalUser firstLocalUser = LocalUserManager.GetFirstLocalUser(); if (firstLocalUser == null || (Object)firstLocalUser.cachedBody != (Object)(object)body || !Object.op_Implicit((Object)(object)target)) { return; } GameObject val = Object.Instantiate(LegacyResourcesAPI.Load("Prefabs/PingIndicator")); PingIndicator component = val.GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { Object.Destroy((Object)(object)val); return; } component.pingOwner = ((Component)this).gameObject; component.pingOrigin = origin; component.pingNormal = Vector3.up; component.pingTarget = target; SuppressVanillaPingChat = true; try { component.RebuildPing(); } finally { SuppressVanillaPingChat = false; } if (Object.op_Implicit((Object)(object)component.pingText)) { ((TMP_Text)component.pingText).text = Language.GetString("BASTION_GANYMEDE_NAME"); } Chat.AddMessage(chatMessage); } private void OnDestroy() { if (subscribed && Object.op_Implicit((Object)(object)body)) { body.onInventoryChanged -= OnInventoryChanged; } DespawnBird(); } } public class GanymedePerchRider : MonoBehaviour { public Transform anchor; public Vector3 worldOffset = new Vector3(0f, 0.1f, 0f); private void LateUpdate() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_001f: 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_002a: Unknown result type (might be due to invalid IL or missing references) if ((Object)anchor != (Object)null) { ((Component)this).transform.position = anchor.position + worldOffset; } } } public class WildThrinchBehavior : MonoBehaviour { private Vector3 basePosition; private float bobClock; private bool flyingAway; private float flyClock; private Vector3 flyDirection; private const float FlyAwayDuration = 3f; private Quaternion baseRotation; private void Start() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Expected O, but got Unknown basePosition = ((Component)this).transform.position; baseRotation = ((Component)this).transform.rotation; Animator componentInChildren = ((Component)this).GetComponentInChildren(); if (Object.op_Implicit((Object)(object)componentInChildren)) { RuntimeAnimatorController val = (((Object)BastionAssets.ganymedePerchController != (Object)null) ? BastionAssets.ganymedePerchController : BastionAssets.ganymedeController); if ((Object)val != (Object)null) { componentInChildren.runtimeAnimatorController = val; } componentInChildren.cullingMode = (AnimatorCullingMode)0; componentInChildren.applyRootMotion = false; componentInChildren.Rebind(); componentInChildren.Update(0f); } } public void OnBefriended() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown Animator componentInChildren = ((Component)this).GetComponentInChildren(); if (Object.op_Implicit((Object)(object)componentInChildren) && (Object)BastionAssets.ganymedeController != (Object)null) { componentInChildren.runtimeAnimatorController = BastionAssets.ganymedeController; } } private void Update() { //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_003e: 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_004d: Unknown result type (might be due to invalid IL or missing references) if (flyingAway) { flyClock += Time.deltaTime; Transform transform = ((Component)this).transform; transform.position += flyDirection * (8f + flyClock * 6f) * Time.deltaTime; if (flyClock >= 3f) { if (NetworkServer.active) { NetworkServer.Destroy(((Component)this).gameObject); } else { Object.Destroy((Object)(object)((Component)this).gameObject); } } } else { bobClock += Time.deltaTime; ((Component)this).transform.rotation = baseRotation * Quaternion.Euler(0f, Mathf.Sin(bobClock * 0.45f) * 35f, 0f); } } public void FlyAway() { //IL_001b: 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_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_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) if (!flyingAway) { flyingAway = true; flyClock = 0f; Vector3 val = Vector3.up * 0.8f + ((Component)this).transform.forward; flyDirection = ((Vector3)(ref val)).normalized; OnBefriended(); } } } } namespace BastionMod.Survivors.Bastion.Achievements { [RegisterAchievement("HASTEREAPR_BASTION_CONSERVATION_ACHIEVEMENT", "HASTEREAPR_BASTION_CONSERVATION_UNLOCKABLE", null, 10u, typeof(BastionConserveServerAchievement))] public class BastionConserveAchievement : BaseAchievement { public class BastionConserveServerAchievement : BaseServerAchievement { public override void OnInstall() { ((BaseServerAchievement)this).OnInstall(); TeleporterInteraction.onTeleporterChargedGlobal += TeleporterInteraction_onTeleporterChargedGlobal; } private void TeleporterInteraction_onTeleporterChargedGlobal(TeleporterInteraction obj) { CharacterBody currentBody = ((BaseServerAchievement)this).GetCurrentBody(); BastionController bastionController = (Object.op_Implicit((Object)(object)currentBody) ? ((Component)currentBody).GetComponent() : null); if (Object.op_Implicit((Object)(object)bastionController) && !bastionController.CheckForTransformation()) { ((BaseServerAchievement)this).Grant(); ((BaseServerAchievement)this).ServerTryToCompleteActivity(); } } public override void OnUninstall() { ((BaseServerAchievement)this).OnUninstall(); TeleporterInteraction.onTeleporterChargedGlobal -= TeleporterInteraction_onTeleporterChargedGlobal; } } public const string IDENTIFIER = "HASTEREAPR_BASTION_CONSERVATION_ACHIEVEMENT"; public const string UNLOCKABLE_IDENTIFIER = "HASTEREAPR_BASTION_CONSERVATION_UNLOCKABLE"; public override BodyIndex LookUpRequiredBodyIndex() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) return BodyCatalog.FindBodyIndex("BastionRobot"); } public override void OnBodyRequirementMet() { ((BaseAchievement)this).OnBodyRequirementMet(); ((BaseAchievement)this).SetServerTracked(true); } public override void OnBodyRequirementBroken() { ((BaseAchievement)this).SetServerTracked(false); ((BaseAchievement)this).OnBodyRequirementBroken(); } } [RegisterAchievement("HASTEREAPR_BASTION_CROWDFUNDER_ACHIEVEMENT", "HASTEREAPR_BASTION_CROWDFUNDER_UNLOCKABLE", null, 10u, typeof(CrowdfunderServerAchievement))] public class BastionCrowdfunderAchievement : BaseAchievement { public class CrowdfunderServerAchievement : BaseServerAchievement { public override void OnInstall() { ((BaseServerAchievement)this).OnInstall(); GlobalEventManager.onCharacterDeathGlobal += OnCharacterDeathGlobal; } public override void OnUninstall() { GlobalEventManager.onCharacterDeathGlobal -= OnCharacterDeathGlobal; ((BaseServerAchievement)this).OnUninstall(); } private void OnCharacterDeathGlobal(DamageReport damageReport) { //IL_0031: 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) CharacterBody currentBody = ((BaseServerAchievement)this).GetCurrentBody(); if (Object.op_Implicit((Object)(object)currentBody) && !((Object)(object)damageReport.attackerBody != (Object)(object)currentBody) && Object.op_Implicit((Object)(object)damageReport.victimBody) && damageReport.victimBody.bodyIndex == BodyCatalog.FindBodyIndex("TitanGoldBody") && Object.op_Implicit((Object)(object)damageReport.damageInfo?.inflictor) && ((Object)damageReport.damageInfo.inflictor).name.StartsWith("GoldGatController")) { ((BaseServerAchievement)this).Grant(); } } } public const string IDENTIFIER = "HASTEREAPR_BASTION_CROWDFUNDER_ACHIEVEMENT"; public const string UNLOCKABLE_IDENTIFIER = "HASTEREAPR_BASTION_CROWDFUNDER_UNLOCKABLE"; public override BodyIndex LookUpRequiredBodyIndex() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) return BodyCatalog.FindBodyIndex("BastionRobot"); } public override void OnBodyRequirementMet() { ((BaseAchievement)this).OnBodyRequirementMet(); ((BaseAchievement)this).SetServerTracked(true); } public override void OnBodyRequirementBroken() { ((BaseAchievement)this).SetServerTracked(false); ((BaseAchievement)this).OnBodyRequirementBroken(); } } [RegisterAchievement("HASTEREAPR_BASTION_DECOMPILE_ACHIEVEMENT", "HASTEREAPR_BASTION_DECOMPILE_UNLOCKABLE", null, 5u, null)] public class BastionDecompileAchievement : BasePerSurvivorDecompileAchievement { public const string IDENTIFIER = "HASTEREAPR_BASTION_DECOMPILE_ACHIEVEMENT"; public const string UNLOCKABLE_IDENTIFIER = "HASTEREAPR_BASTION_DECOMPILE_UNLOCKABLE"; public override BodyIndex LookUpRequiredBodyIndex() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) return BodyCatalog.FindBodyIndex("BastionRobot"); } } [RegisterAchievement("HASTEREAPR_BASTION_LASTRESORT_ACHIEVEMENT", "HASTEREAPR_BASTION_LASTRESORT_UNLOCKABLE", null, 10u, typeof(LastResortServerAchievement))] public class BastionLastResortAchievement : BaseAchievement { public class LastResortServerAchievement : BaseServerAchievement { private int lowHealthKills; public override void OnInstall() { ((BaseServerAchievement)this).OnInstall(); GlobalEventManager.onCharacterDeathGlobal += OnCharacterDeathGlobal; } public override void OnUninstall() { GlobalEventManager.onCharacterDeathGlobal -= OnCharacterDeathGlobal; ((BaseServerAchievement)this).OnUninstall(); } private void OnCharacterDeathGlobal(DamageReport damageReport) { CharacterBody currentBody = ((BaseServerAchievement)this).GetCurrentBody(); if (Object.op_Implicit((Object)(object)currentBody) && (Object)(object)damageReport.attackerBody == (Object)(object)currentBody && Object.op_Implicit((Object)(object)currentBody.healthComponent) && currentBody.healthComponent.health / currentBody.healthComponent.fullHealth < 0.25f) { lowHealthKills++; if (lowHealthKills >= requirement) { ((BaseServerAchievement)this).Grant(); } } } } public const string IDENTIFIER = "HASTEREAPR_BASTION_LASTRESORT_ACHIEVEMENT"; public const string UNLOCKABLE_IDENTIFIER = "HASTEREAPR_BASTION_LASTRESORT_UNLOCKABLE"; private static readonly int requirement = 5; public override BodyIndex LookUpRequiredBodyIndex() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) return BodyCatalog.FindBodyIndex("BastionRobot"); } public override void OnBodyRequirementMet() { ((BaseAchievement)this).OnBodyRequirementMet(); ((BaseAchievement)this).SetServerTracked(true); } public override void OnBodyRequirementBroken() { ((BaseAchievement)this).SetServerTracked(false); ((BaseAchievement)this).OnBodyRequirementBroken(); } } [RegisterAchievement("HASTEREAPR_BASTION_MASTERY_ACHIEVEMENT", "HASTEREAPR_BASTION_MASTERY_UNLOCKABLE", null, 10u, null)] public class BastionMasteryAchievement : BaseMasteryAchievement { public const string IDENTIFIER = "HASTEREAPR_BASTION_MASTERY_ACHIEVEMENT"; public const string UNLOCK_IDENTIFIER = "HASTEREAPR_BASTION_MASTERY_UNLOCKABLE"; public override string RequiredCharacterBody => CharacterBase.instance.bodyName; public override float RequiredDifficultyCoefficient => 3f; } [RegisterAchievement("HASTEREAPR_BASTION_MERIDIAN_ACHIEVEMENT", "HASTEREAPR_BASTION_MERIDIAN_UNLOCKABLE", null, 5u, typeof(MeridianServerAchievement))] public class BastionMeridianAchievement : BaseAchievement { public class MeridianServerAchievement : BaseServerAchievement { public override void OnInstall() { ((BaseServerAchievement)this).OnInstall(); SkyJumpDeathState.falseSonDeathEvent += OnMeridianEvent; } public override void OnUninstall() { ((BaseServerAchievement)this).OnUninstall(); SkyJumpDeathState.falseSonDeathEvent -= OnMeridianEvent; } private void OnMeridianEvent() { ((BaseServerAchievement)this).Grant(); } } public const string IDENTIFIER = "HASTEREAPR_BASTION_MERIDIAN_ACHIEVEMENT"; public const string UNLOCKABLE_IDENTIFIER = "HASTEREAPR_BASTION_MERIDIAN_UNLOCKABLE"; public override BodyIndex LookUpRequiredBodyIndex() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) return BodyCatalog.FindBodyIndex("BastionRobot"); } public override void OnBodyRequirementMet() { ((BaseAchievement)this).OnBodyRequirementMet(); ((BaseAchievement)this).SetServerTracked(true); } public override void OnBodyRequirementBroken() { ((BaseAchievement)this).SetServerTracked(false); ((BaseAchievement)this).OnBodyRequirementBroken(); } } [RegisterAchievement("HASTEREAPR_BASTION_PURGE_ACHIEVEMENT", "HASTEREAPR_BASTION_PURGE_UNLOCKABLE", null, 5u, typeof(KillSolusHeartServerAchievement))] public class BastionPurgeAchievement : BasePerSurvivorPurgeAchievement { public class KillSolusHeartServerAchievement : BasePerSurvivorKillSolusHeartServerAchievement { } public const string IDENTIFIER = "HASTEREAPR_BASTION_PURGE_ACHIEVEMENT"; public const string UNLOCKABLE_IDENTIFIER = "HASTEREAPR_BASTION_PURGE_UNLOCKABLE"; public override BodyIndex LookUpRequiredBodyIndex() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) return BodyCatalog.FindBodyIndex("BastionRobot"); } } [RegisterAchievement("HASTEREAPR_BASTION_QUICK_KILL_ACHIEVEMENT", "HASTEREAPR_BASTION_QUICK_KILL_UNLOCKABLE", null, 10u, typeof(BastionQuickKillBossServerAchievement))] public class BastionQuickKillBossAchievement : BaseAchievement { private class BastionQuickKillBossServerAchievement : BaseServerAchievement { private const float requirement = 10f; public override void OnInstall() { ((BaseServerAchievement)this).OnInstall(); BossGroup.onBossGroupDefeatedServer += OnBossGroupDefeatedServer; } public override void OnUninstall() { BossGroup.onBossGroupDefeatedServer -= OnBossGroupDefeatedServer; ((BaseServerAchievement)this).OnUninstall(); } private void OnBossGroupDefeatedServer(BossGroup bossGroup) { if (bossGroup.fixedTimeSinceEnabled <= 10f) { ((BaseServerAchievement)this).Grant(); ((BaseServerAchievement)this).ServerTryToCompleteActivity(); } } } public const string IDENTIFIER = "HASTEREAPR_BASTION_QUICK_KILL_ACHIEVEMENT"; public const string UNLOCKABLE_IDENTIFIER = "HASTEREAPR_BASTION_QUICK_KILL_UNLOCKABLE"; public override BodyIndex LookUpRequiredBodyIndex() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) return BodyCatalog.FindBodyIndex("BastionRobot"); } public override void OnBodyRequirementMet() { ((BaseAchievement)this).OnBodyRequirementMet(); ((BaseAchievement)this).SetServerTracked(true); } public override void OnBodyRequirementBroken() { ((BaseAchievement)this).SetServerTracked(false); ((BaseAchievement)this).OnBodyRequirementBroken(); } } [RegisterAchievement("HASTEREAPR_BASTION_ULTIMA_ACHIEVEMENT", "HASTEREAPR_BASTION_ULTIMA_UNLOCKABLE", null, 5u, typeof(ClearUltimaServerAchievement))] public class BastionUltimaAchievement : BasePerSurvivorClearUltimaAchievement { public class ClearUltimaServerAchievement : BasePerSurvivorClearUltimaServerAchievement { } public const string IDENTIFIER = "HASTEREAPR_BASTION_ULTIMA_ACHIEVEMENT"; public const string UNLOCKABLE_IDENTIFIER = "HASTEREAPR_BASTION_ULTIMA_UNLOCKABLE"; public override BodyIndex LookUpRequiredBodyIndex() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) return BodyCatalog.FindBodyIndex("BastionRobot"); } } [RegisterAchievement("HASTEREAPR_BASTION_UNLOCK_ACHIEVMENT", "HASTEREAPR_BASTION_CHARACTER_UNLOCKABLE", null, 10u, typeof(BastionUnlockServerAchievement))] public class BastionUnlockAchievement : BaseAchievement { public class BastionUnlockServerAchievement : BaseServerAchievement { public override void OnInstall() { ((BaseServerAchievement)this).OnInstall(); GlobalEventManager.OnInteractionsGlobal += OnInteractionsGlobal; } public override void OnUninstall() { GlobalEventManager.OnInteractionsGlobal -= OnInteractionsGlobal; ((BaseServerAchievement)this).OnUninstall(); } private void OnInteractionsGlobal(Interactor interactor, IInteractable interactable, GameObject interactableObject) { if (Object.op_Implicit((Object)(object)interactableObject) && Object.op_Implicit((Object)(object)interactableObject.GetComponent())) { ((BaseServerAchievement)this).Grant(); } } } public const string IDENTIFIER = "HASTEREAPR_BASTION_UNLOCK_ACHIEVMENT"; public const string UNLOCKABLE_IDENTIFIER = "HASTEREAPR_BASTION_CHARACTER_UNLOCKABLE"; public static Sprite Sprite = Asset.MainAssetBundle.LoadAsset("texBastionIcon"); public override void OnInstall() { ((BaseAchievement)this).OnInstall(); ((BaseAchievement)this).SetServerTracked(true); } public override void OnUninstall() { ((BaseAchievement)this).OnUninstall(); } } [RegisterAchievement("HASTEREAPR_BASTION_DRONEBUDDY_ACHIEVEMENT", "HASTEREAPR_BASTION_DRONEBUDDY_UNLOCKABLE", null, 10u, null)] public class DroneBuddyAchievement : BaseAchievement { public const string IDENTIFIER = "HASTEREAPR_BASTION_DRONEBUDDY_ACHIEVEMENT"; public const string UNLOCKABLE_IDENTIFIER = "HASTEREAPR_BASTION_DRONEBUDDY_UNLOCKABLE"; private const int requirement = 6; private ToggleAction monitorMinions; public override BodyIndex LookUpRequiredBodyIndex() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) return BodyCatalog.FindBodyIndex("BastionRobot"); } private void SubscribeToMinionChanges() { CharacterBody.onBodyStartGlobal += CharacterBody_onBodyStartGlobal; } private void CharacterBody_onBodyStartGlobal(CharacterBody obj) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_006d: 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_007f: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)((BaseAchievement)this).localUser.cachedBody)) { return; } List list = new List(); CharacterBody[] minionBodies = ((BaseAchievement)this).localUser.cachedBody.GetMinionBodies(); foreach (CharacterBody val in minionBodies) { if (Object.op_Implicit((Object)(object)val) && (val.bodyFlags & 0x400000) != 0) { list.Add(val.bodyIndex); } } if (6 <= list.Count && (list.Contains(BodyCatalog.FindBodyIndex("BackupDroneBody")) || list.Contains(BodyCatalog.FindBodyIndex("BackupDroneBody(Clone)")))) { ((BaseAchievement)this).Grant(); ((BaseAchievement)this).TryToCompleteActivity(); } } private void UnSubscribeFromMinionChanges() { CharacterBody.onBodyStartGlobal -= CharacterBody_onBodyStartGlobal; } public override void OnInstall() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Expected O, but got Unknown ((BaseAchievement)this).OnInstall(); monitorMinions = new ToggleAction((Action)SubscribeToMinionChanges, (Action)UnSubscribeFromMinionChanges); } public override void OnBodyRequirementMet() { ((BaseAchievement)this).OnBodyRequirementMet(); monitorMinions.SetActive(true); } public override void OnBodyRequirementBroken() { monitorMinions.SetActive(false); ((BaseAchievement)this).OnBodyRequirementBroken(); } } } namespace BastionMod.Modules { internal static class Asset { internal static Dictionary loadedBundles = new Dictionary(); internal static AssetBundle MainAssetBundle = null; internal static AssetBundle LoadAssetBundle(string bundleName) { if (bundleName == "myassetbundle") { Log.Error("AssetBundle name hasn't been changed. not loading any assets to avoid conflicts.\nMake sure to rename your assetbundle filename and rename the AssetBundleName field in your character setup code "); return null; } if (loadedBundles.ContainsKey(bundleName)) { return loadedBundles[bundleName]; } AssetBundle val = null; try { val = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)BastionPlugin.instance).Info.Location), "AssetBundles", bundleName)); } catch (Exception arg) { Log.Error($"Error loading asset bundle, {bundleName}. Your asset bundle must be in a folder next to your mod dll called 'AssetBundles'. Follow the guide to build and install your mod correctly!\n{arg}"); } loadedBundles[bundleName] = val; if ((Object)(object)MainAssetBundle == (Object)null) { MainAssetBundle = val; } return val; } internal static GameObject CloneTracer(string originalTracerName, string newTracerName) { if ((Object)(object)LegacyResourcesAPI.Load("Prefabs/Effects/Tracers/" + originalTracerName) == (Object)null) { return null; } GameObject val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("Prefabs/Effects/Tracers/" + originalTracerName), newTracerName, true); if (!Object.op_Implicit((Object)(object)val.GetComponent())) { val.AddComponent(); } if (!Object.op_Implicit((Object)(object)val.GetComponent())) { val.AddComponent(); } if (!Object.op_Implicit((Object)(object)val.GetComponent())) { val.AddComponent(); } val.GetComponent().speed = 250f; val.GetComponent().length = 50f; Content.CreateAndAddEffectDef(val); return val; } internal static void ConvertAllRenderersToHopooShader(GameObject objectToConvert) { if (!Object.op_Implicit((Object)(object)objectToConvert)) { return; } MeshRenderer[] componentsInChildren = objectToConvert.GetComponentsInChildren(); foreach (MeshRenderer val in componentsInChildren) { if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)((Renderer)val).sharedMaterial)) { ((Renderer)val).sharedMaterial.ConvertDefaultShaderToHopoo(); } } SkinnedMeshRenderer[] componentsInChildren2 = objectToConvert.GetComponentsInChildren(); foreach (SkinnedMeshRenderer val2 in componentsInChildren2) { if (Object.op_Implicit((Object)(object)val2) && Object.op_Implicit((Object)(object)((Renderer)val2).sharedMaterial)) { ((Renderer)val2).sharedMaterial.ConvertDefaultShaderToHopoo(); } } } internal static GameObject LoadCrosshair(string crosshairName) { GameObject val = LegacyResourcesAPI.Load("Prefabs/Crosshair/" + crosshairName + "Crosshair"); if ((Object)(object)val == (Object)null) { Log.Error("could not load crosshair with the name " + crosshairName + ". defaulting to Standard"); return LegacyResourcesAPI.Load("Prefabs/Crosshair/StandardCrosshair"); } return val; } internal static GameObject LoadEffect(this AssetBundle assetBundle, string resourceName, bool parentToTransform) { return assetBundle.LoadEffect(resourceName, "", parentToTransform); } internal static GameObject LoadEffect(this AssetBundle assetBundle, string resourceName, string soundName = "", bool parentToTransform = false) { //IL_003c: 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) GameObject val = assetBundle.LoadAsset(resourceName); if (!Object.op_Implicit((Object)(object)val)) { Log.ErrorAssetBundle(resourceName, ((Object)assetBundle).name); return null; } val.AddComponent().duration = 12f; val.AddComponent(); val.AddComponent().vfxPriority = (VFXPriority)2; EffectComponent obj = val.AddComponent(); obj.applyScale = false; obj.effectIndex = (EffectIndex)(-1); obj.parentToReferencedTransform = parentToTransform; obj.positionAtReferencedTransform = true; obj.soundName = soundName; Content.CreateAndAddEffectDef(val); return val; } internal static GameObject CreateProjectileGhostPrefab(this AssetBundle assetBundle, string ghostName) { GameObject val = assetBundle.LoadAsset(ghostName); if ((Object)(object)val == (Object)null) { Log.Error("Failed to load ghost prefab " + ghostName); } if (!Object.op_Implicit((Object)(object)val.GetComponent())) { val.AddComponent(); } if (!Object.op_Implicit((Object)(object)val.GetComponent())) { val.AddComponent(); } ConvertAllRenderersToHopooShader(val); return val; } internal static GameObject CloneProjectilePrefab(string prefabName, string newPrefabName) { return PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("Prefabs/Projectiles/" + prefabName), newPrefabName); } internal static GameObject LoadAndAddProjectilePrefab(this AssetBundle assetBundle, string newPrefabName) { GameObject val = assetBundle.LoadAsset(newPrefabName); if ((Object)(object)val == (Object)null) { Log.ErrorAssetBundle(newPrefabName, ((Object)assetBundle).name); return null; } Content.AddProjectilePrefab(val); return val; } } public static class Config { public static ConfigFile MyConfig = ((BaseUnityPlugin)BastionPlugin.instance).Config; public static ConfigEntry CharacterEnableConfig(string section, string characterName, string description = "", bool enabledByDefault = true) { if (string.IsNullOrEmpty(description)) { description = "Set to false to disable this character and as much of its code and content as possible"; } return BindAndOptions(section, "Enable " + characterName, enabledByDefault, description, restartRequired: true); } public static ConfigEntry BindAndOptions(string section, string name, T defaultValue, string description = "", bool restartRequired = false) { return BindAndOptions(section, name, defaultValue, 0f, 20f, description, restartRequired); } public static ConfigEntry BindAndOptions(string section, string name, T defaultValue, float min, float max, string description = "", bool restartRequired = false) { if (string.IsNullOrEmpty(description)) { description = name; } if (restartRequired) { description += " (restart required)"; } ConfigEntry result = MyConfig.Bind(section, name, defaultValue, description); Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions"); return result; } public static ConfigEntry BindAndOptionsSlider(string section, string name, float defaultValue, string description, float min = 0f, float max = 20f, bool restartRequired = false) { return BindAndOptions(section, name, defaultValue, min, max, description, restartRequired); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private static void TryRegisterOption(ConfigEntry entry, float min, float max, bool restartRequired) { } public static bool GetKeyPressed(KeyboardShortcut entry) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) foreach (KeyCode modifier in ((KeyboardShortcut)(ref entry)).Modifiers) { if (!Input.GetKey(modifier)) { return false; } } return Input.GetKeyDown(((KeyboardShortcut)(ref entry)).MainKey); } } internal class Content { internal static void AddCharacterBodyPrefab(GameObject bprefab) { ContentPacks.bodyPrefabs.Add(bprefab); } internal static void AddMasterPrefab(GameObject prefab) { ContentPacks.masterPrefabs.Add(prefab); } internal static void AddProjectilePrefab(GameObject prefab) { ContentPacks.projectilePrefabs.Add(prefab); } internal static void AddSurvivorDef(SurvivorDef survivorDef) { ContentPacks.survivorDefs.Add(survivorDef); } internal static void AddItemDef(ItemDef itemDef) { ContentPacks.itemDefs.Add(itemDef); } internal static void CreateSurvivor(GameObject bodyPrefab, GameObject displayPrefab, Color charColor, string tokenPrefix) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) CreateSurvivor(bodyPrefab, displayPrefab, charColor, tokenPrefix, null, 100f); } internal static void CreateSurvivor(GameObject bodyPrefab, GameObject displayPrefab, Color charColor, string tokenPrefix, float sortPosition) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) CreateSurvivor(bodyPrefab, displayPrefab, charColor, tokenPrefix, null, sortPosition); } internal static void CreateSurvivor(GameObject bodyPrefab, GameObject displayPrefab, Color charColor, string tokenPrefix, UnlockableDef unlockableDef) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) CreateSurvivor(bodyPrefab, displayPrefab, charColor, tokenPrefix, unlockableDef, 100f); } internal static void CreateSurvivor(GameObject bodyPrefab, GameObject displayPrefab, Color charColor, string tokenPrefix, UnlockableDef unlockableDef, float sortPosition) { //IL_0014: 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) SurvivorDef obj = ScriptableObject.CreateInstance(); obj.bodyPrefab = bodyPrefab; obj.displayPrefab = displayPrefab; obj.primaryColor = charColor; obj.cachedName = ((Object)bodyPrefab).name.Replace("Body", ""); obj.displayNameToken = tokenPrefix + "NAME"; obj.descriptionToken = tokenPrefix + "DESCRIPTION"; obj.outroFlavorToken = tokenPrefix + "OUTRO_FLAVOR"; obj.mainEndingEscapeFailureFlavorToken = tokenPrefix + "OUTRO_FAILURE"; obj.desiredSortPosition = sortPosition; obj.unlockableDef = unlockableDef; AddSurvivorDef(obj); } internal static void AddSkillDef(SkillDef skillDef) { ContentPacks.skillDefs.Add(skillDef); } internal static void AddSkillFamily(SkillFamily skillFamily) { ContentPacks.skillFamilies.Add(skillFamily); } internal static void AddEntityState(Type entityState) { ContentPacks.entityStates.Add(entityState); } internal static void AddBuffDef(BuffDef buffDef) { ContentPacks.buffDefs.Add(buffDef); } internal static BuffDef CreateAndAddBuff(string buffName, Sprite buffIcon, Color buffColor, bool canStack, bool isDebuff) { //IL_000d: 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) BuffDef obj = ScriptableObject.CreateInstance(); ((Object)obj).name = buffName; obj.buffColor = buffColor; obj.canStack = canStack; obj.isDebuff = isDebuff; obj.eliteDef = null; obj.iconSprite = buffIcon; AddBuffDef(obj); return obj; } internal static void AddEffectDef(EffectDef effectDef) { ContentPacks.effectDefs.Add(effectDef); } internal static EffectDef CreateAndAddEffectDef(GameObject effectPrefab) { //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_000c: Expected O, but got Unknown //IL_000d: Expected O, but got Unknown EffectDef val = new EffectDef(effectPrefab); AddEffectDef(val); return val; } internal static void AddNetworkSoundEventDef(NetworkSoundEventDef networkSoundEventDef) { ContentPacks.networkSoundEventDefs.Add(networkSoundEventDef); } internal static NetworkSoundEventDef CreateAndAddNetworkSoundEventDef(string eventName) { NetworkSoundEventDef obj = ScriptableObject.CreateInstance(); obj.akId = AkSoundEngine.GetIDFromString(eventName); obj.eventName = eventName; AddNetworkSoundEventDef(obj); return obj; } } internal class ContentPacks : IContentPackProvider { internal ContentPack contentPack = new ContentPack(); public static List bodyPrefabs = new List(); public static List masterPrefabs = new List(); public static List projectilePrefabs = new List(); public static List survivorDefs = new List(); public static List skillFamilies = new List(); public static List skillDefs = new List(); public static List entityStates = new List(); public static List buffDefs = new List(); public static List effectDefs = new List(); public static List networkSoundEventDefs = new List(); public static List itemDefs = new List(); public string identifier => "com.HasteReapr.BastionMod"; public void Initialize() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown ContentManager.collectContentPackProviders += new CollectContentPackProvidersDelegate(ContentManager_collectContentPackProviders); } private void ContentManager_collectContentPackProviders(AddContentPackProviderDelegate addContentPackProvider) { addContentPackProvider.Invoke((IContentPackProvider)(object)this); } public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args) { contentPack.identifier = identifier; contentPack.bodyPrefabs.Add(bodyPrefabs.ToArray()); contentPack.masterPrefabs.Add(masterPrefabs.ToArray()); contentPack.projectilePrefabs.Add(projectilePrefabs.ToArray()); contentPack.survivorDefs.Add(survivorDefs.ToArray()); contentPack.itemDefs.Add(itemDefs.ToArray()); contentPack.unlockableDefs.Add(BastionUnlockables.unlockableDefs.ToArray()); contentPack.skillDefs.Add(skillDefs.ToArray()); contentPack.skillFamilies.Add(skillFamilies.ToArray()); contentPack.entityStateTypes.Add(entityStates.ToArray()); contentPack.buffDefs.Add(buffDefs.ToArray()); contentPack.effectDefs.Add(effectDefs.ToArray()); contentPack.networkSoundEventDefs.Add(networkSoundEventDefs.ToArray()); args.ReportProgress(1f); yield break; } public IEnumerator GenerateContentPackAsync(GetContentPackAsyncArgs args) { ContentPack.Copy(contentPack, args.output); args.ReportProgress(1f); yield break; } public IEnumerator FinalizeAsync(FinalizeAsyncArgs args) { args.ReportProgress(1f); yield break; } } public class CustomRendererInfo { public string childName; public Material material; public bool dontHotpoo; public bool ignoreOverlays; } internal static class ItemDisplayCheck { public static List allDisplayedItems; public static void PrintUnused(ItemDisplayRuleSet itemDisplayRuleSet, string bodyName = "") { PrintUnused((IEnumerable)itemDisplayRuleSet.keyAssetRuleGroups.ToList(), bodyName); } public static void PrintUnused(IEnumerable ruleSet = null, string bodyName = "") { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_004d: 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_0064: Unknown result type (might be due to invalid IL or missing references) string text = "generating item displays for " + bodyName; if (allDisplayedItems == null) { LazyGatherAllItems(); } List list = new List(allDisplayedItems); string text2 = ""; if (ruleSet != null) { foreach (KeyAssetRuleGroup item in ruleSet) { if (item.displayRuleGroup.rules.Length != 0) { list.Remove(item.keyAsset); if (string.IsNullOrEmpty(text2)) { text2 = item.displayRuleGroup.rules[0].childName; } } } } if (string.IsNullOrEmpty(text2)) { text2 = "Chest"; } foreach (Object item2 in list) { string text3 = ""; if (ItemDisplays.KeyAssetDisplayPrefabs.ContainsKey(item2)) { text3 += SpitOutNewRule(item2, text2, ItemDisplays.KeyAssetDisplayPrefabs[item2]); } else { Log.Error($"COULD NOT FIND DISPLAY PREFABS FOR KEYASSET {item2}"); } text += text3; } Log.Message(text); } private static void LazyGatherAllItems() { allDisplayedItems = new List(ItemDisplays.KeyAssetDisplayPrefabs.Keys); allDisplayedItems.Sort(delegate(Object item1, Object item2) { if (item1 is ItemDef && item2 is ItemDef) { return item1.name.CompareTo(item2.name); } if (item1 is EquipmentDef && item2 is EquipmentDef) { return item1.name.CompareTo(item2.name); } if (item1 is ItemDef && item2 is EquipmentDef) { return -1; } return (item1 is EquipmentDef && item2 is ItemDef) ? 1 : 0; }); } private static string SpitOutNewRule(Object asset, string firstCompatibleChild, ItemDisplayRule[] displayRules) { //IL_0031: 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) if (displayRules.Length == 0) { return $"\n[NO DISPLAY RULES FOUND FOR THE KEYASSET {asset}"; } string text = "\n itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets[\"" + asset.name + "\"]"; for (int i = 0; i < displayRules.Length; i++) { text = (((int)displayRules[i].limbMask != 0) ? (text + ",\n" + $" ItemDisplays.CreateLimbMaskDisplayRule(LimbFlags.{displayRules[i].limbMask})") : (text + ",\n ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay(\"" + ((Object)displayRules[i].followerPrefab).name + "\"),\n \"" + firstCompatibleChild + "\",\n new Vector3(2, 2, 2),\n new Vector3(0, 0, 0),\n new Vector3(1, 1, 1)\n )")); } return text + "\n ));"; } } internal static class ItemDisplays { private static Dictionary itemDisplayPrefabs = new Dictionary(); public static Dictionary KeyAssetDisplayPrefabs = new Dictionary(); public static Dictionary KeyAssets = new Dictionary(); public static int queuedDisplays; public static bool initialized = false; public static void LazyInit() { if (!initialized) { initialized = true; PopulateDisplays(); } } internal static void DisposeWhenDone() { queuedDisplays--; if (queuedDisplays <= 0 && initialized) { initialized = false; itemDisplayPrefabs = null; KeyAssetDisplayPrefabs = null; KeyAssets = null; } } internal static void PopulateDisplays() { PopulateFromBody("LoaderBody"); } internal static GameObject ResolveFollower(ItemDisplayRule rule) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)rule.followerPrefab)) { return rule.followerPrefab; } try { if (rule.followerPrefabAddress != null && ((AssetReference)rule.followerPrefabAddress).RuntimeKeyIsValid()) { return Addressables.LoadAssetAsync(((AssetReference)rule.followerPrefabAddress).RuntimeKey).WaitForCompletion(); } } catch (Exception ex) { Log.Warning("item display model could not be loaded by address: " + ex.Message); } return null; } internal static Object ResolveKeyAsset(KeyAssetRuleGroup group) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit(group.keyAsset)) { return group.keyAsset; } try { if (group.keyAssetAddress != null && ((AssetReference)group.keyAssetAddress).RuntimeKeyIsValid()) { return (Object)(object)Addressables.LoadAssetAsync(((AssetReference)group.keyAssetAddress).RuntimeKey).WaitForCompletion(); } } catch (Exception ex) { Log.Warning("item display key could not be loaded by address: " + ex.Message); } return null; } private static void PopulateFromBody(string bodyName) { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) KeyAssetRuleGroup[] keyAssetRuleGroups = ((Component)LegacyResourcesAPI.Load("Prefabs/CharacterBodies/" + bodyName).GetComponent().modelTransform).GetComponent().itemDisplayRuleSet.keyAssetRuleGroups; for (int i = 0; i < keyAssetRuleGroups.Length; i++) { ItemDisplayRule[] rules = keyAssetRuleGroups[i].displayRuleGroup.rules; Object val = ResolveKeyAsset(keyAssetRuleGroups[i]); if (!Object.op_Implicit(val) || rules == null) { continue; } KeyAssetDisplayPrefabs[val] = rules; KeyAssets[val.name] = val; for (int j = 0; j < rules.Length; j++) { GameObject val2 = ResolveFollower(rules[j]); if (Object.op_Implicit((Object)(object)val2)) { string key = ((Object)val2).name?.ToLowerInvariant(); if (!itemDisplayPrefabs.ContainsKey(key)) { itemDisplayPrefabs[key] = val2; } } } } } private static void PopulateCustomLightningArm() { GameObject val = PrefabAPI.InstantiateClone(itemDisplayPrefabs["displaylightningarmright"], "DisplayLightningCustom", false); LimbMatcher component = val.GetComponent(); component.limbPairs[0].targetChildLimb = "LightningArm1"; component.limbPairs[1].targetChildLimb = "LightningArm2"; component.limbPairs[2].targetChildLimb = "LightningArmEnd"; itemDisplayPrefabs["displaylightningarmcustom"] = val; } public static GameObject LoadDisplay(string name) { if (itemDisplayPrefabs.ContainsKey(name.ToLowerInvariant()) && Object.op_Implicit((Object)(object)itemDisplayPrefabs[name.ToLowerInvariant()])) { return itemDisplayPrefabs[name.ToLowerInvariant()]; } Log.Error("item display " + name + " returned null"); return null; } public static KeyAssetRuleGroup CreateDisplayRuleGroupWithRules(string itemName, params ItemDisplayRule[] rules) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) return CreateDisplayRuleGroupWithRules(GetKeyAssetFromString(itemName), rules); } public static KeyAssetRuleGroup CreateDisplayRuleGroupWithRules(Object keyAsset_, params ItemDisplayRule[] rules) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) if (keyAsset_ == (Object)null) { Log.Error("could not find keyasset"); } return new KeyAssetRuleGroup { keyAsset = keyAsset_, displayRuleGroup = new DisplayRuleGroup { rules = rules } }; } public static ItemDisplayRule CreateDisplayRule(string prefabName, string childName, Vector3 position, Vector3 rotation, Vector3 scale) { //IL_0007: 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_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) return CreateDisplayRule(LoadDisplay(prefabName), childName, position, rotation, scale); } public static ItemDisplayRule CreateDisplayRule(GameObject itemPrefab, string childName, Vector3 position, Vector3 rotation, Vector3 scale) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_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) return new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, childName = childName, followerPrefab = itemPrefab, limbMask = (LimbFlags)0, localPos = position, localAngles = rotation, localScale = scale }; } public static ItemDisplayRule CreateLimbMaskDisplayRule(LimbFlags limb) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) return new ItemDisplayRule { ruleType = (ItemDisplayRuleType)1, limbMask = limb, childName = "", followerPrefab = null }; } private static Object GetKeyAssetFromString(string itemName) { Object val = (Object)(object)LegacyResourcesAPI.Load("ItemDefs/" + itemName); if (val == (Object)null) { val = (Object)(object)LegacyResourcesAPI.Load("EquipmentDefs/" + itemName); } if (val == (Object)null) { Log.Error("Could not load keyasset for " + itemName); } return val; } } internal static class Language { public static string TokensOutput = ""; public static bool usingLanguageFolder = false; public static bool printingEnabled = false; private static readonly List> added = new List>(); public const string TemplateFileName = "BAS-10_translation_template.json"; public static void Init() { if (usingLanguageFolder) { Language.collectLanguageRootFolders += Language_collectLanguageRootFolders; } } private static void Language_collectLanguageRootFolders(List obj) { string text = Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)BastionPlugin.instance).Info.Location), "Language"); if (Directory.Exists(text)) { obj.Add(text); } } private static string Escape(string text) { return text.Replace("\\", "\\\\").Replace("\"", "\\\"").Replace("\r\n", "\\n") .Replace("\n", "\\n") .Replace("\r", "\\n") .Replace("\t", "\\t"); } public static void WriteTranslationTemplate() { try { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append("{\n \"en\": {\n"); for (int i = 0; i < added.Count; i++) { stringBuilder.Append(" \"").Append(Escape(added[i].Key)).Append("\": \"") .Append(Escape(added[i].Value)) .Append((i < added.Count - 1) ? "\",\n" : "\"\n"); } stringBuilder.Append(" }\n}\n"); string text = stringBuilder.ToString(); string text2 = Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)BastionPlugin.instance).Info.Location), "Language"); string text3 = Path.Combine(text2, "BAS-10_translation_template.json"); if (!File.Exists(text3) || !(File.ReadAllText(text3) == text)) { Directory.CreateDirectory(text2); File.WriteAllText(text3, text); Log.Message("Translation template written: " + text3 + " (" + added.Count + " strings)"); } } catch (Exception ex) { Log.Warning("Translation template not written: " + ex.Message); } } public static void Add(string token, string text) { added.Add(new KeyValuePair(token, text)); if (!usingLanguageFolder) { LanguageAPI.Add(token, text); } if (printingEnabled) { TokensOutput = TokensOutput + "\n \"" + token + "\" : \"" + text.Replace(Environment.NewLine, "\\n").Replace("\n", "\\n") + "\","; } } public static void PrintOutput(string fileName = "") { if (printingEnabled) { string text = "{\n strings:\n {" + TokensOutput + "\n }\n}"; Log.Message(fileName + ": \n" + text); if (!string.IsNullOrEmpty(fileName)) { File.WriteAllText(Path.Combine(Directory.GetParent(((BaseUnityPlugin)BastionPlugin.instance).Info.Location).FullName, "Language", "en", fileName), text); } TokensOutput = ""; } } } internal static class Materials { private static List cachedMaterials = new List(); internal static Shader hotpoo = LegacyResourcesAPI.Load("Shaders/Deferred/HGStandard"); public static Material LoadMaterial(this AssetBundle assetBundle, string materialName) { return assetBundle.CreateHopooMaterialFromBundle(materialName); } public static Material CreateHopooMaterialFromBundle(this AssetBundle assetBundle, string materialName) { //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown Material val = cachedMaterials.Find(delegate(Material mat) { materialName.Replace(" (Instance)", ""); return ((Object)mat).name.Contains(materialName); }); if (Object.op_Implicit((Object)(object)val)) { Log.Debug(((Object)val).name + " has already been loaded. returning cached"); return val; } val = assetBundle.LoadAsset(materialName); if (!Object.op_Implicit((Object)(object)val)) { Log.ErrorAssetBundle(materialName, ((Object)assetBundle).name); return new Material(hotpoo); } return val.ConvertDefaultShaderToHopoo(); } public static Material SetHopooMaterial(this Material tempMat) { return tempMat.ConvertDefaultShaderToHopoo(); } public static Material ConvertDefaultShaderToHopoo(this Material tempMat) { //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) if (cachedMaterials.Contains(tempMat)) { Log.Debug(((Object)tempMat).name + " has already been converted. returning cached"); return tempMat; } string text = ((Object)tempMat.shader).name.ToLowerInvariant(); if (!text.StartsWith("standard") && !text.StartsWith("autodesk")) { Log.Debug(((Object)tempMat).name + " is not unity standard shader. aborting material conversion"); return tempMat; } float? num = null; Color? val = null; if (tempMat.IsKeywordEnabled("_NORMALMAP")) { num = tempMat.GetFloat("_BumpScale"); } if (tempMat.IsKeywordEnabled("_EMISSION")) { val = tempMat.GetColor("_EmissionColor"); } tempMat.shader = hotpoo; tempMat.SetTexture("_EmTex", tempMat.GetTexture("_EmissionMap")); tempMat.EnableKeyword("DITHER"); if (num.HasValue) { tempMat.SetFloat("_NormalStrength", num.Value); tempMat.SetTexture("_NormalTex", tempMat.GetTexture("_BumpMap")); } if (val.HasValue) { tempMat.SetColor("_EmColor", val.Value); tempMat.SetFloat("_EmPower", 1f); } if (tempMat.IsKeywordEnabled("NOCULL")) { tempMat.SetInt("_Cull", 0); } if (tempMat.IsKeywordEnabled("LIMBREMOVAL")) { tempMat.SetInt("_LimbRemovalOn", 1); } cachedMaterials.Add(tempMat); return tempMat; } public static Material MakeUnique(this Material material) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown if (cachedMaterials.Contains(material)) { return new Material(material); } return material; } public static Material SetColor(this Material material, Color color) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) material.SetColor("_Color", color); return material; } public static Material SetNormal(this Material material, float normalStrength = 1f) { material.SetFloat("_NormalStrength", normalStrength); return material; } public static Material SetEmission(this Material material) { return material.SetEmission(1f); } public static Material SetEmission(this Material material, float emission) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return material.SetEmission(emission, Color.white); } public static Material SetEmission(this Material material, float emission, Color emissionColor) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) material.SetFloat("_EmPower", emission); material.SetColor("_EmColor", emissionColor); return material; } public static Material SetCull(this Material material, bool cull = false) { material.SetInt("_Cull", cull ? 1 : 0); return material; } public static Material SetSpecular(this Material material, float strength) { material.SetFloat("_SpecularStrength", strength); return material; } public static Material SetSpecular(this Material material, float strength, float exponent) { material.SetFloat("_SpecularStrength", strength); material.SetFloat("SpecularExponent", exponent); return material; } } internal static class Prefabs { private static PhysicMaterial ragdollMaterial; public static GameObject CreateDisplayPrefab(AssetBundle assetBundle, string displayPrefabName, GameObject prefab) { GameObject val = assetBundle.LoadAsset(displayPrefabName); if ((Object)(object)val == (Object)null) { Log.Error("could not load display prefab " + displayPrefabName + ". Make sure this prefab exists in assetbundle " + ((Object)assetBundle).name); return null; } CharacterModel val2 = val.GetComponent(); if (!Object.op_Implicit((Object)(object)val2)) { val2 = val.AddComponent(); } val2.baseRendererInfos = prefab.GetComponentInChildren().baseRendererInfos; Asset.ConvertAllRenderersToHopooShader(val); return val; } public static GameObject LoadCharacterModel(AssetBundle assetBundle, string modelName) { GameObject val = assetBundle.LoadAsset(modelName); if ((Object)(object)val == (Object)null) { Log.Error("could not load model prefab " + modelName + ". Make sure this prefab exists in assetbundle " + ((Object)assetBundle).name); return null; } return val; } public static GameObject LoadCharacterBody(AssetBundle assetBundle, string bodyName) { GameObject val = assetBundle.LoadAsset(bodyName); if ((Object)(object)val == (Object)null) { Log.Error("could not load body prefab " + bodyName + ". Make sure this prefab exists in assetbundle " + ((Object)assetBundle).name); return null; } return val; } public static GameObject CloneCharacterBody(BodyInfo bodyInfo) { GameObject val = LegacyResourcesAPI.Load("Prefabs/CharacterBodies/" + bodyInfo.bodyNameToClone + "Body"); if (!Object.op_Implicit((Object)(object)val)) { Log.Error(bodyInfo.bodyNameToClone + " Body to clone is not a valid body, character creation failed"); return null; } GameObject val2 = PrefabAPI.InstantiateClone(val, bodyInfo.bodyName); for (int num = val2.transform.childCount - 1; num >= 0; num--) { Object.DestroyImmediate((Object)(object)((Component)val2.transform.GetChild(num)).gameObject); } return val2; } public static GameObject CreateBodyPrefab(AssetBundle assetBundle, string modelPrefabName, BodyInfo bodyInfo) { return CreateBodyPrefab(LoadCharacterModel(assetBundle, modelPrefabName), bodyInfo); } public static GameObject CreateBodyPrefab(GameObject model, BodyInfo bodyInfo) { return CreateBodyPrefab(CloneCharacterBody(bodyInfo), model, bodyInfo); } public static GameObject CreateBodyPrefab(GameObject newBodyPrefab, AssetBundle assetBundle, string modelName, BodyInfo bodyInfo) { return CreateBodyPrefab(newBodyPrefab, LoadCharacterModel(assetBundle, modelName), bodyInfo); } public static GameObject CreateBodyPrefab(AssetBundle assetBundle, string bodyPrefabName, string modelPrefabName, BodyInfo bodyInfo) { return CreateBodyPrefab(LoadCharacterBody(assetBundle, bodyPrefabName), LoadCharacterModel(assetBundle, modelPrefabName), bodyInfo); } public static GameObject CreateBodyPrefab(GameObject newBodyPrefab, GameObject model, BodyInfo bodyInfo) { if ((Object)(object)model == (Object)null || (Object)(object)newBodyPrefab == (Object)null) { Log.Error($"Character creation failed. Model: {model}, Body: {newBodyPrefab}"); return null; } SetupCharacterBody(newBodyPrefab, bodyInfo); Transform modelBaseTransform = AddCharacterModelToSurvivorBody(newBodyPrefab, model.transform, bodyInfo); SetupModelLocator(newBodyPrefab, modelBaseTransform, model.transform); SetupCharacterDirection(newBodyPrefab, modelBaseTransform, model.transform); SetupCameraTargetParams(newBodyPrefab, bodyInfo); SetupCapsuleCollider(newBodyPrefab); Content.AddCharacterBodyPrefab(newBodyPrefab); return newBodyPrefab; } private static void SetupCharacterBody(GameObject newBodyPrefab, BodyInfo bodyInfo) { //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_01f6: 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) CharacterBody component = newBodyPrefab.GetComponent(); component.baseNameToken = bodyInfo.bodyNameToken; component.subtitleNameToken = bodyInfo.subtitleNameToken; component.portraitIcon = bodyInfo.characterPortrait; component.bodyColor = bodyInfo.bodyColor; component._defaultCrosshairPrefab = bodyInfo.crosshair; component.hideCrosshair = false; component.preferredPodPrefab = bodyInfo.podPrefab; component.baseMaxHealth = bodyInfo.maxHealth; component.baseRegen = bodyInfo.healthRegen; component.baseArmor = bodyInfo.armor; component.baseMaxShield = bodyInfo.shield; component.baseDamage = bodyInfo.damage; component.baseAttackSpeed = bodyInfo.attackSpeed; component.baseCrit = bodyInfo.crit; component.baseMoveSpeed = bodyInfo.moveSpeed; component.baseJumpPower = bodyInfo.jumpPower; component.autoCalculateLevelStats = bodyInfo.autoCalculateLevelStats; if (bodyInfo.autoCalculateLevelStats) { component.levelMaxHealth = Mathf.Round(component.baseMaxHealth * 0.3f); component.levelMaxShield = Mathf.Round(component.baseMaxShield * 0.3f); component.levelRegen = component.baseRegen * 0.2f; component.levelMoveSpeed = 0f; component.levelJumpPower = 0f; component.levelDamage = component.baseDamage * 0.2f; component.levelAttackSpeed = 0f; component.levelCrit = 0f; component.levelArmor = 0f; } else { component.levelMaxHealth = bodyInfo.healthGrowth; component.levelMaxShield = bodyInfo.shieldGrowth; component.levelRegen = bodyInfo.regenGrowth; component.levelMoveSpeed = bodyInfo.moveSpeedGrowth; component.levelJumpPower = bodyInfo.jumpPowerGrowth; component.levelDamage = bodyInfo.damageGrowth; component.levelAttackSpeed = bodyInfo.attackSpeedGrowth; component.levelCrit = bodyInfo.critGrowth; component.levelArmor = bodyInfo.armorGrowth; } component.baseAcceleration = bodyInfo.acceleration; component.baseJumpCount = bodyInfo.jumpCount; component.sprintingSpeedMultiplier = 1.45f; component.bodyFlags = (BodyFlags)16; component.rootMotionInMainState = false; component.hullClassification = (HullClassification)0; component.isChampion = false; } private static Transform AddCharacterModelToSurvivorBody(GameObject bodyPrefab, Transform modelTransform, BodyInfo bodyInfo) { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_001f: 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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: 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_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) Transform val = bodyPrefab.transform.Find("ModelBase"); if ((Object)(object)val == (Object)null) { val = new GameObject("ModelBase").transform; val.parent = bodyPrefab.transform; val.localPosition = bodyInfo.modelBasePosition; val.localRotation = Quaternion.identity; } modelTransform.parent = ((Component)val).transform; modelTransform.localPosition = Vector3.zero; modelTransform.localRotation = Quaternion.identity; if ((Object)(object)bodyPrefab.transform.Find("CameraPivot") == (Object)null) { Transform transform = new GameObject("CameraPivot").transform; transform.parent = bodyPrefab.transform; transform.localPosition = bodyInfo.cameraPivotPosition; transform.localRotation = Quaternion.identity; } Transform val2 = bodyPrefab.transform.Find("AimOrigin"); if ((Object)(object)val2 == (Object)null) { val2 = new GameObject("AimOrigin").transform; val2.parent = bodyPrefab.transform; val2.localPosition = bodyInfo.aimOriginPosition; val2.localRotation = Quaternion.identity; } bodyPrefab.GetComponent().aimOriginTransform = val2; return ((Component)val).transform; } private static void SetupCharacterDirection(GameObject prefab, Transform modelBaseTransform, Transform modelTransform) { if (Object.op_Implicit((Object)(object)prefab.GetComponent())) { CharacterDirection component = prefab.GetComponent(); component.targetTransform = modelBaseTransform; component.overrideAnimatorForwardTransform = null; component.rootMotionAccumulator = null; component.modelAnimator = ((Component)modelTransform).GetComponent(); component.driveFromRootRotation = false; component.turnSpeed = 720f; } } private static void SetupCameraTargetParams(GameObject prefab, BodyInfo bodyInfo) { CameraTargetParams component = prefab.GetComponent(); component.cameraParams = bodyInfo.cameraParams; component.cameraPivotTransform = prefab.transform.Find("CameraPivot"); } private static void SetupModelLocator(GameObject prefab, Transform modelBaseTransform, Transform modelTransform) { ModelLocator component = prefab.GetComponent(); component.modelTransform = modelTransform; component.modelBaseTransform = modelBaseTransform; } private static void SetupCapsuleCollider(GameObject prefab) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) CapsuleCollider component = prefab.GetComponent(); component.center = new Vector3(0f, 0f, 0f); component.radius = 0.5f; component.height = 1.82f; component.direction = 1; } public static CharacterModel SetupCharacterModel(GameObject bodyPrefab, CustomRendererInfo[] customInfos = null) { CharacterModel val = ((Component)bodyPrefab.GetComponent().modelTransform).gameObject.GetComponent(); bool num = (Object)(object)val != (Object)null; if (!num) { val = ((Component)bodyPrefab.GetComponent().modelTransform).gameObject.AddComponent(); } val.body = bodyPrefab.GetComponent(); val.autoPopulateLightInfos = true; val.invisibilityCount = 0; val.temporaryOverlays = new List(); if (!num) { SetupCustomRendererInfos(val, customInfos); } else { SetupPreAttachedRendererInfos(val); } SetupHurtboxGroup(bodyPrefab, ((Component)val).gameObject); SetupAimAnimator(bodyPrefab, ((Component)val).gameObject); SetupFootstepController(((Component)val).gameObject); SetupRagdoll(((Component)val).gameObject); return val; } public static void SetupPreAttachedRendererInfos(CharacterModel characterModel) { for (int i = 0; i < characterModel.baseRendererInfos.Length; i++) { if ((Object)(object)characterModel.baseRendererInfos[i].defaultMaterial == (Object)null) { characterModel.baseRendererInfos[i].defaultMaterial = characterModel.baseRendererInfos[i].renderer.sharedMaterial; } if ((Object)(object)characterModel.baseRendererInfos[i].defaultMaterial == (Object)null) { Log.Error($"no material for rendererinfo of this renderer: {characterModel.baseRendererInfos[i].renderer}"); } characterModel.baseRendererInfos[i].defaultMaterial.ConvertDefaultShaderToHopoo(); } } public static void SetupCustomRendererInfos(CharacterModel characterModel, CustomRendererInfo[] customInfos) { //IL_00aa: 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) ChildLocator component = ((Component)characterModel).GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { Log.Error("Failed CharacterModel setup: ChildLocator component does not exist on the model"); return; } List list = new List(); for (int i = 0; i < customInfos.Length; i++) { if (!Object.op_Implicit((Object)(object)component.FindChild(customInfos[i].childName))) { Log.Error("Trying to add a RendererInfo for a renderer that does not exist: " + customInfos[i].childName); continue; } Renderer component2 = ((Component)component.FindChild(customInfos[i].childName)).GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { Material val = customInfos[i].material; if ((Object)(object)val == (Object)null) { val = ((!customInfos[i].dontHotpoo) ? component2.sharedMaterial.ConvertDefaultShaderToHopoo() : component2.sharedMaterial); } list.Add(new RendererInfo { renderer = component2, defaultMaterial = val, ignoreOverlays = customInfos[i].ignoreOverlays, defaultShadowCastingMode = (ShadowCastingMode)1 }); } } characterModel.baseRendererInfos = list.ToArray(); } private static void SetupHurtboxGroup(GameObject bodyPrefab, GameObject model) { SetupMainHurtboxesFromChildLocator(bodyPrefab, model); SetHurtboxesHealthComponents(bodyPrefab); } private static void SetupMainHurtboxesFromChildLocator(GameObject bodyPrefab, GameObject model) { //IL_00fd: 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) if ((Object)(object)bodyPrefab.GetComponent() != (Object)null) { Log.Debug("Hitboxgroup already exists on model prefab. aborting code setup"); return; } ChildLocator component = model.GetComponent(); if (string.IsNullOrEmpty(component.FindChildNameInsensitive("MainHurtbox"))) { Log.Error("Could not set up main hurtbox: make sure you have a transform pair in your prefab's ChildLocator called 'MainHurtbox'"); return; } HurtBoxGroup val = model.AddComponent(); HurtBox val2 = null; GameObject val3 = component.FindChildGameObjectInsensitive("HeadHurtbox"); if (Object.op_Implicit((Object)(object)val3)) { Log.Debug("HeadHurtboxFound. Setting up"); val2 = val3.AddComponent(); ((Component)val2).gameObject.layer = LayerIndex.entityPrecise.intVal; val2.healthComponent = bodyPrefab.GetComponent(); val2.isBullseye = false; val2.isSniperTarget = true; val2.damageModifier = (DamageModifier)0; val2.hurtBoxGroup = val; val2.indexInGroup = 1; } HurtBox val4 = component.FindChildGameObjectInsensitive("MainHurtbox").AddComponent(); ((Component)val4).gameObject.layer = LayerIndex.entityPrecise.intVal; val4.healthComponent = bodyPrefab.GetComponent(); val4.isBullseye = true; val4.isSniperTarget = (Object)(object)val2 == (Object)null; val4.damageModifier = (DamageModifier)0; val4.hurtBoxGroup = val; val4.indexInGroup = 0; if (Object.op_Implicit((Object)(object)val2)) { val.hurtBoxes = (HurtBox[])(object)new HurtBox[2] { val4, val2 }; } else { val.hurtBoxes = (HurtBox[])(object)new HurtBox[1] { val4 }; } val.mainHurtBox = val4; val.bullseyeCount = 1; } private static string FindChildNameInsensitive(this ChildLocator childLocator, string child) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) return childLocator.transformPairs.Where((NameTransformPair pair) => pair.name.ToLowerInvariant() == child.ToLowerInvariant()).FirstOrDefault().name; } private static Transform FindChildInsensitive(this ChildLocator childLocator, string child) { return childLocator.FindChild(childLocator.FindChildNameInsensitive(child)); } private static GameObject FindChildGameObjectInsensitive(this ChildLocator childLocator, string child) { return childLocator.FindChildGameObject(childLocator.FindChildNameInsensitive(child)); } public static void SetHurtboxesHealthComponents(GameObject bodyPrefab) { HealthComponent component = bodyPrefab.GetComponent(); HurtBoxGroup[] componentsInChildren = bodyPrefab.GetComponentsInChildren(); foreach (HurtBoxGroup val in componentsInChildren) { val.mainHurtBox.healthComponent = component; for (int j = 0; j < val.hurtBoxes.Length; j++) { val.hurtBoxes[j].healthComponent = component; } } } private static void SetupFootstepController(GameObject model) { FootstepHandler obj = model.AddComponent(); obj.baseFootstepString = "Play_player_footstep"; obj.sprintFootstepOverrideString = ""; obj.enableFootstepDust = true; obj.footstepDustPrefab = LegacyResourcesAPI.Load("Prefabs/GenericFootstepDust"); } private static void SetupRagdoll(GameObject model) { RagdollController component = model.GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { return; } if ((Object)(object)ragdollMaterial == (Object)null) { ragdollMaterial = ((Component)LegacyResourcesAPI.Load("Prefabs/CharacterBodies/CommandoBody").GetComponentInChildren().bones[1]).GetComponent().material; } Transform[] bones = component.bones; foreach (Transform val in bones) { if (Object.op_Implicit((Object)(object)val)) { ((Component)val).gameObject.layer = LayerIndex.ragdoll.intVal; Collider component2 = ((Component)val).GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { component2.sharedMaterial = ragdollMaterial; } else { Log.Error($"Ragdoll bone {((Component)val).gameObject} doesn't have a collider. Ragdoll will break."); } } } } private static void SetupAimAnimator(GameObject prefab, GameObject model) { AimAnimator obj = model.AddComponent(); obj.directionComponent = prefab.GetComponent(); obj.pitchRangeMax = 60f; obj.pitchRangeMin = -60f; obj.yawRangeMin = -80f; obj.yawRangeMax = 80f; obj.pitchGiveupRange = 30f; obj.yawGiveupRange = 10f; obj.giveupDuration = 3f; obj.inputBank = prefab.GetComponent(); } public static void CreateGenericDoppelganger(GameObject bodyPrefab, string masterName, string masterToCopy) { CloneDopplegangerMaster(bodyPrefab, masterName, masterToCopy); } public static GameObject CloneDopplegangerMaster(GameObject bodyPrefab, string masterName, string masterToCopy) { GameObject obj = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("Prefabs/CharacterMasters/" + masterToCopy + "MonsterMaster"), masterName, true); obj.GetComponent().bodyPrefab = bodyPrefab; Content.AddMasterPrefab(obj); return obj; } public static GameObject CreateBlankMasterPrefab(GameObject bodyPrefab, string masterName) { GameObject val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("Prefabs/CharacterMasters/CommandoMonsterMaster"), masterName, true); ContentPacks.masterPrefabs.Add(val); val.GetComponent().bodyPrefab = bodyPrefab; AISkillDriver[] components = val.GetComponents(); for (int i = 0; i < components.Length; i++) { Object.Destroy((Object)(object)components[i]); } return val; } public static GameObject LoadMaster(this AssetBundle assetBundle, GameObject bodyPrefab, string assetName) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) GameObject val = assetBundle.LoadAsset(assetName); BaseAI val2 = val.GetComponent(); if ((Object)(object)val2 == (Object)null) { val2 = val.AddComponent(); val2.aimVectorDampTime = 0.1f; val2.aimVectorMaxSpeed = 360f; } val2.scanState = new SerializableEntityStateType(typeof(Wander)); EntityStateMachine component = val.GetComponent(); if ((Object)(object)component == (Object)null) { AddEntityStateMachine(val, "AI", typeof(Wander), typeof(Wander)); } val2.stateMachine = component; CharacterMaster val3 = val.GetComponent(); if ((Object)(object)val3 == (Object)null) { val3 = val.AddComponent(); } val3.bodyPrefab = bodyPrefab; val3.teamIndex = (TeamIndex)2; Content.AddMasterPrefab(val); return val; } public static void ClearEntityStateMachines(GameObject bodyPrefab) { EntityStateMachine[] components = bodyPrefab.GetComponents(); for (int num = components.Length - 1; num >= 0; num--) { Object.DestroyImmediate((Object)(object)components[num]); } bodyPrefab.GetComponent().stateMachines = Array.Empty(); CharacterDeathBehavior component = bodyPrefab.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.idleStateMachine = Array.Empty(); } SetStateOnHurt component2 = bodyPrefab.GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { component2.idleStateMachine = Array.Empty(); } CharacterBody component3 = bodyPrefab.GetComponent(); if (Object.op_Implicit((Object)(object)component3)) { component3.vehicleIdleStateMachine = Array.Empty(); } } public static EntityStateMachine AddEntityStateMachine(GameObject prefab, string machineName, Type mainStateType = null, Type initalStateType = null, bool addToHurt = true, bool addToDeath = true) { //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_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) EntityStateMachine val = EntityStateMachine.FindByCustomName(prefab, machineName); if ((Object)(object)val == (Object)null) { val = prefab.AddComponent(); } else { Log.Message("An Entity State Machine already exists with the name " + machineName + ". replacing."); } val.customName = machineName; if (mainStateType == null) { mainStateType = typeof(Idle); } val.mainStateType = new SerializableEntityStateType(mainStateType); if (initalStateType == null) { initalStateType = typeof(Idle); } val.initialStateType = new SerializableEntityStateType(initalStateType); NetworkStateMachine component = prefab.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.stateMachines = component.stateMachines.Append(val).ToArray(); } CharacterDeathBehavior component2 = prefab.GetComponent(); if (Object.op_Implicit((Object)(object)component2) && addToDeath) { component2.idleStateMachine = component2.idleStateMachine.Append(val).ToArray(); } SetStateOnHurt component3 = prefab.GetComponent(); if (Object.op_Implicit((Object)(object)component3) && addToHurt) { component3.idleStateMachine = component3.idleStateMachine.Append(val).ToArray(); } return val; } public static EntityStateMachine AddMainEntityStateMachine(GameObject bodyPrefab, string machineName = "Body", Type mainStateType = null, Type initalStateType = null) { //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_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) EntityStateMachine val = EntityStateMachine.FindByCustomName(bodyPrefab, machineName); if ((Object)(object)val == (Object)null) { val = bodyPrefab.AddComponent(); } else { Log.Message("An Entity State Machine already exists with the name " + machineName + ". replacing."); } val.customName = machineName; if (mainStateType == null) { mainStateType = typeof(GenericCharacterMain); } val.mainStateType = new SerializableEntityStateType(mainStateType); if (initalStateType == null) { initalStateType = typeof(SpawnTeleporterState); } val.initialStateType = new SerializableEntityStateType(initalStateType); NetworkStateMachine component = bodyPrefab.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.stateMachines = component.stateMachines.Append(val).ToArray(); } CharacterDeathBehavior component2 = bodyPrefab.GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { component2.deathStateMachine = val; } SetStateOnHurt component3 = bodyPrefab.GetComponent(); if (Object.op_Implicit((Object)(object)component3)) { component3.targetStateMachine = val; } return val; } public static void SetupHitbox(GameObject prefab, Transform hitboxTransform, string hitboxName) { SetupHitBoxGroup(prefab, hitboxName, hitboxTransform); } public static void SetupHitBoxGroup(GameObject modelPrefab, string hitBoxGroupName, params string[] hitboxChildNames) { ChildLocator component = modelPrefab.GetComponent(); Transform[] array = (Transform[])(object)new Transform[hitboxChildNames.Length]; for (int i = 0; i < hitboxChildNames.Length; i++) { array[i] = component.FindChild(hitboxChildNames[i]); if ((Object)(object)array[i] == (Object)null) { Log.Error("missing hitbox for " + hitboxChildNames[i]); } } SetupHitBoxGroup(modelPrefab, hitBoxGroupName, array); } public static void SetupHitBoxGroup(GameObject prefab, string hitBoxGroupName, params Transform[] hitBoxTransforms) { List list = new List(); foreach (Transform val in hitBoxTransforms) { if ((Object)(object)val == (Object)null) { Log.Error("Error setting up hitboxGroup for " + hitBoxGroupName + ": hitbox transform was null"); continue; } HitBox item = ((Component)val).gameObject.AddComponent(); ((Component)val).gameObject.layer = LayerIndex.projectile.intVal; list.Add(item); } if (list.Count == 0) { Log.Error("No hitboxes were set up. aborting setting up hitboxGroup for " + hitBoxGroupName); return; } HitBoxGroup obj = prefab.AddComponent(); obj.hitBoxes = list.ToArray(); obj.groupName = hitBoxGroupName; } } internal class SkillDefInfo { public string skillName; public string skillNameToken; public string skillDescriptionToken; public string[] keywordTokens = Array.Empty(); public Sprite skillIcon; public SerializableEntityStateType activationState; public string activationStateMachineName; public InterruptPriority interruptPriority; public float baseRechargeInterval; public int baseMaxStock = 1; public int rechargeStock = 1; public int requiredStock = 1; public int stockToConsume = 1; public bool resetCooldownTimerOnUse; public bool fullRestockOnAssign = true; public bool dontAllowPastMaxStocks; public bool beginSkillCooldownOnSkillEnd; public bool mustKeyPress; public bool isCombatSkill = true; public bool canceledFromSprinting; public bool cancelSprintingOnActivation = true; public bool forceSprintDuringState; public SkillDefInfo() { } public SkillDefInfo(string skillName, string skillNameToken, string skillDescriptionToken, Sprite skillIcon, SerializableEntityStateType activationState, string activationStateMachineName = "Weapon", bool agile = false) { //IL_0060: 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_0094: Unknown result type (might be due to invalid IL or missing references) this.skillName = skillName; this.skillNameToken = skillNameToken; this.skillDescriptionToken = skillDescriptionToken; this.skillIcon = skillIcon; this.activationState = activationState; this.activationStateMachineName = activationStateMachineName; cancelSprintingOnActivation = !agile; if (agile) { keywordTokens = new string[1] { "KEYWORD_AGILE" }; } interruptPriority = (InterruptPriority)0; isCombatSkill = true; baseRechargeInterval = 0f; requiredStock = 0; stockToConsume = 0; } } internal static class Skills { public static void CreateSkillFamilies(GameObject targetPrefab) { SkillSlot[] array = new SkillSlot[4]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); CreateSkillFamilies(targetPrefab, (SkillSlot[])(object)array); } public static void CreateSkillFamilies(GameObject targetPrefab, params SkillSlot[] slots) { //IL_000e: 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_0025: Expected I4, but got Unknown SkillLocator component = targetPrefab.GetComponent(); foreach (SkillSlot val in slots) { switch ((int)val) { case 0: component.primary = CreateGenericSkillWithSkillFamily(targetPrefab, "Primary"); break; case 1: component.secondary = CreateGenericSkillWithSkillFamily(targetPrefab, "Secondary"); break; case 2: component.utility = CreateGenericSkillWithSkillFamily(targetPrefab, "Utility"); break; case 3: component.special = CreateGenericSkillWithSkillFamily(targetPrefab, "Special"); break; } } } public static void ClearGenericSkills(GameObject targetPrefab) { GenericSkill[] componentsInChildren = targetPrefab.GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { Object.DestroyImmediate((Object)(object)componentsInChildren[i]); } } public static GenericSkill CreateGenericSkillWithSkillFamily(GameObject targetPrefab, SkillSlot skillSlot, bool hidden = false) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected I4, but got Unknown SkillLocator component = targetPrefab.GetComponent(); switch (skillSlot - -1) { case 1: return component.primary = CreateGenericSkillWithSkillFamily(targetPrefab, "Primary", hidden); case 2: return component.secondary = CreateGenericSkillWithSkillFamily(targetPrefab, "Secondary", hidden); case 3: return component.utility = CreateGenericSkillWithSkillFamily(targetPrefab, "Utility", hidden); case 4: return component.special = CreateGenericSkillWithSkillFamily(targetPrefab, "Special", hidden); case 0: Log.Error("Failed to create GenericSkill with skillslot None. If making a GenericSkill outside of the main 4, specify a familyName, and optionally a genericSkillName"); return null; default: return null; } } public static GenericSkill CreateGenericSkillWithSkillFamily(GameObject targetPrefab, string familyName, bool hidden = false) { return CreateGenericSkillWithSkillFamily(targetPrefab, familyName, familyName, hidden); } public static GenericSkill CreateGenericSkillWithSkillFamily(GameObject targetPrefab, string genericSkillName, string familyName, bool hidden = false) { GenericSkill obj = targetPrefab.AddComponent(); obj.skillName = genericSkillName; obj.hideInCharacterSelect = hidden; SkillFamily val = ScriptableObject.CreateInstance(); ((Object)val).name = ((Object)targetPrefab).name + familyName + "Family"; val.variants = (Variant[])(object)new Variant[0]; obj._skillFamily = val; Content.AddSkillFamily(val); return obj; } public static void AddSkillToFamily(SkillFamily skillFamily, SkillDef skillDef, UnlockableDef unlockableDef = null) { //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) Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1); Variant[] variants = skillFamily.variants; int num = skillFamily.variants.Length - 1; Variant val = new Variant { skillDef = skillDef, unlockableDef = unlockableDef }; ((Variant)(ref val)).viewableNode = new Node(skillDef.skillNameToken, false, (Node)null); variants[num] = val; } public static void AddSkillsToFamily(SkillFamily skillFamily, params SkillDef[] skillDefs) { foreach (SkillDef skillDef in skillDefs) { AddSkillToFamily(skillFamily, skillDef); } } public static void AddPrimarySkills(GameObject targetPrefab, params SkillDef[] skillDefs) { AddSkillsToFamily(targetPrefab.GetComponent().primary.skillFamily, skillDefs); } public static void AddSecondarySkills(GameObject targetPrefab, params SkillDef[] skillDefs) { AddSkillsToFamily(targetPrefab.GetComponent().secondary.skillFamily, skillDefs); } public static void AddUtilitySkills(GameObject targetPrefab, params SkillDef[] skillDefs) { AddSkillsToFamily(targetPrefab.GetComponent().utility.skillFamily, skillDefs); } public static void AddSpecialSkills(GameObject targetPrefab, params SkillDef[] skillDefs) { AddSkillsToFamily(targetPrefab.GetComponent().special.skillFamily, skillDefs); } public static void AddUnlockablesToFamily(SkillFamily skillFamily, params UnlockableDef[] unlockableDefs) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < unlockableDefs.Length; i++) { Variant val = skillFamily.variants[i]; val.unlockableDef = unlockableDefs[i]; skillFamily.variants[i] = val; } } public static SkillDef CreateSkillDef(SkillDefInfo skillDefInfo) { return Skills.CreateSkillDef(skillDefInfo); } public static T CreateSkillDef(SkillDefInfo skillDefInfo) where T : SkillDef { //IL_0061: 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_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) T val = ScriptableObject.CreateInstance(); ((SkillDef)val).skillName = skillDefInfo.skillName; ((Object)(object)val).name = skillDefInfo.skillName; ((SkillDef)val).skillNameToken = skillDefInfo.skillNameToken; ((SkillDef)val).skillDescriptionToken = skillDefInfo.skillDescriptionToken; ((SkillDef)val).icon = skillDefInfo.skillIcon; ((SkillDef)val).activationState = skillDefInfo.activationState; ((SkillDef)val).activationStateMachineName = skillDefInfo.activationStateMachineName; ((SkillDef)val).interruptPriority = skillDefInfo.interruptPriority; ((SkillDef)val).baseMaxStock = skillDefInfo.baseMaxStock; ((SkillDef)val).baseRechargeInterval = skillDefInfo.baseRechargeInterval; ((SkillDef)val).rechargeStock = skillDefInfo.rechargeStock; ((SkillDef)val).requiredStock = skillDefInfo.requiredStock; ((SkillDef)val).stockToConsume = skillDefInfo.stockToConsume; ((SkillDef)val).dontAllowPastMaxStocks = skillDefInfo.dontAllowPastMaxStocks; ((SkillDef)val).beginSkillCooldownOnSkillEnd = skillDefInfo.beginSkillCooldownOnSkillEnd; ((SkillDef)val).canceledFromSprinting = skillDefInfo.canceledFromSprinting; ((SkillDef)val).forceSprintDuringState = skillDefInfo.forceSprintDuringState; ((SkillDef)val).fullRestockOnAssign = skillDefInfo.fullRestockOnAssign; ((SkillDef)val).resetCooldownTimerOnUse = skillDefInfo.resetCooldownTimerOnUse; ((SkillDef)val).isCombatSkill = skillDefInfo.isCombatSkill; ((SkillDef)val).mustKeyPress = skillDefInfo.mustKeyPress; ((SkillDef)val).cancelSprintingOnActivation = skillDefInfo.cancelSprintingOnActivation; ((SkillDef)val).keywordTokens = skillDefInfo.keywordTokens; Content.AddSkillDef((SkillDef)(object)val); return val; } public static void SetStateSkill(this GenericSkill skill, SkillDef skillDef, SkillOverridePriority priority = (SkillOverridePriority)3) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) skill.SetSkillOverride((object)((Component)skill).gameObject, skillDef, priority); } public static void UnsetStateSkill(this GenericSkill skill, SkillDef skillDef, SkillOverridePriority priority = (SkillOverridePriority)3) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) skill.UnsetSkillOverride((object)((Component)skill).gameObject, skillDef, priority); } public static void SetStateSkills(this SkillLocator skillLoc, BastionStateDef stateDef, SkillOverridePriority priority = (SkillOverridePriority)3) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) skillLoc.primary.SetStateSkill(stateDef.primary, priority); skillLoc.utility.SetSkillInternal(stateDef.utility); skillLoc.special.SetSkillInternal(stateDef.special); } public static void UnsetStateSkills(this SkillLocator skillLoc, BastionStateDef stateDef, SkillOverridePriority priority = (SkillOverridePriority)3) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) skillLoc.primary.UnsetStateSkill(stateDef.primary, priority); skillLoc.utility.UnsetStateSkill(stateDef.utility, priority); skillLoc.special.UnsetStateSkill(stateDef.special, priority); } public static void SetStateSkills(this EntityStateMachine machine, SkillLocator locator, BastionController ctrl, BastionStateDef stateDef, SkillOverridePriority priority = (SkillOverridePriority)3) { if (!ctrl.StanceSkillsStored) { ctrl.PrimaryStorage = locator.primary.skillDef; ctrl.UtilityStorage = locator.utility.skillDef; ctrl.SpecialStorage = locator.special.skillDef; ctrl.UtilityStockStored = locator.utility.stock; ctrl.UtilityStopwatchStored = locator.utility.rechargeStopwatch; ctrl.SpecialStockStored = locator.special.stock; ctrl.SpecialStopwatchStored = locator.special.rechargeStopwatch; ctrl.SkillsCapturedAt = Time.fixedTime; ctrl.StanceSkillsStored = true; } locator.primary.SetSkillInternal(stateDef.primary); bool num = locator.utility.cooldownRemaining > 0f; locator.utility.SetSkillInternal(stateDef.utility); if (num) { locator.utility.DeductStock(1); } bool num2 = locator.special.cooldownRemaining > 0f; locator.special.SetSkillInternal(stateDef.special); if (num2) { locator.special.DeductStock(1); } } public static void UnsetStateSkills(this EntityStateMachine machine, SkillLocator locator, BastionController ctrl, BastionStateDef stateDef, SkillOverridePriority priority = (SkillOverridePriority)3) { locator.primary.SetSkillInternal(ctrl.PrimaryStorage); locator.utility.SetSkillInternal(ctrl.UtilityStorage); locator.special.SetSkillInternal(ctrl.SpecialStorage); float num = Time.fixedTime - ctrl.SkillsCapturedAt; RestoreSkillState(locator.utility, ctrl.UtilityStockStored, ctrl.UtilityStopwatchStored + num); RestoreSkillState(locator.special, ctrl.SpecialStockStored, ctrl.SpecialStopwatchStored + num); ctrl.StanceSkillsStored = false; } private static void RestoreSkillState(GenericSkill skill, int stock, float stopwatch) { if (!Object.op_Implicit((Object)(object)skill.skillDef)) { return; } float finalRechargeInterval = skill.finalRechargeInterval; if (finalRechargeInterval > 0f) { while (stopwatch >= finalRechargeInterval && stock < skill.maxStock) { stock += skill.skillDef.rechargeStock; stopwatch -= finalRechargeInterval; } } skill.stock = Mathf.Clamp(stock, 0, skill.maxStock); skill.rechargeStopwatch = ((skill.stock < skill.maxStock) ? stopwatch : 0f); } public static void SetStateSkillOverride(EntityStateMachine machine, GenericSkill skill, SkillDef skillDef, SkillOverridePriority priority = (SkillOverridePriority)3) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) skill.SetSkillOverride((object)machine, skillDef, priority); } public static void UnSetStateSkillOverride(EntityStateMachine machine, GenericSkill skill, SkillDef skillDef, SkillOverridePriority priority = (SkillOverridePriority)3) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) skill.UnsetSkillOverride((object)machine, skillDef, priority); } } internal static class Skins { internal struct SkinDefInfo { internal SkinDef[] BaseSkins; internal Sprite Icon; internal string NameToken; internal UnlockableDef UnlockableDef; internal GameObject RootObject; internal RendererInfo[] RendererInfos; internal MeshReplacement[] MeshReplacements; internal GameObjectActivation[] GameObjectActivations; internal ProjectileGhostReplacement[] ProjectileGhostReplacements; internal MinionSkinReplacement[] MinionSkinReplacements; internal string Name; } [CompilerGenerated] private static class <>O { public static hook_Awake <0>__DoNothing; } internal static Sprite CreateSkinIcon(Color top, Color right, Color bottom, Color left) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0087: 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_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(128, 128, (TextureFormat)4, false); ((Texture)val).wrapMode = (TextureWrapMode)1; Color32[] array = (Color32[])(object)new Color32[16384]; for (int i = 0; i < 128; i++) { for (int j = 0; j < 128; j++) { float num = (float)j / 127f - 0.5f; float num2 = (float)i / 127f - 0.5f; Color val2 = ((num2 > Mathf.Abs(num)) ? top : ((num2 < 0f - Mathf.Abs(num)) ? bottom : ((num > 0f) ? right : left))); array[i * 128 + j] = Color32.op_Implicit(val2); } } val.SetPixels32(array); val.Apply(); return Sprite.Create(val, new Rect(0f, 0f, 128f, 128f), new Vector2(0.5f, 0.5f)); } internal static SkinDef CreateSkinDef(string skinName, Sprite skinIcon, RendererInfo[] defaultRendererInfos, GameObject root, UnlockableDef unlockableDef = null, MeshReplacement[] meshReplacements = null, GameObjectActivation[] gameObjectActivations = null) { //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Expected O, but got Unknown //IL_0195: 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_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Expected O, but got Unknown SkinDefInfo skinDefInfo = new SkinDefInfo { BaseSkins = Array.Empty(), GameObjectActivations = (GameObjectActivation[])(((object)gameObjectActivations) ?? ((object)new GameObjectActivation[0])), Icon = skinIcon, MeshReplacements = (MeshReplacement[])(((object)meshReplacements) ?? ((object)new MeshReplacement[0])), MinionSkinReplacements = (MinionSkinReplacement[])(object)new MinionSkinReplacement[0], Name = skinName, NameToken = skinName, ProjectileGhostReplacements = (ProjectileGhostReplacement[])(object)new ProjectileGhostReplacement[0], RendererInfos = (RendererInfo[])(object)new RendererInfo[defaultRendererInfos.Length], RootObject = root, UnlockableDef = unlockableDef }; object obj = <>O.<0>__DoNothing; if (obj == null) { hook_Awake val = DoNothing; <>O.<0>__DoNothing = val; obj = (object)val; } SkinDef.Awake += (hook_Awake)obj; SkinDef val2 = ScriptableObject.CreateInstance(); val2.baseSkins = skinDefInfo.BaseSkins; val2.icon = skinDefInfo.Icon; val2.unlockableDef = skinDefInfo.UnlockableDef; val2.rootObject = skinDefInfo.RootObject; defaultRendererInfos.CopyTo(skinDefInfo.RendererInfos, 0); val2.rendererInfos = skinDefInfo.RendererInfos; val2.gameObjectActivations = skinDefInfo.GameObjectActivations; val2.meshReplacements = skinDefInfo.MeshReplacements; val2.projectileGhostReplacements = skinDefInfo.ProjectileGhostReplacements; val2.minionSkinReplacements = skinDefInfo.MinionSkinReplacements; val2.nameToken = skinDefInfo.NameToken; ((Object)val2).name = skinDefInfo.Name; SkinDefParams val3 = ScriptableObject.CreateInstance(); ((Object)val3).name = skinDefInfo.Name + "Params"; val3.rendererInfos = skinDefInfo.RendererInfos; val3.gameObjectActivations = (GameObjectActivation[])(object)new GameObjectActivation[skinDefInfo.GameObjectActivations.Length]; for (int i = 0; i < skinDefInfo.GameObjectActivations.Length; i++) { val3.gameObjectActivations[i] = GameObjectActivation.op_Implicit(skinDefInfo.GameObjectActivations[i]); } val3.meshReplacements = (MeshReplacement[])(object)new MeshReplacement[skinDefInfo.MeshReplacements.Length]; for (int j = 0; j < skinDefInfo.MeshReplacements.Length; j++) { val3.meshReplacements[j] = MeshReplacement.op_Implicit(skinDefInfo.MeshReplacements[j]); } val3.projectileGhostReplacements = (ProjectileGhostReplacement[])(object)new ProjectileGhostReplacement[0]; val3.minionSkinReplacements = (MinionSkinReplacement[])(object)new MinionSkinReplacement[0]; val2.skinDefParams = val3; object obj2 = <>O.<0>__DoNothing; if (obj2 == null) { hook_Awake val4 = DoNothing; <>O.<0>__DoNothing = val4; obj2 = (object)val4; } SkinDef.Awake -= (hook_Awake)obj2; return val2; } private static void DoNothing(orig_Awake orig, SkinDef self) { } private static RendererInfo[] getRendererMaterials(RendererInfo[] defaultRenderers, params Material[] materials) { RendererInfo[] array = (RendererInfo[])(object)new RendererInfo[defaultRenderers.Length]; defaultRenderers.CopyTo(array, 0); for (int i = 0; i < array.Length; i++) { try { array[i].defaultMaterial = materials[i]; } catch { Log.Error("error adding skin rendererinfo material. make sure you're not passing in too many"); } } return array; } internal static MeshReplacement[] getMeshReplacements(AssetBundle assetBundle, RendererInfo[] defaultRendererInfos, params string[] meshes) { //IL_0017: 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) List list = new List(); for (int i = 0; i < defaultRendererInfos.Length; i++) { if (!string.IsNullOrEmpty(meshes[i])) { list.Add(new MeshReplacement { renderer = defaultRendererInfos[i].renderer, mesh = assetBundle.LoadAsset(meshes[i]) }); } } return list.ToArray(); } } internal static class Tokens { public const string agilePrefix = "Agile."; public static string DamageText(string text) { return "" + text + ""; } public static string DamageValueText(float value) { return $"{value * 100f}% damage"; } public static string UtilityText(string text) { return "" + text + ""; } public static string RedText(string text) { return HealthText(text); } public static string HealthText(string text) { return "" + text + ""; } public static string KeywordText(string keyword, string sub) { return "" + keyword + "" + sub + ""; } public static string ScepterDescription(string desc) { return "\nSCEPTER: " + desc + ""; } public static string GetAchievementNameToken(string identifier) { return "ACHIEVEMENT_" + identifier.ToUpperInvariant() + "_NAME"; } public static string GetAchievementDescriptionToken(string identifier) { return "ACHIEVEMENT_" + identifier.ToUpperInvariant() + "_DESCRIPTION"; } } } namespace BastionMod.Modules.Characters { public class BodyInfo { public string bodyName = ""; public string bodyNameToken = ""; public string subtitleNameToken = ""; public string bodyNameToClone = "Commando"; public Color bodyColor = Color.white; public Texture characterPortrait; public float sortPosition = 100f; public GameObject crosshair; public GameObject podPrefab; public float maxHealth = 100f; public float healthRegen = 1f; public float armor; public float shield; public int jumpCount = 1; public float damage = 12f; public float attackSpeed = 1f; public float crit = 1f; public float moveSpeed = 7f; public float acceleration = 80f; public float jumpPower = 15f; public bool autoCalculateLevelStats = true; public float healthGrowth = 30.000002f; public float regenGrowth = 0.2f; public float armorGrowth; public float shieldGrowth; public float damageGrowth = 2.4f; public float attackSpeedGrowth; public float critGrowth; public float moveSpeedGrowth; public float jumpPowerGrowth; public Vector3 aimOriginPosition = new Vector3(0f, 1.6f, 0f); public Vector3 modelBasePosition = new Vector3(0f, -0.92f, 0f); public Vector3 cameraPivotPosition = new Vector3(0f, 0.8f, 0f); public float cameraParamsVerticalOffset = 1.37f; public float cameraParamsDepth = -10f; private CharacterCameraParams _cameraParams; public CharacterCameraParams cameraParams { get { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_cameraParams == (Object)null) { _cameraParams = ScriptableObject.CreateInstance(); _cameraParams.data.minPitch = BlendableFloat.op_Implicit(-70f); _cameraParams.data.maxPitch = BlendableFloat.op_Implicit(70f); _cameraParams.data.wallCushion = BlendableFloat.op_Implicit(0.1f); _cameraParams.data.pivotVerticalOffset = BlendableFloat.op_Implicit(cameraParamsVerticalOffset); _cameraParams.data.idealLocalCameraPos = BlendableVector3.op_Implicit(new Vector3(0f, 0f, cameraParamsDepth)); } return _cameraParams; } set { _cameraParams = value; } } } public abstract class CharacterBase where T : CharacterBase, new() { public abstract string assetBundleName { get; } public abstract string bodyName { get; } public abstract string modelPrefabName { get; } public abstract BodyInfo bodyInfo { get; } public virtual CustomRendererInfo[] customRendererInfos { get; } public virtual ItemDisplaysBase itemDisplays { get; } public static T instance { get; private set; } public abstract AssetBundle assetBundle { get; protected set; } public abstract GameObject bodyPrefab { get; protected set; } public abstract CharacterBody prefabCharacterBody { get; protected set; } public abstract GameObject characterModelObject { get; protected set; } public abstract CharacterModel prefabCharacterModel { get; protected set; } public virtual void Initialize() { instance = this as T; assetBundle = Asset.LoadAssetBundle(assetBundleName); } public virtual void InitializeCharacter() { InitializeCharacterBodyPrefab(); InitializeItemDisplays(); } protected virtual void InitializeCharacterBodyPrefab() { characterModelObject = Prefabs.LoadCharacterModel(assetBundle, modelPrefabName); bodyPrefab = Prefabs.CreateBodyPrefab(characterModelObject, bodyInfo); prefabCharacterBody = bodyPrefab.GetComponent(); prefabCharacterModel = Prefabs.SetupCharacterModel(bodyPrefab, customRendererInfos); } public virtual void InitializeItemDisplays() { ItemDisplayRuleSet val = ScriptableObject.CreateInstance(); ((Object)val).name = "idrs" + bodyName; prefabCharacterModel.itemDisplayRuleSet = val; if (itemDisplays != null) { ItemDisplays.queuedDisplays++; ContentManager.onContentPacksAssigned += SetItemDisplays; } } public void SetItemDisplays(ReadOnlyArray obj) { itemDisplays.SetItemDisplays(prefabCharacterModel.itemDisplayRuleSet); } public abstract void InitializeEntityStateMachines(); public abstract void InitializeSkills(); public abstract void InitializeSkins(); public abstract void InitializeCharacterMaster(); } public abstract class ItemDisplaysBase { public void SetItemDisplays(ItemDisplayRuleSet itemDisplayRuleSet) { List list = new List(); ItemDisplays.LazyInit(); SetItemDisplayRules(list); itemDisplayRuleSet.keyAssetRuleGroups = list.ToArray(); ItemDisplays.DisposeWhenDone(); } protected abstract void SetItemDisplayRules(List itemDisplayRules); } public abstract class SurvivorBase : CharacterBase where T : SurvivorBase, new() { public abstract string masterName { get; } public abstract string displayPrefabName { get; } public abstract string survivorTokenPrefix { get; } public abstract UnlockableDef characterUnlockableDef { get; } public abstract GameObject displayPrefab { get; protected set; } public override void InitializeCharacter() { base.InitializeCharacter(); } protected virtual void InitializeDisplayPrefab() { displayPrefab = Prefabs.CreateDisplayPrefab(assetBundle, displayPrefabName, bodyPrefab); } protected virtual void InitializeSurvivor() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) Content.CreateSurvivor(bodyPrefab, displayPrefab, bodyInfo.bodyColor, survivorTokenPrefix, characterUnlockableDef, bodyInfo.sortPosition); } protected virtual void AddCssPreviewSkill(int indexFromEditor, SkillFamily skillFamily, SkillDef skillDef) { CharacterSelectSurvivorPreviewDisplayController component = displayPrefab.GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { Log.Error("trying to add skillChangeResponse to null CharacterSelectSurvivorPreviewDisplayController.\nMake sure you created one on your Display prefab in editor"); return; } component.skillChangeResponses[indexFromEditor].triggerSkillFamily = skillFamily; component.skillChangeResponses[indexFromEditor].triggerSkill = skillDef; } protected virtual void AddCssPreviewSkin(int indexFromEditor, SkinDef skinDef) { CharacterSelectSurvivorPreviewDisplayController component = displayPrefab.GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { Log.Error("trying to add skinChangeResponse to null CharacterSelectSurvivorPreviewDisplayController.\nMake sure you created one on your Display prefab in editor"); } else { component.skinChangeResponses[indexFromEditor].triggerSkin = skinDef; } } protected virtual void FinalizeCSSPreviewDisplayController() { //IL_005a: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)displayPrefab)) { return; } CharacterSelectSurvivorPreviewDisplayController component = displayPrefab.GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { return; } component.bodyPrefab = bodyPrefab; List list = new List(); for (int i = 0; i < component.skillChangeResponses.Length; i++) { if ((Object)(object)component.skillChangeResponses[i].triggerSkillFamily != (Object)null) { list.Add(component.skillChangeResponses[i]); } } component.skillChangeResponses = list.ToArray(); } } } namespace BastionMod.Modules.BaseStates { public abstract class BaseMeleeAttack : BaseSkillState, IStepSetter { public int swingIndex; protected string hitboxGroupName = "SwordGroup"; protected DamageTypeCombo damageType = DamageTypeCombo.op_Implicit((DamageType)0); protected float damageCoefficient = 3.5f; protected float procCoefficient = 1f; protected float pushForce = 300f; protected Vector3 bonusForce = Vector3.zero; protected float baseDuration = 1f; protected float attackStartPercentTime = 0.2f; protected float attackEndPercentTime = 0.4f; protected float earlyExitPercentTime = 0.4f; protected float hitStopDuration = 0.012f; protected float attackRecoil = 0.75f; protected float hitHopVelocity = 4f; protected bool doHitHop = true; protected string swingSoundString = ""; protected string hitSoundString = ""; protected string muzzleString = "SwingCenter"; protected string playbackRateParam = "Slash.playbackRate"; protected GameObject swingEffectPrefab; protected GameObject hitEffectPrefab; protected NetworkSoundEventIndex impactSound = (NetworkSoundEventIndex)(-1); protected OverlapAttack attack; public float duration; protected bool hasFired; private float hitPauseTimer; protected bool inHitPause; private bool hasHopped; protected float stopwatch; protected Animator animator; private HitStopCachedState hitStopCachedState; private Vector3 storedVelocity; public override void OnEnter() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Expected O, but got Unknown //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_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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; animator = ((EntityState)this).GetModelAnimator(); ((BaseState)this).StartAimMode(0.5f + duration, false); PlayAttackAnimation(); attack = new OverlapAttack(); attack.damageType = damageType; attack.attacker = ((EntityState)this).gameObject; attack.inflictor = ((EntityState)this).gameObject; attack.teamIndex = ((BaseState)this).GetTeam(); attack.damage = damageCoefficient * ((BaseState)this).damageStat; attack.procCoefficient = procCoefficient; attack.hitEffectPrefab = hitEffectPrefab; attack.forceVector = bonusForce; attack.pushAwayForce = pushForce; attack.hitBoxGroup = ((BaseState)this).FindHitBoxGroup(hitboxGroupName); attack.isCrit = ((BaseState)this).RollCrit(); attack.impactSound = impactSound; ModifyOverlapAttack(attack); } protected virtual void ModifyOverlapAttack(OverlapAttack attack) { } protected virtual void PlayAttackAnimation() { ((EntityState)this).PlayCrossfade("Gesture, Override", "Slash" + (1 + swingIndex), playbackRateParam, duration, 0.05f); } public override void OnExit() { if (inHitPause) { RemoveHitstop(); } ((EntityState)this).OnExit(); } protected virtual void PlaySwingEffect() { EffectManager.SimpleMuzzleFlash(swingEffectPrefab, ((EntityState)this).gameObject, muzzleString, false); } protected virtual void OnHitEnemyAuthority() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown Util.PlaySound(hitSoundString, ((EntityState)this).gameObject); if (!hasHopped) { if (Object.op_Implicit((Object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.isGrounded && hitHopVelocity > 0f) { ((BaseState)this).SmallHop(((EntityState)this).characterMotor, hitHopVelocity); } hasHopped = true; } ApplyHitstop(); } protected void ApplyHitstop() { //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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) if (!inHitPause && hitStopDuration > 0f) { storedVelocity = ((EntityState)this).characterMotor.velocity; hitStopCachedState = ((BaseState)this).CreateHitStopCachedState(((EntityState)this).characterMotor, animator, playbackRateParam); hitPauseTimer = hitStopDuration / ((BaseState)this).attackSpeedStat; inHitPause = true; } } private void FireAttack() { if (((EntityState)this).isAuthority && attack.Fire((List)null)) { OnHitEnemyAuthority(); } } private void EnterAttack() { hasFired = true; Util.PlayAttackSpeedSound(swingSoundString, ((EntityState)this).gameObject, ((BaseState)this).attackSpeedStat); PlaySwingEffect(); if (((EntityState)this).isAuthority) { ((BaseState)this).AddRecoil(-1f * attackRecoil, -2f * attackRecoil, -0.5f * attackRecoil, 0.5f * attackRecoil); } } public override void FixedUpdate() { //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Expected O, but got Unknown //IL_0067: 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) ((EntityState)this).FixedUpdate(); hitPauseTimer -= Time.deltaTime; if (hitPauseTimer <= 0f && inHitPause) { RemoveHitstop(); } if (!inHitPause) { stopwatch += Time.deltaTime; } else { if (Object.op_Implicit((Object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.velocity = Vector3.zero; } if (Object.op_Implicit((Object)(object)animator)) { animator.SetFloat(playbackRateParam, 0f); } } bool flag = stopwatch >= duration * attackStartPercentTime; bool flag2 = stopwatch >= duration * attackEndPercentTime; if ((flag && !flag2) || (flag && flag2 && !hasFired)) { if (!hasFired) { EnterAttack(); } FireAttack(); } if (stopwatch >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } private void RemoveHitstop() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).ConsumeHitStopCachedState(hitStopCachedState, ((EntityState)this).characterMotor, animator); inHitPause = false; ((EntityState)this).characterMotor.velocity = storedVelocity; } public override InterruptPriority GetMinimumInterruptPriority() { if (!(stopwatch >= duration * earlyExitPercentTime)) { return (InterruptPriority)1; } return (InterruptPriority)0; } public override void OnSerialize(NetworkWriter writer) { ((BaseSkillState)this).OnSerialize(writer); writer.Write(swingIndex); } public override void OnDeserialize(NetworkReader reader) { ((BaseSkillState)this).OnDeserialize(reader); swingIndex = reader.ReadInt32(); } public void SetStep(int i) { swingIndex = i; } } public abstract class BaseTimedSkillState : BaseSkillState { protected float duration; protected float castStartTime; protected float castEndTime; protected bool hasFired; protected bool isFiring; protected bool hasExited; public abstract float TimedBaseDuration { get; } public abstract float TimedBaseCastStartPercentTime { get; } public virtual float TimedBaseCastEndPercentTime => 1f; public override void OnEnter() { InitDurationValues(); ((BaseState)this).OnEnter(); } protected virtual void InitDurationValues() { duration = TimedBaseDuration / ((BaseState)this).attackSpeedStat; castStartTime = TimedBaseCastStartPercentTime * duration; castEndTime = TimedBaseCastEndPercentTime * duration; } protected virtual void OnCastEnter() { } protected virtual void OnCastFixedUpdate() { } protected virtual void OnCastUpdate() { } protected virtual void OnCastExit() { } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); bool flag = ((EntityState)this).fixedAge >= castStartTime; bool flag2 = ((EntityState)this).fixedAge >= castEndTime; isFiring = false; if ((flag && !flag2) || (flag && flag2 && !hasFired)) { isFiring = true; OnCastFixedUpdate(); if (!hasFired) { OnCastEnter(); hasFired = true; } } if (flag2 && !hasExited) { hasExited = true; OnCastExit(); } if (((EntityState)this).fixedAge > duration) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void Update() { ((EntityState)this).Update(); if (isFiring) { OnCastUpdate(); } } } public class ExampleDelayedSkillState : BaseTimedSkillState { public override float TimedBaseDuration => 1.5f; public override float TimedBaseCastStartPercentTime => 0.2f; protected override void OnCastEnter() { } } public class ExampleTimedSkillState : BaseTimedSkillState { public override float TimedBaseDuration => 1.5f; public override float TimedBaseCastStartPercentTime => 0.2f; public override float TimedBaseCastEndPercentTime => 0.9f; protected override void OnCastEnter() { } protected override void OnCastFixedUpdate() { } protected override void OnCastExit() { } } } namespace BastionMod.Modules.Achievements { public abstract class BaseMasteryAchievement : BaseAchievement { public abstract string RequiredCharacterBody { get; } public abstract float RequiredDifficultyCoefficient { get; } public override BodyIndex LookUpRequiredBodyIndex() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return BodyCatalog.FindBodyIndex(RequiredCharacterBody); } public override void OnBodyRequirementMet() { ((BaseAchievement)this).OnBodyRequirementMet(); Run.onClientGameOverGlobal += OnClientGameOverGlobal; } public override void OnBodyRequirementBroken() { Run.onClientGameOverGlobal -= OnClientGameOverGlobal; ((BaseAchievement)this).OnBodyRequirementBroken(); } private void OnClientGameOverGlobal(Run run, RunReport runReport) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: 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_0060: Invalid comparison between Unknown and I4 //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Invalid comparison between Unknown and I4 if (!Object.op_Implicit((Object)(object)runReport.gameEnding) || !runReport.gameEnding.isWin) { return; } DifficultyIndex val = runReport.ruleBook.FindDifficulty(); DifficultyDef difficultyDef = DifficultyCatalog.GetDifficultyDef(val); if (difficultyDef != null) { bool num = difficultyDef.countsAsHardMode && difficultyDef.scalingValue >= RequiredDifficultyCoefficient; bool flag = difficultyDef.nameToken == "INFERNO_NAME"; bool flag2 = (int)val >= 3 && (int)val <= 10; if (num || flag || flag2) { ((BaseAchievement)this).Grant(); } } } } } namespace BastionMod.Characters.Survivors.Bastion.Achievements { [RegisterAchievement("HASTEREAPR_BASTION_BOMBARDMULTI_ACHIEVEMENT", "HASTEREAPR_BASTION_BOMBARDMULTI_UNLOCKABLE", null, 10u, typeof(BombardServerMultikill))] internal class BombardMultikill : BaseAchievement { private class BombardServerMultikill : BaseServerAchievement { public override void OnInstall() { ((BaseServerAchievement)this).OnInstall(); GlobalEventManager.onCharacterDeathGlobal += GlobalEventManager_onCharacterDeathGlobal; } private void GlobalEventManager_onCharacterDeathGlobal(DamageReport damageReport) { CharacterBody currentBody = ((BaseServerAchievement)this).GetCurrentBody(); if (Object.op_Implicit((Object)(object)currentBody) && requirement <= currentBody.multiKillCount && DoesDamageQualify(damageReport)) { ((BaseServerAchievement)this).Grant(); ((BaseServerAchievement)this).ServerTryToCompleteActivity(); } } public override void OnUninstall() { GlobalEventManager.onCharacterDeathGlobal -= GlobalEventManager_onCharacterDeathGlobal; ((BaseServerAchievement)this).OnUninstall(); } private bool DoesDamageQualify(DamageReport damageReport) { return (Object)(object)damageReport.damageInfo.inflictor.GetComponent() != (Object)null; } } public const string IDENTIFIER = "HASTEREAPR_BASTION_BOMBARDMULTI_ACHIEVEMENT"; public const string UNLOCKABLE_IDENTIFIER = "HASTEREAPR_BASTION_BOMBARDMULTI_UNLOCKABLE"; private static readonly int requirement = 5; public override BodyIndex LookUpRequiredBodyIndex() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) return BodyCatalog.FindBodyIndex("BastionRobot"); } public override void OnBodyRequirementMet() { ((BaseAchievement)this).OnBodyRequirementMet(); ((BaseAchievement)this).SetServerTracked(true); } public override void OnBodyRequirementBroken() { ((BaseAchievement)this).SetServerTracked(false); ((BaseAchievement)this).OnBodyRequirementBroken(); } } }