Decompiled source of NascentGrovetender v1.0.0
NascentGrovetender.dll
Decompiled 5 days ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; 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.Captain.Weapon; using EntityStates.Croco; using EntityStates.GravekeeperBoss; using EntityStates.GravekeeperMonster.Weapon; using EntityStates.Merc; using Generics.Dynamics; using JetBrains.Annotations; using KinematicCharacterController; using R2API; using R2API.Utils; using Rewired.ComponentControls.Effects; using RoR2; using RoR2.CharacterAI; using RoR2.Navigation; using RoR2.Projectile; using RoR2.Skills; using RoR2.UI; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Networking; [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: CompilationRelaxations(8)] [assembly: AssemblyCompany("NascentGrovetender")] [assembly: AssemblyProduct("NascentGrovetender")] [assembly: AssemblyTitle("NascentGrovetender")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace NascentGrovetender; internal class Assets { public static AssetBundle MainAssetBundle; public static T Load<T>(string name) where T : Object { return MainAssetBundle.LoadAsset<T>(name); } public static void PopulateAssets() { Assembly executingAssembly = Assembly.GetExecutingAssembly(); if ((Object)(object)MainAssetBundle == (Object)null) { using (Stream stream = executingAssembly.GetManifestResourceStream("NascentGrovetender.AssetBundle." + "NascentGrovetender".ToLower() + "assets")) { MainAssetBundle = AssetBundle.LoadFromStream(stream); } } } } internal class Behaviour : NetworkBehaviour { public List<GameObject> allies = new List<GameObject>(); public List<GameObject> wisps = new List<GameObject>(); public List<GameObject> greaterWisps = new List<GameObject>(); public float spread = 3f; private static int kRpcRpcWispAttack; private void Start() { AkBankManager.LoadBankAsync("Boss_Brother", (BankCallback)null); } [ClientRpc] public void RpcWispAttack(GameObject target) { foreach (GameObject ally in allies) { CharacterBody component = ally.GetComponent<CharacterBody>(); if (!Object.op_Implicit((Object)(object)component)) { continue; } if (Object.op_Implicit((Object)(object)component.master)) { BaseAI component2 = ((Component)component.master).GetComponent<BaseAI>(); if (Object.op_Implicit((Object)(object)component2)) { component2.currentEnemy.Reset(); component2.currentEnemy.gameObject = target; } } if (component.hasEffectiveAuthority) { component.skillLocator.primary.OnExecute(); } } } private void UNetVersion() { } protected static void InvokeRpcRpcWispAttack(NetworkBehaviour obj, NetworkReader reader) { if (!NetworkClient.active) { Debug.LogError((object)"RPC RpcWispAttack called on server."); } else { ((Behaviour)(object)obj).RpcWispAttack(reader.ReadGameObject()); } } public void CallRpcWispAttack(GameObject target) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { Debug.LogError((object)"RPC Function RpcWispAttack called on client."); return; } NetworkWriter val = new NetworkWriter(); val.Write((short)0); val.Write((short)2); val.WritePackedUInt32((uint)kRpcRpcWispAttack); val.Write(((Component)this).GetComponent<NetworkIdentity>().netId); val.Write(target); ((NetworkBehaviour)this).SendRPCInternal(val, 0, "RpcWispAttack"); } static Behaviour() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown kRpcRpcWispAttack = 1739084010; NetworkBehaviour.RegisterRpcDelegate(typeof(Behaviour), kRpcRpcWispAttack, new CmdDelegate(InvokeRpcRpcWispAttack)); NetworkCRC.RegisterBehaviour("Behaviour", 0); } public override bool OnSerialize(NetworkWriter writer, bool forceAll) { bool result = default(bool); return result; } public override void OnDeserialize(NetworkReader reader, bool initialState) { } } internal class ModelBehaviour : MonoBehaviour { private void Start() { Animator component = ((Component)this).GetComponent<Animator>(); component.SetBool("isGrounded", true); EntityState.PlayAnimationOnAnimator(component, "Body", "Idle"); EntityState.PlayAnimationOnAnimator(component, "Jar, Override", GravekeeperBarrage.BeginGravekeeperBarrageStateHash); Util.PlaySound(GravekeeperBarrage.jarOpenSoundString, ((Component)this).gameObject); ChildLocator component2 = ((Component)this).GetComponent<ChildLocator>(); if (Object.op_Implicit((Object)(object)component2)) { ((Component)component2.FindChild("JarEffectLoop")).gameObject.SetActive(true); } } } internal class WispMinionBehaviour : MonoBehaviour { private Behaviour behaviour; public bool wisp; private void Start() { CharacterBody component = ((Component)this).GetComponent<CharacterBody>(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.master) && Object.op_Implicit((Object)(object)component.master.minionOwnership) && Object.op_Implicit((Object)(object)component.master.minionOwnership.ownerMaster)) { CharacterBody body = component.master.minionOwnership.ownerMaster.GetBody(); if (Object.op_Implicit((Object)(object)body)) { behaviour = ((Component)body).GetComponent<Behaviour>(); } } if (Object.op_Implicit((Object)(object)behaviour)) { behaviour.allies.Add(((Component)this).gameObject); if (wisp) { behaviour.wisps.Add(((Component)this).gameObject); } else { behaviour.greaterWisps.Add(((Component)this).gameObject); } } } private void OnDisable() { if (wisp && Object.op_Implicit((Object)(object)behaviour)) { behaviour.wisps.Remove(((Component)this).gameObject); } } } internal class CharacterBodySetup { internal static GameObject baseBody = Prefabs.Load<GameObject>("RoR2/Base/Gravekeeper/GravekeeperBody.prefab"); internal static GameObject baseMaster; internal const string SURVIVORNAME = "Nascent Grovetender"; internal const string SURVIVORNAMEKEY = "NASCENTGROVETENDER_"; internal static void CreateCharacterBodies() { RegisterStates(); CreateSurvivorPrefab(); } internal static void CreateSurvivorPrefab() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_032a: Unknown result type (might be due to invalid IL or missing references) //IL_034a: Unknown result type (might be due to invalid IL or missing references) //IL_034c: Unknown result type (might be due to invalid IL or missing references) //IL_02e3: Unknown result type (might be due to invalid IL or missing references) //IL_02e8: Unknown result type (might be due to invalid IL or missing references) GameObject val = CreateBodyPrefab("Nascent Grovetender", new Color(0.726f, 0.216f, 0.439f), 300f); val.AddComponent<Behaviour>(); CharacterBody component = val.GetComponent<CharacterBody>(); component.mainRootSpeed = 0f; component.baseMaxHealth = 110f; component.levelMaxHealth = 33f; component.baseRegen = 1.5f; component.levelRegen = 0.2f; component.baseMaxShield = 0f; component.levelMaxShield = 0f; component.baseMoveSpeed = 7f; component.levelMoveSpeed = 0f; component.baseAcceleration = 110f; component.baseJumpPower = 15f; component.levelJumpPower = 0f; component.baseDamage = 12f; component.levelDamage = 2.4f; component.baseAttackSpeed = 1f; component.levelAttackSpeed = 0f; component.baseCrit = 1f; component.levelCrit = 0f; component.baseArmor = 0f; component.levelArmor = 0f; component.baseJumpCount = 1; component.sprintingSpeedMultiplier = 1.45f; component.spreadBloomCurve = Prefabs.Load<GameObject>("RoR2/Base/Captain/CaptainBody.prefab").GetComponent<CharacterBody>().spreadBloomCurve; val.GetComponent<HealthComponent>().health = component.baseMaxHealth; Transform modelTransform = val.GetComponent<ModelLocator>().modelTransform; ((Behaviour)((Component)modelTransform).GetComponent<InverseKinematics>()).enabled = false; ChildLocator component2 = ((Component)modelTransform).GetComponent<ChildLocator>(); Transform val2 = component2.FindChild("JarEffectLoop"); ((Component)val2).GetComponentInChildren<Light>(true).color = Color32.op_Implicit(new Color32(byte.MaxValue, (byte)121, (byte)42, byte.MaxValue)); ParticleSystemRenderer[] componentsInChildren = ((Component)val2).GetComponentsInChildren<ParticleSystemRenderer>(true); foreach (ParticleSystemRenderer val3 in componentsInChildren) { string name = ((Object)val3).name; if (name != "Ring") { if (Object.op_Implicit((Object)(object)val3.trailMaterial)) { val3.trailMaterial = Prefabs.wispFire; } else { ((Renderer)val3).material = Prefabs.wispFire; } } MainModule main = ((Component)val3).GetComponent<ParticleSystem>().main; ((MainModule)(ref main)).scalingMode = (ParticleSystemScalingMode)0; } Transform val4 = Object.Instantiate<Transform>(val2, val2.position, val2.rotation, ((Component)val2).transform.parent); ((Component)val4).GetComponentInChildren<Light>(true).color = Color32.op_Implicit(new Color32((byte)42, byte.MaxValue, (byte)62, byte.MaxValue)); ParticleSystemRenderer[] componentsInChildren2 = ((Component)val4).GetComponentsInChildren<ParticleSystemRenderer>(true); foreach (ParticleSystemRenderer val5 in componentsInChildren2) { string name2 = ((Object)val5).name; if (name2 != "Ring") { if (Object.op_Implicit((Object)(object)val5.trailMaterial)) { val5.trailMaterial = Prefabs.greaterWispFire; } else { ((Renderer)val5).material = Prefabs.greaterWispFire; } } MainModule main2 = ((Component)val5).GetComponent<ParticleSystem>().main; ((MainModule)(ref main2)).scalingMode = (ParticleSystemScalingMode)0; } Array.Resize(ref component2.transformPairs, component2.transformPairs.Length + 1); component2.transformPairs[component2.transformPairs.Length - 1] = new NameTransformPair { name = "JarEffectLoopGreater", transform = ((Component)val4).transform }; CreateSurvivorDef(val); PassiveSetup(val); PrimarySetup(val); SecondarySetup(val); UtilitySetup(val); SpecialSetup(val); } internal static void CreateSurvivorDef(GameObject characterPrefab) { //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) CharacterBody component = characterPrefab.GetComponent<CharacterBody>(); string text = ((Object)characterPrefab).name.Replace("Body", ""); string text2 = text.Replace(" ", "").ToUpper(); string text3 = " <style=cSub>\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("NASCENTGROVETENDER_" + text2 + "_DESCRIPTION", text3); LanguageAPI.Add("NASCENTGROVETENDER_" + text2 + "_SUBTITLE", "Wisp Cultivator"); LanguageAPI.Add("NASCENTGROVETENDER_" + text2 + "_OUTRO", text4); LanguageAPI.Add("NASCENTGROVETENDER_" + text2 + "_FAIL", text5); GameObject val = PrefabAPI.InstantiateClone(((Component)characterPrefab.GetComponent<ModelLocator>().modelBaseTransform).gameObject, text + "Display", false); Animator componentInChildren = val.GetComponentInChildren<Animator>(); componentInChildren.runtimeAnimatorController = Assets.Load<RuntimeAnimatorController>("displayAnimator"); Utils.SetupDisplay(val); SurvivorDef val2 = ScriptableObject.CreateInstance<SurvivorDef>(); val2.cachedName = "NASCENTGROVETENDER_" + text2 + "_NAME"; val2.unlockableDef = null; val2.descriptionToken = "NASCENTGROVETENDER_" + text2 + "_DESCRIPTION"; val2.primaryColor = component.bodyColor; val2.bodyPrefab = characterPrefab; val2.displayPrefab = val; val2.outroFlavorToken = "NASCENTGROVETENDER_" + text2 + "_OUTRO"; val2.desiredSortPosition = 22f; val2.mainEndingEscapeFailureFlavorToken = "NASCENTGROVETENDER_" + text2 + "_FAIL"; ContentAddition.AddSurvivorDef(val2); GameObject val3 = PrefabAPI.InstantiateClone(Prefabs.Load<GameObject>("RoR2/Base/Commando/CommandoMonsterMaster.prefab"), text + "Master", true); ContentAddition.AddMaster(val3); CharacterMaster component2 = val3.GetComponent<CharacterMaster>(); 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) //IL_004b: Unknown result type (might be due to invalid IL or missing references) bool flag = default(bool); ContentAddition.AddEntityState<Primary>(ref flag); ContentAddition.AddEntityState<PrimaryPrep>(ref flag); ContentAddition.AddEntityState<PrimaryFire>(ref flag); ContentAddition.AddEntityState<Secondary>(ref flag); ContentAddition.AddEntityState<Utility>(ref flag); ContentAddition.AddEntityState<Special>(ref flag); ContentAddition.AddEntityState<CharacterMain>(ref flag); ContentAddition.AddEntityState<MeleeSkillState>(ref flag); ContentAddition.AddEntityState<BasicMeleeSkillState>(ref flag); ContentAddition.AddEntityState<SpawnState>(ref flag); } internal static void PassiveSetup(GameObject characterPrefab) { SkillLocator component = characterPrefab.GetComponent<SkillLocator>(); LanguageAPI.Add("NASCENTGROVETENDER__PASSIVE_NAME", "Little Disciples"); LanguageAPI.Add("NASCENTGROVETENDER__PASSIVE_DESCRIPTION", "Ally Wisps share <style=cIsHealing>10% stats</style>."); component.passiveSkill.enabled = true; component.passiveSkill.skillNameToken = "NASCENTGROVETENDER__PASSIVE_NAME"; component.passiveSkill.skillDescriptionToken = "NASCENTGROVETENDER__PASSIVE_DESCRIPTION"; component.passiveSkill.icon = Prefabs.Load<SkillDef>("RoR2/DLC2/Chef/ChefChefsKiss.asset").icon; } internal static void PrimarySetup(GameObject characterPrefab) { SkillLocator component = characterPrefab.GetComponent<SkillLocator>(); string text = "_M1"; LanguageAPI.Add("NASCENTGROVETENDER_" + text, "Scorched Chains"); LanguageAPI.Add("NASCENTGROVETENDER_" + text + "_DESCRIPTION", "Fire a blast of chains that deal <style=cIsDamage>6x" + MainPlugin.primaryDamage.Value * 100f + "% damage</style>. Charging the attack narrows the <style=cIsUtility>spread</style>. Hitting at least <style=cIsDamage>4</style>, <style=cIsDamage>roots</style> the enemy and makes ally wisps target it."); SkillDef skill = Utils.NewSkillDef<SkillDef>(typeof(Primary), "Weapon", 0, 0f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: true, (InterruptPriority)0, isCombatSkill: true, mustKeyPress: false, cancelSprintingOnActivation: true, 0, 0, 0, Prefabs.Load<SkillDef>("RoR2/Base/Captain/CaptainShotgun.asset").icon, "NASCENTGROVETENDER_" + text, "NASCENTGROVETENDER_" + text + "_DESCRIPTION", Array.Empty<string>()); component.primary = Utils.NewGenericSkill(characterPrefab, skill); } internal static void SecondarySetup(GameObject characterPrefab) { SkillLocator component = characterPrefab.GetComponent<SkillLocator>(); string text = "_M2"; LanguageAPI.Add("NASCENTGROVETENDER_" + text, "Wisp Swarm"); LanguageAPI.Add("NASCENTGROVETENDER_" + text + "_DESCRIPTION", "Summon <style=cIsDamage>1</style> Lesser Wisp. If there are no ally Lesser Wisps, summon <style=cIsDamage>2</style> instead. Up to <style=cIsDamage>10</style> can be active at a time."); SkillDef skill = Utils.NewSkillDef<SkillDef>(typeof(Secondary), "Weapon", 1, 5f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)1, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: false, 1, 1, 1, Prefabs.Load<SkillDef>("RoR2/Base/Croco/CrocoPassiveBlight.asset").icon, "NASCENTGROVETENDER_" + text, "NASCENTGROVETENDER_" + text + "_DESCRIPTION", Array.Empty<string>()); component.secondary = Utils.NewGenericSkill(characterPrefab, skill); } internal static void UtilitySetup(GameObject characterPrefab) { SkillLocator component = characterPrefab.GetComponent<SkillLocator>(); string text = "_UTIL"; LanguageAPI.Add("NASCENTGROVETENDER_" + text, "Flaming Leap"); LanguageAPI.Add("NASCENTGROVETENDER_" + text + "_DESCRIPTION", "<style=cIsDamage>Ignite</style>. Leap in the air, dealing <style=cIsDamage>" + MainPlugin.utilityDamage.Value * 100f + "% damage</style>."); SkillDef skill = Utils.NewSkillDef<SkillDef>(typeof(Utility), "Weapon", 1, 5f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)1, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: false, 1, 1, 1, Prefabs.Load<SkillDef>("RoR2/DLC2/Chef/ChefOilSpill.asset").icon, "NASCENTGROVETENDER_" + text, "NASCENTGROVETENDER_" + text + "_DESCRIPTION", Array.Empty<string>()); component.utility = Utils.NewGenericSkill(characterPrefab, skill); } internal static void SpecialSetup(GameObject characterPrefab) { SkillLocator component = characterPrefab.GetComponent<SkillLocator>(); string text = "_SPEC"; LanguageAPI.Add("NASCENTGROVETENDER_" + text, "Greater Sacrifice"); LanguageAPI.Add("NASCENTGROVETENDER_" + text + "_DESCRIPTION", "Sacrifice <style=cIsHealth>5</style> Lesser Wisps to <style=cIsDamage>summon</style> a Greater Wisp. Up to <style=cIsDamage>5</style> can be active at a time."); SkillDef skill = Utils.NewSkillDef<NascentSkillDef>(typeof(Special), "Weapon", 1, 30f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)1, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: false, 1, 1, 1, Prefabs.Load<SkillDef>("RoR2/Base/Croco/CrocoPassivePoison.asset").icon, "NASCENTGROVETENDER_" + text, "NASCENTGROVETENDER_" + text + "_DESCRIPTION", Array.Empty<string>()); component.special = Utils.NewGenericSkill(characterPrefab, skill); } internal static GameObject CreateBodyPrefab(string characterName, Color bodyColor, float mass) { //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: 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_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_0341: Unknown result type (might be due to invalid IL or missing references) //IL_0346: Unknown result type (might be due to invalid IL or missing references) //IL_0357: Unknown result type (might be due to invalid IL or missing references) //IL_035c: Unknown result type (might be due to invalid IL or missing references) string text = characterName.Replace(" ", ""); string text2 = text.ToUpper(); LanguageAPI.Add("NASCENTGROVETENDER_" + text2 + "_NAME", characterName); GameObject val = PrefabAPI.InstantiateClone(baseBody, text + "Body", true); val.GetComponent<NetworkIdentity>().localPlayerAuthority = true; Transform child = val.transform.GetChild(0); child.localPosition = Vector3.up * -1.48f; child.localScale = Vector3.one * 0.2f; ((Component)val.transform.GetChild(2)).transform.localPosition = Vector3.up * 1.4f; CapsuleCollider component = val.GetComponent<CapsuleCollider>(); component.radius = 1f; component.height = 3f; CharacterBody component2 = val.GetComponent<CharacterBody>(); ((Object)component2).name = text + "Body"; component2.baseNameToken = "NASCENTGROVETENDER_" + text2 + "_NAME"; component2.subtitleNameToken = "NASCENTGROVETENDER_" + text2 + "_SUBTITLE"; component2.bodyFlags = (BodyFlags)16; component2.hullClassification = (HullClassification)1; component2.isChampion = false; component2.currentVehicle = null; component2.skinIndex = 0u; component2.bodyColor = bodyColor; component2._defaultCrosshairPrefab = Prefabs.Load<GameObject>("RoR2/Base/Captain/CaptainCrosshair.prefab"); component2.portraitIcon = (Texture)(object)Assets.Load<Texture2D>("portrait"); CharacterMotor component3 = val.GetComponent<CharacterMotor>(); component3.walkSpeedPenaltyCoefficient = 1f; component3.muteWalkMotion = false; component3.mass = mass; component3.initialCapsuleRadius = component.radius; component3.initialCapsuleHeight = component.height; KinematicCharacterMotor component4 = val.GetComponent<KinematicCharacterMotor>(); component4.CapsuleRadius = component.radius; component4.CapsuleHeight = component.height; HealthComponent component5 = val.GetComponent<HealthComponent>(); component5.health = component2.baseMaxHealth; component5.shield = 0f; component5.barrier = 0f; val.GetComponent<KinematicCharacterMotor>().playerCharacter = true; FootstepHandler componentInChildren = val.GetComponentInChildren<FootstepHandler>(); componentInChildren.baseFootstepString = "Play_player_footstep"; componentInChildren.sprintFootstepOverrideString = ""; componentInChildren.enableFootstepDust = true; componentInChildren.footstepDustPrefab = Prefabs.footstepEffect; val.GetComponent<Interactor>().maxInteractionDistance = 3f; val.GetComponent<InteractionDriver>().highlightInteractor = true; SfxLocator component6 = val.GetComponent<SfxLocator>(); component6.deathSound = "Play_ui_player_death"; component6.barkSound = ""; component6.openSound = ""; component6.landingSound = "Play_char_land"; component6.fallDamageSound = "Play_char_land_fall_damage"; component6.aliveLoopStart = ""; component6.aliveLoopStop = ""; CameraTargetParams component7 = val.GetComponent<CameraTargetParams>(); component7.cameraParams = Prefabs.Load<CharacterCameraParams>("RoR2/Base/Common/ccpStandardMelee.asset"); component7.cameraPivotTransform = null; component7.recoil = Vector2.zero; component7.dontRaycastToPivot = false; val.GetComponent<Rigidbody>().mass = mass; GenericSkill[] componentsInChildren = val.GetComponentsInChildren<GenericSkill>(); foreach (GenericSkill val2 in componentsInChildren) { Object.DestroyImmediate((Object)(object)val2); } EntityStateMachine component8 = ((Component)component2).GetComponent<EntityStateMachine>(); component8.mainStateType = new SerializableEntityStateType(typeof(CharacterMain)); component8.initialStateType = new SerializableEntityStateType(typeof(SpawnState)); NetworkStateMachine component9 = ((Component)component2).GetComponent<NetworkStateMachine>(); component9.stateMachines = ((Component)component2).GetComponents<EntityStateMachine>(); 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); GlobalEventManager.onServerDamageDealt += GlobalEventManager_onServerDamageDealt; } private static void GlobalEventManager_onServerDamageDealt(DamageReport damageReport) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) DamageInfo damageInfo = damageReport.damageInfo; if (!DamageAPI.HasModdedDamageType(damageInfo, Prefabs.hook) || !Object.op_Implicit((Object)(object)damageReport.victimBody) || !Object.op_Implicit((Object)(object)damageReport.attackerBody)) { return; } damageReport.victimBody.AddTimedBuff(Prefabs.hookHit, 0.25f); if (damageReport.victimBody.GetBuffCount(Prefabs.hookHit) >= 4) { damageReport.victimBody.ClearTimedBuffs(Prefabs.hookHit); damageReport.victimBody.AddTimedBuff(Buffs.Entangle, 1f); Behaviour component = ((Component)damageReport.attackerBody).GetComponent<Behaviour>(); if (Object.op_Implicit((Object)(object)component)) { component.CallRpcWispAttack(((Component)damageReport.victimBody).gameObject); } } } private static void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args) { if ((sender.baseNameToken == "WISP_BODY_NAME" || sender.baseNameToken == "GREATERWISP_BODY_NAME") && Object.op_Implicit((Object)(object)sender.master) && Object.op_Implicit((Object)(object)sender.master.minionOwnership) && Object.op_Implicit((Object)(object)sender.master.minionOwnership.ownerMaster) && sender.master.minionOwnership.ownerMaster.hasBody) { CharacterBody body = sender.master.minionOwnership.ownerMaster.GetBody(); if (body.baseNameToken == "NASCENTGROVETENDER_NASCENTGROVETENDER_NAME") { float value = MainPlugin.passivePercentage.Value; args.baseHealthAdd += body.healthComponent.fullHealth * value; args.baseRegenAdd += body.regen * value; args.baseDamageAdd += body.damage * value; args.baseAttackSpeedAdd += body.attackSpeed * value; args.baseMoveSpeedAdd += body.moveSpeed * value; args.armorAdd += body.armor * value; args.critAdd += body.crit * value; } } } } [BepInDependency(/*Could not decode attribute arguments.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.Dragonyck.NascentGrovetender", "NascentGrovetender", "1.0.0")] [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.*/)] public class MainPlugin : BaseUnityPlugin { public const string MODUID = "com.Dragonyck.NascentGrovetender"; public const string MODNAME = "NascentGrovetender"; public const string VERSION = "1.0.0"; internal const string MODKEY = "NASCENTGROVETENDER_"; internal static ConfigEntry<float> passivePercentage; internal static ConfigEntry<float> primaryDamage; internal static ConfigEntry<float> primaryForce; internal static ConfigEntry<float> utilityDamage; internal static ConfigEntry<int> wispCount; internal static ConfigEntry<int> greaterWispCount; private void Awake() { passivePercentage = ((BaseUnityPlugin)this).Config.Bind<float>("Passive", "Stat Share Coefficient", 0.1f, (ConfigDescription)null); primaryDamage = ((BaseUnityPlugin)this).Config.Bind<float>("Primary", "Damage Coefficient", 1.5f, (ConfigDescription)null); primaryForce = ((BaseUnityPlugin)this).Config.Bind<float>("Primary", "Force", 3000f, (ConfigDescription)null); utilityDamage = ((BaseUnityPlugin)this).Config.Bind<float>("Utility", "Damage Coefficient", 3.2f, (ConfigDescription)null); wispCount = ((BaseUnityPlugin)this).Config.Bind<int>("Wisps", "Lesser Wisp Cap", 10, (ConfigDescription)null); greaterWispCount = ((BaseUnityPlugin)this).Config.Bind<int>("Wisps", "Greater Wisp Cap", 5, (ConfigDescription)null); Assets.PopulateAssets(); Prefabs.CreatePrefabs(); CharacterBodySetup.CreateCharacterBodies(); Hook.Hooks(); } } internal class NascentSkillDef : SkillDef { private class InstanceData : BaseSkillInstanceData { public Behaviour behaviour; } public override BaseSkillInstanceData OnAssigned([NotNull] GenericSkill skillSlot) { return (BaseSkillInstanceData)(object)new InstanceData { behaviour = ((Component)skillSlot).GetComponent<Behaviour>() }; } internal static bool IsExecutable([NotNull] GenericSkill skillSlot) { InstanceData instanceData = (InstanceData)(object)skillSlot.skillInstanceData; Behaviour behaviour = instanceData.behaviour; return behaviour.wisps.Count >= 5; } public override bool CanExecute([NotNull] GenericSkill skillSlot) { return IsExecutable(skillSlot) && ((SkillDef)this).CanExecute(skillSlot); } public override bool IsReady([NotNull] GenericSkill skillSlot) { return ((SkillDef)this).IsReady(skillSlot) && IsExecutable(skillSlot); } } internal class Prefabs { internal static GameObject footstepEffect; internal static GameObject hookProjectile; internal static GameObject leapImpactEffect; internal static GameObject leapExplosionEffect; internal static GameObject jarOpenEffectWisp; internal static GameObject jarOpenEffectGreaterWisp; internal static GameObject spawnEffect; internal static GameObject wispBody; internal static GameObject wispMaster; internal static GameObject greaterBody; internal static GameObject greaterMaster; internal static Material wispFire; internal static Material greaterWispFire; internal static BuffDef hookHit; internal static ModdedDamageType hook; internal static Material baseMaterial = Load<Material>("RoR2/Base/Commando/matCommandoDualies.mat"); internal static void CreatePrefabs() { //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Expected O, but got Unknown //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Expected O, but got Unknown //IL_01a1: 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_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_0330: Unknown result type (might be due to invalid IL or missing references) //IL_0335: Unknown result type (might be due to invalid IL or missing references) //IL_0364: Unknown result type (might be due to invalid IL or missing references) //IL_036e: Unknown result type (might be due to invalid IL or missing references) //IL_0442: Unknown result type (might be due to invalid IL or missing references) //IL_044c: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0474: 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_027b: Expected O, but got Unknown //IL_0296: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_039e: Unknown result type (might be due to invalid IL or missing references) //IL_03a8: Expected O, but got Unknown //IL_03c3: Unknown result type (might be due to invalid IL or missing references) //IL_03c8: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_03ec: Unknown result type (might be due to invalid IL or missing references) //IL_03f1: Unknown result type (might be due to invalid IL or missing references) //IL_04a3: Unknown result type (might be due to invalid IL or missing references) //IL_04ad: Unknown result type (might be due to invalid IL or missing references) //IL_04dd: Unknown result type (might be due to invalid IL or missing references) //IL_04e7: Expected O, but got Unknown //IL_0502: Unknown result type (might be due to invalid IL or missing references) //IL_0507: Unknown result type (might be due to invalid IL or missing references) //IL_052b: Unknown result type (might be due to invalid IL or missing references) //IL_0530: Unknown result type (might be due to invalid IL or missing references) //IL_066a: Unknown result type (might be due to invalid IL or missing references) //IL_0674: Unknown result type (might be due to invalid IL or missing references) //IL_0694: Unknown result type (might be due to invalid IL or missing references) //IL_069e: Unknown result type (might be due to invalid IL or missing references) //IL_06cc: Unknown result type (might be due to invalid IL or missing references) //IL_06d1: Unknown result type (might be due to invalid IL or missing references) //IL_06dd: Unknown result type (might be due to invalid IL or missing references) wispBody = Instantiate("RoR2/Base/Wisp/WispBody.prefab", "NascentWispBody", registerNetwork: true); wispBody.AddComponent<WispMinionBehaviour>().wisp = true; CharacterBody component = wispBody.GetComponent<CharacterBody>(); ((Object)component).name = "NascentWispBody"; ContentAddition.AddBody(wispBody); wispMaster = Instantiate("RoR2/Base/Wisp/WispMaster.prefab", "NascentWispMaster", registerNetwork: true); wispMaster.GetComponent<CharacterMaster>().bodyPrefab = wispBody; AddFollowerAI(wispMaster); ContentAddition.AddMaster(wispMaster); greaterBody = Instantiate("RoR2/Base/GreaterWisp/GreaterWispBody.prefab", "NascentGreaterWispBody", registerNetwork: true); greaterBody.AddComponent<WispMinionBehaviour>(); component = greaterBody.GetComponent<CharacterBody>(); ((Object)component).name = "NascentGreaterWispBody"; ContentAddition.AddBody(greaterBody); greaterMaster = Instantiate("RoR2/Base/GreaterWisp/GreaterWispMaster.prefab", "NascentGreaterWispMaster", registerNetwork: true); greaterMaster.GetComponent<CharacterMaster>().bodyPrefab = greaterBody; AddFollowerAI(greaterMaster); ContentAddition.AddMaster(greaterMaster); hook = DamageAPI.ReserveDamageType(); hookHit = Utils.NewBuffDef("HookHit", stack: true, hidden: true, null, Color.white); Material val = Load<Material>("RoR2/Base/Gravekeeper/matArchWispFire.mat"); Texture2D val2 = Load<Texture2D>("RoR2/Base/Common/ColorRamps/texRampWisp.png"); Texture2D val3 = Load<Texture2D>("RoR2/Base/Common/ColorRamps/texRampGreaterWisp.png"); wispFire = new Material(val); wispFire.SetTexture("_RemapTex", (Texture)(object)val2); greaterWispFire = new Material(val); greaterWispFire.SetTexture("_RemapTex", (Texture)(object)val3); spawnEffect = Instantiate("RoR2/Base/Gravekeeper/GravekeeperLandingImpact.prefab", "SpawnEffect"); spawnEffect.transform.localScale = Vector3.one * 0.6f; spawnEffect.GetComponentInChildren<Light>().color = Color32.op_Implicit(new Color32(byte.MaxValue, (byte)121, (byte)42, byte.MaxValue)); ParticleSystemRenderer[] componentsInChildren = spawnEffect.GetComponentsInChildren<ParticleSystemRenderer>(); foreach (ParticleSystemRenderer val4 in componentsInChildren) { string name = ((Object)val4).name; if (name == "Flash Lines, Fire" || name == "Wet'" || name == "Noise") { ((Renderer)val4).material = wispFire; if (Object.op_Implicit((Object)(object)val4.trailMaterial)) { val4.trailMaterial = wispFire; } } else { ((Renderer)val4).material = new Material(((Renderer)val4).material); ((Renderer)val4).material.SetColor("_TintColor", Color32.op_Implicit(new Color32(byte.MaxValue, (byte)121, (byte)42, byte.MaxValue))); } MainModule main = ((Component)val4).GetComponent<ParticleSystem>().main; ((MainModule)(ref main)).scalingMode = (ParticleSystemScalingMode)0; } ContentAddition.AddEffect(spawnEffect); GameObject obj = Load<GameObject>("RoR2/Base/Gravekeeper/GravekeeperJarOpen.prefab"); jarOpenEffectWisp = Instantiate(obj, "JarOpenEffectWisp"); jarOpenEffectWisp.transform.localScale = Vector3.one * 2f; jarOpenEffectWisp.GetComponentInChildren<Light>().color = Color32.op_Implicit(new Color32(byte.MaxValue, (byte)121, (byte)42, byte.MaxValue)); ParticleSystemRenderer[] componentsInChildren2 = jarOpenEffectWisp.GetComponentsInChildren<ParticleSystemRenderer>(); foreach (ParticleSystemRenderer val5 in componentsInChildren2) { ((Component)val5).transform.localScale = Vector3.one * 2f; string name2 = ((Object)val5).name; if (name2 == "Ring") { ((Renderer)val5).material = new Material(((Renderer)val5).material); ((Renderer)val5).material.SetColor("_TintColor", Color32.op_Implicit(new Color32(byte.MaxValue, (byte)121, (byte)42, byte.MaxValue))); } else { ((Renderer)val5).material = wispFire; } MainModule main2 = ((Component)val5).GetComponent<ParticleSystem>().main; ((MainModule)(ref main2)).scalingMode = (ParticleSystemScalingMode)0; } Utils.RegisterEffect(jarOpenEffectWisp, -1f, "", applyScale: true); jarOpenEffectGreaterWisp = Instantiate(obj, "JarOpenEffectGreaterWisp"); jarOpenEffectGreaterWisp.transform.localScale = Vector3.one * 2f; jarOpenEffectGreaterWisp.GetComponentInChildren<Light>().color = Color32.op_Implicit(new Color32((byte)42, byte.MaxValue, (byte)62, byte.MaxValue)); ParticleSystemRenderer[] componentsInChildren3 = jarOpenEffectGreaterWisp.GetComponentsInChildren<ParticleSystemRenderer>(); foreach (ParticleSystemRenderer val6 in componentsInChildren3) { ((Component)val6).transform.localScale = Vector3.one * 2f; string name3 = ((Object)val6).name; if (name3 == "Ring") { ((Renderer)val6).material = new Material(((Renderer)val6).material); ((Renderer)val6).material.SetColor("_TintColor", Color32.op_Implicit(new Color32((byte)42, byte.MaxValue, (byte)62, byte.MaxValue))); } else { ((Renderer)val6).material = greaterWispFire; } MainModule main3 = ((Component)val6).GetComponent<ParticleSystem>().main; ((MainModule)(ref main3)).scalingMode = (ParticleSystemScalingMode)0; } Utils.RegisterEffect(jarOpenEffectGreaterWisp, -1f, "", applyScale: true); leapImpactEffect = Instantiate("RoR2/Base/Parent/ParentSlamEffect.prefab", "LeapImpactEffect"); leapImpactEffect.GetComponent<EffectComponent>().soundName = "Play_gravekeeper_land"; ContentAddition.AddEffect(leapImpactEffect); leapExplosionEffect = Instantiate("RoR2/Base/ExplosivePotDestructible/ExplosivePotExplosion.prefab", "LeapExplosionEffect"); leapExplosionEffect.GetComponent<EffectComponent>().soundName = "Play_gravekeeper_land"; ParticleSystemRenderer[] componentsInChildren4 = leapExplosionEffect.GetComponentsInChildren<ParticleSystemRenderer>(); foreach (ParticleSystemRenderer val7 in componentsInChildren4) { string name4 = ((Object)val7).name; if (name4 == "Goo") { ((Renderer)val7).material = Load<Material>("RoR2/Base/Common/VFX/mageMageFireStarburst.mat"); } if (name4 == "Ring") { ((Renderer)val7).material = Load<Material>("RoR2/DLC3/SolusMine/matWorkerUnitExplosionFireTrails.mat"); } } ContentAddition.AddEffect(leapExplosionEffect); footstepEffect = Instantiate("RoR2/Base/Gravekeeper/GravekeeperFootstep.prefab", "GraveFootstep"); footstepEffect.transform.localScale = Vector3.one * 0.4f; ((Component)footstepEffect.transform.GetChild(0)).transform.localScale = Vector3.one * 0.4f; hookProjectile = Instantiate("RoR2/Base/Gravekeeper/GravekeeperHookProjectileSimple.prefab", "HookProjectile", registerNetwork: true); ProjectileDamage component2 = hookProjectile.GetComponent<ProjectileDamage>(); component2.damageType = DamageTypeCombo.GenericPrimary; DamageAPI.AddModdedDamageType(ref component2.damageType, hook); ContentAddition.AddProjectile(hookProjectile); } internal static void AddFollowerAI(GameObject target) { //IL_0020: 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_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0080: 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_00c4: 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_00d2: 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_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_024c: 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_0261: Unknown result type (might be due to invalid IL or missing references) BaseAI component = target.GetComponent<BaseAI>(); component.enemyAttentionDuration = 5f; component.copyLeaderTarget = false; component.followPattern = default(FollowPattern); AISkillDriver[] components = target.GetComponents<AISkillDriver>(); for (int i = 0; i < components.Length; i++) { Object.DestroyImmediate((Object)(object)components[i]); } AISkillDriver val = target.AddComponent<AISkillDriver>(); val.customName = "HardLeashToLeader"; val.skillSlot = (SkillSlot)(-1); val.minDistance = 60f; val.moveTargetType = (TargetType)2; val.movementType = (MovementType)1; val.aimType = (AimType)2; val.shouldSprint = true; val.driverUpdateTimerOverride = 3f; val.resetCurrentEnemyOnNextDriverSelection = true; val = target.AddComponent<AISkillDriver>(); val.customName = "SoftLeashAttack"; val.skillSlot = (SkillSlot)(-1); val.minDistance = 60f; val.moveTargetType = (TargetType)2; val.movementType = (MovementType)0; val.aimType = (AimType)1; val.driverUpdateTimerOverride = 1.5f; val.resetCurrentEnemyOnNextDriverSelection = true; val.noRepeat = true; val = target.AddComponent<AISkillDriver>(); val.customName = "SoftLeashToLeader"; val.skillSlot = (SkillSlot)(-1); val.minDistance = 0f; val.minDistance = 45f; val.moveTargetType = (TargetType)2; val.movementType = (MovementType)1; val.aimType = (AimType)2; val.driverUpdateTimerOverride = 0.05f; val.shouldSprint = true; val.resetCurrentEnemyOnNextDriverSelection = true; val = target.AddComponent<AISkillDriver>(); val.customName = "StrafeNearbyEnemies"; val.skillSlot = (SkillSlot)0; val.minDistance = 0f; val.maxDistance = 45f; val.selectionRequiresTargetLoS = true; val.moveTargetType = (TargetType)0; val.activationRequiresTargetLoS = true; val.activationRequiresAimConfirmation = true; val.movementType = (MovementType)2; val.aimType = (AimType)2; val.buttonPressType = (ButtonPressType)2; val.driverUpdateTimerOverride = -1f; val.noRepeat = true; val = target.AddComponent<AISkillDriver>(); val.customName = "ChaseFarEnemies"; val.skillSlot = (SkillSlot)0; val.requireSkillReady = true; val.minDistance = 20f; val.maxDistance = 45f; val.selectionRequiresTargetLoS = true; val.moveTargetType = (TargetType)0; val.activationRequiresTargetLoS = true; val.activationRequiresAimConfirmation = true; val.movementType = (MovementType)1; val.aimType = (AimType)1; val.shouldSprint = true; val = target.AddComponent<AISkillDriver>(); val.customName = "ChaseDownRandomEnemiesIfLeaderIsDead"; val.skillSlot = (SkillSlot)(-1); val.minDistance = 0f; val.moveTargetType = (TargetType)0; val.activationRequiresAimConfirmation = true; val.movementType = (MovementType)2; val.aimType = (AimType)1; } internal static T Load<T>(string path) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) return Addressables.LoadAssetAsync<T>((object)path).WaitForCompletion(); } internal static GameObject Instantiate(string path, string name, bool registerNetwork = false) { return PrefabAPI.InstantiateClone(Load<GameObject>(path), name, registerNetwork); } internal static GameObject Instantiate(GameObject obj, string name, bool registerNetwork = false) { return PrefabAPI.InstantiateClone(obj, name, registerNetwork); } 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_001d: 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) 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); 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); 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<HurtBox>)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; 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 DamageType damageType => (DamageType)0; 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 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) //IL_00be: 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 = DamageTypeCombo.op_Implicit(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(); } 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) { hasSwung = true; AkSoundEngine.PostEvent(swingSound, ((EntityState)this).gameObject); if (Object.op_Implicit((Object)(object)swingEffectPrefab) && !Utility.IsNullOrWhiteSpace(swingMuzzle)) { 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 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<HurtBox>)null); } return result; } public virtual void SetState() { } 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 Primary : BaseSkillState { private float duration; private GameObject chargeInstance; private float charge; public override void OnEnter() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); duration = ChargeCaptainShotgun.baseChargeDuration / ((BaseState)this).attackSpeedStat; ((EntityState)this).characterDirection.moveVector = ((EntityState)this).inputBank.aimDirection; Transform modelTransform = ((EntityState)this).GetModelTransform(); if (Object.op_Implicit((Object)(object)modelTransform)) { ChildLocator component = ((Component)modelTransform).GetComponent<ChildLocator>(); if (Object.op_Implicit((Object)(object)component)) { Transform val = component.FindChild(PrepHook.muzzleString); if (Object.op_Implicit((Object)(object)val)) { chargeInstance = Object.Instantiate<GameObject>(Prefabs.Load<GameObject>("RoR2/Base/Lemurian/ChargeMegaFireball.prefab"), val.position, val.rotation); chargeInstance.transform.parent = val; ScaleParticleSystemDuration component2 = chargeInstance.GetComponent<ScaleParticleSystemDuration>(); if (Object.op_Implicit((Object)(object)component2)) { component2.newDuration = duration; } } } } Util.PlayAttackSpeedSound(PrepHook.attackString, ((EntityState)this).gameObject, ((BaseState)this).attackSpeedStat); } public override void Update() { ((EntityState)this).Update(); ((EntityState)this).characterBody.SetSpreadBloom(((EntityState)this).age / duration, true); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); charge = Mathf.Clamp01(((EntityState)this).fixedAge / duration); if ((((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration) || !((BaseSkillState)this).IsKeyDownAuthority()) { ((EntityState)this).outer.SetNextState((EntityState)(object)new PrimaryFire { charge = charge }); } } 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 PrimaryPrep : BaseState { private float duration; public float charge; public float baseDuration = 0.5f; private EntityStateMachine bodyMachine; public override void OnEnter() { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown ((BaseState)this).OnEnter(); duration = baseDuration / base.attackSpeedStat; ((EntityState)this).PlayCrossfade("Body", "PrepHook", "PrepHook.playbackRate", duration, 0.2f); ((EntityState)this).characterDirection.moveVector = ((EntityState)this).inputBank.aimDirection; bodyMachine = ((EntityState)this).GetComponent<EntityStateMachine>(); if (((EntityState)this).isAuthority) { bodyMachine.SetNextState((EntityState)new Idle()); } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextState((EntityState)(object)new PrimaryFire { charge = charge }); } } public override void OnExit() { if (((EntityState)this).isAuthority) { bodyMachine.SetNextStateToMain(); } ((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)5; } } internal class PrimaryFire : BaseState { private float duration; public float baseDuration = 0.6f; private EntityStateMachine bodyMachine; public float charge; public override void OnEnter() { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); duration = baseDuration / base.attackSpeedStat; ((EntityState)this).PlayCrossfade("Body", "FireHook", "FireHook.playbackRate", duration, 0.03f); ((EntityState)this).characterDirection.moveVector = ((EntityState)this).inputBank.aimDirection; bodyMachine = ((EntityState)this).GetComponent<EntityStateMachine>(); if (((EntityState)this).isAuthority) { bodyMachine.SetNextState((EntityState)new Idle()); } Util.PlayAttackSpeedSound(FireHook.soundString, ((EntityState)this).gameObject, base.attackSpeedStat); EffectManager.SimpleMuzzleFlash(FireHook.muzzleflashEffectPrefab, ((EntityState)this).gameObject, FireHook.muzzleString, false); if (((EntityState)this).isAuthority) { Ray aimRay = ((BaseState)this).GetAimRay(); float spread = ((EntityState)this).GetComponent<Behaviour>().spread; for (int i = 0; i < 6; i++) { float num = Random.Range(0f - spread, spread) / 2f / (charge * 2f); float num2 = Random.Range(0f - spread, spread) / 2f / (charge * 2f); Vector3 val = Util.ApplySpread(((Ray)(ref aimRay)).direction, 0f, 0f, 1f, 1f, num2, num); ProjectileManager.instance.FireProjectileWithoutDamageType(Prefabs.hookProjectile, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation((i == 0) ? ((Ray)(ref aimRay)).direction : val), ((EntityState)this).gameObject, base.damageStat * MainPlugin.primaryDamage.Value, 0f, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, -1f); } } float num3 = 4.2f; ((BaseState)this).AddRecoil(-0.1f * num3, 0.1f * num3, -1f * num3, 1f * num3); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { if (((EntityState)this).isAuthority) { bodyMachine.SetNextStateToMain(); } ((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)5; } } 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 DamageType damageType => DamageTypeCombo.op_Implicit(DamageTypeCombo.GenericPrimary); public override void OnSerialize(NetworkWriter writer) { base.OnSerialize(writer); writer.Write(attackIndex); } public override void OnDeserialize(NetworkReader reader) { base.OnDeserialize(reader); attackIndex = reader.ReadInt32(); } public override void OnEnter() { base.OnEnter(); ((BaseState)this).StartAimMode(2f, false); } public override void SetState() { if (!finisher) { PrimaryMelee primaryMelee = new PrimaryMelee(); primaryMelee.attackIndex = attackIndex + 1; ((EntityState)this).outer.SetNextState((EntityState)(object)primaryMelee); } } 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 Secondary : BaseSkillState { private float duration; private float baseDuration = 0.65f; private GameObject effectLoop; public override void OnEnter() { //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0100: 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_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_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_011d: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0137: 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_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; Transform modelTransform = ((EntityState)this).GetModelTransform(); if (Object.op_Implicit((Object)(object)modelTransform)) { ChildLocator component = ((Component)modelTransform).GetComponent<ChildLocator>(); if (Object.op_Implicit((Object)(object)component)) { effectLoop = ((Component)component.FindChild("JarEffectLoop")).gameObject; effectLoop.SetActive(true); } } ((EntityState)this).PlayAnimation("Jar, Override", GravekeeperBarrage.BeginGravekeeperBarrageStateHash); EffectManager.SimpleMuzzleFlash(Prefabs.jarOpenEffectWisp, ((EntityState)this).gameObject, GravekeeperBarrage.jarEffectChildLocatorString, false); Util.PlaySound(GravekeeperBarrage.jarOpenSoundString, ((EntityState)this).gameObject); if (NetworkServer.active) { GameObject wispMaster = Prefabs.wispMaster; Vector3 val = ((EntityState)this).transform.position; Quaternion rotation = Quaternion.LookRotation(((EntityState)this).characterDirection.forward); int num = 1; Behaviour component2 = ((EntityState)this).GetComponent<Behaviour>(); if (component2.wisps.Count == 0) { num = 2; } for (int i = 0; i < num; i++) { val = Utils.FindNearestNodePosition(val, (GraphType)1); CharacterMaster val2 = new MasterSummon { masterPrefab = wispMaster, position = val, rotation = rotation, summonerBodyObject = ((EntityState)this).gameObject, ignoreTeamMemberLimit = true, teamIndexOverride = ((EntityState)this).teamComponent.teamIndex }.Perform(); } if (component2.wisps.Count >= MainPlugin.wispCount.Value) { component2.wisps[0].GetComponent<HealthComponent>().Suicide((GameObject)null, (GameObject)null, default(DamageTypeCombo)); } } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { ((EntityState)this).PlayCrossfade("Jar, Override", GravekeeperBarrage.EndGravekeeperBarrageStateHash, 0.06f); EffectManager.SimpleMuzzleFlash(Prefabs.jarOpenEffectWisp, ((EntityState)this).gameObject, GravekeeperBarrage.jarEffectChildLocatorString, false); Util.PlaySound(GravekeeperBarrage.jarCloseSoundString, ((EntityState)this).gameObject); effectLoop.SetActive(false); ((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 SpawnState : BaseState { private float duration = 0.5f; public override void OnEnter() { ((BaseState)this).OnEnter(); ((EntityState)this).PlayAnimation("Body", SpawnState.SpawnStateHash, SpawnState.SpawnParamHash, duration); Util.PlaySound(SpawnState.spawnSoundString, ((EntityState)this).gameObject); EffectManager.SimpleMuzzleFlash(Prefabs.spawnEffect, ((EntityState)this).gameObject, "Root", false); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration) { ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)9; } } internal class Special : BaseSkillState { private float duration; private float baseDuration = 0.65f; private GameObject effectLoop; public override void OnEnter() { //IL_00b0: 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_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: 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_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; Transform modelTransform = ((EntityState)this).GetModelTransform(); if (Object.op_Implicit((Object)(object)modelTransform)) { ChildLocator component = ((Component)modelTransform).GetComponent<ChildLocator>(); if (Object.op_Implicit((Object)(object)component)) { effectLoop = ((Component)component.FindChild("JarEffectLoopGreater")).gameObject; effectLoop.SetActive(true); } } ((EntityState)this).PlayAnimation("Jar, Override", GravekeeperBarrage.BeginGravekeeperBarrageStateHash); EffectManager.SimpleMuzzleFlash(Prefabs.jarOpenEffectGreaterWisp, ((EntityState)this).gameObject, GravekeeperBarrage.jarEffectChildLocatorString, false); Util.PlaySound(GravekeeperBarrage.jarOpenSoundString, ((EntityState)this).gameObject); GameObject greaterMaster = Prefabs.greaterMaster; Vector3 position = Utils.FindNearestNodePosition(((EntityState)this).transform.position, (GraphType)1); Quaternion rotation = Quaternion.LookRotation(((EntityState)this).characterDirection.forward); if (!NetworkServer.active) { return; } Behaviour component2 = ((EntityState)this).GetComponent<Behaviour>(); for (int i = 0; i < 5; i++) { GameObject val = component2.wisps[i]; if (Object.op_Implicit((Object)(object)val)) { HealthComponent component3 = val.GetComponent<HealthComponent>(); if (Object.op_Implicit((Object)(object)component3)) { component3.Suicide((GameObject)null, (GameObject)null, default(DamageTypeCombo)); } } } CharacterMaster val2 = new MasterSummon { masterPrefab = greaterMaster, position = position, rotation = rotation, summonerBodyObject = ((EntityState)this).gameObject, ignoreTeamMemberLimit = true, teamIndexOverride = ((EntityState)this).teamComponent.teamIndex }.Perform(); if (component2.greaterWisps.Count >= MainPlugin.greaterWispCount.Value) { component2.greaterWisps[0].GetComponent<HealthComponent>().Suicide((GameObject)null, (GameObject)null, default(DamageTypeCombo)); } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { ((EntityState)this).PlayCrossfade("Jar, Override", GravekeeperBarrage.EndGravekeeperBarrageStateHash, 0.06f); EffectManager.SimpleMuzzleFlash(Prefabs.jarOpenEffectGreaterWisp, ((EntityState)this).gameObject, GravekeeperBarrage.jarEffectChildLocatorString, false); Util.PlaySound(GravekeeperBarrage.jarCloseSoundString, ((EntityState)this).gameObject); effectLoop.SetActive(false); ((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 Utility : Leap { public override void DoImpactAuthority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown ((BaseLeap)this).DetonateAuthority(); Vector3 footPosition = ((EntityState)this).characterBody.footPosition; EffectData val = new EffectData { origin = footPosition, scale = BaseLeap.blastRadius }; EffectManager.SpawnEffect(Prefabs.Load<GameObject>("RoR2/Base/IgniteOnKill/IgniteExplosionVFX.prefab"), val, true); EffectManager.SpawnEffect(Prefabs.leapExplosionEffect, val, true); } public override DamageTypeCombo GetBlastDamageType() { //IL_0001: 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_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) return DamageTypeCombo.GenericUtility | DamageTypeCombo.op_Implicit((DamageType)128); } public override void OnEnter() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) ((BaseLeap)this).fistEffectPrefab = new GameObject(); ((BaseLeap)this).blastEffectPrefab = Prefabs.leapImpactEffect; ((BaseLeap)this).OnEnter(); ((BaseLeap)this).blastDamageCoefficient = MainPlugin.utilityDamage.Value; CharacterMotor characterMotor = ((EntityState)this).characterMotor; characterMotor.velocity *= 1.15f; AkSoundEngine.PostEvent("Play_moonBrother_phaseJump_jumpAway", ((EntityState)this).gameObject); } public override void OnExit() { ((BaseLeap)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 GameObject NewSyringe(this GameObject g, params Material[] m) { ((Renderer)g.GetComponentsInChildren<MeshRenderer>(false)[0]).material = m[0]; ((Renderer)g.GetComponent<TrailRenderer>()).material = m[1]; ((Renderer)g.GetComponent<ParticleSystemRenderer>()).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<Renderer>(); 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 { public static Material DisableDither(Material material) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown Material val = new Material(material); val.DisableKeyword("DITHER"); return val; } internal static void SetupDisplay(GameObject gameObject) { //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) CharacterModel componentInChildren = gameObject.GetComponentInChildren<CharacterModel>(); ((Behaviour)componentInChildren).enabled = false; Material material = DisableDither(Prefabs.Load<Material>("RoR2/Base/Gravekeeper/matGravekeeperDiffuse.mat")); SkinnedMeshRenderer[] componentsInChildren = gameObject.GetComponentsInChildren<SkinnedMeshRenderer>(true); foreach (SkinnedMeshRenderer val in componentsInChildren) { switch (((Object)val).name) { case "GravekeeperFurMesh": ((Renderer)val).material = DisableDither(Prefabs.Load<Material>("RoR2/Base/Gravekeeper/matGravekeeperFurDiffuse.mat")); break; case "GravekeeperMaskMesh": case "GravekeeperMesh": ((Renderer)val).material = material; break; case "Sphere": ((Renderer)val).material = DisableDither(Prefabs.Load<Material>("RoR2/Base/Gravekeeper/matGravekeeperJar.mat")); break; } } ((Component)componentInChildren).gameObject.AddComponent<ModelBehaviour>(); ((Component)componentInChildren).transform.localPosition = Vector3.up * 0.1f; ((Component)componentInChildren).transform.localScale = Vector3.one * 0.6f; Transform val2 = ((Component)componentInChildren).GetComponent<ChildLocator>().FindChild("JarEffectLoop"); ((Component)val2).gameObject.SetActive(true); ((Component)val2).transform.localPosition = new Vector3(1f, 1f, -1f); ((Component)val2).GetComponentInChildren<Light>().intensity = 5f; ((Behaviour)((Component)componentInChildren).GetComponent<InverseKinematics>()).enabled = false; } 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<OmniEffect>(); if (Object.op_Implicit((Object)(object)component)) { Object.DestroyImmediate((Object)(object)obj.GetComponent<OmniEffect>()); } Renderer[] componentsInChildren = obj.GetComponentsInChildren<Renderer>(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<SpawnCard>(); val.hullSize = (HullClassification)1; val.nodeGraphType = nodeGraphType; val.prefab = Prefabs.Load<GameObject>("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<Animator>(); 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<Animator>(); 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<T>(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<T>(); ((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<T>(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<EntityStateMachine>(); 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<GenericSkill>(); SkillFamily val2 = ScriptableObject.CreateInstance<SkillFamily>(); 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<BuffDef>(); ((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<ObjectScaleCurve>(); 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<RotateAroundAxis>(); 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<AnimateShaderAlpha>(); 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, string objectToEnable, RendererInfo[] rendererInfos, UnlockableDef unlockableDef = null) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) SkinDefInfo result = default(SkinDefInfo); result.BaseSkins = Array.Empty<SkinDef>(); result.MinionSkinReplacements = (MinionSkinReplacement[])(object)new MinionSkinReplacement[0]; result.ProjectileGhostReplacements = (ProjectileGhostReplacement[])(object)new ProjectileGhostReplacement[0]; List<GameObjectActivation> list = new List<GameObjectActivation>(); foreach (SkinnedMeshRenderer val in childList) { GameObjectActivation val2 = defa