using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using EntityStates; using EntityStates.ClayGrenadier; using EntityStates.Merc; using Grumpy; using KinematicCharacterController; using R2API; using R2API.Utils; using Rewired.ComponentControls.Effects; using RoR2; using RoR2.ExpansionManagement; using RoR2.Navigation; using RoR2.Projectile; using RoR2.Skills; using RoR2.UI; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Networking; using UnityEngine.Rendering; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")] [assembly: AssemblyCompany("PlayableApothecary")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("PlayableApothecary")] [assembly: AssemblyTitle("PlayableApothecary")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace PlayableApothecary; internal class Assets { public static AssetBundle MainAssetBundle; public static T Load(string name) where T : Object { return MainAssetBundle.LoadAsset(name); } public static void PopulateAssets() { Assembly executingAssembly = Assembly.GetExecutingAssembly(); if ((Object)(object)MainAssetBundle == (Object)null) { using (Stream stream = executingAssembly.GetManifestResourceStream("PlayableApothecary.AssetBundle." + "PlayableApothecary".ToLower() + "assets")) { MainAssetBundle = AssetBundle.LoadFromStream(stream); } } } } internal class Behaviour : HuntressTracker { public SkillDef secondary1; public SkillDef secondary2; private NetworkedBodyAttachment attachment; private void Start() { ((HuntressTracker)this).Start(); if (NetworkServer.active) { attachment = Object.Instantiate(Prefabs.urnAttachmentPrefab).GetComponent(); attachment.AttachToGameObjectAndSpawn(((Component)this).gameObject, (string)null); } } private void FixedUpdate() { ((HuntressTracker)this).FixedUpdate(); if (Input.GetKeyDown((KeyCode)108)) { MainPlugin.config.Reload(); Chat.AddMessage("Config reloaded."); base.maxTrackingDistance = MainPlugin.primary2Range.Value; } } private void OnDisable() { if (Object.op_Implicit((Object)(object)attachment)) { Object.Destroy((Object)(object)((Component)attachment).gameObject); } ((HuntressTracker)this).OnDisable(); } } internal class CharacterSelectBehaviour : MonoBehaviour { private BodyIndex bodyIndex; private CharacterSelectSurvivorPreviewDisplayController select; private Loadout currentLoadout = new Loadout(); private uint lastPrimaryIndex; private uint lastSecondaryIndex; private bool set; private int primarySlotIndex = 0; private int secondarySlotIndex = 1; private void Start() { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0076: 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) currentLoadout = Loadout.RequestInstance(); select = ((Component)this).GetComponentInParent(); if (Object.op_Implicit((Object)(object)select)) { NetworkUser.onLoadoutChangedGlobal += OnLoadoutChangedGlobal; select.networkUser.networkLoadout.CopyLoadout(currentLoadout); bodyIndex = BodyCatalog.FindBodyIndex("PlayableApothecaryBody"); lastPrimaryIndex = currentLoadout.bodyLoadoutManager.GetSkillVariant(bodyIndex, primarySlotIndex); lastSecondaryIndex = currentLoadout.bodyLoadoutManager.GetSkillVariant(bodyIndex, secondarySlotIndex); } } private void OnLoadoutChangedGlobal(NetworkUser changedNetworkUser) { //IL_0051: 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_00cb: 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) if ((Object)(object)changedNetworkUser != (Object)(object)select.networkUser) { return; } if (set) { set = false; return; } changedNetworkUser.networkLoadout.CopyLoadout(currentLoadout); uint skillVariant = currentLoadout.bodyLoadoutManager.GetSkillVariant(bodyIndex, primarySlotIndex); uint num = currentLoadout.bodyLoadoutManager.GetSkillVariant(bodyIndex, secondarySlotIndex); if (lastPrimaryIndex != skillVariant) { Debug.LogWarning((object)"primary changed"); lastPrimaryIndex = skillVariant; if (skillVariant == 1 && num == 1) { num = 0u; lastSecondaryIndex = 0u; currentLoadout.bodyLoadoutManager.SetSkillVariant(bodyIndex, secondarySlotIndex, lastSecondaryIndex); set = true; } } if (lastSecondaryIndex != num) { Debug.LogWarning((object)"secondary changed"); lastSecondaryIndex = num; if (skillVariant == 1 && num == 1) { lastPrimaryIndex = 0u; currentLoadout.bodyLoadoutManager.SetSkillVariant(bodyIndex, primarySlotIndex, lastPrimaryIndex); set = true; } } if (set) { changedNetworkUser.localUser.userProfile.SetLoadout(currentLoadout); } } private void OnDisable() { if (Object.op_Implicit((Object)(object)select)) { NetworkUser.onLoadoutChangedGlobal -= OnLoadoutChangedGlobal; } } } internal class DisplayBehaviour : MonoBehaviour { private Animator animator; private void Awake() { animator = ((Component)this).GetComponent(); } private void Start() { animator.SetBool("isGrounded", true); } } internal class UrnTether : MonoBehaviour { private TetherVfxOrigin tetherVfxOrigin; private NetworkedBodyAttachment attachment; private SphereSearch sphereSearch = new SphereSearch(); private float stopwatch = 1f; private List hurtboxes = new List(); private List transforms = new List(); private void Awake() { attachment = ((Component)this).GetComponent(); tetherVfxOrigin = ((Component)this).GetComponent(); } private void FixedUpdate() { if (Object.op_Implicit((Object)(object)attachment.attachedBody)) { stopwatch += Time.fixedDeltaTime; if (stopwatch >= 1f / MainPlugin.passiveTicks.Value / attachment.attachedBody.attackSpeed) { stopwatch = 0f; Tick(); } } } private void Tick() { hurtboxes.Clear(); transforms.Clear(); SearchForTargets(hurtboxes); if (hurtboxes.Count > 0) { DamageTargets(); } tetherVfxOrigin.SetTetheredTransforms(transforms); } protected void SearchForTargets(List dest) { //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_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_0048: 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) sphereSearch.mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask; sphereSearch.origin = ((Component)this).transform.position; sphereSearch.radius = MainPlugin.passiveRadius.Value; sphereSearch.queryTriggerInteraction = (QueryTriggerInteraction)0; sphereSearch.RefreshCandidates(); sphereSearch.FilterCandidatesByHurtBoxTeam(TeamMask.GetEnemyTeams(attachment.attachedBody.teamComponent.teamIndex)); sphereSearch.OrderCandidatesByDistance(); sphereSearch.FilterCandidatesByDistinctHurtBoxEntities(); sphereSearch.FilterByLiveEntities(); sphereSearch.GetHurtBoxes(dest); sphereSearch.ClearCandidates(); } private void DamageTargets() { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Expected O, but got Unknown //IL_008a: 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_00d0: 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_00dc: 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_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_010f: 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_014d: Unknown result type (might be due to invalid IL or missing references) foreach (HurtBox hurtbox in hurtboxes) { CharacterBody body = hurtbox.healthComponent.body; Transform val = (((Object)(object)body != (Object)null) ? body.coreTransform : null) ?? ((Component)hurtbox).transform; transforms.Add(val); if (NetworkServer.active) { DamageInfo val2 = new DamageInfo(); val2.attacker = attachment.attachedBodyObject; val2.inflictor = ((Component)this).gameObject; val2.position = val.position; val2.crit = attachment.attachedBody.RollCrit(); val2.damage = attachment.attachedBody.damage * MainPlugin.passiveDamageCoefficient.Value; val2.damageColorIndex = (DamageColorIndex)0; val2.force = Vector3.zero; val2.procCoefficient = 1f; val2.damageType = DamageTypeCombo.Generic | DamageTypeCombo.op_Implicit((DamageType)512); val2.procChainMask = default(ProcChainMask); hurtbox.healthComponent.TakeDamage(val2); attachment.attachedBody.healthComponent.Heal(val2.damage * MainPlugin.passiveHealCoefficient.Value, default(ProcChainMask), true); } } } private void OnDisable() { } } internal class CharacterBodySetup { internal static GameObject baseBody = Prefabs.Load("RoR2/DLC1/ClayGrenadier/ClayGrenadierBody.prefab"); internal static GameObject baseMaster = Prefabs.Load("RoR2/DLC1/ClayGrenadier/ClayGrenadierMaster.prefab"); internal const string SURVIVORNAME = "Clay Apothecary"; internal const string SURVIVORNAMEKEY = "PLAYABLEAPOTHECARY_"; internal static Color characterColor = Color32.op_Implicit(new Color32((byte)51, (byte)23, (byte)23, byte.MaxValue)); internal static void CreateCharacterBodies() { RegisterStates(); CreateSurvivorPrefab(); } internal static void CreateSurvivorPrefab() { //IL_0006: 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_0150: Expected O, but got Unknown //IL_01dd: 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_01f9: 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_0219: 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_0258: Unknown result type (might be due to invalid IL or missing references) GameObject val = CreateBodyPrefab("Clay Apothecary", characterColor, 200f); val.GetComponent().canBeHitStunned = false; val.GetComponent().requireEntitlementIfPlayerControlled = true; Behaviour behaviour = val.AddComponent(); ((HuntressTracker)behaviour).maxTrackingDistance = MainPlugin.primary2Range.Value; CharacterBody component = val.GetComponent(); component.mainRootSpeed = 0f; component.baseMaxHealth = 160f; component.levelMaxHealth = 48f; component.baseRegen = 2.5f; component.levelRegen = 0.5f; component.baseMaxShield = 0f; component.levelMaxShield = 0f; component.baseMoveSpeed = 7f; component.levelMoveSpeed = 0f; component.baseAcceleration = 110f; component.baseJumpPower = 15f; component.levelJumpPower = 0f; component.baseDamage = 15f; component.levelDamage = 3f; component.baseAttackSpeed = 1f; component.levelAttackSpeed = 0f; component.baseCrit = 1f; component.levelCrit = 0f; component.baseArmor = 20f; component.levelArmor = 0f; component.baseJumpCount = 1; component.sprintingSpeedMultiplier = 1.45f; component.spreadBloomDecayTime = 0.7f; component.spreadBloomCurve = new AnimationCurve(); component.spreadBloomCurve.AddKey(0.3506f, 0.0087f); component.spreadBloomCurve.AddKey(1f, 2f); val.GetComponent().health = component.baseMaxHealth; CapsuleCollider component2 = val.GetComponent(); component2.radius = 0.75f; component2.height = 1.82f; KinematicCharacterMotor component3 = val.GetComponent(); component3.CapsuleRadius = component2.radius; component3.CapsuleHeight = component2.height; ModelLocator component4 = val.GetComponent(); component4.modelBaseTransform.localPosition = Vector3.up * -1f; component4.modelBaseTransform.localScale = Vector3.one; Transform modelTransform = component4.modelTransform; modelTransform.localScale = Vector3.one * 2f; ((Component)modelTransform).GetComponent().footstepDustPrefab = Prefabs.Load("RoR2/Base/Common/VFX/GenericFootstepDust.prefab"); Transform val2 = val.transform.Find("AimOrigin"); val2.localPosition = Vector3.up * 0.7f; CreateSurvivorDef(val); PassiveSetup(val); PrimarySetup(val); SecondarySetup(val); UtilitySetup(val); SpecialSetup(val); } internal static void CreateSurvivorDef(GameObject characterPrefab) { //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) CharacterBody component = characterPrefab.GetComponent(); string text = ((Object)characterPrefab).name.Replace("Body", ""); string text2 = text.Replace(" ", "").ToUpper(); string text3 = " \r\n\r\n< ! > \r\n\r\n< ! > \r\n\r\n< ! > \r\n\r\n< ! > \r\n\r\n"; string text4 = "..and so it left."; string text5 = "..and so it vanished."; string text6 = ""; LanguageAPI.Add("PLAYABLEAPOTHECARY_" + text2 + "_DESCRIPTION", text3); LanguageAPI.Add("PLAYABLEAPOTHECARY_" + text2 + "_SUBTITLE", ""); LanguageAPI.Add("PLAYABLEAPOTHECARY_" + text2 + "_OUTRO", text4); LanguageAPI.Add("PLAYABLEAPOTHECARY_" + text2 + "_FAIL", text5); GameObject val = PrefabAPI.InstantiateClone(((Component)characterPrefab.GetComponent().modelBaseTransform).gameObject, text + "Display", false); val.AddComponent().bodyPrefab = characterPrefab; val.AddComponent(); HurtBoxGroup componentInChildren = val.GetComponentInChildren(); ((Component)componentInChildren).gameObject.AddComponent(); Object.Destroy((Object)(object)componentInChildren); SurvivorDef val2 = ScriptableObject.CreateInstance(); val2.cachedName = "PLAYABLEAPOTHECARY_" + text2 + "_NAME"; val2.unlockableDef = null; val2.descriptionToken = "PLAYABLEAPOTHECARY_" + text2 + "_DESCRIPTION"; val2.primaryColor = component.bodyColor; val2.bodyPrefab = characterPrefab; val2.displayPrefab = val; val2.outroFlavorToken = "PLAYABLEAPOTHECARY_" + text2 + "_OUTRO"; val2.desiredSortPosition = 22f; val2.mainEndingEscapeFailureFlavorToken = "PLAYABLEAPOTHECARY_" + text2 + "_FAIL"; ContentAddition.AddSurvivorDef(val2); GameObject val3 = PrefabAPI.InstantiateClone(baseMaster, text + "Master", true); ContentAddition.AddMaster(val3); CharacterMaster component2 = val3.GetComponent(); component2.bodyPrefab = characterPrefab; } internal static void RegisterStates() { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) bool flag = default(bool); ContentAddition.AddEntityState(ref flag); ContentAddition.AddEntityState(ref flag); ContentAddition.AddEntityState(ref flag); ContentAddition.AddEntityState(ref flag); ContentAddition.AddEntityState(ref flag); ContentAddition.AddEntityState(ref flag); ContentAddition.AddEntityState(ref flag); ContentAddition.AddEntityState(ref flag); ContentAddition.AddEntityState(ref flag); } internal static void PassiveSetup(GameObject characterPrefab) { SkillLocator component = characterPrefab.GetComponent(); LanguageAPI.Add("PLAYABLEAPOTHECARY__PASSIVE_NAME", "Mired Urn"); LanguageAPI.Add("PLAYABLEAPOTHECARY__PASSIVE_DESCRIPTION", "Tar. The nearest enemies to you will be tethered to you, dealing " + MainPlugin.passiveDamageCoefficient.Value * 100f + "% damage, and healing you for " + MainPlugin.passiveHealCoefficient.Value * 100f + "% of the damage dealt."); component.passiveSkill.enabled = true; component.passiveSkill.skillNameToken = "PLAYABLEAPOTHECARY__PASSIVE_NAME"; component.passiveSkill.skillDescriptionToken = "PLAYABLEAPOTHECARY__PASSIVE_DESCRIPTION"; component.passiveSkill.icon = Prefabs.Load("RoR2/Base/Treebot/TreebotBodyFireFlower2.asset").icon; } internal static void PrimarySetup(GameObject characterPrefab) { SkillLocator component = characterPrefab.GetComponent(); string text = "_M1"; LanguageAPI.Add("PLAYABLEAPOTHECARY_" + text, "Tar Beam"); LanguageAPI.Add("PLAYABLEAPOTHECARY_" + text + "_DESCRIPTION", "Tar. Fire a beam for " + MainPlugin.primary2DamageCoefficient.Value * 100f + "% damage, chaining on up to " + MainPlugin.primary2MaxTargets.Value + " targets, reducing the damage by " + MainPlugin.primary2DamageReduction.Value * 100f + "% for each subsequent target, and heals for " + MainPlugin.primary2Heal.Value * 100f + "% of the damage dealt."); SkillDef skill = Utils.NewSkillDef(typeof(Primary), "Weapon", 0, 0f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: true, (InterruptPriority)0, isCombatSkill: true, mustKeyPress: false, cancelSprintingOnActivation: false, 0, 0, 0, Prefabs.Load("RoR2/DLC1/VoidSurvivor/FireCorruptBeam.asset").icon, "PLAYABLEAPOTHECARY_" + text, "PLAYABLEAPOTHECARY_" + text + "_DESCRIPTION", Array.Empty()); component.primary = Utils.NewGenericSkill(characterPrefab, skill); text = "_M1_ALT"; LanguageAPI.Add("PLAYABLEAPOTHECARY_" + text, "Tar Spikes"); LanguageAPI.Add("PLAYABLEAPOTHECARY_" + text + "_DESCRIPTION", "Tar. Fire a spike for " + MainPlugin.primaryDamageCoefficient.Value * 100f + "% damage."); SkillDef skillDef = Utils.NewSkillDef(typeof(PrimarySpikes), "Weapon", 0, 0f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: true, (InterruptPriority)0, isCombatSkill: true, mustKeyPress: false, cancelSprintingOnActivation: false, 0, 0, 0, Prefabs.Load("RoR2/Base/Commando/CommandoBodyFirePistol.asset").icon, "PLAYABLEAPOTHECARY_" + text, "PLAYABLEAPOTHECARY_" + text + "_DESCRIPTION", Array.Empty()); Utils.AddAlt(component.primary.skillFamily, skillDef); } internal static void SecondarySetup(GameObject characterPrefab) { Behaviour component = characterPrefab.GetComponent(); SkillLocator component2 = characterPrefab.GetComponent(); string text = "_M2"; LanguageAPI.Add("PLAYABLEAPOTHECARY_" + text, "Tar Slam"); LanguageAPI.Add("PLAYABLEAPOTHECARY_" + text + "_DESCRIPTION", "Tar. Slam the ground, dealing " + MainPlugin.secondaryDamageCoefficient.Value * 100f + "% damage, and fire a mortar at the target for " + MainPlugin.secondaryProjDamageCoefficient.Value * 100f + "% damage."); SkillDef val = Utils.NewSkillDef(typeof(Secondary), "Weapon", 1, MainPlugin.secondaryCooldown.Value, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)1, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: false, 1, 1, 1, Prefabs.Load("RoR2/Base/Croco/CrocoChainableLeap.asset").icon, "PLAYABLEAPOTHECARY_" + text, "PLAYABLEAPOTHECARY_" + text + "_DESCRIPTION", Array.Empty()); component2.secondary = Utils.NewGenericSkill(characterPrefab, val); component.secondary1 = val; text = "_M2_ALT"; LanguageAPI.Add("PLAYABLEAPOTHECARY_" + text, "Tar Spikes"); LanguageAPI.Add("PLAYABLEAPOTHECARY_" + text + "_DESCRIPTION", "Tar. Fire a spike for " + MainPlugin.primary2DamageCoefficient.Value * 100f + "% damage."); val = Utils.NewSkillDef(typeof(PrimarySpikes), "Weapon", 10, MainPlugin.secondaryAltCooldown.Value, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)1, isCombatSkill: true, mustKeyPress: false, cancelSprintingOnActivation: false, 10, 1, 1, Prefabs.Load("RoR2/Base/Commando/CommandoBodyFirePistol.asset").icon, "PLAYABLEAPOTHECARY_" + text, "PLAYABLEAPOTHECARY_" + text + "_DESCRIPTION", Array.Empty()); Utils.AddAlt(component2.secondary.skillFamily, val); component.secondary2 = val; } internal static void UtilitySetup(GameObject characterPrefab) { SkillLocator component = characterPrefab.GetComponent(); string text = "_UTIL"; LanguageAPI.Add("PLAYABLEAPOTHECARY_" + text, "Tar Overheat"); LanguageAPI.Add("PLAYABLEAPOTHECARY_" + text + "_DESCRIPTION", "Tar. Knockback nearby enemies and gain " + MainPlugin.utilityAttackSpeedMult.Value * 100f + "% attack speed, " + MainPlugin.utilityMoveSpeedMult.Value * 100f + "% movement speed and " + MainPlugin.utilityRegenMult.Value * 100f + "% health regeneration."); SkillDef skill = Utils.NewSkillDef(typeof(Utility), "Add", 2, MainPlugin.utilityCooldown.Value, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)1, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: false, 1, 1, 1, Prefabs.Load("RoR2/Base/Toolbot/ToolbotDualWield.asset").icon, "PLAYABLEAPOTHECARY_" + text, "PLAYABLEAPOTHECARY_" + text + "_DESCRIPTION", Array.Empty()); component.utility = Utils.NewGenericSkill(characterPrefab, skill); text = "_UTIL_ALT"; LanguageAPI.Add("PLAYABLEAPOTHECARY_" + text, "Tar Spill"); LanguageAPI.Add("PLAYABLEAPOTHECARY_" + text + "_DESCRIPTION", "Fade away, becoming intangible, gaining +30% movement speed and dealing " + MainPlugin.utility2DamageCoefficient.Value * 100f + "% damage to enemies around you. Heal for 18.2% of your maximum health. Lasts 3s."); skill = Utils.NewSkillDef(typeof(LunarUtility), "Body", 1, MainPlugin.utility2Cooldown.Value, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)1, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: false, 1, 1, 1, Prefabs.Load("RoR2/Base/LunarSkillReplacements/LunarUtilityReplacement.asset").icon, "PLAYABLEAPOTHECARY_" + text, "PLAYABLEAPOTHECARY_" + text + "_DESCRIPTION", Array.Empty()); Utils.AddAlt(component.utility.skillFamily, skill); } internal static void SpecialSetup(GameObject characterPrefab) { SkillLocator component = characterPrefab.GetComponent(); string text = "_SPEC"; LanguageAPI.Add("PLAYABLEAPOTHECARY_" + text, "Tar Fling"); LanguageAPI.Add("PLAYABLEAPOTHECARY_" + text + "_DESCRIPTION", "Tar. Throw tar barrels for " + MainPlugin.specialProjCount.Value + "x" + MainPlugin.specialDamageCoefficient.Value * 100f + "% damage."); SkillDef skill = Utils.NewSkillDef(typeof(Special), "Weapon", 1, MainPlugin.specialCooldown.Value, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)1, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: false, 3, 1, 1, Prefabs.Load("RoR2/DLC2/Chef/ChefGlaze.asset").icon, "PLAYABLEAPOTHECARY_" + text, "PLAYABLEAPOTHECARY_" + text + "_DESCRIPTION", Array.Empty()); component.special = Utils.NewGenericSkill(characterPrefab, skill); } internal static GameObject CreateBodyPrefab(string characterName, Color bodyColor, float mass) { //IL_00a0: 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_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_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_024b: Unknown result type (might be due to invalid IL or missing references) //IL_0250: 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_02e8: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: 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_03fb: Unknown result type (might be due to invalid IL or missing references) //IL_04ea: Unknown result type (might be due to invalid IL or missing references) //IL_05d4: Unknown result type (might be due to invalid IL or missing references) //IL_05d9: Unknown result type (might be due to invalid IL or missing references) string text = characterName.Replace(" ", ""); string text2 = text.ToUpper(); LanguageAPI.Add("PLAYABLEAPOTHECARY_" + text2 + "_NAME", characterName); GameObject val = PrefabAPI.InstantiateClone(baseBody, text + "Body", true); val.GetComponent().localPlayerAuthority = true; ModelLocator component = val.GetComponent(); Object.DestroyImmediate((Object)(object)((Component)component.modelTransform).gameObject); GameObject val2 = Assets.Load("ApothecaryMdl"); val2.AddComponent().soundCenter = val2; val2.transform.parent = component.modelBaseTransform; val2.transform.localPosition = Vector3.zero; val2.transform.localRotation = Quaternion.identity; component.modelTransform = val2.transform; ChildLocator component2 = val2.GetComponent(); ((Component)component2.FindChild("body")).GetComponent().material = Prefabs.Load("RoR2/DLC1/ClayGrenadier/matClayGrenadierBody.mat"); ((Component)component2.FindChild("limbs")).GetComponent().material = Prefabs.Load("RoR2/DLC1/ClayGrenadier/matClayGrenadierLimbs.mat"); MidpointBetweenTwoTransforms val3 = ((Component)component2.FindChild("MuzzleBetweenHands")).gameObject.AddComponent(); val3.transform1 = component2.FindChild("hand.r"); val3.transform2 = component2.FindChild("hand.l"); CharacterBody component3 = val.GetComponent(); ((Object)component3).name = "PlayableApothecaryBody"; component3.baseNameToken = "PLAYABLEAPOTHECARY_" + text2 + "_NAME"; component3.subtitleNameToken = "PLAYABLEAPOTHECARY_" + text2 + "_SUBTITLE"; component3.bodyFlags = (BodyFlags)16; component3.hullClassification = (HullClassification)0; Sprite val4 = Assets.Load(text); component3.portraitIcon = (Texture)(object)(Object.op_Implicit((Object)(object)val4) ? val4.texture : null); component3.isChampion = false; component3.currentVehicle = null; component3.skinIndex = 0u; component3.bodyColor = bodyColor; HealthComponent component4 = val.GetComponent(); component4.health = component3.baseMaxHealth; component4.shield = 0f; component4.barrier = 0f; CharacterMotor component5 = val.GetComponent(); component5.mass = mass; CameraTargetParams component6 = val.GetComponent(); component6.cameraParams = Prefabs.Load("RoR2/Base/Common/ccpStandard.asset"); component6.cameraPivotTransform = null; component6.recoil = Vector2.zero; component6.dontRaycastToPivot = false; KinematicCharacterMotor component7 = val.GetComponent(); component7.CharacterController = (ICharacterController)(object)component5; component7.playerCharacter = true; component7.MaxStepHeight = 0.182f; val.GetComponent().maxInteractionDistance = 3f; val.GetComponent().highlightInteractor = true; CharacterModel val5 = val2.AddComponent(); SkinnedMeshRenderer[] componentsInChildren = val2.GetComponentsInChildren(); List list = new List(); foreach (SkinnedMeshRenderer val6 in componentsInChildren) { list.Add(new RendererInfo { renderer = (Renderer)(object)val6, defaultMaterial = ((Renderer)val6).material, defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = false }); } RendererInfo[] array = list.ToArray(); val5.body = component3; val5.baseRendererInfos = array; val5.autoPopulateLightInfos = true; val5.temporaryOverlays = new List(); val5.mainSkinnedMeshRenderer = componentsInChildren[0]; LanguageAPI.Add(text2 + "BODY_DEFAULT_SKIN_NAME", "Default"); ModelSkinController val7 = val2.AddComponent(); val7.skins = (SkinDef[])(object)new SkinDef[1] { Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, text2 + "BODY_DEFAULT_SKIN_NAME", array)) }; Collider[] componentsInChildren2 = val2.GetComponentsInChildren(); HurtBoxGroup val8 = val2.AddComponent(); List list2 = new List(); Collider[] array2 = componentsInChildren2; foreach (Collider val9 in array2) { HurtBox val10 = ((Component)val9).gameObject.AddComponent(); ((Component)val10).gameObject.layer = LayerIndex.entityPrecise.intVal; val10.healthComponent = component4; val10.isBullseye = true; val10.damageModifier = (DamageModifier)0; val10.hurtBoxGroup = val8; val10.indexInGroup = 0; val8.mainHurtBox = val10; val8.bullseyeCount = 1; list2.Add(val10); } val8.hurtBoxes = list2.ToArray(); AimAnimator val11 = val2.AddComponent(); val11.inputBank = val.GetComponent(); val11.directionComponent = val.GetComponent(); val11.pitchRangeMin = -40f; val11.pitchRangeMax = 40f; val11.yawRangeMin = -45f; val11.yawRangeMax = 45f; val11.pitchGiveupRange = 30f; val11.yawGiveupRange = 30f; val11.giveupDuration = 3f; val11.raisedApproachSpeed = 720f; val11.loweredApproachSpeed = 360f; val11.smoothTime = 0.3f; val11.aimType = (AimType)0; SfxLocator component8 = val.GetComponent(); component8.barkSound = ""; component8.openSound = ""; component8.fallDamageSound = "Play_char_land_fall_damage"; component8.aliveLoopStart = ""; component8.aliveLoopStop = ""; val.GetComponent().mass = mass; FootstepHandler val12 = val2.AddComponent(); val12.baseFootstepString = "Play_clayGrenadier_step"; val12.sprintFootstepOverrideString = ""; val12.enableFootstepDust = true; val12.footstepDustPrefab = Prefabs.Load("RoR2/Base/Common/VFX/GenericFootstepDust.prefab"); GenericSkill[] componentsInChildren3 = val.GetComponentsInChildren(); foreach (GenericSkill val13 in componentsInChildren3) { Object.DestroyImmediate((Object)(object)val13); } Utils.NewStateMachine(val, "Add"); Utils.NewStateMachine(val, "Weapon"); EntityStateMachine component9 = ((Component)component3).GetComponent(); component9.mainStateType = new SerializableEntityStateType(typeof(CharacterMain)); NetworkStateMachine component10 = ((Component)component3).GetComponent(); component10.stateMachines = ((Component)component3).GetComponents(); ContentAddition.AddBody(val); return val; } } internal class Hook { internal static void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients); } private static void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args) { if (sender.HasBuff(Prefabs.buff)) { args.attackSpeedMultAdd += MainPlugin.utilityAttackSpeedMult.Value; args.moveSpeedMultAdd += MainPlugin.utilityMoveSpeedMult.Value; args.regenMultAdd += MainPlugin.utilityRegenMult.Value; } } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.Dragonyck.PlayableApothecary", "PlayableApothecary", "1.0.0")] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] public class MainPlugin : BaseUnityPlugin { public const string MODUID = "com.Dragonyck.PlayableApothecary"; public const string MODNAME = "PlayableApothecary"; public const string VERSION = "1.0.0"; internal const string MODKEY = "PLAYABLEAPOTHECARY_"; internal static ConfigFile config; internal static ConfigEntry passiveHealCoefficient; internal static ConfigEntry passiveDamageCoefficient; internal static ConfigEntry passiveTicks; internal static ConfigEntry passiveRadius; internal static ConfigEntry primaryDamageCoefficient; internal static ConfigEntry primaryFireRate; internal static ConfigEntry primary2Ticks; internal static ConfigEntry primary2DamageCoefficient; internal static ConfigEntry primary2DamageReduction; internal static ConfigEntry primary2Range; internal static ConfigEntry primary2MaxTargets; internal static ConfigEntry primary2Heal; internal static ConfigEntry secondaryDamageCoefficient; internal static ConfigEntry secondaryDuration; internal static ConfigEntry secondaryDelay; internal static ConfigEntry secondaryRadius; internal static ConfigEntry secondaryProjDamageCoefficient; internal static ConfigEntry secondaryProjSnapAngle; internal static ConfigEntry secondaryCooldown; internal static ConfigEntry secondaryAltCooldown; internal static ConfigEntry utilityDuration; internal static ConfigEntry utilityAttackSpeedMult; internal static ConfigEntry utilityMoveSpeedMult; internal static ConfigEntry utilityRegenMult; internal static ConfigEntry utilityRadius; internal static ConfigEntry utilityKnockback; internal static ConfigEntry utilityCooldown; internal static ConfigEntry utility2DamageCoefficient; internal static ConfigEntry utility2Radius; internal static ConfigEntry utility2FireRate; internal static ConfigEntry utility2Cooldown; internal static ConfigEntry specialDuration; internal static ConfigEntry specialProjCount; internal static ConfigEntry specialDamageCoefficient; internal static ConfigEntry specialSpread; internal static ConfigEntry specialRadius; internal static ConfigEntry specialFireDelay; internal static ConfigEntry specialCooldown; private void Awake() { passiveHealCoefficient = ((BaseUnityPlugin)this).Config.Bind("Passive", "Heal Coefficient", 0.25f, (ConfigDescription)null); passiveDamageCoefficient = ((BaseUnityPlugin)this).Config.Bind("Passive", "Damage Coefficient", 0.25f, (ConfigDescription)null); passiveRadius = ((BaseUnityPlugin)this).Config.Bind("Passive", "Radius", 4f, (ConfigDescription)null); passiveTicks = ((BaseUnityPlugin)this).Config.Bind("Passive", "Ticks Per Second", 4f, (ConfigDescription)null); primaryDamageCoefficient = ((BaseUnityPlugin)this).Config.Bind("Tar Spikes", "Damage Coefficient", 2f, (ConfigDescription)null); primaryFireRate = ((BaseUnityPlugin)this).Config.Bind("Tar Spikes", "Spikes Per Second", 9f, (ConfigDescription)null); primary2Ticks = ((BaseUnityPlugin)this).Config.Bind("Tar Beam", "Ticks Per Second", 5f, (ConfigDescription)null); primary2DamageCoefficient = ((BaseUnityPlugin)this).Config.Bind("Tar Beam", "Damage Coefficient", 0.4f, (ConfigDescription)null); primary2DamageReduction = ((BaseUnityPlugin)this).Config.Bind("Tar Beam", "Damage Reduction Mult Per Target", 0.5f, (ConfigDescription)null); primary2Range = ((BaseUnityPlugin)this).Config.Bind("Tar Beam", "Range", 14f, (ConfigDescription)null); primary2MaxTargets = ((BaseUnityPlugin)this).Config.Bind("Tar Beam", "Max Targets", 3, (ConfigDescription)null); primary2Heal = ((BaseUnityPlugin)this).Config.Bind("Tar Beam", "Heal Mult", 0.01f, (ConfigDescription)null); secondaryDamageCoefficient = ((BaseUnityPlugin)this).Config.Bind("Face Slam", "Slam Damage Coefficient", 1.5f, (ConfigDescription)null); secondaryDuration = ((BaseUnityPlugin)this).Config.Bind("Face Slam", "Duration", 2.46f, (ConfigDescription)null); secondaryDelay = ((BaseUnityPlugin)this).Config.Bind("Face Slam", "Slam Delay", 1f, (ConfigDescription)null); secondaryRadius = ((BaseUnityPlugin)this).Config.Bind("Face Slam", "Slam Radius", 15f, (ConfigDescription)null); secondaryProjDamageCoefficient = ((BaseUnityPlugin)this).Config.Bind("Face Slam", "Projectile Damage Coefficient", 4f, (ConfigDescription)null); secondaryProjSnapAngle = ((BaseUnityPlugin)this).Config.Bind("Face Slam", "Projectile SnapOn Angle", 100f, (ConfigDescription)null); secondaryCooldown = ((BaseUnityPlugin)this).Config.Bind("Face Slam", "Cooldown", 5f, (ConfigDescription)null); secondaryAltCooldown = ((BaseUnityPlugin)this).Config.Bind("Tar Spikes", "Cooldown", 2f, "Secondary version only."); utilityDuration = ((BaseUnityPlugin)this).Config.Bind("Tar Buff", "Duration", 4f, (ConfigDescription)null); utilityAttackSpeedMult = ((BaseUnityPlugin)this).Config.Bind("Tar Buff", "Attack Speed Mult", 0.5f, (ConfigDescription)null); utilityMoveSpeedMult = ((BaseUnityPlugin)this).Config.Bind("Tar Buff", "Movement Speed Mult", 0.5f, (ConfigDescription)null); utilityRegenMult = ((BaseUnityPlugin)this).Config.Bind("Tar Buff", "Regen Mult", 1f, (ConfigDescription)null); utilityRadius = ((BaseUnityPlugin)this).Config.Bind("Tar Buff", "Radius", 12f, (ConfigDescription)null); utilityKnockback = ((BaseUnityPlugin)this).Config.Bind("Tar Buff", "Knockback Force", 2400f, (ConfigDescription)null); utilityCooldown = ((BaseUnityPlugin)this).Config.Bind("Tar Buff", "Cooldown", 10f, (ConfigDescription)null); utility2DamageCoefficient = ((BaseUnityPlugin)this).Config.Bind("Tar Spill", "Damage Coefficient", 1.4f, (ConfigDescription)null); utility2Radius = ((BaseUnityPlugin)this).Config.Bind("Tar Spill", "Radius", 12f, (ConfigDescription)null); utility2FireRate = ((BaseUnityPlugin)this).Config.Bind("Tar Spill", "Hits Per Second", 5f, (ConfigDescription)null); utility2Cooldown = ((BaseUnityPlugin)this).Config.Bind("Tar Spill", "Cooldown", 6f, (ConfigDescription)null); specialDuration = ((BaseUnityPlugin)this).Config.Bind("Tar Fling", "Duration", 1.9f, (ConfigDescription)null); specialProjCount = ((BaseUnityPlugin)this).Config.Bind("Tar Fling", "Projectile Count", 4, (ConfigDescription)null); specialDamageCoefficient = ((BaseUnityPlugin)this).Config.Bind("Tar Fling", "Damage Coefficient", 1.5f, (ConfigDescription)null); specialSpread = ((BaseUnityPlugin)this).Config.Bind("Tar Fling", "Spread", 6f, (ConfigDescription)null); specialRadius = ((BaseUnityPlugin)this).Config.Bind("Tar Fling", "Radius", 6f, (ConfigDescription)null); specialFireDelay = ((BaseUnityPlugin)this).Config.Bind("Tar Fling", "Fire Delay", 1f, (ConfigDescription)null); specialCooldown = ((BaseUnityPlugin)this).Config.Bind("Tar Fling", "Cooldown", 10f, (ConfigDescription)null); config = ((BaseUnityPlugin)this).Config; Assets.PopulateAssets(); Prefabs.CreatePrefabs(); CharacterBodySetup.CreateCharacterBodies(); Hook.Hooks(); } } internal class Prefabs { internal static GameObject muzzleflash; internal static GameObject squidHit; internal static GameObject lunarCoreVFX; internal static GameObject beamMuzzleEffect; internal static GameObject hitEffect; internal static GameObject spikeProjectileGhost; internal static GameObject spikeProjectile; internal static GameObject ballProjectile; internal static BuffDef buff; internal static GameObject urnAttachmentPrefab; internal static GameObject tetherVFX; internal static Material baseMaterial = Load("RoR2/Base/Commando/matCommandoDualies.mat"); internal static void CreatePrefabs() { //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Expected O, but got Unknown //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Expected O, but got Unknown //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_0407: Unknown result type (might be due to invalid IL or missing references) //IL_0411: Expected O, but got Unknown //IL_047c: Unknown result type (might be due to invalid IL or missing references) //IL_048e: Unknown result type (might be due to invalid IL or missing references) //IL_0498: 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_02cf: 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_0527: 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_0554: Unknown result type (might be due to invalid IL or missing references) squidHit = Instantiate("RoR2/Base/Squid/SquidTurretHitEffect.prefab", "GooHit"); Texture2D val = Load("RoR2/Base/Common/ColorRamps/texClayGooRamp.png"); ParticleSystemRenderer[] componentsInChildren = squidHit.GetComponentsInChildren(); foreach (ParticleSystemRenderer val2 in componentsInChildren) { if (((Object)val2).name != "Ring") { Material val3 = new Material(((Renderer)val2).material); val3.SetColor("_EmissionColor", Color.black); val3.SetTexture("_RemapTex", (Texture)(object)val); val3.SetFloat("_SpecularStrength", 0f); ((Renderer)val2).material = val3; } else { ((Component)val2).gameObject.SetActive(false); } } ContentAddition.AddEffect(squidHit); muzzleflash = Instantiate("RoR2/Base/Squid/MuzzleflashSquid.prefab", "GooMuzzleFlash"); Renderer component = ((Component)muzzleflash.transform.GetChild(0)).GetComponent(); component.material = new Material(component.material); component.material.SetFloat("_SpecularStrength", 0f); ContentAddition.AddEffect(muzzleflash); buff = Utils.NewBuffDef("Tar Overdrive", stack: false, hidden: false, Load("RoR2/Base/Grandparent/bdOverheat.asset").iconSprite, CharacterBodySetup.characterColor); lunarCoreVFX = Instantiate("RoR2/Base/LunarSkillReplacements/CrowstormCoreVFX.prefab", "LunarCoreVFX"); ParticleSystemRenderer[] componentsInChildren2 = lunarCoreVFX.GetComponentsInChildren(); foreach (ParticleSystemRenderer val4 in componentsInChildren2) { string name = ((Object)val4).name; if (name == "FeatherRings") { ((Component)val4).transform.localScale = Vector3.one * 3f; ((Renderer)val4).material = Load("RoR2/DLC1/ClayGrenadier/matClayGrenadierShockwave.mat"); } if (name == "Big Feathers") { ((Component)val4).gameObject.SetActive(false); } if (name == "Core") { ((Renderer)val4).material = Load("RoR2/Base/Clay/matClayBubbleBillboard.mat"); } } beamMuzzleEffect = Instantiate("RoR2/Base/ClayBoss/ClayBossMulcher.prefab", "BeamMuzzleEffect"); Object.Destroy((Object)(object)beamMuzzleEffect.GetComponent()); Object.Destroy((Object)(object)beamMuzzleEffect.GetComponent()); Object.Destroy((Object)(object)beamMuzzleEffect.GetComponent()); ParticleSystemRenderer[] componentsInChildren3 = beamMuzzleEffect.GetComponentsInChildren(); foreach (ParticleSystemRenderer val5 in componentsInChildren3) { string name2 = ((Object)val5).name; if (name2 == "Single Floating Particle" || name2 == "Trail") { ((Component)val5).gameObject.SetActive(false); } else { ((Component)val5).transform.localScale = Vector3.one * 0.08f; } } hitEffect = Instantiate("RoR2/Base/Squid/SquidTurretHitEffect.prefab", "HitEffect"); Material material = Load("RoR2/DLC1/VoidBarnacle/matVoidBarnacleGoo.mat"); ParticleSystemRenderer[] componentsInChildren4 = hitEffect.GetComponentsInChildren(); foreach (ParticleSystemRenderer val6 in componentsInChildren4) { string name3 = ((Object)val6).name; if (name3 == "Ring") { ((Component)val6).gameObject.SetActive(false); } else { ((Renderer)val6).material = material; } } Utils.RegisterEffect(hitEffect, -1f); urnAttachmentPrefab = Instantiate("RoR2/Base/SiphonOnLowHealth/SiphonNearbyBodyAttachment.prefab", "UrnAttachmentPrefab", registerNetwork: true); Object.Destroy((Object)(object)urnAttachmentPrefab.GetComponent()); urnAttachmentPrefab.AddComponent(); tetherVFX = Instantiate(urnAttachmentPrefab.GetComponent().tetherPrefab, "TetherVFX", registerNetwork: true); tetherVFX.GetComponent().fadeOut.timeMax = 0.25f; LineRenderer component2 = tetherVFX.GetComponent(); ((Renderer)component2).material = new Material(((Renderer)component2).material); component2.widthMultiplier = 0.6f; spikeProjectileGhost = Instantiate("RoR2/Base/ClayBoss/TarballGhost.prefab", "SpikeProjectileGhost"); TrailRenderer componentInChildren = spikeProjectileGhost.GetComponentInChildren(); componentInChildren.widthMultiplier = 0.5f; componentInChildren.time = 0.2f; MeshRenderer componentInChildren2 = spikeProjectileGhost.GetComponentInChildren(true); ((Component)componentInChildren2).transform.localScale = new Vector3(2f, 0.25f, 0.25f); ((Component)componentInChildren2).transform.localRotation = Quaternion.Euler(Vector3.up * 90f); ((Behaviour)((Component)componentInChildren2).GetComponent()).enabled = false; ParticleSystemRenderer[] componentsInChildren5 = spikeProjectileGhost.GetComponentsInChildren(); foreach (ParticleSystemRenderer val7 in componentsInChildren5) { switch (((Object)val7).name) { case "Flames": ((Component)val7).gameObject.SetActive(false); break; case "Goo": ((Component)val7).transform.localScale = Vector3.one * 0.25f; break; case "Donut": ((Component)val7).transform.localScale = new Vector3(3f, 0.25f, 1f); break; } } spikeProjectile = Instantiate("RoR2/Base/Brother/LunarShardProjectile.prefab", "SpikeProjectile", registerNetwork: true); spikeProjectile.GetComponent().ghostPrefab = spikeProjectileGhost; ProjectileImpactExplosion component3 = spikeProjectile.GetComponent(); ((ProjectileExplosion)component3).blastDamageCoefficient = 1f; component3.impactEffect = hitEffect; ((ProjectileExplosion)component3).explosionEffect = component3.impactEffect; ContentAddition.AddProjectile(spikeProjectile); ballProjectile = Instantiate("RoR2/DLC1/ClayGrenadier/ClayGrenadierBarrelProjectile.prefab", "BallProjectile", registerNetwork: true); ((ProjectileExplosion)ballProjectile.GetComponent()).blastRadius = MainPlugin.specialRadius.Value; ContentAddition.AddProjectile(ballProjectile); } internal static T Load(string path) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) return Addressables.LoadAssetAsync((object)path).WaitForCompletion(); } internal static GameObject Instantiate(string path, string name, bool registerNetwork = false) { return PrefabAPI.InstantiateClone(Load(path), name, registerNetwork); } internal static GameObject Instantiate(GameObject obj, string name, bool registerNetwork = false) { return PrefabAPI.InstantiateClone(obj, name, registerNetwork); } public static Material InstantiateDefaultSurvivorMaterial(Texture tex) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0020: 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) Material val = new Material(baseMaterial); if (Object.op_Implicit((Object)(object)val)) { val.SetColor("_Color", Color.white); val.SetTexture("_MainTex", tex); val.SetColor("_EmColor", Color.black); val.SetFloat("_EmPower", 0f); val.SetTexture("_EmTex", (Texture)null); val.SetFloat("_NormalStrength", 1f); val.SetTexture("_NormalTex", (Texture)null); val.SetFloat("_Cull", 0f); return val; } return val; } public static Material InstantiateDefaultSurvivorMaterial(Color color, Texture tex, Color emColor, float emPower, Texture emTex, float normStr, Texture normTex) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_001d: 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) Material val = new Material(baseMaterial); if (Object.op_Implicit((Object)(object)val)) { val.SetColor("_Color", color); val.SetTexture("_MainTex", tex); val.SetColor("_EmColor", emColor); val.SetFloat("_EmPower", emPower); val.SetTexture("_EmTex", emTex); val.SetFloat("_NormalStrength", 1f); val.SetTexture("_NormalTex", normTex); val.SetFloat("_Cull", 0f); return val; } return val; } } internal class BasicMeleeSkillState : BaseSkillState { private float duration = 0.2f; private Vector3 dir; private OverlapAttack attack; private float damageCoefficient = 4.2f; private GameObject hitEffectPrefab = null; private bool parried; public Animator animator; private uint ID; private string hitboxGroupName = ""; public override void OnEnter() { ((BaseState)this).OnEnter(); animator = ((EntityState)this).GetModelAnimator(); if (!animator.GetBool("slide")) { ((BaseState)this).StartAimMode(1f, true); } ((EntityState)this).PlayAnimation("LeftArm, Override", "MeleeAttack"); AkSoundEngine.PostEvent(ID, ((EntityState)this).gameObject); attack = ((BaseState)this).InitMeleeOverlap(damageCoefficient, hitEffectPrefab, ((EntityState)this).GetModelTransform(), hitboxGroupName); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).isAuthority) { attack.Fire((List)null); } if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)1; } } internal class CharacterMain : GenericCharacterMain { } internal class MeleeSkillState : BaseSkillState { public float attackDuration; private bool hopped; private bool hasSwung; public bool isInHitPause; public float hitPauseDuration; public float hopVelocity; public float hitPauseTimer; public float stopwatch; public HitStopCachedState hitStopCachedState; public OverlapAttack overlapAttack; public bool hasHit; private bool hasAnimParameter; private float attackSpeedScaling; public Animator animator; public int attackIndex = 1; private GameObject swingEffectInstance; public virtual float baseAttackDuration => 0f; public virtual float earlyExitDurationPercentage => 0f; public virtual float damageCoefficient => 0f; public virtual float forceMagnitude => 440f; public virtual float rootMotionSpeed => 25f; public virtual float baseHopVelocity => 4f; public virtual string layerName => "Gesture, Override"; public virtual string animationStateName => ""; public virtual string animParameter => "M1"; public virtual string hitBoxGroupName => ""; public virtual string hitBoxActiveParameter => "Curve"; public virtual string swingMuzzle => ""; public virtual GameObject swingEffectPrefab => null; public virtual bool hopOnHit => true; public virtual bool rootMotion => false; public virtual bool rootMotionWhileHitting => false; public virtual string swingSound => ""; public virtual DamageTypeCombo damageType => DamageTypeCombo.Generic; public virtual DamageColorIndex damageColor => (DamageColorIndex)0; public virtual Vector3 bonusForce => Vector3.zero; public virtual GameObject hitEffectPrefab => null; public virtual bool crossfade => false; public virtual bool finisher => attackIndex == 2; public virtual bool scaleSwingEffectSpeed => false; public override void OnSerialize(NetworkWriter writer) { ((BaseSkillState)this).OnSerialize(writer); writer.Write(attackIndex); } public override void OnDeserialize(NetworkReader reader) { ((BaseSkillState)this).OnDeserialize(reader); attackIndex = reader.ReadInt32(); } public override void OnEnter() { //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); attackSpeedScaling = Math.Min(((BaseState)this).attackSpeedStat, 6f); attackDuration = baseAttackDuration / attackSpeedScaling; hitPauseDuration = GroundLight.hitPauseDuration / attackSpeedScaling; hopVelocity = baseHopVelocity / attackSpeedScaling; animator = ((EntityState)this).GetModelAnimator(); animator.SetFloat(hitBoxActiveParameter, 0f); overlapAttack = ((BaseState)this).InitMeleeOverlap(damageCoefficient, hitEffectPrefab, ((EntityState)this).GetModelTransform(), hitBoxGroupName); overlapAttack.pushAwayForce = 1f; overlapAttack.damageType = damageType; hasAnimParameter = !Utility.IsNullOrWhiteSpace(animParameter); if (hasAnimParameter && !Utility.IsNullOrWhiteSpace(animationStateName)) { if (crossfade) { ((EntityState)this).PlayAnimation("Additive, Override", animationStateName, animParameter, attackDuration, 0f); ((EntityState)this).PlayCrossfade(layerName, animationStateName, animParameter, attackDuration, 0.1f); } else { ((EntityState)this).PlayAnimation(layerName, animationStateName, animParameter, attackDuration, 0f); } } } public virtual Vector3 rootMotionDirection() { //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_000f: Unknown result type (might be due to invalid IL or missing references) return ((EntityState)this).characterDirection.forward; } public override void FixedUpdate() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_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_0111: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); if (((EntityState)this).isAuthority) { bool flag = FireMeleeAttack(overlapAttack, animator, hitBoxActiveParameter, forceMagnitude, bonusForce); hasHit = flag || hasHit; if (hasHit) { if (hopOnHit && !((EntityState)this).characterMotor.isGrounded && !hopped) { ((BaseState)this).SmallHop(((EntityState)this).characterMotor, hopVelocity); hopped = true; } if (!rootMotionWhileHitting && !isInHitPause && hasAnimParameter) { isInHitPause = true; } } if (animator.GetFloat(hitBoxActiveParameter) > 0.1f && rootMotion && !isInHitPause) { Vector3 val = rootMotionDirection(); CharacterMotor characterMotor = ((EntityState)this).characterMotor; characterMotor.rootMotion += val * rootMotionSpeed * Time.fixedDeltaTime; } if (hitPauseTimer >= hitPauseDuration && isInHitPause) { isInHitPause = false; animator.speed = 1f; } if (!isInHitPause) { stopwatch += Time.fixedDeltaTime; } else { hitPauseTimer += Time.fixedDeltaTime; animator.speed = 0f; } if (stopwatch >= attackDuration * earlyExitDurationPercentage) { if (((EntityState)this).inputBank.skill1.down && SetState()) { return; } if (stopwatch >= attackDuration) { BaseSkillState val2 = StateOverride(); if (val2 != null) { ((EntityState)this).outer.SetNextState((EntityState)(object)val2); } else { ((EntityState)this).outer.SetNextStateToMain(); } return; } } } if (!(animator.GetFloat(hitBoxActiveParameter) >= 0.11f) || hasSwung) { return; } hasSwung = true; AkSoundEngine.PostEvent(swingSound, ((EntityState)this).gameObject); if (Object.op_Implicit((Object)(object)swingEffectPrefab) && !Utility.IsNullOrWhiteSpace(swingMuzzle)) { if (scaleSwingEffectSpeed) { SpawnSwingEffect(swingMuzzle); } else { EffectManager.SimpleMuzzleFlash(swingEffectPrefab, ((EntityState)this).gameObject, swingMuzzle, false); } } float num = 4.2f; ((BaseState)this).AddRecoil(-0.1f * num, 0.1f * num, -1f * num, 1f * num); } public override void OnExit() { if (Object.op_Implicit((Object)(object)swingEffectInstance)) { EntityState.Destroy((Object)(object)swingEffectInstance); } ((EntityState)this).OnExit(); } public void SpawnSwingEffect(string muzzle) { //IL_0011: 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) Transform val = ((BaseState)this).FindModelChild(muzzle); swingEffectInstance = Object.Instantiate(swingEffectPrefab, val.position, val.rotation, val); ScaleParticleSystemDuration component = swingEffectInstance.GetComponent(); component.initialDuration = attackDuration; component._newDuration = attackDuration; } public bool FireMeleeAttack(OverlapAttack attack, Animator animator, string mecanimHitboxActiveParameter, float forceMagnitude, Vector3 bonusForce) { //IL_0042: 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_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_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) bool result = false; if (Object.op_Implicit((Object)(object)animator) && animator.GetFloat(mecanimHitboxActiveParameter) > 0.1f) { attack.forceVector = (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection) ? ((EntityState)this).characterDirection.forward : ((EntityState)this).transform.forward) * forceMagnitude + bonusForce; result = attack.Fire((List)null); } return result; } public virtual bool SetState() { return false; } public virtual BaseSkillState StateOverride() { return null; } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)1; } } internal class PrimaryMelee : MeleeSkillState { public override float baseAttackDuration => 0.9f; public override float earlyExitDurationPercentage => 0.95f; public override string layerName => "Gesture, Override"; public override string animationStateName => "Attack" + attackIndex; public override string animParameter => "M1"; public override string hitBoxGroupName => "Punch"; public override float forceMagnitude => 250f; public override float damageCoefficient => 2.5f; public override string swingSound => ""; public override float baseHopVelocity => 6f; public override GameObject hitEffectPrefab => null; public override string swingMuzzle => animationStateName + "Muzzle"; public override bool crossfade => true; public override GameObject swingEffectPrefab => null; public override DamageTypeCombo damageType => DamageTypeCombo.GenericPrimary; public override bool scaleSwingEffectSpeed => false; public override bool finisher => attackIndex == 3; public override void OnEnter() { base.OnEnter(); ((BaseState)this).StartAimMode(2f, false); } public override bool SetState() { if (finisher) { return false; } PrimaryMelee primaryMelee = new PrimaryMelee(); primaryMelee.attackIndex = attackIndex + 1; ((EntityState)this).outer.SetNextState((EntityState)(object)primaryMelee); return true; } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)1; } } internal class Primary : BaseSkillState { private float stopwatch = 1f; private List> tethers = new List>(); private Behaviour behaviour; private SphereSearch search = new SphereSearch(); private TeamMask mask; private GameObject effectInstance; private HurtBox target => ((HuntressTracker)behaviour).trackingTarget; public override void OnEnter() { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_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) ((BaseState)this).OnEnter(); behaviour = ((EntityState)this).GetComponent(); if (!Object.op_Implicit((Object)(object)target)) { if (((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } return; } mask = TeamMask.GetEnemyTeams(((EntityState)this).teamComponent.teamIndex); search.mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask; Transform val = ((BaseState)this).FindModelChild("MuzzleFace"); effectInstance = Object.Instantiate(Prefabs.beamMuzzleEffect, val.position, Quaternion.identity, val); effectInstance.transform.localPosition = Vector3.up * 0.1f; AddTether(effectInstance.transform, ((HuntressTracker)behaviour).trackingTarget.healthComponent, ((Component)((HuntressTracker)behaviour).trackingTarget).transform).transform.parent = ((EntityState)this).transform; AkSoundEngine.PostEvent("Play_siphonOnLowHealth_launch", ((EntityState)this).gameObject); AkSoundEngine.PostEvent("Play_siphonOnLowHealth_siphonLoop", ((EntityState)this).gameObject); } private GameObject AddTether(Transform parent, HealthComponent health, Transform target) { GameObject val = Object.Instantiate(Prefabs.tetherVFX, parent); TetherVfx component = val.GetComponent(); component.tetherTargetTransform = target; tethers.Add(new KeyValuePair(component, health)); return val; } public override void FixedUpdate() { //IL_015d: 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_018f: 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_028b: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Unknown result type (might be due to invalid IL or missing references) //IL_0295: 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_02ad: 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_02c4: 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_02cd: 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_02dc: Unknown result type (might be due to invalid IL or missing references) //IL_02e1: Unknown result type (might be due to invalid IL or missing references) //IL_02e8: Expected O, but got Unknown //IL_030f: Unknown result type (might be due to invalid IL or missing references) //IL_0315: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); if (((EntityState)this).isAuthority && (!((BaseSkillState)this).IsKeyDownAuthority() || !Object.op_Implicit((Object)(object)target))) { ((EntityState)this).outer.SetNextStateToMain(); } stopwatch += Time.fixedDeltaTime; if (!(stopwatch >= 1f / MainPlugin.primary2Ticks.Value / ((BaseState)this).attackSpeedStat)) { return; } stopwatch = 0f; for (int i = 0; i < tethers.Count; i++) { KeyValuePair keyValuePair = tethers.ElementAt(i); TetherVfx key = keyValuePair.Key; HealthComponent value = keyValuePair.Value; if (!Object.op_Implicit((Object)(object)value)) { tethers.RemoveAt(i); if (Object.op_Implicit((Object)(object)key)) { ((Behaviour)key.fadeOut).enabled = true; } } } int num = MainPlugin.primary2MaxTargets.Value + 1; if (tethers.Count < num) { for (int j = 0; j < num - tethers.Count; j++) { HealthComponent value2 = tethers.ElementAt(tethers.Count - 1).Value; search.origin = ((Component)value2).transform.position; search.radius = MainPlugin.primary2Range.Value; search.RefreshCandidates(); search.FilterCandidatesByHurtBoxTeam(mask); search.OrderCandidatesByDistance(); search.FilterCandidatesByDistinctHurtBoxEntities(); search.FilterOutHurtBoxes(tethers); HurtBox val = search.GetHurtBoxes().FirstOrDefault(); if (Object.op_Implicit((Object)(object)val)) { AddTether(((Component)value2).transform, val.healthComponent, ((Component)val).transform); } search.ClearCandidates(); } } if (!NetworkServer.active) { return; } float num2 = ((BaseState)this).damageStat * MainPlugin.primary2DamageCoefficient.Value; float value3 = MainPlugin.primary2Heal.Value; for (int k = 0; k < tethers.Count; k++) { HealthComponent value4 = tethers.ElementAt(k).Value; DamageInfo val2 = new DamageInfo { position = ((Component)value4).transform.position, attacker = ((EntityState)this).gameObject, inflictor = ((EntityState)this).gameObject, crit = ((BaseState)this).RollCrit(), procCoefficient = 1f, damage = num2, damageType = (DamageTypeCombo.GenericPrimary | DamageTypeCombo.op_Implicit((DamageType)512)) }; value4.TakeDamage(val2); if (value3 > 0f) { ((EntityState)this).healthComponent.Heal(num2 * value3, default(ProcChainMask), true); } num2 *= MainPlugin.primary2DamageReduction.Value; } } public override void OnExit() { AkSoundEngine.PostEvent("Play_siphonOnLowHealth_retract", ((EntityState)this).gameObject); AkSoundEngine.PostEvent("Stop_siphonOnLowHealth_siphonLoop", ((EntityState)this).gameObject); if (Object.op_Implicit((Object)(object)effectInstance)) { EntityState.Destroy((Object)(object)effectInstance); } foreach (KeyValuePair tether in tethers) { if (Object.op_Implicit((Object)(object)tether.Key)) { ((Behaviour)tether.Key.fadeOut).enabled = true; } } ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)1; } } internal class PrimarySpikes : BaseSkillState { private float duration; private bool isSecondary; public override void OnEnter() { //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Invalid comparison between Unknown and I4 //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003c: 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_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: 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_00a1: 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_00c0: 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_00c5: 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_0123: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); duration = 1f / MainPlugin.primaryFireRate.Value / ((BaseState)this).attackSpeedStat; if (((EntityState)this).isAuthority) { Ray aimRay = ((BaseState)this).GetAimRay(); FireProjectileInfo val = new FireProjectileInfo { position = ((Ray)(ref aimRay)).origin, rotation = Quaternion.LookRotation(((Ray)(ref aimRay)).direction), crit = ((EntityState)this).characterBody.RollCrit(), damage = ((EntityState)this).characterBody.damage * MainPlugin.primaryDamageCoefficient.Value, damageColorIndex = (DamageColorIndex)0, damageTypeOverride = (DamageTypeCombo.op_Implicit((DamageType)512) | (((int)((EntityState)this).skillLocator.FindSkillSlot(((BaseSkillState)this).activatorSkillSlot) == 0) ? DamageTypeCombo.GenericPrimary : DamageTypeCombo.GenericSecondary)), owner = ((EntityState)this).gameObject, procChainMask = default(ProcChainMask), force = 50f, useFuseOverride = false, useSpeedOverride = false, target = null, projectilePrefab = Prefabs.spikeProjectile }; ProjectileManager.instance.FireProjectile(val); } float num = 1.5f; ((BaseState)this).AddRecoil(-0.4f * num, -0.8f * num, -0.3f * num, 0.3f * num); ((EntityState)this).characterBody.AddSpreadBloom(0.4f); EffectManager.SimpleMuzzleFlash(Prefabs.muzzleflash, ((EntityState)this).gameObject, "Muzzle", false); AkSoundEngine.PostEvent("Play_moonBrother_m1_laser_shoot", ((EntityState)this).gameObject); isSecondary = (int)((EntityState)this).skillLocator.FindSkillSlot(((BaseSkillState)this).activatorSkillSlot) == 1; } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration) { ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_000d: 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) return (InterruptPriority)((!isSecondary) ? 1 : 2); } } internal class Secondary : BaseSkillState { private string animationLayerName = "Body"; private string animationStateName = "FaceSlam"; private string playbackRateParam = "FaceSlam.playbackRate"; private static int FaceSlamStateHash = Animator.StringToHash("FaceSlam"); private static int FaceSlamParamHash = Animator.StringToHash("FaceSlam.playbackRate"); private string chargeEffectMuzzleString = "MuzzleFace"; private float blastForceMagnitude = 3000f; private float blastUpwardForce = 1500f; private string blastMuzzleString = "MuzzleBlast"; private float projectileForce = 1600f; private Transform modelTransform; private bool hasFiredBlast; private float duration; private float durationBeforeBlast; private GameObject chargeInstance; private float baseDuration => MainPlugin.secondaryDuration.Value; private float baseDurationBeforeBlast => MainPlugin.secondaryDelay.Value; private float blastDamageCoefficient => MainPlugin.secondaryDamageCoefficient.Value; private float projectileDamageCoefficient => MainPlugin.secondaryProjDamageCoefficient.Value; private float blastRadius => MainPlugin.secondaryRadius.Value; private float projectileSnapOnAngle => MainPlugin.secondaryProjSnapAngle.Value; public override void OnEnter() { //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_00c7: 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) ((BaseState)this).OnEnter(); modelTransform = ((EntityState)this).GetModelTransform(); duration = baseDuration / ((BaseState)this).attackSpeedStat; durationBeforeBlast = baseDurationBeforeBlast / ((BaseState)this).attackSpeedStat; Util.PlayAttackSpeedSound("Play_clayGrenadier_attack1_chargeup", ((EntityState)this).gameObject, ((BaseState)this).attackSpeedStat); ((EntityState)this).PlayAnimation("Gesture, Override", "Secondary", "M2", duration, 0f); if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection)) { ((EntityState)this).characterDirection.moveVector = ((EntityState)this).characterDirection.forward; } Transform val = ((BaseState)this).FindModelChild(chargeEffectMuzzleString); if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)FaceSlam.chargeEffectPrefab)) { chargeInstance = Object.Instantiate(FaceSlam.chargeEffectPrefab, val.position, val.rotation); chargeInstance.transform.parent = val; ScaleParticleSystemDuration component = chargeInstance.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.newDuration = durationBeforeBlast; } } if (NetworkServer.active) { ((EntityState)this).characterBody.AddTimedBuff(Buffs.HiddenInvincibility, duration); } } public override void FixedUpdate() { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0065: 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_007e: Expected O, but got Unknown //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_017f: 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_0193: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: 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_022f: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: 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_00d2: 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_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_0102: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_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_011b: 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_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0159: 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_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_016a: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_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_032a: 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_035c: Unknown result type (might be due to invalid IL or missing references) //IL_0366: Unknown result type (might be due to invalid IL or missing references) //IL_036b: 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_0246: Expected O, but got Unknown //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_0271: 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_02a4: 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_02b6: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_0317: 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) ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge > durationBeforeBlast && !hasFiredBlast) { hasFiredBlast = true; if (Object.op_Implicit((Object)(object)chargeInstance)) { EntityState.Destroy((Object)(object)chargeInstance); } Vector3 footPosition = ((EntityState)this).characterBody.footPosition; EffectManager.SpawnEffect(FaceSlam.blastImpactEffect, new EffectData { origin = footPosition, scale = blastRadius }, true); if (((EntityState)this).isAuthority) { if (Object.op_Implicit((Object)(object)modelTransform)) { Transform val = ((BaseState)this).FindModelChild(blastMuzzleString); if (Object.op_Implicit((Object)(object)val)) { new BlastAttack { attacker = ((EntityState)this).gameObject, inflictor = ((EntityState)this).gameObject, teamIndex = TeamComponent.GetObjectTeam(((EntityState)this).gameObject), baseDamage = ((BaseState)this).damageStat * blastDamageCoefficient, baseForce = blastForceMagnitude, position = val.position, radius = blastRadius, bonusForce = new Vector3(0f, blastUpwardForce, 0f), damageType = (DamageTypeCombo.GenericSecondary | DamageTypeCombo.op_Implicit((DamageType)512) | DamageTypeCombo.op_Implicit((DamageType)32)), attackerFiltering = (AttackerFiltering)2, falloffModel = (FalloffModel)0 }.Fire(); } } Vector3 val2 = footPosition; RaycastHit val3 = default(RaycastHit); if (Physics.Raycast(((BaseState)this).GetAimRay(), ref val3, 1000f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask) | LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask))) { val2 = ((RaycastHit)(ref val3)).point; if (Object.op_Implicit((Object)(object)((RaycastHit)(ref val3)).collider)) { CharacterBody component = ((Component)((RaycastHit)(ref val3)).collider).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { val2 = component.footPosition; } HurtBox component2 = ((Component)((RaycastHit)(ref val3)).collider).GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { val2 = component2.healthComponent.body.footPosition; } } } if (val2 == footPosition) { BullseyeSearch val4 = new BullseyeSearch(); val4.viewer = ((EntityState)this).characterBody; val4.teamMaskFilter = TeamMask.allButNeutral; ((TeamMask)(ref val4.teamMaskFilter)).RemoveTeam(((EntityState)this).characterBody.teamComponent.teamIndex); val4.sortMode = (SortMode)3; val4.minDistanceFilter = 0f; val4.maxDistanceFilter = 1000f; val4.searchOrigin = ((EntityState)this).inputBank.aimOrigin; val4.searchDirection = ((EntityState)this).inputBank.aimDirection; val4.maxAngleFilter = projectileSnapOnAngle; val4.filterByLoS = false; val4.RefreshCandidates(); HurtBox val5 = val4.GetResults().FirstOrDefault(); if (Object.op_Implicit((Object)(object)val5) && Object.op_Implicit((Object)(object)val5.healthComponent)) { val2 = val5.healthComponent.body.footPosition; } } ProjectileManager.instance.FireProjectile(FaceSlam.projectilePrefab, val2, Quaternion.identity, ((EntityState)this).gameObject, ((EntityState)this).characterBody.damage * projectileDamageCoefficient, projectileForce, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, -1f, (DamageTypeCombo?)(DamageTypeCombo.GenericSecondary | DamageTypeCombo.op_Implicit((DamageType)512))); } } if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { if (Object.op_Implicit((Object)(object)chargeInstance)) { EntityState.Destroy((Object)(object)chargeInstance); } ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)2; } } internal class Special : GenericProjectileBaseState { [SerializeField] public float aimCalculationRaycastDistance; [SerializeField] public string animationLayerName = "Body"; [SerializeField] public string animationStateName = "FaceSlam"; [SerializeField] public string playbackRateParam = "FaceSlam.playbackRate"; [SerializeField] public int projectileCount; [SerializeField] public float projectilePitchBonusPerProjectile; [SerializeField] public float projectileYawBonusPerProjectile; [SerializeField] public GameObject chargeEffectPrefab; [SerializeField] public string chargeEffectMuzzleString; [SerializeField] public string enterSoundString; private GameObject chargeInstance; private int currentProjectileCount; public override void OnEnter() { //IL_0157: 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_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_01ab: 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) aimCalculationRaycastDistance = 1000f; animationStateName = ""; animationLayerName = ""; base.damageCoefficient = MainPlugin.specialDamageCoefficient.Value; chargeEffectPrefab = Prefabs.Load("RoR2/DLC1/ClayGrenadier/ChargeClayGrenadierBarrel.prefab"); base.projectilePrefab = Prefabs.ballProjectile; base.effectPrefab = Prefabs.Load("RoR2/Base/ClayBoss/MuzzleflashClayBoss.prefab467"); chargeEffectMuzzleString = "MuzzleBetweenHands"; base.bloom = 1f; base.baseDuration = MainPlugin.specialDuration.Value; base.baseDelayBeforeFiringProjectile = MainPlugin.specialFireDelay.Value; base.attackSoundString = "Play_clayGrenadier_attack2_throw"; base.targetMuzzle = "MuzzleBetweenHands"; base.recoilAmplitude = 1f; projectileYawBonusPerProjectile = 0f; projectilePitchBonusPerProjectile = -3f; base.projectilePitchBonus = 6f; projectileCount = MainPlugin.specialProjCount.Value; playbackRateParam = "ThrowBarrel.playbackRate"; base.minSpread = 0f; base.maxSpread = MainPlugin.specialSpread.Value; base.force = 0f; enterSoundString = "Play_clayGrenadier_attack2_chargeup"; ((GenericProjectileBaseState)this).OnEnter(); Util.PlayAttackSpeedSound(enterSoundString, ((EntityState)this).gameObject, ((BaseState)this).attackSpeedStat); if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection)) { CharacterDirection characterDirection = ((EntityState)this).characterDirection; Ray aimRay = ((BaseState)this).GetAimRay(); characterDirection.moveVector = ((Ray)(ref aimRay)).direction; } ((EntityState)this).characterBody.SetAimTimer(0f); Transform val = ((BaseState)this).FindModelChild(chargeEffectMuzzleString); if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)chargeEffectPrefab)) { chargeInstance = Object.Instantiate(chargeEffectPrefab, val.position, val.rotation); chargeInstance.transform.parent = val; ScaleParticleSystemDuration component = chargeInstance.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.newDuration = base.delayBeforeFiringProjectile; } } if (NetworkServer.active) { ((EntityState)this).characterBody.AddTimedBuff(Buffs.HiddenInvincibility, base.duration); } ((ProjectileExplosion)Prefabs.ballProjectile.GetComponent()).blastRadius = MainPlugin.specialRadius.Value; ((EntityState)this).PlayAnimation("Gesture, Override", "Special", "Special", base.duration, 0f); } public override void PlayAnimation(float duration) { ((GenericProjectileBaseState)this).PlayAnimation(duration); ((EntityState)this).PlayCrossfade(animationLayerName, animationStateName, playbackRateParam, duration, 0.2f); } public override Ray ModifyProjectileAimRay(Ray aimRay) { //IL_0003: 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_000a: 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_0031: 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_004d: 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_00f4: 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_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: 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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: 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_00e1: 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_0139: Unknown result type (might be due to invalid IL or missing references) RaycastHit val = default(RaycastHit); Ray val2 = aimRay; float desiredForwardSpeed = base.projectilePrefab.GetComponent().desiredForwardSpeed; ((Ray)(ref val2)).origin = ((Ray)(ref aimRay)).origin; if (Util.CharacterRaycast(((EntityState)this).gameObject, val2, ref val, float.PositiveInfinity, LayerMask.op_Implicit(LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask) | LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask)), (QueryTriggerInteraction)1)) { float num = desiredForwardSpeed; Vector3 val3 = ((RaycastHit)(ref val)).point - ((Ray)(ref aimRay)).origin; Vector2 val4 = default(Vector2); ((Vector2)(ref val4))..ctor(val3.x, val3.z); float magnitude = ((Vector2)(ref val4)).magnitude; float num2 = Trajectory.CalculateInitialYSpeed(magnitude / num, val3.y); Vector3 val5 = default(Vector3); ((Vector3)(ref val5))..ctor(val4.x / magnitude * num, num2, val4.y / magnitude * num); desiredForwardSpeed = ((Vector3)(ref val5)).magnitude; ((Ray)(ref aimRay)).direction = val5 / desiredForwardSpeed; } ((Ray)(ref aimRay)).direction = Util.ApplySpread(((Ray)(ref aimRay)).direction, 0f, 0f, 1f, 1f, projectileYawBonusPerProjectile * (float)currentProjectileCount, projectilePitchBonusPerProjectile * (float)currentProjectileCount); return aimRay; } public override void FireProjectile() { for (int i = 0; i < projectileCount; i++) { ((GenericProjectileBaseState)this).FireProjectile(); currentProjectileCount++; } if (Object.op_Implicit((Object)(object)chargeInstance)) { EntityState.Destroy((Object)(object)chargeInstance); } } public override void OnExit() { if (Object.op_Implicit((Object)(object)chargeInstance)) { EntityState.Destroy((Object)(object)chargeInstance); } ((GenericProjectileBaseState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)2; } } public class LunarUtility : GenericCharacterMain { private HurtBoxGroup hurtBoxGroup; private CharacterModel characterModel; private GameObject coreVfxInstance; private GameObject footVfxInstance; private float healTimer; private float duration; private ICharacterGravityParameterProvider characterGravityParameterProvider; private ICharacterFlightParameterProvider characterFlightParameterProvider; [SerializeField] public string animationLayerName; [SerializeField] public string animationStateName; [SerializeField] public string playbackRateParam; private EffectManagerHelper _emh_coreVfxInstance; private EffectManagerHelper _emh_footVfxInstance; private BlastAttack blastAttack; private float stopwatch = 1f; private float fireRate; public override void Reset() { ((BaseState)this).Reset(); hurtBoxGroup = null; characterModel = null; coreVfxInstance = null; footVfxInstance = null; healTimer = 0f; duration = 0f; _emh_coreVfxInstance = null; _emh_footVfxInstance = null; } public override void OnEnter() { //IL_010b: 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_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_0133: Expected O, but got Unknown //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_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: 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_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: 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_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: 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_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_02f0: 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_02fc: 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_0311: 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_031c: Unknown result type (might be due to invalid IL or missing references) //IL_0321: Unknown result type (might be due to invalid IL or missing references) //IL_0326: 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) //IL_032d: Unknown result type (might be due to invalid IL or missing references) //IL_0332: 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_0339: Unknown result type (might be due to invalid IL or missing references) //IL_033f: 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_034e: Expected O, but got Unknown ((GenericCharacterMain)this).OnEnter(); duration = GhostUtilitySkillState.baseDuration; characterGravityParameterProvider = ((EntityState)this).gameObject.GetComponent(); characterFlightParameterProvider = ((EntityState)this).gameObject.GetComponent(); if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody)) { hurtBoxGroup = ((EntityState)this).characterBody.hurtBoxGroup; if (Object.op_Implicit((Object)(object)hurtBoxGroup)) { HurtBoxGroup val = hurtBoxGroup; int hurtBoxesDeactivatorCounter = val.hurtBoxesDeactivatorCounter + 1; val.hurtBoxesDeactivatorCounter = hurtBoxesDeactivatorCounter; } coreVfxInstance = Object.Instantiate(Prefabs.lunarCoreVFX); if (Object.op_Implicit((Object)(object)GhostUtilitySkillState.footVfxPrefab)) { if (!EffectManager.ShouldUsePooledEffect(GhostUtilitySkillState.footVfxPrefab)) { footVfxInstance = Object.Instantiate(GhostUtilitySkillState.footVfxPrefab); } else { _emh_footVfxInstance = EffectManager.GetAndActivatePooledEffect(GhostUtilitySkillState.footVfxPrefab, Vector3.zero, Quaternion.identity); footVfxInstance = ((Component)_emh_footVfxInstance).gameObject; } } UpdateVfxPositions(); EffectManager.SpawnEffect(Prefabs.Load("RoR2/DLC1/ClayGrenadier/ClayGrenadierBarrelExplosion.prefab"), new EffectData { origin = ((EntityState)this).characterBody.corePosition, scale = 6f }, false); } Transform modelTransform = ((EntityState)this).GetModelTransform(); characterModel = (((Object)(object)modelTransform != (Object)null) ? ((Component)modelTransform).GetComponent() : null); if (Object.op_Implicit((Object)(object)((BaseCharacterMain)this).modelAnimator)) { ((Behaviour)((BaseCharacterMain)this).modelAnimator).enabled = false; } if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.walkSpeedPenaltyCoefficient = GhostUtilitySkillState.moveSpeedCoefficient; } if (characterGravityParameterProvider != null) { CharacterGravityParameters gravityParameters = characterGravityParameterProvider.gravityParameters; gravityParameters.channeledAntiGravityGranterCount++; characterGravityParameterProvider.gravityParameters = gravityParameters; } if (characterFlightParameterProvider != null) { CharacterFlightParameters flightParameters = characterFlightParameterProvider.flightParameters; flightParameters.channeledFlightGranterCount++; characterFlightParameterProvider.flightParameters = flightParameters; } if (Object.op_Implicit((Object)(object)characterModel)) { CharacterModel val2 = characterModel; int invisibilityCount = val2.invisibilityCount + 1; val2.invisibilityCount = invisibilityCount; } EntityStateMachine[] components = ((EntityState)this).gameObject.GetComponents(); foreach (EntityStateMachine val3 in components) { if (val3.customName == "Weapon") { val3.SetNextStateToMain(); } } fireRate = 1f / MainPlugin.utility2FireRate.Value / ((BaseState)this).attackSpeedStat; blastAttack = new BlastAttack { attacker = ((EntityState)this).gameObject, inflictor = ((EntityState)this).gameObject, teamIndex = TeamComponent.GetObjectTeam(((EntityState)this).gameObject), baseDamage = ((BaseState)this).damageStat * MainPlugin.utility2DamageCoefficient.Value, baseForce = 500f, position = ((EntityState)this).transform.position, radius = MainPlugin.utility2Radius.Value, damageType = (DamageTypeCombo.GenericUtility | DamageTypeCombo.op_Implicit((DamageType)512)), attackerFiltering = (AttackerFiltering)2, falloffModel = (FalloffModel)0, impactEffect = EffectCatalog.FindEffectIndexFromPrefab(Prefabs.squidHit) }; } private void UpdateVfxPositions() { //IL_0032: 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) if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody)) { if (Object.op_Implicit((Object)(object)coreVfxInstance)) { coreVfxInstance.transform.position = ((EntityState)this).characterBody.corePosition; } if (Object.op_Implicit((Object)(object)footVfxInstance)) { footVfxInstance.transform.position = ((EntityState)this).characterBody.footPosition; } } } public override bool CanExecuteSkill(GenericSkill skillSlot) { return false; } public override void Update() { ((GenericCharacterMain)this).Update(); UpdateVfxPositions(); } public override void FixedUpdate() { //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0062: 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_00ae: Unknown result type (might be due to invalid IL or missing references) ((GenericCharacterMain)this).FixedUpdate(); if (((EntityState)this).isAuthority) { stopwatch += Time.fixedDeltaTime; if (stopwatch >= fireRate) { stopwatch = 0f; blastAttack.position = ((EntityState)this).transform.position; blastAttack.Fire(); } } healTimer -= Time.fixedDeltaTime; if (healTimer <= 0f) { if (NetworkServer.active) { ((EntityState)this).healthComponent.HealFraction(GhostUtilitySkillState.healFractionPerTick, default(ProcChainMask)); } healTimer = 1f / GhostUtilitySkillState.healFrequency; } if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { //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_0017: 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_0033: Expected O, but got Unknown //IL_015e: 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_0177: 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_01af: Unknown result type (might be due to invalid IL or missing references) EffectManager.SpawnEffect(Prefabs.Load("RoR2/DLC1/ClayGrenadier/ClayGrenadierBarrelExplosion.prefab"), new EffectData { origin = ((EntityState)this).characterBody.corePosition, scale = 6f }, false); if ((Object)(object)coreVfxInstance != (Object)null) { EntityState.Destroy((Object)(object)coreVfxInstance); } coreVfxInstance = null; _emh_coreVfxInstance = null; if ((Object)(object)_emh_footVfxInstance != (Object)null && _emh_footVfxInstance.OwningPool != null) { ((GenericPool)(object)_emh_footVfxInstance.OwningPool).ReturnObject(_emh_footVfxInstance); } else if ((Object)(object)footVfxInstance != (Object)null) { EntityState.Destroy((Object)(object)footVfxInstance); } footVfxInstance = null; _emh_footVfxInstance = null; if (Object.op_Implicit((Object)(object)characterModel)) { CharacterModel val = characterModel; int invisibilityCount = val.invisibilityCount - 1; val.invisibilityCount = invisibilityCount; } if (Object.op_Implicit((Object)(object)hurtBoxGroup)) { HurtBoxGroup val2 = hurtBoxGroup; int hurtBoxesDeactivatorCounter = val2.hurtBoxesDeactivatorCounter - 1; val2.hurtBoxesDeactivatorCounter = hurtBoxesDeactivatorCounter; } if (Object.op_Implicit((Object)(object)((BaseCharacterMain)this).modelAnimator)) { ((Behaviour)((BaseCharacterMain)this).modelAnimator).enabled = true; } if (characterFlightParameterProvider != null) { CharacterFlightParameters flightParameters = characterFlightParameterProvider.flightParameters; flightParameters.channeledFlightGranterCount--; characterFlightParameterProvider.flightParameters = flightParameters; } if (characterGravityParameterProvider != null) { CharacterGravityParameters gravityParameters = characterGravityParameterProvider.gravityParameters; gravityParameters.channeledAntiGravityGranterCount--; characterGravityParameterProvider.gravityParameters = gravityParameters; } if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.walkSpeedPenaltyCoefficient = 1f; } ((GenericCharacterMain)this).OnExit(); } } internal class Utility : BaseSkillState { private float duration => MainPlugin.utilityDuration.Value; private float radius => MainPlugin.utilityRadius.Value; public override void OnEnter() { //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: 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_021c: Expected O, but got Unknown //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //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_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_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_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: 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_00fa: 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_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: 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_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013e: 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_0148: 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_0157: Expected O, but got Unknown ((BaseState)this).OnEnter(); if (NetworkServer.active) { ((EntityState)this).characterBody.AddTimedBuff(Prefabs.buff, duration); float value = MainPlugin.utilityKnockback.Value; SphereSearch val = new SphereSearch(); val.origin = ((EntityState)this).transform.position; val.radius = radius; val.mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask; val.RefreshCandidates(); val.FilterCandidatesByHurtBoxTeam(TeamMask.GetEnemyTeams(((BaseState)this).GetTeam())); val.FilterCandidatesByDistinctHurtBoxEntities(); HurtBox[] hurtBoxes = val.GetHurtBoxes(); foreach (HurtBox val2 in hurtBoxes) { if (val2.healthComponent.alive) { HealthComponent healthComponent = val2.healthComponent; DamageInfo val3 = new DamageInfo { position = ((Component)val2).transform.position, attacker = ((EntityState)this).gameObject, inflictor = ((EntityState)this).gameObject, damage = 0f, procCoefficient = 1f, crit = ((BaseState)this).RollCrit(), damageType = DamageTypeCombo.op_Implicit((DamageType)512) }; Vector3 val4 = ((Component)val2).transform.position - ((EntityState)this).transform.position; val3.force = ((Vector3)(ref val4)).normalized * value; healthComponent.TakeDamage(val3); } } } TemporaryOverlayInstance val5 = TemporaryOverlayManager.AddOverlay(((EntityState)this).gameObject); val5.originalMaterial = Prefabs.Load("RoR2/Base/Common/matClayGooDebuff.mat"); val5.duration = duration; val5.destroyComponentOnEnd = true; val5.animateShaderAlpha = true; val5.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); val5.alphaCurve.AddKey(0.85f, 1f); val5.AddToCharacterModel(((Component)((EntityState)this).GetModelTransform()).GetComponent()); EffectManager.SpawnEffect(Prefabs.Load("RoR2/DLC1/ClayGrenadier/ClayGrenadierBarrelExplosion.prefab"), new EffectData { origin = ((EntityState)this).characterBody.corePosition, scale = radius }, false); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)1; } } internal static class Extensions { public static SphereSearch FilterOutHurtBoxes(this SphereSearch s, List> targets) { int i; for (i = s.searchData.candidatesCount - 1; i >= 0; i--) { if (targets.Any((KeyValuePair x) => (Object)(object)x.Value == (Object)(object)((SearchData)(ref s.searchData)).GetCandidate(i).hurtBox.healthComponent)) { ((SearchData)(ref s.searchData)).RemoveCandidate(i); } } return s; } public static SphereSearch FilterByLiveEntities(this SphereSearch s) { for (int num = s.searchData.candidatesCount - 1; num >= 0; num--) { if (!((SearchData)(ref s.searchData)).GetCandidate(num).hurtBox.healthComponent.alive) { ((SearchData)(ref s.searchData)).RemoveCandidate(num); } } return s; } public static GameObject NewSyringe(this GameObject g, params Material[] m) { ((Renderer)g.GetComponentsInChildren(false)[0]).material = m[0]; ((Renderer)g.GetComponent()).material = m[1]; ((Renderer)g.GetComponent()).material = m[2]; return g; } public static Material SwapTexture(this Material m, Texture2D t) { m.mainTexture = (Texture)(object)t; return m; } public static GameObject SwapMaterials(this GameObject g, Material[] m) { Renderer[] componentsInChildren = g.GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { if (Object.op_Implicit((Object)(object)m[i])) { componentsInChildren[i].material = m[i]; } } return g; } public static float Mult(this float f, float mult = 100f) { return f * mult; } public static Color ToRGB255(this Color c, string title, string body) { //IL_0001: 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_0019: 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) //IL_002d: Unknown result type (might be due to invalid IL or missing references) return new Color(c.r / 255f, c.g / 255f, c.b / 255f); } public static void SetStrings(this TooltipProvider t, string title, string body) { t.overrideTitleText = title; t.overrideBodyText = body; } } internal class Utils { internal static void DisablePooling(GameObject obj) { VFXAttributes val = obj.GetComponent(); if (!Object.op_Implicit((Object)(object)val)) { val = obj.AddComponent(); } val.DoNotCullPool = true; val.DoNotPool = true; } internal static void RecolorEffect(GameObject obj, Color color) { //IL_008c: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)obj)) { return; } OmniEffect component = obj.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { Object.DestroyImmediate((Object)(object)obj.GetComponent()); } Renderer[] componentsInChildren = obj.GetComponentsInChildren(Object.op_Implicit((Object)(object)component)); for (int i = 0; i < componentsInChildren.Length; i++) { ((Component)componentsInChildren[i]).gameObject.SetActive(true); if (Object.op_Implicit((Object)(object)componentsInChildren[i].material) && componentsInChildren[i].material.HasProperty("_TintColor")) { componentsInChildren[i].material.SetColor("_TintColor", color); } } } public static Vector3 FindNearestNodePosition(Vector3 targetPosition, GraphType nodeGraphType) { //IL_0009: 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_0010: 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_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_004a: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Expected O, but got Unknown //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_0084: 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_0089: Unknown result type (might be due to invalid IL or missing references) SpawnCard val = ScriptableObject.CreateInstance(); val.hullSize = (HullClassification)1; val.nodeGraphType = nodeGraphType; val.prefab = Prefabs.Load("RoR2/Base/Common/DirectorSpawnProbeHelperPrefab.prefab"); Vector3 result = targetPosition; GameObject val2 = DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest(val, new DirectorPlacementRule { placementMode = (PlacementMode)3, position = targetPosition }, RoR2Application.rng)); if (Object.op_Implicit((Object)(object)val2)) { result = val2.transform.position; } if (Object.op_Implicit((Object)(object)val2)) { Object.Destroy((Object)(object)val2); } Object.Destroy((Object)(object)val); return result; } public static Vector3 GetForwardDirection(Vector3 dir) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //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) //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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: 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_0045: Unknown result type (might be due to invalid IL or missing references) Vector2 val = Util.Vector3XZToVector2XY(dir); if (val != Vector2.zero) { ((Vector2)(ref val)).Normalize(); Vector3 val2 = new Vector3(val.x, 0f, val.y); return ((Vector3)(ref val2)).normalized; } return dir; } public static void PlayAnimation(GameObject g, string layerName, string animationStateName) { Animator component = g.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { int layerIndex = component.GetLayerIndex(layerName); component.speed = 1f; component.Update(0f); component.PlayInFixedTime(animationStateName, layerIndex, 0f); } } public static void PlayAnimation(GameObject g, string layerName, string animationStateName, string playbackRateParam, float duration) { //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) Animator component = g.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.speed = 1f; component.Update(0f); int layerIndex = component.GetLayerIndex(layerName); component.SetFloat(playbackRateParam, 1f); component.PlayInFixedTime(animationStateName, layerIndex, 0f); component.Update(0f); AnimatorStateInfo currentAnimatorStateInfo = component.GetCurrentAnimatorStateInfo(layerIndex); float length = ((AnimatorStateInfo)(ref currentAnimatorStateInfo)).length; component.SetFloat(playbackRateParam, length / duration); } } public static void AnimatorPlayAnimation(Animator modelAnimator, string layerName, string animationStateName) { int layerIndex = modelAnimator.GetLayerIndex(layerName); modelAnimator.speed = 1f; modelAnimator.Update(0f); modelAnimator.PlayInFixedTime(animationStateName, layerIndex, 0f); } public static void AnimatorPlayAnimation(Animator modelAnimator, string layerName, string animationStateName, string playbackRateParam, float duration) { //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) modelAnimator.speed = 1f; modelAnimator.Update(0f); int layerIndex = modelAnimator.GetLayerIndex(layerName); modelAnimator.SetFloat(playbackRateParam, 1f); modelAnimator.PlayInFixedTime(animationStateName, layerIndex, 0f); modelAnimator.Update(0f); AnimatorStateInfo currentAnimatorStateInfo = modelAnimator.GetCurrentAnimatorStateInfo(layerIndex); float length = ((AnimatorStateInfo)(ref currentAnimatorStateInfo)).length; modelAnimator.SetFloat(playbackRateParam, length / duration); } public static SkillDef NewSkillDef(Type activationState, string activationStateMachineName, int baseMaxStock, float baseRechargeInterval, bool beginSkillCooldownOnSkillEnd, bool canceledFromSprinting, bool fullRestockOnAssign, InterruptPriority interruptPriority, bool isCombatSkill, bool mustKeyPress, bool cancelSprintingOnActivation, int rechargeStock, int requiredStock, int stockToConsume, Sprite icon, string skillName, string skillDescriptionToken, params string[] keywordTokens) where T : SkillDef { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0069: 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) T val = ScriptableObject.CreateInstance(); ((SkillDef)val).activationState = new SerializableEntityStateType(activationState); ((SkillDef)val).activationStateMachineName = activationStateMachineName; ((SkillDef)val).baseMaxStock = baseMaxStock; ((SkillDef)val).baseRechargeInterval = baseRechargeInterval; ((SkillDef)val).beginSkillCooldownOnSkillEnd = beginSkillCooldownOnSkillEnd; ((SkillDef)val).canceledFromSprinting = canceledFromSprinting; ((SkillDef)val).fullRestockOnAssign = fullRestockOnAssign; ((SkillDef)val).interruptPriority = interruptPriority; ((SkillDef)val).isCombatSkill = isCombatSkill; ((SkillDef)val).mustKeyPress = mustKeyPress; ((SkillDef)val).cancelSprintingOnActivation = cancelSprintingOnActivation; ((SkillDef)val).rechargeStock = rechargeStock; ((SkillDef)val).requiredStock = requiredStock; ((SkillDef)val).stockToConsume = stockToConsume; ((SkillDef)val).icon = icon; ((SkillDef)val).skillDescriptionToken = skillDescriptionToken; ((SkillDef)val).skillName = skillName; ((SkillDef)val).skillNameToken = ((SkillDef)val).skillName; ((SkillDef)val).keywordTokens = keywordTokens; ContentAddition.AddSkillDef((SkillDef)(object)val); return (SkillDef)(object)val; } public static Color HexTo10(string hexColor) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_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_0039: Unknown result type (might be due to invalid IL or missing references) char[] array = hexColor.ToCharArray(); return new Color((float)(array[0] + array[1]), (float)(array[2] + array[3]), (float)(array[4] + array[5]), 255f) / 255f; } public static EntityStateMachine NewStateMachine(GameObject obj, string customName) where T : EntityState { //IL_0021: 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_0028: 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) SerializableEntityStateType val = default(SerializableEntityStateType); ((SerializableEntityStateType)(ref val))..ctor(typeof(T)); EntityStateMachine val2 = obj.AddComponent(); val2.customName = customName; val2.initialStateType = val; val2.mainStateType = val; return val2; } public static GenericSkill NewGenericSkill(GameObject obj, SkillDef skill) { //IL_0031: 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_0053: Expected O, but got Unknown //IL_0054: 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) GenericSkill val = obj.AddComponent(); SkillFamily val2 = ScriptableObject.CreateInstance(); val2.variants = (Variant[])(object)new Variant[1]; val._skillFamily = val2; SkillFamily skillFamily = val.skillFamily; Variant[] variants = skillFamily.variants; Variant val3 = new Variant { skillDef = skill }; ((Variant)(ref val3)).viewableNode = new Node(skill.skillNameToken, false, (Node)null); variants[0] = val3; ContentAddition.AddSkillFamily(skillFamily); return val; } public static void AddAlt(SkillFamily skillFamily, SkillDef SkillDef) { //IL_0029: 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_004b: Expected O, but got Unknown //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) 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 }; ((Variant)(ref val)).viewableNode = new Node(SkillDef.skillNameToken, false, (Node)null); variants[num] = val; } public static BuffDef NewBuffDef(string name, bool stack, bool hidden, Sprite sprite, Color color) { //IL_0025: 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) BuffDef val = ScriptableObject.CreateInstance(); ((Object)val).name = name; val.canStack = stack; val.isHidden = hidden; val.iconSprite = sprite; val.buffColor = color; ContentAddition.AddBuffDef(val); return val; } public static ObjectScaleCurve AddScaleComponent(GameObject target, float timeMax) { ObjectScaleCurve val = target.AddComponent(); val.useOverallCurveOnly = true; val.timeMax = timeMax; val.overallCurve = AnimationCurve.Linear(0f, 0f, 1f, 1f); return val; } public static RotateAroundAxis AddRotationComponent(GameObject target, float speed, RotationAxis axis) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) RotateAroundAxis val = target.AddComponent(); val.speed = (Speed)2; val.fastRotationSpeed = speed; val.rotateAroundAxis = axis; return val; } public static AnimateShaderAlpha AddShaderAlphaComponent(GameObject target, float timeMax, AnimationCurve curve, bool destroyOnEnd = true, bool disableOnEnd = false) { AnimateShaderAlpha val = target.AddComponent(); val.timeMax = timeMax; val.alphaCurve = curve; val.destroyOnEnd = destroyOnEnd; val.disableOnEnd = disableOnEnd; return val; } internal static Sprite CreateSprite(Texture2D tex) { //IL_001a: 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) return Sprite.Create(tex, new Rect(0f, 0f, (float)((Texture)tex).width, (float)((Texture)tex).height), new Vector2(0.5f, 0.5f), 128f); } internal static SkinDefInfo CreateNewSkinDefInfo(SkinnedMeshRenderer[] childList, GameObject rootObject, string skinName, RendererInfo[] rendererInfos, UnlockableDef unlockableDef = null) { //IL_0003: 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_0089: 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) return new SkinDefInfo { BaseSkins = Array.Empty(), MinionSkinReplacements = (MinionSkinReplacement[])(object)new MinionSkinReplacement[0], ProjectileGhostReplacements = (ProjectileGhostReplacement[])(object)new ProjectileGhostReplacement[0], GameObjectActivations = (GameObjectActivation[])(object)new GameObjectActivation[0], Icon = Assets.MainAssetBundle.LoadAsset("skinIcon"), MeshReplacements = (MeshReplacement[])(object)new MeshReplacement[0], Name = skinName, NameToken = skinName, RendererInfos = rendererInfos, RootObject = rootObject, UnlockableDef = unlockableDef }; } internal static T CopyComponent(T original, GameObject destination) where T : Component { Type type = ((object)original).GetType(); Component val = destination.AddComponent(type); FieldInfo[] fields = type.GetFields(); FieldInfo[] array = fields; foreach (FieldInfo fieldInfo in array) { fieldInfo.SetValue(val, fieldInfo.GetValue(original)); } return (T)(object)((val is T) ? val : null); } public static Sprite CreateSpriteFromTexture(Texture2D texture) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)texture)) { return Sprite.Create(texture, new Rect(0f, 0f, (float)((Texture)texture).width, (float)((Texture)texture).height), new Vector2(0.5f, 0.5f)); } return null; } public static GameObject FindInActiveObjectByName(string name) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Invalid comparison between Unknown and I4 Transform[] array = Resources.FindObjectsOfTypeAll(); for (int i = 0; i < array.Length; i++) { if ((int)((Object)array[i]).hideFlags == 0 && ((Object)array[i]).name == name) { return ((Component)array[i]).gameObject; } } return null; } public static void CreateHitboxes(string name, Transform parent, Vector3[] sizes, Vector3[] positions) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) HitBoxGroup val = ((Component)parent).gameObject.AddComponent(); val.groupName = name; List list = new List(); for (int i = 0; i < sizes.Length; i++) { GameObject val2 = new GameObject(name + (i + 1)); val2.transform.SetParent(parent); val2.transform.localPosition = positions[i]; val2.transform.localRotation = Quaternion.Euler(Vector3.forward * 45f); val2.transform.localScale = sizes[i]; HitBox item = val2.AddComponent(); val2.layer = LayerIndex.projectile.intVal; list.Add(item); } val.hitBoxes = list.ToArray(); } public static GameObject CreateHitbox(string name, Transform parent, Vector3 scale, Vector3 localPosition) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_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_0048: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name); val.transform.SetParent(parent); val.transform.localPosition = localPosition; val.transform.localRotation = Quaternion.Euler(Vector3.forward * 45f); val.transform.localScale = scale; HitBoxGroup val2 = ((Component)parent).gameObject.AddComponent(); HitBox val3 = val.AddComponent(); val.layer = LayerIndex.projectile.intVal; val2.hitBoxes = (HitBox[])(object)new HitBox[1] { val3 }; val2.groupName = name; return val; } internal static EffectComponent RegisterEffect(GameObject effect, float duration, string soundName = "", bool applyScale = false, bool parentToReferencedTransform = true, bool positionAtReferencedTransform = true) { //IL_00a6: 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) EffectComponent val = effect.GetComponent(); if (!Object.op_Implicit((Object)(object)val)) { val = effect.AddComponent(); } if (duration != -1f) { DestroyOnTimer component = effect.GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { effect.AddComponent().duration = duration; } else { component.duration = duration; } } if (!Object.op_Implicit((Object)(object)effect.GetComponent())) { effect.AddComponent(); } if (!Object.op_Implicit((Object)(object)effect.GetComponent())) { effect.AddComponent().vfxPriority = (VFXPriority)2; } val.applyScale = applyScale; val.effectIndex = (EffectIndex)(-1); val.parentToReferencedTransform = parentToReferencedTransform; val.positionAtReferencedTransform = positionAtReferencedTransform; val.soundName = soundName; ContentAddition.AddEffect(effect); return val; } public static Material FindMaterial(string name) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Invalid comparison between Unknown and I4 Material[] array = Resources.FindObjectsOfTypeAll(); for (int i = 0; i < array.Length; i++) { if ((int)((Object)array[i]).hideFlags == 0 && ((Object)array[i]).name == name) { return array[i]; } } return null; } }