Decompiled source of Gwen v1.0.1
Gwen.dll
Decompiled a day 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.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using EntityStates; using EntityStates.FlyingVermin.Mode; using EntityStates.Merc; using KinematicCharacterController; using R2API; using R2API.Utils; using Rewired.ComponentControls.Effects; using RoR2; using RoR2.Navigation; using RoR2.Projectile; using RoR2.Skills; using RoR2.UI; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Networking; using UnityEngine.Rendering; [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: CompilationRelaxations(8)] [assembly: AssemblyCompany("Gwen")] [assembly: AssemblyProduct("Gwen")] [assembly: AssemblyTitle("Gwen")] [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 Gwen; 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("Gwen.AssetBundle." + "Gwen".ToLower() + "assets"); MainAssetBundle = AssetBundle.LoadFromStream(stream); } using Stream stream2 = executingAssembly.GetManifestResourceStream("Gwen.Gwen.bnk"); byte[] array = new byte[stream2.Length]; stream2.Read(array, 0, array.Length); SoundBanks.Add(array); } } internal class Behaviour : NetworkBehaviour { [SyncVar] public bool refunded; private CharacterBody body; public float rootMotionSpeed = 18f; public float dashSpeed = 0.15f; public float damagePerc = 0.15f; public float healthPercDMG = 0.01f; public float healthPercDMGSpec = 0.03f; public float healPerc = 0.5f; public float primaryDur = 0.6f; public float primaryFinisherDur = 1f; public float primaryDashDur = 0.85f; public float secondaryDur = 0.45f; public float secondaryFollowupDur = 0.1f; public float specialHop = 0.3f; public float speedPenalty = 0.25f; private Animator animator; public SkinnedMeshRenderer[] renderers; public int barCount => body.GetBuffCount(Prefabs.snippy); public bool Networkrefunded { get { return refunded; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar<bool>(value, ref refunded, 1u); } } private void Awake() { body = ((Component)this).GetComponent<CharacterBody>(); } private void Start() { animator = ((Component)body.modelLocator.modelTransform).GetComponent<Animator>(); renderers = ((Component)this).GetComponentsInChildren<SkinnedMeshRenderer>(); } private void FixedUpdate() { if (animator.GetFloat("passive") == 0f) { if (body.HasBuff(Prefabs.dash)) { animator.SetFloat("passive", 1f); } } else if (!body.HasBuff(Prefabs.dash)) { animator.SetFloat("passive", 0f); } } private void UNetVersion() { } public override bool OnSerialize(NetworkWriter writer, bool forceAll) { if (forceAll) { writer.Write(refunded); return true; } bool flag = false; if ((((NetworkBehaviour)this).syncVarDirtyBits & (true ? 1u : 0u)) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.Write(refunded); } if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); } return flag; } public override void OnDeserialize(NetworkReader reader, bool initialState) { if (initialState) { refunded = reader.ReadBoolean(); return; } int num = (int)reader.ReadPackedUInt32(); if (((uint)num & (true ? 1u : 0u)) != 0) { refunded = reader.ReadBoolean(); } } } internal class HUDTracker : MonoBehaviour { public GameObject barRoot; public HUD hud; private Behaviour behaviour; private List<GameObject> bars = new List<GameObject>(); private int barCount; private void Awake() { hud = ((Component)this).GetComponent<HUD>(); } private void Start() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)barRoot)) { ChildLocator component = barRoot.GetComponent<ChildLocator>(); NameTransformPair[] transformPairs = component.transformPairs; foreach (NameTransformPair val in transformPairs) { bars.Add(((Component)val.transform).gameObject); } } } private void FixedUpdate() { //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)behaviour)) { if (Object.op_Implicit((Object)(object)hud) && Object.op_Implicit((Object)(object)hud.targetBodyObject) && Util.HasEffectiveAuthority(hud.targetBodyObject)) { behaviour = hud.targetBodyObject.GetComponent<Behaviour>(); if (Object.op_Implicit((Object)(object)behaviour)) { barRoot.transform.localPosition = Vector2.op_Implicit(new Vector2(103f, -20f)); UpdateBar(); } } if (barRoot.activeInHierarchy) { barRoot.SetActive(false); } } else { if (!barRoot.activeInHierarchy) { barRoot.SetActive(true); } if (barCount != behaviour.barCount) { UpdateBar(); } } } private void UpdateBar() { barCount = behaviour.barCount; for (int i = 0; i < bars.Count; i++) { bars[i].SetActive(i < barCount); } if (barCount == 4) { AkSoundEngine.PostEvent("Play_sfx_Gwen_GwenQ_max_stacks_buffactivate", ((Component)behaviour).gameObject); } } } internal class ModelSound : MonoBehaviour { private uint ID; private void Start() { ID = AkSoundEngine.PostEvent("Play_sfx_Gwen_Gwen_Recall", ((Component)this).gameObject); } private void OnDisable() { AkSoundEngine.StopPlayingID(ID); } } internal class CharacterBodySetup { internal const bool melee = true; internal static GameObject baseBody = Prefabs.Load<GameObject>("RoR2/Base/Merc/MercBody.prefab"); internal static GameObject baseMaster; internal const string SURVIVORNAME = "Gwen"; internal const string SURVIVORNAMEKEY = "GWEN_"; internal static SkillDef special2; internal static SkillDef special3; internal static void CreateCharacterBodies() { RegisterStates(); CreateSurvivorPrefab(); } internal static void CreateSurvivorPrefab() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) GameObject val = CreateBodyPrefab("Gwen", Color32.op_Implicit(new Color32((byte)49, (byte)211, (byte)231, byte.MaxValue)), 140f); val.AddComponent<Behaviour>(); CharacterBody component = val.GetComponent<CharacterBody>(); component.mainRootSpeed = 0f; component.baseMaxHealth = 160f; component.levelMaxHealth = 48f; 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 = 20f; component.levelArmor = 0f; component.baseJumpCount = 1; component.sprintingSpeedMultiplier = 1.45f; val.GetComponent<HealthComponent>().health = component.baseMaxHealth; CreateSurvivorDef(val); PassiveSetup(val); PrimarySetup(val); SecondarySetup(val); UtilitySetup(val); SpecialSetup(val); } internal static void CreateSurvivorDef(GameObject characterPrefab) { //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) 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 he left."; string text5 = "..and so he vanished."; string text6 = ""; LanguageAPI.Add("GWEN" + text2 + "_DESCRIPTION", text3); LanguageAPI.Add("GWEN" + text2 + "_SUBTITLE", "Hallowed Seamstress"); LanguageAPI.Add("GWEN" + text2 + "_OUTRO", text4); LanguageAPI.Add("GWEN" + 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"); ((Component)componentInChildren).gameObject.AddComponent<ModelSound>(); Utils.SetupDisplay(val); SurvivorDef val2 = ScriptableObject.CreateInstance<SurvivorDef>(); val2.cachedName = "GWEN" + text2 + "_NAME"; val2.unlockableDef = null; val2.descriptionToken = "GWEN" + text2 + "_DESCRIPTION"; val2.primaryColor = component.bodyColor; val2.bodyPrefab = characterPrefab; val2.displayPrefab = val; val2.outroFlavorToken = "GWEN" + text2 + "_OUTRO"; val2.desiredSortPosition = 22f; val2.mainEndingEscapeFailureFlavorToken = "GWEN" + text2 + "_FAIL"; ContentAddition.AddSurvivorDef(val2); GameObject val3 = PrefabAPI.InstantiateClone(Prefabs.Load<GameObject>("RoR2/Base/Merc/MercMonsterMaster.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<Secondary>(ref flag); ContentAddition.AddEntityState<Utility>(ref flag); ContentAddition.AddEntityState<BaseSpecial>(ref flag); ContentAddition.AddEntityState<Special>(ref flag); ContentAddition.AddEntityState<Special2>(ref flag); ContentAddition.AddEntityState<Special3>(ref flag); ContentAddition.AddEntityState<CharacterMain>(ref flag); ContentAddition.AddEntityState<MeleeSkillState>(ref flag); ContentAddition.AddEntityState<BasicMeleeSkillState>(ref flag); } internal static void PassiveSetup(GameObject characterPrefab) { SkillLocator component = characterPrefab.GetComponent<SkillLocator>(); LanguageAPI.Add("GWEN__PASSIVE_NAME", "A Thousand Cuts"); LanguageAPI.Add("GWEN__PASSIVE_DESCRIPTION", "Gwen's Hallowed Cuts, <style=cIsDamage>center</style> of Snip Snip!, and Needlework deal <style=cIsDamage>bonus damage</style> based on the target's <style=cIsHealth>maximum health</style>."); component.passiveSkill.enabled = true; component.passiveSkill.skillNameToken = "GWEN__PASSIVE_NAME"; component.passiveSkill.skillDescriptionToken = "GWEN__PASSIVE_DESCRIPTION"; component.passiveSkill.icon = Assets.MainAssetBundle.LoadAsset<Sprite>("passive"); } internal static void PrimarySetup(GameObject characterPrefab) { SkillLocator component = characterPrefab.GetComponent<SkillLocator>(); string text = "_M1"; LanguageAPI.Add("GWEN_" + text, "Hallowed Cuts"); LanguageAPI.Add("GWEN_" + text + "_DESCRIPTION", "Slash foward for <style=cIsDamage>250% damage</style>. Every 3rd hit thrusts for <style=cIsDamage>350% damage</style>. Generate a stack of <style=cIsDamage>Snippy</style> up to <style=cIsDamage>4</style> times."); SkillDef skill = Utils.NewSkillDef<SkillDef>(typeof(Primary), "Weapon", 0, 0f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: true, fullRestockOnAssign: true, (InterruptPriority)0, isCombatSkill: true, mustKeyPress: false, cancelSprintingOnActivation: true, 0, 0, 0, Assets.MainAssetBundle.LoadAsset<Sprite>("primary"), "GWEN_" + text, "GWEN_" + 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("GWEN_" + text, "Snip Snip!"); LanguageAPI.Add("GWEN_" + text + "_DESCRIPTION", "Gwen snips at least twice with her scissors forward, dealing <style=cIsDamage>150% damage</style> per snip, with the final snip dealing <style=cIsDamage>400% damage</style>. Execute enemies below <style=cIsHealing>5% health</style>."); SkillDef skill = Utils.NewSkillDef<SkillDef>(typeof(Secondary), "Weapon", 1, 8f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: true, fullRestockOnAssign: false, (InterruptPriority)1, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: true, 1, 1, 1, Assets.MainAssetBundle.LoadAsset<Sprite>("secondary"), "GWEN_" + text, "GWEN_" + 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("GWEN_" + text, "Skip 'n Slash"); LanguageAPI.Add("GWEN_" + text + "_DESCRIPTION", "Gwen dashes forward, then empowers her Hallowed Cuts within the next <style=cIsUtility>5s</style>, to always deal 3rd hit damage and an additional <style=cIsDamage>50%</style> and gain <style=cIsDamage>50% attack speed</style>. Hits <style=cIsUtility>refund</style> this cooldown by <style=cIsUtility>4s</style>."); SkillDef skill = Utils.NewSkillDef<SkillDef>(typeof(Utility), "Dash", 1, 8f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)1, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: false, 1, 1, 1, Assets.MainAssetBundle.LoadAsset<Sprite>("utility"), "GWEN_" + text, "GWEN_" + 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("GWEN_" + text, "Needlework"); LanguageAPI.Add("GWEN_" + text + "_DESCRIPTION", "<style=cIsDamage>Slows</style>. Gwen launches a needle in the target direction that deals <style=cIsDamage>350% damage</style>. Needlework can be recast twice more within 8 seconds, <style=cIsDamage>increasing</style> the number of needles launched by <style=cIsDamage>2</style>."); SkillDef skill = Utils.NewSkillDef<SkillDef>(typeof(Special), "Spec", 1, 12f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)1, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: false, 1, 1, 1, Assets.MainAssetBundle.LoadAsset<Sprite>("special"), "GWEN_" + text, "GWEN_" + text + "_DESCRIPTION", Array.Empty<string>()); component.special = Utils.NewGenericSkill(characterPrefab, skill); special2 = Utils.NewSkillDef<SkillDef>(typeof(Special2), "Recast", 1, 0f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: true, (InterruptPriority)1, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: false, 0, 1, 1, Assets.MainAssetBundle.LoadAsset<Sprite>("special1"), "GWEN_" + text, "GWEN_" + text + "_DESCRIPTION", Array.Empty<string>()); special3 = Utils.NewSkillDef<SkillDef>(typeof(Special3), "Recast", 1, 0f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: true, (InterruptPriority)1, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: false, 0, 1, 1, Assets.MainAssetBundle.LoadAsset<Sprite>("special2"), "GWEN_" + text, "GWEN_" + text + "_DESCRIPTION", Array.Empty<string>()); } internal static GameObject CreateBodyPrefab(string characterName, Color bodyColor, float mass, bool large = false, bool flying = false) { //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Expected O, but got Unknown //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0120: 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: Expected O, but got Unknown //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_0326: Unknown result type (might be due to invalid IL or missing references) //IL_032b: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_035d: Unknown result type (might be due to invalid IL or missing references) //IL_0406: Unknown result type (might be due to invalid IL or missing references) //IL_0426: Unknown result type (might be due to invalid IL or missing references) //IL_0433: Unknown result type (might be due to invalid IL or missing references) //IL_0563: Unknown result type (might be due to invalid IL or missing references) //IL_0586: Unknown result type (might be due to invalid IL or missing references) //IL_05a9: Unknown result type (might be due to invalid IL or missing references) //IL_05cc: Unknown result type (might be due to invalid IL or missing references) //IL_05ef: Unknown result type (might be due to invalid IL or missing references) //IL_0612: Unknown result type (might be due to invalid IL or missing references) //IL_0684: Unknown result type (might be due to invalid IL or missing references) //IL_06ef: Unknown result type (might be due to invalid IL or missing references) //IL_0703: Unknown result type (might be due to invalid IL or missing references) //IL_0729: Unknown result type (might be due to invalid IL or missing references) //IL_073d: Unknown result type (might be due to invalid IL or missing references) //IL_076b: Unknown result type (might be due to invalid IL or missing references) //IL_0770: Unknown result type (might be due to invalid IL or missing references) //IL_0786: Unknown result type (might be due to invalid IL or missing references) //IL_078b: Unknown result type (might be due to invalid IL or missing references) //IL_07a7: Unknown result type (might be due to invalid IL or missing references) //IL_07ac: Unknown result type (might be due to invalid IL or missing references) //IL_07c2: Unknown result type (might be due to invalid IL or missing references) //IL_07c7: Unknown result type (might be due to invalid IL or missing references) //IL_07f5: Unknown result type (might be due to invalid IL or missing references) //IL_07fa: Unknown result type (might be due to invalid IL or missing references) //IL_0810: Unknown result type (might be due to invalid IL or missing references) //IL_0815: Unknown result type (might be due to invalid IL or missing references) //IL_0831: Unknown result type (might be due to invalid IL or missing references) //IL_0836: Unknown result type (might be due to invalid IL or missing references) //IL_084c: Unknown result type (might be due to invalid IL or missing references) //IL_0851: Unknown result type (might be due to invalid IL or missing references) //IL_0877: Unknown result type (might be due to invalid IL or missing references) //IL_088b: Unknown result type (might be due to invalid IL or missing references) //IL_08b1: Unknown result type (might be due to invalid IL or missing references) //IL_08c5: Unknown result type (might be due to invalid IL or missing references) //IL_0a36: Unknown result type (might be due to invalid IL or missing references) //IL_0a3b: Unknown result type (might be due to invalid IL or missing references) //IL_0a61: Unknown result type (might be due to invalid IL or missing references) //IL_0a66: Unknown result type (might be due to invalid IL or missing references) string text = characterName.Replace(" ", ""); string text2 = text.ToUpper(); LanguageAPI.Add("GWEN" + text2 + "_NAME", characterName); GameObject val = PrefabAPI.InstantiateClone(baseBody, text + "Body", true); val.GetComponent<NetworkIdentity>().localPlayerAuthority = true; Object.Destroy((Object)(object)((Component)val.transform.Find("ModelBase")).gameObject); Object.Destroy((Object)(object)((Component)val.transform.Find("CameraPivot")).gameObject); Object.Destroy((Object)(object)((Component)val.transform.Find("AimOrigin")).gameObject); GameObject val2 = Assets.MainAssetBundle.LoadAsset<GameObject>(text + "Mdl"); val2.AddComponent<AnimationEvents>().soundCenter = val2; GameObject val3 = new GameObject("ModelBase"); val3.transform.parent = val.transform; val3.transform.localPosition = new Vector3(0f, -0.94f, 0f); val3.transform.localRotation = Quaternion.identity; val3.transform.localScale = Vector3.one; GameObject val4 = new GameObject("AimOrigin"); val4.transform.parent = val3.transform; val4.transform.localPosition = new Vector3(0f, 1.4f, 0f); val4.transform.localRotation = Quaternion.identity; val4.transform.localScale = Vector3.one; Transform transform = val2.transform; transform.parent = val3.transform; transform.localPosition = Vector3.zero; transform.localRotation = Quaternion.identity; CharacterDirection component = val.GetComponent<CharacterDirection>(); component.targetTransform = val3.transform; component.modelAnimator = val2.GetComponentInChildren<Animator>(); component.turnSpeed = 720f; CharacterBody component2 = val.GetComponent<CharacterBody>(); ((Object)component2).name = text + "Body"; component2.baseNameToken = "GWEN" + text2 + "_NAME"; component2.subtitleNameToken = "GWEN" + text2 + "_SUBTITLE"; component2.bodyFlags = (BodyFlags)16; component2.aimOriginTransform = val4.transform; component2.hullClassification = (HullClassification)(large ? 1 : 0); Sprite val5 = Assets.MainAssetBundle.LoadAsset<Sprite>(text); component2.portraitIcon = (Texture)(object)(Object.op_Implicit((Object)(object)val5) ? val5.texture : null); component2.isChampion = false; component2.currentVehicle = null; component2.skinIndex = 0u; component2.bodyColor = bodyColor; HealthComponent component3 = val.GetComponent<HealthComponent>(); component3.health = component2.baseMaxHealth; component3.shield = 0f; component3.barrier = 0f; CharacterMotor component4 = val.GetComponent<CharacterMotor>(); component4.walkSpeedPenaltyCoefficient = 1f; component4.characterDirection = component; component4.muteWalkMotion = false; component4.mass = mass; component4.airControl = 0.25f; component4.disableAirControlUntilCollision = false; component4.generateParametersOnAwake = true; InputBankTest component5 = val.GetComponent<InputBankTest>(); component5.moveVector = Vector3.zero; CameraTargetParams component6 = val.GetComponent<CameraTargetParams>(); component6.cameraParams = baseBody.GetComponent<CameraTargetParams>().cameraParams; component6.cameraPivotTransform = null; component6.recoil = Vector2.zero; component6.dontRaycastToPivot = false; ModelLocator component7 = val.GetComponent<ModelLocator>(); component7.modelTransform = transform; component7.modelBaseTransform = val3.transform; component7.dontReleaseModelOnDeath = false; component7.autoUpdateModelTransform = true; component7.dontDetatchFromParent = false; component7.noCorpse = false; component7.normalizeToFloor = false; component7.preserveModel = false; ChildLocator component8 = val2.GetComponent<ChildLocator>(); CharacterModel val6 = val2.AddComponent<CharacterModel>(); SkinnedMeshRenderer[] componentsInChildren = val2.GetComponentsInChildren<SkinnedMeshRenderer>(); List<RendererInfo> list = new List<RendererInfo>(); foreach (SkinnedMeshRenderer val7 in componentsInChildren) { ((Renderer)val7).material = Prefabs.InstantiateDefaultSurvivorMaterial(((Renderer)val7).material.mainTexture); list.Add(new RendererInfo { renderer = (Renderer)(object)val7, defaultMaterial = ((Renderer)val7).material, defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = false }); if (!((Object)val7).name.Contains("base")) { ((Component)val7).gameObject.SetActive(false); } } RendererInfo[] array = list.ToArray(); val6.body = component2; val6.baseRendererInfos = array; val6.autoPopulateLightInfos = true; val6.temporaryOverlays = new List<TemporaryOverlayInstance>(); val6.mainSkinnedMeshRenderer = componentsInChildren[0]; LanguageAPI.Add(text2 + "BODY_DEFAULT_SKIN_NAME", "Default"); LanguageAPI.Add(text2 + "BODY_SKIN01_NAME", "Space Groove"); LanguageAPI.Add(text2 + "BODY_SKIN11_NAME", "Cafe Cuties"); LanguageAPI.Add(text2 + "BODY_SKIN20_NAME", "Soul Fighter"); LanguageAPI.Add(text2 + "BODY_QUEEN_NAME", "Battle Queen"); LanguageAPI.Add(text2 + "BODY_RAIN_NAME", "Rain Shepherd"); ModelSkinController val8 = val2.AddComponent<ModelSkinController>(); val8.skins = (SkinDef[])(object)new SkinDef[6] { Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, text2 + "BODY_DEFAULT_SKIN_NAME", "base", array)), Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, text2 + "BODY_SKIN01_NAME", "skin01", array)), Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, text2 + "BODY_SKIN11_NAME", "skin11", array)), Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, text2 + "BODY_SKIN20_NAME", "skin20", array)), Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, text2 + "BODY_QUEEN_NAME", "queen", array)), Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, text2 + "BODY_RAIN_NAME", "rain", array)) }; Collider[] componentsInChildren2 = val2.GetComponentsInChildren<Collider>(); HurtBoxGroup val9 = val2.AddComponent<HurtBoxGroup>(); List<HurtBox> list2 = new List<HurtBox>(); Collider[] array2 = componentsInChildren2; foreach (Collider val10 in array2) { HurtBox val11 = ((Component)val10).gameObject.AddComponent<HurtBox>(); ((Component)val11).gameObject.layer = LayerIndex.entityPrecise.intVal; val11.healthComponent = component3; val11.isBullseye = true; val11.damageModifier = (DamageModifier)0; val11.hurtBoxGroup = val9; val11.indexInGroup = 0; val9.mainHurtBox = val11; val9.bullseyeCount = 1; list2.Add(val11); } val9.hurtBoxes = list2.ToArray(); Utils.CreateHitbox("Attack", val2.transform, new Vector3(4.5f, 5f, 7f), new Vector3(0f, 1f, 2f)); Utils.CreateHitbox("AttackBig", val2.transform, new Vector3(4.5f, 5f, 11f), new Vector3(0f, 1f, 3f)); Utils.CreateHitboxes("Sides", val2.transform, (Vector3[])(object)new Vector3[2] { new Vector3(2.5f, 5f, 8f), new Vector3(2.5f, 5f, 8f) }, (Vector3[])(object)new Vector3[2] { new Vector3(-1.75f, 1f, 3.5f), new Vector3(1.75f, 1f, 3.5f) }, noRotation: true); Utils.CreateHitboxes("SidesBig", val2.transform, (Vector3[])(object)new Vector3[2] { new Vector3(2.5f, 5f, 12f), new Vector3(2.5f, 5f, 12f) }, (Vector3[])(object)new Vector3[2] { new Vector3(-1.75f, 1f, 5.25f), new Vector3(1.75f, 1f, 5.25f) }, noRotation: true); Utils.CreateHitbox("Center", val2.transform, new Vector3(1f, 5f, 8f), new Vector3(0f, 1f, 3.5f), noRotation: true); Utils.CreateHitbox("CenterBig", val2.transform, new Vector3(1f, 5f, 12f), new Vector3(0f, 1f, 5.25f), noRotation: true); KinematicCharacterMotor component9 = val.GetComponent<KinematicCharacterMotor>(); component9.CharacterController = (ICharacterController)(object)component4; component9.playerCharacter = true; val.GetComponent<Interactor>().maxInteractionDistance = 3f; val.GetComponent<InteractionDriver>().highlightInteractor = true; SfxLocator component10 = val.GetComponent<SfxLocator>(); component10.deathSound = "Play_ui_player_death"; component10.barkSound = ""; component10.openSound = ""; component10.landingSound = (large ? "Play_gravekeeper_land" : "Play_char_land"); component10.fallDamageSound = "Play_char_land_fall_damage"; component10.aliveLoopStart = ""; component10.aliveLoopStop = ""; val.GetComponent<Rigidbody>().mass = mass; FootstepHandler val12 = val2.AddComponent<FootstepHandler>(); val12.baseFootstepString = (large ? "Play_beetle_queen_step" : "Play_player_footstep"); val12.sprintFootstepOverrideString = ""; val12.enableFootstepDust = true; val12.footstepDustPrefab = Prefabs.Load<GameObject>(large ? "RoR2/Base/Common/VFX/GenericHugeFootstepDust.prefab" : "RoR2/Base/Common/VFX/GenericFootstepDust.prefab"); GenericSkill[] componentsInChildren3 = val.GetComponentsInChildren<GenericSkill>(); foreach (GenericSkill val13 in componentsInChildren3) { Object.DestroyImmediate((Object)(object)val13); } if (flying) { Utils.NewStateMachine<GrantFlight>(val, "Flight"); component10.landingSound = ""; component10.fallDamageSound = ""; } EntityStateMachine component11 = ((Component)component2).GetComponent<EntityStateMachine>(); component11.mainStateType = new SerializableEntityStateType(typeof(CharacterMain)); CharacterDeathBehavior component12 = val.GetComponent<CharacterDeathBehavior>(); component12.deathStateMachine = val.GetComponent<EntityStateMachine>(); component12.deathState = new SerializableEntityStateType(typeof(GenericCharacterDeath)); Utils.NewStateMachine<Idle>(val, "Dash"); Utils.NewStateMachine<Idle>(val, "Spec"); Utils.NewStateMachine<Idle>(val, "Recast"); NetworkStateMachine component13 = ((Component)component2).GetComponent<NetworkStateMachine>(); component13.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 RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args) { if (sender.HasBuff(Prefabs.dash)) { args.attackSpeedMultAdd += 0.5f; } } private static void GlobalEventManager_onServerDamageDealt(DamageReport damageReport) { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Invalid comparison between Unknown and I4 //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Invalid comparison between Unknown and I4 //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Invalid comparison between Unknown and I4 //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Expected O, but got Unknown //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Expected O, but got Unknown //IL_0254: 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) DamageInfo damageInfo = damageReport.damageInfo; if (!(damageInfo.procCoefficient > 0f) || !Object.op_Implicit((Object)(object)damageReport.attackerBody) || !Object.op_Implicit((Object)(object)damageReport.victim)) { return; } Behaviour component = ((Component)damageReport.attackerBody).GetComponent<Behaviour>(); if (!Object.op_Implicit((Object)(object)component)) { return; } bool flag = (int)damageInfo.damageType.damageSource == 1; bool flag2 = (int)damageInfo.damageType.damageSource == 2; bool flag3 = (int)damageInfo.damageType.damageSource == 8; if (flag) { damageReport.attackerBody.AddTimedBuff(Prefabs.snippy, 6f, 4); if (damageReport.attackerBody.HasBuff(Prefabs.dash)) { component.Networkrefunded = true; DamageInfo val = new DamageInfo { position = damageInfo.position, damage = damageReport.attackerBody.damage * MainPlugin.utilityAdditionalDamage.Value, procCoefficient = 0f, damageType = DamageTypeCombo.op_Implicit((DamageType)0), damageColorIndex = (DamageColorIndex)16, attacker = damageReport.attacker, crit = damageInfo.crit }; damageReport.victim.TakeDamage(val); } } else if (flag2 && damageReport.victim.combinedHealth <= damageReport.victim.fullCombinedHealth * MainPlugin.secondaryExecutePercentage.Value) { damageReport.victim.Suicide(damageReport.attacker, (GameObject)null, default(DamageTypeCombo)); } if (DamageAPI.HasModdedDamageType(damageInfo, Prefabs.snip) || flag3) { float num = (flag3 ? MainPlugin.passiveSpecialDamage.Value : (flag ? MainPlugin.passivePrimaryDamage.Value : MainPlugin.passiveSecondaryCenterDamage.Value)); float num2 = damageReport.victim.fullCombinedHealth * num; DamageInfo val2 = new DamageInfo { position = damageInfo.position, damage = num2, procCoefficient = 0f, damageType = DamageTypeCombo.op_Implicit((DamageType)0), damageColorIndex = (DamageColorIndex)5, attacker = damageReport.attacker, crit = false }; damageReport.victim.TakeDamage(val2); damageReport.attackerBody.healthComponent.Heal(num2 * component.healPerc, default(ProcChainMask), true); } } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.Dragonyck.Gwen", "Gwen", "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.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] public class MainPlugin : BaseUnityPlugin { public const string MODUID = "com.Dragonyck.Gwen"; public const string MODNAME = "Gwen"; public const string VERSION = "1.0.0"; internal const string MODKEY = "GWEN"; internal static ConfigEntry<float> passivePrimaryDamage; internal static ConfigEntry<float> passiveSecondaryCenterDamage; internal static ConfigEntry<float> passiveSpecialDamage; internal static ConfigEntry<float> primaryDamage; internal static ConfigEntry<float> primaryFinisherDamage; internal static ConfigEntry<float> secondaryDamage; internal static ConfigEntry<float> secondaryLastHitDamage; internal static ConfigEntry<float> secondaryExecutePercentage; internal static ConfigEntry<float> utilityAdditionalDamage; internal static ConfigEntry<float> specialDamage; private void Awake() { passivePrimaryDamage = ((BaseUnityPlugin)this).Config.Bind<float>("Passive", "Primary Health Percentage", 0.01f, (ConfigDescription)null); passiveSecondaryCenterDamage = ((BaseUnityPlugin)this).Config.Bind<float>("Passive", "Secondary Center Health Percentage", 0.01f, (ConfigDescription)null); passiveSpecialDamage = ((BaseUnityPlugin)this).Config.Bind<float>("Passive", "Special Health Percentage", 0.03f, (ConfigDescription)null); primaryDamage = ((BaseUnityPlugin)this).Config.Bind<float>("Primary", "Damage Coefficient", 2.5f, (ConfigDescription)null); primaryFinisherDamage = ((BaseUnityPlugin)this).Config.Bind<float>("Primary", "Finisher Damage Coefficient", 3.5f, (ConfigDescription)null); secondaryDamage = ((BaseUnityPlugin)this).Config.Bind<float>("Secondary", "Damage Coefficient", 1.5f, (ConfigDescription)null); secondaryLastHitDamage = ((BaseUnityPlugin)this).Config.Bind<float>("Secondary", "Last Damage Coefficient", 4f, (ConfigDescription)null); secondaryExecutePercentage = ((BaseUnityPlugin)this).Config.Bind<float>("Secondary", "Execute Percentage", 0.05f, (ConfigDescription)null); utilityAdditionalDamage = ((BaseUnityPlugin)this).Config.Bind<float>("Utility", "Additional Damage Coefficient", 0.5f, (ConfigDescription)null); specialDamage = ((BaseUnityPlugin)this).Config.Bind<float>("Special", "Damage Coefficient", 3.5f, (ConfigDescription)null); Assets.PopulateAssets(); Prefabs.CreatePrefabs(); CharacterBodySetup.CreateCharacterBodies(); Hook.Hooks(); } } internal class Prefabs { internal static GameObject hitEffect; internal static GameObject hitEffectMed; internal static GameObject hitEffectLarge; internal static GameObject hitEffectLargeLast; internal static GameObject hitEffectCenter; internal static GameObject hitEffectProjectile; internal static GameObject hitEffectDash; internal static GameObject dashEffect; internal static GameObject dashSwingEffect; internal static GameObject swingEffect; internal static GameObject thrustSwingEffect; internal static GameObject needleProjectileGhost; internal static GameObject needleProjectile; internal static GameObject ultCastEffect; internal static GameObject snipSwingEffect; internal static GameObject snipSwingEffectLarge; internal static GameObject afterImageEffect; internal static BuffDef snippy; internal static BuffDef dash; internal static ModdedDamageType snip; internal static Material baseMaterial = Load<Material>("RoR2/Base/Commando/matCommandoDualies.mat"); internal static void CreatePrefabs() { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0091: 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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: 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_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Expected O, but got Unknown //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Expected O, but got Unknown //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_051d: Unknown result type (might be due to invalid IL or missing references) //IL_0527: Unknown result type (might be due to invalid IL or missing references) //IL_056c: Unknown result type (might be due to invalid IL or missing references) GameObject val = Load<GameObject>("RoR2/Base/UI/HUDSimple.prefab"); Object.DontDestroyOnLoad((Object)(object)val); HUDScaleController component = val.GetComponent<HUDScaleController>(); HUDTracker hUDTracker = val.AddComponent<HUDTracker>(); Transform val2 = val.GetComponent<ChildLocator>().FindChild("BottomLeftCluster"); GameObject gameObject = ((Component)((Component)val2).GetComponentInChildren<HealthBar>()).gameObject; GameObject val3 = Object.Instantiate<GameObject>(Assets.Load<GameObject>("BarUI")); ((Transform)(RectTransform)val3.transform).SetParent(gameObject.transform); val3.transform.localPosition = Vector2.op_Implicit(new Vector2(103f, -20f)); val3.transform.localRotation = Quaternion.identity; val3.transform.localScale = new Vector3(0.66f, 0.5f, 1f); val3.SetActive(false); hUDTracker.barRoot = val3; snip = DamageAPI.ReserveDamageType(); dash = Utils.NewBuffDef("Skip 'n Slash", stack: false, hidden: false, Assets.Load<Sprite>("utility"), Color.white); snippy = Utils.NewBuffDef("Snippy", stack: true, hidden: false, Assets.Load<Sprite>("secondary"), Color.white); afterImageEffect = Instantiate(Assets.Load<GameObject>("AfterImageBase"), "AfterImageBase"); Material val4 = new Material(Load<Material>("RoR2/Base/Captain/matCaptainTazerCore.mat")); val4.SetTexture("_MainTex", (Texture)null); val4.SetFloat("_AlphaBoost", 1.05f); ((Renderer)afterImageEffect.GetComponent<MeshRenderer>()).material = val4; AnimateShaderAlpha val5 = afterImageEffect.AddComponent<AnimateShaderAlpha>(); val5.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); val5.destroyOnEnd = true; val5.timeMax = 0.3f; dashEffect = Instantiate(Assets.Load<GameObject>("DashEffect"), "DashEffect"); Utils.RegisterEffect(dashEffect, 1.1f); dashSwingEffect = Instantiate(Assets.Load<GameObject>("ESwing"), "DashSwingEffect"); dashSwingEffect.AddComponent<ScaleParticleSystemDuration>().initialDuration = 0.45f; dashSwingEffect.AddComponent<DestroyOnTimer>().duration = 0.8f; swingEffect = Instantiate("RoR2/Base/Merc/MercSwordSlash.prefab", "SwingEffect"); swingEffect.AddComponent<DestroyOnTimer>().duration = 0.8f; ParticleSystemRenderer componentInChildren = swingEffect.GetComponentInChildren<ParticleSystemRenderer>(); ((Renderer)componentInChildren).material = new Material(((Renderer)componentInChildren).material); ((Renderer)componentInChildren).material.SetColor("_TintColor", Color.cyan); ((Renderer)componentInChildren).material.SetTexture("_MainTex", (Texture)(object)Load<Texture2D>("RoR2/Base/Imp/texImpSwipeMask.png")); ((Component)componentInChildren).transform.localScale = new Vector3(1f, 1f, 0.5f); thrustSwingEffect = Instantiate(Assets.Load<GameObject>("ThrustSwingEffect"), "ThrustSwingEffect"); thrustSwingEffect.AddComponent<ScaleParticleSystemDuration>().initialDuration = 0.65f; thrustSwingEffect.AddComponent<DestroyOnTimer>().duration = 0.8f; snipSwingEffect = Instantiate(Assets.Load<GameObject>("QSwing"), "SnipSwingEffect"); snipSwingEffect.AddComponent<ScaleParticleSystemDuration>().initialDuration = 0.45f; snipSwingEffect.AddComponent<DestroyOnTimer>().duration = 0.8f; snipSwingEffectLarge = Instantiate(Assets.Load<GameObject>("QSwingStrong"), "snipSwingEffectLarge"); snipSwingEffectLarge.AddComponent<ScaleParticleSystemDuration>().initialDuration = 0.6f; snipSwingEffectLarge.AddComponent<DestroyOnTimer>().duration = 0.8f; ultCastEffect = Instantiate(Assets.Load<GameObject>("UltCastEffect"), "UltCastEffect"); Utils.RegisterEffect(ultCastEffect, 1.1f); hitEffect = Instantiate("RoR2/Base/Merc/OmniImpactVFXSlashMerc.prefab", "HitEffect"); Utils.RegisterEffect(hitEffect, -1f, "Play_sfx_Gwen_GwenBasicAttack_Swipe_hit"); hitEffectMed = Instantiate("RoR2/Base/Merc/OmniImpactVFXSlashMerc.prefab", "HitEffectMed"); Utils.RegisterEffect(hitEffectMed, -1f, "Play_sfx_Gwen_GwenBasicAttack_Stab_hit"); hitEffectLarge = Instantiate("RoR2/Base/Merc/OmniImpactVFXSlashMerc.prefab", "HitEffectLarge"); Utils.RegisterEffect(hitEffectLarge, -1f, "Play_sfx_Gwen_GwenQFirst_hit"); hitEffectLargeLast = Instantiate("RoR2/Base/Merc/OmniImpactVFXSlashMerc.prefab", "HitEffectLargeLast"); Utils.RegisterEffect(hitEffectLargeLast, -1f, "Play_sfx_Gwen_GwenQLast_hit"); hitEffectCenter = Instantiate("RoR2/Base/Common/VFX/OmniImpactVFXSlash.prefab", "HitEffectCenter"); Utils.RegisterEffect(hitEffectCenter, -1f, "Play_sfx_Gwen_GwenQCenter_hit"); hitEffectProjectile = Instantiate("RoR2/Base/Huntress/OmniImpactVFXHuntress.prefab", "HitEffectProjectile"); Utils.RegisterEffect(hitEffectProjectile, -1f, "Play_sfx_Gwen_GwenRMis_OnHitLocation"); hitEffectDash = Instantiate("RoR2/Base/Merc/OmniImpactVFXSlashMerc.prefab", "HitEffectDash"); Utils.RegisterEffect(hitEffectDash, -1f, "Play_sfx_Gwen_GwenEEmpoweredAttack_OnHitLocation"); needleProjectileGhost = Instantiate(Assets.Load<GameObject>("UltProjectile"), "NeedleProjectileGhost"); needleProjectileGhost.transform.localScale = Vector3.one * 1.5f; needleProjectileGhost.AddComponent<ProjectileGhostController>(); Utils.AddScaleComponent(needleProjectileGhost, 0.2f); needleProjectile = Instantiate("RoR2/Base/Mage/MageIceBombProjectile.prefab", "NeedleProjectile", registerNetwork: true); needleProjectile.AddComponent<ModdedDamageTypeHolderComponent>().Add(snip); needleProjectile.GetComponent<ProjectileOverlapAttack>().impactEffect = hitEffectProjectile; ProjectileController component2 = needleProjectile.GetComponent<ProjectileController>(); component2.ghostPrefab = needleProjectileGhost; component2.startSound = "Play_sfx_Gwen_GwenR_missile"; ProjectileSimple component3 = needleProjectile.GetComponent<ProjectileSimple>(); component3.lifetime = 2f; component3.desiredForwardSpeed = 60f; ContentAddition.AddProjectile(needleProjectile); } 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 Behaviour behaviour; 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 DamageSource damageSource => (DamageSource)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 virtual bool snap => false; public override void OnSerialize(NetworkWriter writer) { ((BaseSkillState)this).OnSerialize(writer); writer.Write(attackIndex); } public override void OnDeserialize(NetworkReader reader) { ((BaseSkillState)this).OnDeserialize(reader); attackIndex = reader.ReadInt32(); } public override void OnEnter() { //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); behaviour = ((EntityState)this).GetComponent<Behaviour>(); attackSpeedScaling = Math.Min(((BaseState)this).attackSpeedStat, 6f); attackDuration = baseAttackDuration / attackSpeedScaling; hitPauseDuration = GroundLight.hitPauseDuration / attackSpeedScaling; hopVelocity = baseHopVelocity / attackSpeedScaling; ((BaseState)this).StartAimMode(attackDuration, snap); 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); overlapAttack.damageType.damageSource = damageSource; 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 virtual bool FireAttack() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) return FireMeleeAttack(overlapAttack, animator, hitBoxActiveParameter, forceMagnitude, bonusForce); } public override void FixedUpdate() { //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); if (((EntityState)this).isAuthority) { bool flag = FireAttack(); 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)) { SpawnSwingEffect(attackDuration); } float num = 4.2f; ((BaseState)this).AddRecoil(-0.1f * num, 0.1f * num, -1f * num, 1f * num); } } public void SpawnSwingEffect(float duration) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) Transform val = ((BaseState)this).FindModelChild(swingMuzzle); GameObject val2 = Object.Instantiate<GameObject>(swingEffectPrefab, val.position, Quaternion.identity, val); val2.transform.localScale = Vector3.one; val2.transform.localRotation = Quaternion.identity; val2.GetComponent<ScaleParticleSystemDuration>().newDuration = duration; } 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 : MeleeSkillState { public override float baseAttackDuration => (!dash) ? behaviour.primaryDur : (finisher ? behaviour.primaryDashDur : behaviour.primaryFinisherDur); public override float earlyExitDurationPercentage => 0.95f; public override string layerName => "FullBody, Override"; public override string animationStateName => dash ? "PassiveAttack" : ("Attack" + attackIndex); public override string animParameter => "M1"; public override string hitBoxGroupName => dash ? "AttackBig" : "Attack"; public override float forceMagnitude => 250f; public override float damageCoefficient => finisher ? MainPlugin.primaryFinisherDamage.Value : MainPlugin.primaryDamage.Value; public override string swingSound => dash ? "Play_sfx_Gwen_GwenEEmpoweredAttack_Oncast" : (finisher ? "Play_sfx_Gwen_GwenBasicAttack_Stab_cast" : "Play_sfx_Gwen_GwenBasicAttack_Swipe_cast"); public override float baseHopVelocity => 6f; public override bool finisher => dash || attackIndex == 3; public override GameObject hitEffectPrefab => dash ? Prefabs.hitEffectDash : (finisher ? Prefabs.hitEffectMed : Prefabs.hitEffect); public override string swingMuzzle => dash ? "center" : ("swing" + attackIndex + "Muzzle"); public override bool rootMotion => true; public override float rootMotionSpeed => behaviour.rootMotionSpeed; public override GameObject swingEffectPrefab => dash ? Prefabs.dashSwingEffect : (finisher ? Prefabs.thrustSwingEffect : Prefabs.swingEffect); public override DamageType damageType => DamageTypeCombo.op_Implicit(DamageTypeCombo.GenericPrimary); public override DamageSource damageSource => (DamageSource)1; private bool dash => ((EntityState)this).characterBody.HasBuff(Prefabs.dash); 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() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) base.OnEnter(); DamageAPI.AddModdedDamageType(overlapAttack, Prefabs.snip); ((EntityState)this).characterMotor.walkSpeedPenaltyCoefficient = behaviour.speedPenalty; } public override void FixedUpdate() { base.FixedUpdate(); if (((EntityState)this).isAuthority && ((EntityState)this).inputBank.skill3.down && ((EntityState)this).skillLocator.utility.CanExecute()) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void SetState() { if (!finisher) { Primary primary = new Primary(); primary.attackIndex = attackIndex + 1; ((EntityState)this).outer.SetNextState((EntityState)(object)primary); } } public override void OnExit() { ((EntityState)this).characterMotor.walkSpeedPenaltyCoefficient = 1f; ((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 Secondary : MeleeSkillState { private HitBoxGroup center; private HitBoxGroup sides; public override float baseAttackDuration => followUpAttack ? behaviour.secondaryFollowupDur : behaviour.secondaryDur; public override float earlyExitDurationPercentage => 1f; public override string layerName => "FullBody, Override"; public override string animationStateName => finisher ? "Secondary3" : ((attackIndex == 1) ? "Secondary" : "Secondary2"); public override string animParameter => "M2"; public override string hitBoxGroupName => ((EntityState)this).characterBody.HasBuff(Prefabs.dash) ? "AttackBig" : "Attack"; public override float forceMagnitude => 250f; public override float damageCoefficient => finisher ? MainPlugin.secondaryLastHitDamage.Value : MainPlugin.secondaryDamage.Value; public override string swingSound => followUpAttack ? "Play_sfx_Gwen_GwenQ_Middle_Cast" : (finisher ? "Play_sfx_Gwen_GwenQLast_cast" : "Play_sfx_Gwen_GwenQFirst_cast"); public override float baseHopVelocity => (attackIndex <= 1) ? 6 : 0; public override bool finisher => attackIndex == 2 + ((EntityState)this).characterBody.GetBuffCount(Prefabs.snippy); public override GameObject hitEffectPrefab => null; public override string swingMuzzle => "center"; public override GameObject swingEffectPrefab => finisher ? Prefabs.snipSwingEffectLarge : Prefabs.snipSwingEffect; public override DamageType damageType => DamageTypeCombo.op_Implicit(DamageTypeCombo.GenericSecondary); public override DamageSource damageSource => (DamageSource)2; public override bool snap => true; private bool followUpAttack => attackIndex > 1 && !finisher; 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(); bool flag = ((EntityState)this).characterBody.HasBuff(Prefabs.dash); string centerHitbox = (flag ? "CenterBig" : "Center"); string sidesHitbox = (flag ? "SidesBig" : "Sides"); HitBoxGroup[] components = ((Component)((EntityState)this).GetModelTransform()).GetComponents<HitBoxGroup>(); center = Array.Find(components, (HitBoxGroup x) => x.groupName == centerHitbox); sides = Array.Find(components, (HitBoxGroup x) => x.groupName == sidesHitbox); ((EntityState)this).characterMotor.walkSpeedPenaltyCoefficient = behaviour.speedPenalty; if (attackIndex == 1) { AkSoundEngine.PostEvent("Play_sfx_Gwen_GwenQ_OnCast", ((EntityState)this).gameObject); } if (NetworkServer.active) { ((EntityState)this).characterBody.ExtendTimedBuffIfPresent(Prefabs.snippy, 4f); } AkSoundEngine.PostEvent("Play_sfx_Gwen_GwenQ_Middle_Cast", ((EntityState)this).gameObject); if (followUpAttack) { SpawnSwingEffect(0.25f); } } public override void FixedUpdate() { base.FixedUpdate(); ((BaseState)this).SmallHop(((EntityState)this).characterMotor, 0f); } public override bool FireAttack() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) overlapAttack.hitBoxGroup = center; DamageAPI.AddModdedDamageType(overlapAttack, Prefabs.snip); overlapAttack.hitEffectPrefab = Prefabs.hitEffectCenter; bool flag = base.FireAttack(); overlapAttack.hitBoxGroup = sides; DamageAPI.RemoveModdedDamageType(overlapAttack, Prefabs.snip); overlapAttack.hitEffectPrefab = (finisher ? Prefabs.hitEffectLargeLast : Prefabs.hitEffectLarge); bool flag2 = base.FireAttack(); return flag || flag2; } public override BaseSkillState StateOverride() { if (finisher) { return null; } Secondary secondary = new Secondary(); secondary.attackIndex = attackIndex + 1; return (BaseSkillState)(object)secondary; } public override void OnExit() { if (NetworkServer.active && finisher) { ((EntityState)this).characterBody.ClearTimedBuffs(Prefabs.snippy); } ((EntityState)this).characterMotor.walkSpeedPenaltyCoefficient = 1f; ((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 BaseSpecial : BaseSkillState { public float duration; private Animator animator; private bool curveFired; public virtual float baseDuration => 0f; public virtual string animName => ""; public virtual string soundID => ""; public override void OnEnter() { ((BaseState)this).OnEnter(); animator = ((EntityState)this).GetModelAnimator(); duration = baseDuration / ((BaseState)this).attackSpeedStat; ((EntityState)this).PlayAnimation("FullBody, Override", animName, "Special", duration, 0f); ((BaseState)this).SmallHop(((EntityState)this).characterMotor, 15f); AkSoundEngine.PostEvent("Play_sfx_Gwen_GwenR_OnCast", ((EntityState)this).gameObject); EffectManager.SimpleMuzzleFlash(Prefabs.ultCastEffect, ((EntityState)this).gameObject, "base", false); } public virtual void OnCurveFire() { AkSoundEngine.PostEvent(soundID, ((EntityState)this).gameObject); } public void FireProjectile(Vector3 origin) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) if (((EntityState)this).isAuthority) { ProjectileManager instance = ProjectileManager.instance; GameObject needleProjectile = Prefabs.needleProjectile; Ray aimRay = ((BaseState)this).GetAimRay(); instance.FireProjectile(needleProjectile, origin, Quaternion.LookRotation(((Ray)(ref aimRay)).direction), ((EntityState)this).gameObject, ((BaseState)this).damageStat * MainPlugin.specialDamage.Value, 500f, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, -1f, (DamageTypeCombo?)(DamageTypeCombo.GenericSpecial | DamageTypeCombo.op_Implicit((DamageType)8))); } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (!curveFired && animator.GetFloat("Curve") >= 0.11f) { curveFired = true; OnCurveFire(); } } 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 Special : BaseSpecial { private float recastDuration = 8f; private bool secondCast; public override string soundID => "Play_sfx_Gwen_GwenR1_OnCast"; public override string animName => "Special1"; public override float baseDuration => 1f; public override void OnEnter() { base.OnEnter(); ((EntityState)this).characterBody.onSkillActivatedAuthority += CharacterBody_onSkillActivatedAuthority; ChildLocator modelChildLocator = ((EntityState)this).GetModelChildLocator(); for (int i = 0; i < 3; i++) { ((Component)modelChildLocator.FindChild("needleMuzzle" + i)).gameObject.SetActive(true); } } private void CharacterBody_onSkillActivatedAuthority(GenericSkill skill) { if (!((Object)(object)skill != (Object)(object)((EntityState)this).skillLocator.special)) { ((EntityState)this).fixedAge = 0f; } } public override void OnCurveFire() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) base.OnCurveFire(); FireProjectile(((BaseState)this).FindModelChild("needleMuzzle0").position); } public override void FixedUpdate() { base.FixedUpdate(); if (!secondCast && ((EntityState)this).fixedAge >= duration) { secondCast = true; ((EntityState)this).skillLocator.special.SetSkillOverride((object)((EntityState)this).gameObject, CharacterBodySetup.special2, (SkillOverridePriority)4); } if ((((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= recastDuration) || (secondCast && !((EntityState)this).skillLocator.special.HasSkillOverrideOfPriority((SkillOverridePriority)4))) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { AkSoundEngine.PostEvent("Play_sfx_Gwen_GwenR_buffdeactivate", ((EntityState)this).gameObject); ((EntityState)this).characterBody.onSkillActivatedAuthority -= CharacterBody_onSkillActivatedAuthority; if (((EntityState)this).skillLocator.special.HasSkillOverrideOfPriority((SkillOverridePriority)4)) { ((EntityState)this).skillLocator.special.UnsetSkillOverride((object)((EntityState)this).gameObject, CharacterBodySetup.special2, (SkillOverridePriority)4); ((EntityState)this).skillLocator.special.UnsetSkillOverride((object)((EntityState)this).gameObject, CharacterBodySetup.special3, (SkillOverridePriority)4); } ChildLocator modelChildLocator = ((EntityState)this).GetModelChildLocator(); for (int i = 0; i < 5; i++) { ((Component)modelChildLocator.FindChild("needleMuzzle" + i)).gameObject.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)7; } } internal class Special2 : BaseSpecial { public override string soundID => "Play_sfx_Gwen_GwenR2_OnCast"; public override string animName => "Special1"; public override float baseDuration => 1f; public override void OnEnter() { base.OnEnter(); duration /= ((BaseState)this).attackSpeedStat; ChildLocator modelChildLocator = ((EntityState)this).GetModelChildLocator(); for (int i = 0; i < 5; i++) { ((Component)modelChildLocator.FindChild("needleMuzzle" + i)).gameObject.SetActive(true); } } public override void OnCurveFire() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) base.OnCurveFire(); ChildLocator modelChildLocator = ((EntityState)this).GetModelChildLocator(); for (int i = 0; i < 3; i++) { FireProjectile(modelChildLocator.FindChild("needleMuzzle" + i).position); } } public override void FixedUpdate() { base.FixedUpdate(); if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { if (((EntityState)this).fixedAge >= duration) { ((EntityState)this).skillLocator.special.UnsetSkillOverride((object)((EntityState)this).gameObject, CharacterBodySetup.special2, (SkillOverridePriority)4); ((EntityState)this).skillLocator.special.SetSkillOverride((object)((EntityState)this).gameObject, CharacterBodySetup.special3, (SkillOverridePriority)4); } ((EntityState)this).OnExit(); } } internal class Special3 : BaseSpecial { public override string soundID => "Play_sfx_Gwen_GwenR3_OnCast"; public override string animName => "Special2"; public override float baseDuration => 1f; public override void OnEnter() { base.OnEnter(); duration /= ((BaseState)this).attackSpeedStat; } public override void OnCurveFire() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) base.OnCurveFire(); ChildLocator modelChildLocator = ((EntityState)this).GetModelChildLocator(); for (int i = 0; i < 5; i++) { FireProjectile(modelChildLocator.FindChild("needleMuzzle" + i).position); } } public override void FixedUpdate() { base.FixedUpdate(); if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { ((EntityState)this).skillLocator.special.UnsetSkillOverride((object)((EntityState)this).gameObject, CharacterBodySetup.special3, (SkillOverridePriority)4); ((EntityState)this).OnExit(); } } internal class Utility : BaseSkillState { private float duration = 5f; private float dashDuration = 0.3f; private Vector3 direction; private AnimationCurve curve = AnimationCurve.Linear(0f, 1f, 1f, 0f); private Behaviour behaviour; private bool refunded; private float stopwatch = 1f; private Transform modelTransform; 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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); behaviour = ((EntityState)this).GetComponent<Behaviour>(); behaviour.Networkrefunded = false; ((EntityState)this).PlayAnimation("Body", "Utility", "Utility", dashDuration, 0f); direction = ((EntityState)this).inputBank.moveVector; if (direction == Vector3.zero) { direction = ((EntityState)this).characterDirection.forward; } if (((EntityState)this).isAuthority) { EffectManager.SimpleMuzzleFlash(Prefabs.dashEffect, ((EntityState)this).gameObject, "center", true); } if (NetworkServer.active) { ((EntityState)this).characterBody.AddTimedBuff(Prefabs.dash, duration); } AkSoundEngine.PostEvent("Play_sfx_Gwen_GwenE_OnCast", ((EntityState)this).gameObject); modelTransform = ((EntityState)this).GetModelTransform(); } private void SpawnAfterImage() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_002b: 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: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < behaviour.renderers.Length; i++) { Mesh val = new Mesh(); behaviour.renderers[i].BakeMesh(val); GameObject val2 = Object.Instantiate<GameObject>(Prefabs.afterImageEffect, ((EntityState)this).transform.position, Quaternion.Euler(90f, modelTransform.rotation.y, 0f)); val2.GetComponent<MeshFilter>().mesh = val; } } public override void FixedUpdate() { //IL_00e7: 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_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); bool flag = ((EntityState)this).fixedAge < dashDuration; if (flag) { stopwatch += Time.fixedDeltaTime; if (stopwatch >= 0.1f) { stopwatch = 0f; SpawnAfterImage(); } } if (!refunded && behaviour.refunded) { refunded = true; ((EntityState)this).skillLocator.utility.rechargeStopwatch = 4f; AkSoundEngine.PostEvent("Play_sfx_Gwen_GwenE_refund", ((EntityState)this).gameObject); } if (((EntityState)this).isAuthority) { if (flag) { float num = curve.Evaluate(((EntityState)this).fixedAge / dashDuration) * behaviour.dashSpeed; CharacterMotor characterMotor = ((EntityState)this).characterMotor; characterMotor.rootMotion += direction * (num * Mathf.Clamp(((BaseState)this).moveSpeedStat, 7f, 99f)); } if (((EntityState)this).fixedAge >= duration) { ((EntityState)this).outer.SetNextStateToMain(); } } } public override void OnExit() { ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)1; } } internal static class Extensions { public static 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 { internal static void SetupDisplay(GameObject gameObject) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown ((Behaviour)gameObject.GetComponentInChildren<CharacterModel>()).enabled = false; SkinnedMeshRenderer[] componentsInChildren = gameObject.GetComponentsInChildren<SkinnedMeshRenderer>(true); foreach (SkinnedMeshRenderer val in componentsInChildren) { ((Renderer)val).material = new Material(((Renderer)val).material); ((Renderer)val).material.DisableKeyword("DITHER"); } } 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 = default(GameObjectActivation); val2.gameObject = ((Component)val).gameObject; val2.shouldActivate = ((Object)val).name.Contains(objectToEnable); GameObjectActivation item = val2; list.Add(item); } result.GameObjectActivations = list.ToArray(); result.Icon = Assets.MainAssetBundle.LoadAsset<Sprite>(objectToEnable); result.MeshReplacements = (MeshReplacement[])(object)new MeshReplacement[0]; result.Name = skinName; result.NameToken = skinName; result.RendererInfos = rendererInfos; result.RootObject = rootObject; result.UnlockableDef = unlockableDef; return result; } internal static T CopyComponent<T>(T original, GameObject destination) where T : Component { Type type = ((object)original).GetType(); Component val = destination.AddComponent(type); FieldInfo[] fields = type.GetFields(); FieldInfo[] array = fields; foreach (FieldInfo fieldInfo in array) { fieldInfo.SetValue(val, fieldInfo.GetValue(original)); } return (T)(object)((val is T) ? val : null); } public static Sprite CreateSpriteFromTexture(Texture2D texture) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)texture)) { return Sprite.Create(texture, new Rect(0f, 0f, (float)((Texture)texture).width, (floa