Decompiled source of Green Enforcer v1.1.0
GreenEnforcer.dll
Decompiled a week ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using EnforcerPlugin; using EntityStates; using GreenEnforcer.Buffs; using GreenEnforcer.Icons; using GreenEnforcer.Skills; using GreenEnforcer.States; using GreenEnforcer.Utils; using GreenEnforcer.Utils.Assets; using GreenEnforcer.Utils.Components; using HG; using HG.Reflection; using IL.RoR2.UI; using KinematicCharacterController; using Microsoft.CodeAnalysis; using Modules.Characters; using Mono.Cecil; using Mono.Cecil.Cil; using MonoMod.Cil; using On.RoR2; using R2API; using R2API.Networking; using R2API.Networking.Interfaces; using Rebindables; using Rewired; using RoR2; using RoR2.Audio; using RoR2.EntitlementManagement; using RoR2.ExpansionManagement; using RoR2.Navigation; using RoR2.Orbs; using RoR2.Projectile; using RoR2.Skills; using RoR2.UI; using Survariants; using Survariants.Utils; using TMPro; using UnityEngine; using UnityEngine.AI; using UnityEngine.AddressableAssets; using UnityEngine.Audio; using UnityEngine.Networking; using UnityEngine.Rendering; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: IgnoresAccessChecksTo("")] [assembly: AssemblyCompany("GreenEnforcer")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("GreenEnforcer")] [assembly: AssemblyTitle("GreenEnforcer")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: UnverifiableCode] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace GreenEnforcer { [BepInPlugin("pseudopulse.GreenEnforcer", "GreenEnforcer", "1.1.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { public const string PluginGUID = "pseudopulse.GreenEnforcer"; public const string PluginAuthor = "pseudopulse"; public const string PluginName = "GreenEnforcer"; public const string PluginVersion = "1.1.0"; public static ManualLogSource ModLogger; public static bool disableSounds; public static bool chargeGrabsBosses; public static AssetBundle EnforcerAssets; public static Plugin instance; public void Start() { //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Expected O, but got Unknown ModLogger = ((BaseUnityPlugin)this).Logger; instance = this; EnforcerAssets = AssetBundle.GetAllLoadedAssetBundles().FirstOrDefault((Func<AssetBundle, bool>)((AssetBundle x) => ((Object)x).name == "enforcer")); ScanTypes(delegate(SkillBase x) { x.Init(); }); ScanTypes(delegate(BuffBase x) { x.Init(); }); ScanTypes(delegate(SurvivorBase x) { ((MonoBehaviour)this).StartCoroutine(x.Init()); }); ScanTypesNoInstance<EntityState>(delegate(Type x) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) bool flag = default(bool); ContentAddition.AddEntityState(x, ref flag); }); NetworkingAPI.RegisterMessageType<InfernalHealSync>(); NetworkingAPI.RegisterMessageType<ShoulderChargeSync>(); NetworkingAPI.RegisterMessageType<ShoulderChargeSlamSync>(); NetworkingAPI.RegisterMessageType<ShoulderChargePositionSync>(); RoR2Content.Init += new hook_Init(OnWwiseInit); disableSounds = !((BaseUnityPlugin)this).Config.Bind<bool>("Green Enforcer", "Voicelines", true, "Plays Abrams voicelines when using Siphon Life and Shoulder Charge, aswell as an edited line when using Seismic Impact.").Value; chargeGrabsBosses = ((BaseUnityPlugin)this).Config.Bind<bool>("Green Enforcer", "Charge Grabs Bosses", false, "Makes Shoulder Charge grab bosses instead of treating them as walls.").Value; } private void OnWwiseInit(orig_Init orig) { //IL_002d: 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_0047: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(); string text = typeof(Plugin).Assembly.Location.Replace("GreenEnforcer.dll", ""); AkSoundEngine.AddBasePath(text); uint num = default(uint); AkSoundEngine.LoadBank("initabrams", ref num); AkSoundEngine.LoadBank("abramsbank", ref num); } public static void PlaySound(string sound, GameObject target) { if (!disableSounds) { AkSoundEngine.PostEvent(sound, target); } } internal static void ScanTypes<T>(Action<T> action) { IEnumerable<Type> enumerable = from x in Assembly.GetExecutingAssembly().GetTypes() where !x.IsAbstract && x.IsSubclassOf(typeof(T)) select x; foreach (Type item in enumerable) { T obj = (T)Activator.CreateInstance(item); action(obj); } } internal static void ScanTypesNoInstance<T>(Action<Type> action) { IEnumerable<Type> enumerable = from x in Assembly.GetExecutingAssembly().GetTypes() where !x.IsAbstract && x.IsSubclassOf(typeof(T)) select x; foreach (Type item in enumerable) { action(item); } } } public class InfernalResilience : MonoBehaviour, IOnIncomingDamageServerReceiver { public class InfernalDamageInfo { public float healPerTick; public int ticksRemaining; } public HealthComponent hc; public float stopwatch; public int ticksPerSecond = 3; public float delay; public float healTime = 7f; public float regenerationPerct = 0.2f; public float mult; public int totalTicks; public List<InfernalDamageInfo> healQueue = new List<InfernalDamageInfo>(); public InputBankTest input; public float meleeCooldown = 1.2f; public float lightMeleeCooldown = 0.5f; public float meleeCDStopwatch = 0f; public EntityStateMachine esm; public bool canMelee = true; public float holdStopwatch = 0f; public float holdTime = 0.1f; public static ModKeybind Melee => GreenEnforcer.Melee; public void Start() { hc = ((Component)this).GetComponent<HealthComponent>(); delay = 1f / (float)ticksPerSecond; totalTicks = (int)healTime * ticksPerSecond; mult = 1f / (float)totalTicks; meleeCDStopwatch = meleeCooldown; input = ((Component)this).GetComponent<InputBankTest>(); esm = EntityStateMachine.FindByCustomName(((Component)this).gameObject, "Weapon"); } public void OnIncomingDamageServer(DamageInfo damageInfo) { if (!damageInfo.rejected) { float damage = damageInfo.damage; float num = damage * regenerationPerct; healQueue.Add(new InfernalDamageInfo { healPerTick = num * mult, ticksRemaining = totalTicks }); NetMessageExtensions.Send((INetMessage)(object)new InfernalHealSync(((Component)this).gameObject, num * mult, totalTicks), (NetworkDestination)1); } } public void Update() { //IL_002c: 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_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) if (!canMelee) { return; } if (meleeCDStopwatch >= lightMeleeCooldown && !InputBankExtensions.GetButtonState(input, Melee).down && InputBankExtensions.GetButtonState(input, Melee).wasDown && esm.CanInterruptState((InterruptPriority)1)) { esm.SetInterruptState((EntityState)(object)new LightMelee(), (InterruptPriority)1); meleeCDStopwatch = 0f; } if (meleeCDStopwatch >= meleeCooldown && InputBankExtensions.GetButtonState(input, Melee).down && InputBankExtensions.GetButtonState(input, Melee).wasDown) { holdStopwatch += Time.deltaTime; if (esm.CanInterruptState((InterruptPriority)1) && holdStopwatch >= holdTime) { esm.SetInterruptState((EntityState)(object)new HeavyMelee(), (InterruptPriority)1); meleeCDStopwatch = 0f; holdStopwatch = 0f; } } else { holdStopwatch = 0f; } } public 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) stopwatch += Time.fixedDeltaTime; if (canMelee) { meleeCDStopwatch += Time.fixedDeltaTime; } if (!(stopwatch >= delay)) { return; } stopwatch = 0f; float num = 0f; foreach (InfernalDamageInfo item in healQueue) { num += item.healPerTick; item.ticksRemaining--; } healQueue.RemoveAll((InfernalDamageInfo x) => x.ticksRemaining <= 0); if (NetworkServer.active) { hc.Heal(num, default(ProcChainMask), true); } } public float GetPendingHeal() { float num = 0f; foreach (InfernalDamageInfo item in healQueue) { num += item.healPerTick * (float)item.ticksRemaining; } return num; } } public class InfernalHealSync : INetMessage, ISerializableObject { public GameObject owner; public float perTick; public int ticks; public InfernalHealSync() { } public InfernalHealSync(GameObject owner, float perTick, int ticks) { this.owner = owner; this.ticks = ticks; this.perTick = perTick; } public void Deserialize(NetworkReader reader) { owner = reader.ReadGameObject(); perTick = reader.ReadSingle(); ticks = reader.ReadInt32(); } public void OnReceived() { owner.GetComponent<InfernalResilience>().healQueue.Add(new InfernalResilience.InfernalDamageInfo { healPerTick = perTick, ticksRemaining = ticks }); } public void Serialize(NetworkWriter writer) { writer.Write(owner); writer.Write(perTick); writer.Write(ticks); } } public class GreenEnforcer : SurvivorBase<GreenEnforcer> { public static LazyIndex Index = new LazyIndex("GreenEnforcerBody"); public static GameObject ShoulderChargeEffect; public static GameObject SiphonLifeEffect; public static GameObject SeismicIndicator; public static GameObject SeismicCharge; public static GameObject SeismicImpactEffect; private static Mesh SiphonIndicatorMesh; public static MPInput input; public static ModKeybind Melee = RebindAPI.RegisterModKeybind(new ModKeybind("ABRAMS_MELEE_INPUT", (KeyCode)102, 10, (string)null, (InputActionType)1, (AxisRange)0)); public static ModdedDamageType Lifestrike = DamageAPI.ReserveDamageType(); public override string Name => "Green Enforcer"; public override string Description => "Green Enforcer is here to see what his dick can do.\n\n< ! > Case Closed can quickly dispatch aerial threats. Utilize your light and heavy melees to pummel crowds when Case Closed is reloading.\n\n< ! > Siphon Life deals considerable area of effect damage while greatly improving your survivability in conjunction with Infernal Resilience.\n\n< ! > Shoulder Charge groups up targets as you run. Utilize walls or large enemies to slam and stun the enemies you drag.\n\n< ! > Seismic Impact deals immense burst damage and stuns crowds, but may also serve as an escape tool to leap away."; public override string Subtitle => "The Juggernaut"; public override string Outro => "i need my book"; public override string Failure => "i need my book"; public override IEnumerator LoadAssets() { Body = PrefabAPI.InstantiateClone(CharacterBase.instance.bodyPrefab, "GreenEnforcerBody"); Master = PrefabAPI.InstantiateClone(GameObject.TreebotMonsterMaster, "GreenEnforcerMaster"); CharacterBody body = Body.GetComponent<CharacterBody>(); body.baseNameToken = "ABRAMS_NAME"; body._defaultCrosshairPrefab = GameObject.StandardCrosshair; body.bodyColor = Color32.op_Implicit(new Color32((byte)0, byte.MaxValue, (byte)87, byte.MaxValue)); body.portraitIcon = (Texture)(object)global::GreenEnforcer.Icons.Body.GetSprite().texture; ((Component)(object)body).AddComponent<InfernalResilience>(); ((Component)(object)body).RemoveComponent<EnforcerComponent>(); ((Component)(object)body).RemoveComponent<EnforcerNetworkComponent>(); ((Component)(object)body).RemoveComponent<EnforcerWeaponComponent>(); EntityStateMachine.FindByCustomName(Body, "Body").mainStateType = new SerializableEntityStateType(typeof(GenericCharacterMain)); ModifyModel(); yield return (object)new WaitForEndOfFrame(); yield return (object)new WaitForEndOfFrame(); MakeEffects(); GameObject enforcerDisplay = Plugin.EnforcerAssets.LoadAsset<GameObject>("EnforcerDisplay.prefab"); GameObject display = PrefabAPI.InstantiateClone(((Component)Body.GetComponent<ModelLocator>()._modelTransform).gameObject, "GreenEnforcerDisplay"); display.GetComponentInChildren<Animator>().runtimeAnimatorController = enforcerDisplay.GetComponentInChildren<Animator>().runtimeAnimatorController; CharacterMaster master = Master.GetComponent<CharacterMaster>(); master.bodyPrefab = Body; SkillLocator locator = Body.GetComponent<SkillLocator>(); locator.passiveSkill.skillNameToken = "ABRAMS_PASSIVE_NAME"; locator.passiveSkill.skillDescriptionToken = "ABRAMS_PASSIVE_DESC"; locator.passiveSkill.enabled = true; locator.passiveSkill.icon = Passive.GetSprite(); "ABRAMS_PASSIVE_NAME".Add("Infernal Resilience"); "ABRAMS_PASSIVE_DESC".Add("<style=cIsHealing>20%</style> of <style=cIsUtility>damage taken</style> is <style=cIsHealing>regenerated</style> over <style=cIsDamage>7 seconds</style>. Press or hold <style=cIsUtility>%INPUT%</style> to perform a <style=cIsDamage>light</style> or <style=cIsDamage>heavy</style> melee, dealing <style=cIsDamage>250%<style> and <style=cIsDamage>650% damage</style> respectively, which <style=cIsHealing>heal</style> for <style=cIsHealing>10%</style> of damage dealt."); ReplaceSkills(locator.primary, SkillBase<global::GreenEnforcer.Skills.CaseClosed>.instance.skillDef); ReplaceSkills(locator.secondary, SkillBase<global::GreenEnforcer.Skills.SiphonLife>.instance.skillDef); ReplaceSkills(locator.utility, SkillBase<global::GreenEnforcer.Skills.ShoulderCharge>.instance.skillDef); ReplaceSkills(locator.special, SkillBase<SeismicImpact>.instance.skillDef); SurvivorDef = ScriptableObject.CreateInstance<SurvivorDef>(); ((Object)SurvivorDef).name = "GreenEnforcer"; SurvivorDef.cachedName = "GreenEnforcer"; SurvivorDef.descriptionToken = "ABRAMS_DESC"; SurvivorDef.outroFlavorToken = "ABRAMS_WIN"; SurvivorDef.mainEndingEscapeFailureFlavorToken = "ABRAMS_LOSS"; SurvivorDef.bodyPrefab = Body; SurvivorDef.displayPrefab = display; SurvivorDef.hidden = true; List<SurvivorDef> enforcerPack = typeof(EnforcerModPlugin).Assembly.GetTypes().First((Type x) => x.FullName == "Modules.ContentPacks").GetField("survivorDefs", (BindingFlags)(-1)) .GetValue(null) as List<SurvivorDef>; SurvivorVariantDef svd = new SurvivorVariantDef(); svd.Color = Body.GetComponent<CharacterBody>().bodyColor; svd.DisplayName = "Green Enforcer"; svd.TargetSurvivor = enforcerPack.First((SurvivorDef x) => x.cachedName == "Enforcer"); svd.VariantSurvivor = SurvivorDef; svd.Description = "lets see what this dick can do"; SurvivorVariantCatalog.AddSurvivorVariant(svd); HealthBar.ApplyBars += new Manipulator(InfernalPreview); InputMapperHelper.InputMapperOnInputMappedEvent += new hook_InputMapperOnInputMappedEvent(OnInputMapped); "ABRAMS_MELEE_INPUT".Add("Melee (Green Enforcer)"); RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, (Action)delegate { input = GameObject.Find("MPEventSystem Player0").GetComponent<MPInput>(); Refresh(); }); GlobalEventManager.OnHitEnemy += new hook_OnHitEnemy(OnHitEnemy); yield return null; } private void OnHitEnemy(orig_OnHitEnemy orig, GlobalEventManager self, DamageInfo damageInfo, GameObject victim) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, damageInfo, victim); if (NetworkServer.active && DamageAPI.HasModdedDamageType(damageInfo, Lifestrike) && (Object)(object)damageInfo.attacker != (Object)null) { HealthComponent component = damageInfo.attacker.GetComponent<HealthComponent>(); if (Object.op_Implicit((Object)(object)component)) { component.Heal(damageInfo.damage * 0.1f, default(ProcChainMask), true); } } } private void OnInputMapped(orig_InputMapperOnInputMappedEvent orig, InputMapperHelper self, InputMappedEventData inputMappedEventData) { orig.Invoke(self, inputMappedEventData); Refresh(); } public void Refresh() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) string text = "<style=cIsHealing>20%</style> of <style=cIsUtility>damage taken</style> is <style=cIsHealing>regenerated</style> over <style=cIsDamage>7 seconds</style>. Press or hold <style=cIsUtility>%INPUT%</style> to perform a <style=cIsDamage>light</style> or <style=cIsDamage>heavy</style> melee, dealing <style=cIsDamage>380%</style> or <style=cIsDamage>900% damage</style> respectively."; string text2 = text.Replace("%INPUT%", Glyphs.GetGlyphString(input.eventSystem, RebindAPI.KeybindActions[Melee].name, Melee.AxisRange)); LanguageAPI.AddOverlay("ABRAMS_PASSIVE_DESC", text2); } public void ModifyModel() { //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) ModelLocator component = Body.GetComponent<ModelLocator>(); GameObject gameObject = ((Component)component.modelTransform).gameObject; CharacterModel component2 = gameObject.GetComponent<CharacterModel>(); ChildLocator component3 = gameObject.GetComponent<ChildLocator>(); gameObject.RemoveComponent<ModelSkinController>(); gameObject.RemoveComponent<EnforcerItemDisplayEditorComponent>(); gameObject.RemoveComponent<MemeRigController>(); Material val = DuplicateMaterial(component2.baseRendererInfos[8].defaultMaterial); val.SetColor("_Color", Color.green); val.EnableKeyword("FRESNEL_EMISSION"); val.SetFloat("Fresnel Boost", 2.21f); Transform val2 = component3.FindChild("HammerMuzzle"); val2.localPosition = new Vector3(0f, 1f, 1f); val2.localRotation = Quaternion.Euler(90f, 305f, 0f); val2.localScale = new Vector3(1.6f, 1.6f, 1.6f); Apply(component2, 7, val); Apply(component2, 8, val); GameObject gameObject2 = ((Component)component2.baseRendererInfos[0].renderer).gameObject; gameObject2.RemoveComponent<SkinnedMeshRenderer>(); ((Component)gameObject2.transform.GetChild(0)).gameObject.SetActive(false); gameObject2.transform.GetChild(0).parent = gameObject2.transform.parent; gameObject2.transform.parent = component3.FindChild("HandL"); gameObject2.transform.localPosition = new Vector3(0f, 0.3f, 0f); gameObject2.transform.localRotation = Quaternion.Euler(new Vector3(0f, 270f, 270f)); gameObject2.transform.localScale = new Vector3(0.2f, 0.2f, 0.2f); gameObject2.AddComponent<MeshFilter>((Action<MeshFilter>)delegate(MeshFilter x) { x.mesh = GameObject.DisplayTome.GetComponentInChildren<MeshFilter>().mesh; }); gameObject2.AddComponent<MeshRenderer>((Action<MeshRenderer>)delegate(MeshRenderer x) { ((Renderer)x).material = Material.matTome; }); component2.baseRendererInfos[0].defaultMaterial = Material.matTome; component2.baseRendererInfos[0].renderer = (Renderer)(object)gameObject2.GetComponent<MeshRenderer>(); } public void MakeEffects() { //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0137: 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_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Expected O, but got Unknown //IL_0203: 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_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_029d: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_02df: Unknown result type (might be due to invalid IL or missing references) //IL_02f0: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_03ad: Unknown result type (might be due to invalid IL or missing references) GameObject bisonBody = GameObject.BisonBody; ShoulderChargeEffect = PrefabAPI.InstantiateClone(((Component)((Component)bisonBody.GetComponent<ModelLocator>()._modelTransform).GetComponent<ChildLocator>().FindChild("SprintEffect")).gameObject, "ShoulderChargeEffect"); ShoulderChargeEffect.gameObject.SetActive(true); ((Renderer)ShoulderChargeEffect.FindComponent<ParticleSystemRenderer>("SmokeRings")).material = Material.matHealTrail; ((Component)ShoulderChargeEffect.FindComponent<ParticleSystemRenderer>("SmokeRings")).transform.localScale = new Vector3(0.17f, 0.17f, 0.17f); Material mat = null; SiphonLifeEffect = PrefabAPI.InstantiateClone(GameObject.UnseenHandAreaIndicator, "SiphonLifeEffect"); SiphonLifeEffect.transform.localScale = Vector3.one; Object.Destroy((Object)(object)SiphonLifeEffect.FindComponent<CapsuleCollider>("Indicator")); Object.Destroy((Object)(object)((Component)SiphonLifeEffect.FindComponent<ParticleSystemRenderer>("GlowGradient")).gameObject); ((Component)(object)SiphonLifeEffect.transform.Find("Mesh")).EditComponent<MeshRenderer>((Action<MeshRenderer>)delegate(MeshRenderer x) { //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_011f: 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_0150: Unknown result type (might be due to invalid IL or missing references) mat = DuplicateMaterial(((Renderer)x).sharedMaterial); mat.SetColor("_TintColor", Color32.op_Implicit(new Color32((byte)0, byte.MaxValue, (byte)87, byte.MaxValue))); mat.SetTexture("_RemapTex", (Texture)(object)Texture2D.texRampHealingVariant); mat.SetFloat("_SoftPower", 2.12f); mat.SetFloat("_InvFade", 0.5f); mat.SetFloat("_Boost", 1.71f); mat.SetFloat("_RimPower", 20f); mat.SetFloat("_RimStrength", 0f); mat.SetFloat("_AlphaBoost", 0.4f); mat.SetFloat("_IntersectionStrength", 4.23f); ((Renderer)x).sharedMaterial = mat; ((Renderer)x).material = mat; ((Component)x).transform.localPosition = new Vector3(0f, -50f, 0f); ((Component)x).transform.localScale = Vector3.one; ((Component)x).transform.localRotation = Quaternion.Euler(0f, 0f, 90f); }); Vector3 val = Vector3.forward; Vector3 normalized = ((Vector3)(ref val)).normalized; Vector3 right = Vector3.right; val = Vector3.Cross(normalized, right); Vector3 normalized2 = ((Vector3)(ref val)).normalized; float num = global::GreenEnforcer.States.SiphonLife.angle * 0.5f * (MathF.PI / 180f); Vector3 val2 = Vector3.zero + global::GreenEnforcer.States.SiphonLife.distance * (Mathf.Cos(num) * normalized + Mathf.Sin(num) * normalized2); Vector3 val3 = Vector3.zero + global::GreenEnforcer.States.SiphonLife.distance * (Mathf.Cos(num) * normalized - Mathf.Sin(num) * normalized2); Vector3 val4 = default(Vector3); ((Vector3)(ref val4))..ctor(100f, 0f, 0f); SiphonIndicatorMesh = new Mesh(); ((Object)SiphonIndicatorMesh).name = "SiphonIndicatorMesh"; SiphonIndicatorMesh.vertices = (Vector3[])(object)new Vector3[6] { Vector3.zero, val2, val3, val4, val2 + val4, val3 + val4 }; SiphonIndicatorMesh.triangles = new int[24] { 0, 1, 2, 0, 5, 2, 0, 5, 3, 3, 4, 5, 0, 4, 3, 0, 1, 4, 1, 4, 5, 1, 2, 5 }; SiphonIndicatorMesh.uv = (Vector2[])(object)new Vector2[6] { new Vector2(0.5f, 0f), new Vector2(0f, 0f), new Vector2(1f, 0f), new Vector2(0.5f, 1f), new Vector2(0f, 1f), new Vector2(1f, 1f) }; SiphonIndicatorMesh.RecalculateNormals(); Object.DontDestroyOnLoad((Object)(object)SiphonIndicatorMesh); ((Component)SiphonLifeEffect.transform.Find("Mesh")).GetComponent<MeshFilter>().mesh = SiphonIndicatorMesh; SeismicIndicator = PrefabAPI.InstantiateClone(GameObject.UnseenHandAreaIndicator, "SeismicIndicator"); Object.Destroy((Object)(object)SeismicIndicator.FindComponent<CapsuleCollider>("Indicator")); Object.Destroy((Object)(object)((Component)SeismicIndicator.FindComponent<ParticleSystemRenderer>("GlowGradient")).gameObject); ((Component)(object)SeismicIndicator.transform.Find("Mesh")).EditComponent<MeshRenderer>((Action<MeshRenderer>)delegate(MeshRenderer x) { //IL_0021: 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) ((Renderer)x).sharedMaterial = mat; ((Renderer)x).material = mat; ((Component)x).transform.localScale = Vector3.one; ((Component)x).transform.localPosition = Vector3.zero; }); SeismicIndicator.transform.localScale = Vector3.one; SeismicCharge = PrefabAPI.InstantiateClone(GameObject.ChargeGreaterWisp, "SeismicChargeEffect"); Body.AddComponent<TrailRenderer>((Action<TrailRenderer>)delegate(TrailRenderer x) { ((Renderer)x).enabled = false; ((Renderer)x).material = Material.matHealBeam; x.startWidth = 1f; x.endWidth = 0.2f; x.time = 0.6f; }); SeismicImpactEffect = PrefabAPI.InstantiateClone(GameObject.FalseSonGroundSlam, "SeismicImpactEffect"); ContentAddition.AddEffect(SeismicImpactEffect); } public Material DuplicateMaterial(Material mat) { Material val = Object.Instantiate<Material>(mat); Object.DontDestroyOnLoad((Object)(object)val); return val; } public void Apply(CharacterModel m, int i, Material mat) { m.baseRendererInfos[i].defaultMaterial = mat; m.baseRendererInfos[i].renderer.material = mat; m.baseRendererInfos[i].renderer.sharedMaterial = mat; } private void InfernalPreview(ILContext il) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Expected O, but got Unknown //IL_00a8: 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_0117: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); MethodReference handleBar = null; VariableDefinition val2 = null; int allocIndex = -1; val.TryGotoNext(new Func<Instruction, bool>[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, ref handleBar) && handleBar != null && ((MemberReference)handleBar).Name != null && ((MemberReference)handleBar).Name.StartsWith("<ApplyBars>g__HandleBar|") }); val.TryGotoPrev(new Func<Instruction, bool>[1] { (Instruction x) => ILPatternMatchingExt.MatchLdloca(x, ref allocIndex) }); val2 = il.Method.Body.Variables[allocIndex]; VariableDefinition val3 = new VariableDefinition(il.Import(typeof(BarInfo))); il.Method.Body.Variables.Add(val3); val.Index = 0; val.Emit(OpCodes.Ldarg_0); val.EmitDelegate<Func<HealthBar, BarInfo>>((Func<HealthBar, BarInfo>)delegate(HealthBar bar) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) InfernalResilience infernalResilience = (Object.op_Implicit((Object)(object)bar.source) ? ((Component)bar.source).GetComponent<InfernalResilience>() : null); float num = (Object.op_Implicit((Object)(object)infernalResilience) ? infernalResilience.GetPendingHeal() : 0f); BarInfo val4 = default(BarInfo); val4.enabled = Object.op_Implicit((Object)(object)infernalResilience) && num > 0f; val4.color = Color32.op_Implicit(new Color32((byte)203, byte.MaxValue, (byte)172, byte.MaxValue)); val4.sprite = bar.style.trailingOverHealthBarStyle.sprite; val4.imageType = bar.style.trailingOverHealthBarStyle.imageType; val4.sizeDelta = bar.style.trailingOverHealthBarStyle.sizeDelta; val4.normalizedXMax = 0f; val4.normalizedXMin = 0f; BarInfo val5 = val4; if (val5.enabled) { float num2 = (1f - (1f - 1f / bar.source.body.cursePenalty)) / bar.source.fullCombinedHealth; float num3 = bar.source.health * num2; float num4 = num * num2; num4 = Mathf.Clamp01(num3 + num4); val5.normalizedXMin = num3; val5.normalizedXMax = num4; if (num4 >= 1f) { val5.enabled = false; } } return val5; }); val.Emit(OpCodes.Stloc, val3); val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<BarInfoCollection>(x, "GetActiveCount") }); val.Emit(OpCodes.Ldloca, val3); val.EmitDelegate<<>F{0000000c}<int, BarInfo, int>>((<>F{0000000c}<int, BarInfo, int>)delegate(int count, in BarInfo info) { if (info.enabled) { count++; } return count; }); val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[1] { (Instruction x) => ILPatternMatchingExt.MatchRet(x) }); val.Emit(OpCodes.Ldarg_0); val.Emit(OpCodes.Ldloca, val3); val.Emit(OpCodes.Ldloca, val2); val.Emit(OpCodes.Call, handleBar); } } public abstract class SkillBase<T> : SkillBase where T : SkillBase<T> { public static T instance; public static implicit operator SkillDef(SkillBase<T> skill) { return skill.skillDef; } public SkillBase() { instance = this as T; } } public abstract class SkillBase { public SkillDef skillDef; public abstract string Name { get; } public abstract string Description { get; } public virtual string LangToken => GetType().Name.ToUpper(); public string NameToken => "GreenEnforcer_SKILL_" + LangToken + "_NAME"; public string DescToken => "GreenEnforcer_SKILL_" + LangToken + "_DESC"; public abstract Type ActivationStateType { get; } public abstract string ActivationMachineName { get; } public abstract float Cooldown { get; } public virtual bool BeginCooldownOnSkillEnd { get; } = false; public virtual bool MustKeyPress { get; } = false; public virtual int MaxStock { get; } = 1; public virtual int StockToConsume { get; } = 1; public virtual int RechargeStock { get; } = 1; public virtual bool Agile { get; } = false; public virtual bool CanceledFromSprinting => false; public virtual string[] Keywords { get; } = null; public virtual bool IsCombat => true; public virtual InterruptPriority InterruptPriority => (InterruptPriority)1; public virtual bool ResetCooldownTimerOnUse => false; public virtual bool FullRestockOnAssign { get; } = true; public abstract Sprite Icon { get; } public virtual bool ScalesWithAttackSpeed { get; } = false; private static bool DefaultEnabledCallback(SkillBase self) { return true; } public virtual void Init() { CreateSkillDef(); SetupSkillDef(); CreateLang(); } public virtual void CreateSkillDef() { skillDef = ScriptableObject.CreateInstance<SkillDef>(); } public virtual void SetupSkillDef() { //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) skillDef.skillName = Name; skillDef.skillNameToken = NameToken; skillDef.skillDescriptionToken = DescToken; skillDef.baseRechargeInterval = Cooldown; skillDef.canceledFromSprinting = CanceledFromSprinting; skillDef.cancelSprintingOnActivation = !Agile; skillDef.baseMaxStock = MaxStock; skillDef.stockToConsume = StockToConsume; skillDef.activationStateMachineName = ActivationMachineName; skillDef.activationState = new SerializableEntityStateType(ActivationStateType); skillDef.icon = Icon; skillDef.rechargeStock = RechargeStock; skillDef.isCombatSkill = IsCombat; skillDef.keywordTokens = Keywords; skillDef.interruptPriority = InterruptPriority; skillDef.beginSkillCooldownOnSkillEnd = BeginCooldownOnSkillEnd; skillDef.mustKeyPress = MustKeyPress; skillDef.fullRestockOnAssign = FullRestockOnAssign; skillDef.resetCooldownTimerOnUse = ResetCooldownTimerOnUse; skillDef.attackSpeedBuffsRestockSpeed = ScalesWithAttackSpeed; ContentAddition.AddSkillDef(skillDef); } public virtual void CreateLang() { NameToken.Add(Name); DescToken.Add(Description); } public string GetConfigName() { return Name; } } public abstract class SurvivorBase<T> : SurvivorBase where T : SurvivorBase<T> { public static T instance; public SurvivorBase() { instance = this as T; } } public abstract class SurvivorBase { public GameObject Body; public GameObject Master; public SurvivorDef SurvivorDef; public SkinDef mastery; public abstract string Name { get; } public abstract string Description { get; } public abstract string Subtitle { get; } public abstract string Outro { get; } public abstract string Failure { get; } public static bool DefaultEnabledCallback(SurvivorBase self) { return true; } public virtual IEnumerator Init() { yield return LoadAssets(); CreateLang(); ContentAddition.AddBody(Body); ContentAddition.AddMaster(Master); ContentAddition.AddSurvivorDef(SurvivorDef); } public virtual IEnumerator LoadAssets() { yield return null; } public virtual void CreateLang() { CharacterBody component = Body.GetComponent<CharacterBody>(); component.baseNameToken.Add(Name); component.subtitleNameToken.Add(Subtitle); SurvivorDef.displayNameToken = component.baseNameToken; SurvivorDef.outroFlavorToken.Add(Outro); SurvivorDef.mainEndingEscapeFailureFlavorToken.Add(Failure); SurvivorDef.descriptionToken.Add(Description); } public EntityStateMachine AddESM(GameObject prefab, string name, SerializableEntityStateType initial) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) EntityStateMachine val = prefab.AddComponent<EntityStateMachine>(); val.customName = name; val.initialStateType = initial; val.mainStateType = initial; return val; } public void SwapMaterials(GameObject prefab, Material mat, bool all = false, List<int> renders = null) { CharacterModel componentInChildren = prefab.GetComponentInChildren<CharacterModel>(); ((Component)(object)componentInChildren).RemoveComponent<ModelSkinController>(); if (all) { for (int i = 0; i < componentInChildren.baseRendererInfos.Length; i++) { componentInChildren.baseRendererInfos[i].defaultMaterial = mat; componentInChildren.baseRendererInfos[i].renderer.sharedMaterial = mat; } } if (renders == null) { return; } foreach (int render in renders) { componentInChildren.baseRendererInfos[render].defaultMaterial = mat; } } public void ReplaceSkills(GenericSkill slot, params SkillDef[] skills) { //IL_0033: 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_0057: Expected O, but got Unknown //IL_0058: Unknown result type (might be due to invalid IL or missing references) SkillFamily val = ScriptableObject.CreateInstance<SkillFamily>(); ((Object)val).name = slot.skillName ?? "default"; List<Variant> list = new List<Variant>(); foreach (SkillDef val2 in skills) { Variant item = new Variant { skillDef = val2 }; ((Variant)(ref item)).viewableNode = new Node(val2.skillNameToken, false, (Node)null); list.Add(item); } val.variants = list.ToArray(); slot._skillFamily = val; ContentAddition.AddSkillFamily(val); } public string GetConfigName() { return Name; } } } namespace GreenEnforcer.Utils { public class BasicLaserBeam { public float DamageCoefficient; public CharacterBody Owner; public Transform TargetMuzzle; private LineRenderer lr; public GameObject effectInstance; private bool firing = false; private float stopwatch = 0f; private float growthStopwatch = 0f; private float delay; private BasicLaserInfo info; private Transform origin; private Transform end; private Vector3 targetEndpoint; private float origWidth = 0f; public bool Active => firing; public BasicLaserBeam(CharacterBody owner, Transform muzzle, BasicLaserInfo info) { //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) this.info = info; delay = 1f / info.TickRate; TargetMuzzle = muzzle; DamageCoefficient = info.DamageCoefficient * delay; effectInstance = Object.Instantiate<GameObject>(info.EffectPrefab, ((Component)muzzle).transform.position, Quaternion.identity); growthStopwatch = info.ChargeDelay; origin = (info.OriginIsBase ? effectInstance.transform : effectInstance.GetComponent<ChildLocator>().FindChild(info.OriginName)); end = effectInstance.GetComponent<ChildLocator>().FindChild(info.EndpointName); lr = effectInstance.GetComponent<DetachLineRendererAndFade>().line; origWidth = lr.widthMultiplier; Owner = owner; targetEndpoint = GetEndpoint(out var _); ((Component)end).transform.position = targetEndpoint; ((Component)origin).transform.position = ((Component)TargetMuzzle).transform.position; } public void Fire() { if (Object.op_Implicit((Object)(object)info.FiringMaterial)) { ((Renderer)lr).material = info.FiringMaterial; } lr.widthMultiplier = origWidth * info.FiringWidthMultiplier; firing = true; stopwatch = 0f; } public void UpdateVisual(float deltaTime) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003e: 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) ((Component)origin).transform.position = ((Component)TargetMuzzle).transform.position; ((Component)end).transform.position = Vector3.MoveTowards(((Component)end).transform.position, targetEndpoint, 250f * deltaTime); } public void Update(float deltaTime) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Expected O, but got Unknown stopwatch += deltaTime; if (stopwatch >= delay) { targetEndpoint = GetEndpoint(out var unmodified); stopwatch = 0f; if (firing && ((NetworkBehaviour)Owner).hasAuthority) { GetBulletAttack().Fire(); if (Object.op_Implicit((Object)(object)info.ImpactEffect)) { EffectManager.SpawnEffect(info.ImpactEffect, new EffectData { origin = unmodified, scale = 1f }, false); } } } if (!firing) { growthStopwatch -= deltaTime; lr.widthMultiplier = Mathf.Max(0f, growthStopwatch / info.ChargeDelay); } } public Vector3 GetEndpoint(out Vector3 unmodified) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_002b: 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) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ((info.FiringMode == LaserFiringMode.TrackAim) ? Owner.inputBank.aimDirection : TargetMuzzle.forward); Vector3 val2 = ((info.FiringMode == LaserFiringMode.TrackAim) ? Owner.inputBank.aimOrigin : TargetMuzzle.position); Ray val3 = new Ray(val2, val); Vector3 point = ((Ray)(ref val3)).GetPoint(info.MaxRange); RaycastHit val4 = default(RaycastHit); if (Physics.Raycast(val2, val, ref val4, info.MaxRange, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask))) { point = ((RaycastHit)(ref val4)).point; } unmodified = point; return point + val * 5f; } public BulletAttack GetBulletAttack() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) BulletAttack val = new BulletAttack(); val.radius = lr.startWidth * 0.75f; val.damage = Owner.damage * DamageCoefficient; val.origin = ((info.FiringMode == LaserFiringMode.TrackAim) ? Owner.inputBank.aimOrigin : TargetMuzzle.position); Vector3 val2 = ((Component)end).transform.position - TargetMuzzle.position; val.aimVector = ((Vector3)(ref val2)).normalized; val.procCoefficient = 1f; val.owner = ((Component)Owner).gameObject; val.falloffModel = (FalloffModel)0; val.isCrit = Util.CheckRoll(Owner.crit, Owner.master); val.stopperMask = ((LayerIndex)(ref LayerIndex.world)).mask; return val; } public void Stop() { Object.Destroy((Object)(object)effectInstance); } } public class BasicLaserInfo { public GameObject EffectPrefab; public string OriginName = "Origin"; public string EndpointName = "End"; public bool OriginIsBase = true; public float TickRate = 20f; public float DamageCoefficient = 1f; public Material FiringMaterial; public float ChargeDelay = 0.5f; public float FiringWidthMultiplier = 2f; public LaserFiringMode FiringMode = LaserFiringMode.Straight; public float MaxRange = 60f; public GameObject ImpactEffect; } public enum LaserFiringMode { TrackAim, Straight } public abstract class CoolerBasicMeleeAttack : BasicMeleeAttack { public abstract float BaseDuration { get; } public abstract float DamageCoefficient { get; } public abstract string HitboxName { get; } public abstract GameObject HitEffectPrefab { get; } public abstract float ProcCoefficient { get; } public abstract float HitPauseDuration { get; } public abstract GameObject SwingEffectPrefab { get; } public abstract string MuzzleString { get; } public virtual string MechanimHitboxParameter { get; } = null; public virtual bool ScaleHitPauseDurationWithAttackSpeed { get; } = true; public virtual Func<bool> AlternateActiveParameter { get; } = () => true; public override void OnEnter() { base.baseDuration = BaseDuration; base.damageCoefficient = DamageCoefficient; base.hitBoxGroupName = HitboxName; base.hitEffectPrefab = HitEffectPrefab; base.procCoefficient = ProcCoefficient; base.hitPauseDuration = HitPauseDuration; base.swingEffectPrefab = SwingEffectPrefab; base.swingEffectMuzzleString = MuzzleString; if (MechanimHitboxParameter != null) { base.mecanimHitboxActiveParameter = MechanimHitboxParameter; } base.scaleHitPauseDurationAndVelocityWithAttackSpeed = ScaleHitPauseDurationWithAttackSpeed; ((BasicMeleeAttack)this).OnEnter(); } public override void FixedUpdate() { ((EntityState)this).fixedAge = ((EntityState)this).fixedAge + Time.fixedDeltaTime; if (string.IsNullOrEmpty(MechanimHitboxParameter) && AlternateActiveParameter()) { ((BasicMeleeAttack)this).BeginMeleeAttackEffect(); } else if (base.animator.GetFloat(MechanimHitboxParameter) >= 0.5f) { ((BasicMeleeAttack)this).BeginMeleeAttackEffect(); } if (((EntityState)this).isAuthority) { ((BasicMeleeAttack)this).AuthorityFixedUpdate(); } } public override void AuthorityFixedUpdate() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: 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_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) if (((BasicMeleeAttack)this).authorityInHitPause) { base.hitPauseTimer -= ((EntityState)this).GetDeltaTime(); if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.velocity = Vector3.zero; } ((EntityState)this).fixedAge = ((EntityState)this).fixedAge - ((EntityState)this).GetDeltaTime(); if (!((BasicMeleeAttack)this).authorityInHitPause) { ((BasicMeleeAttack)this).AuthorityExitHitPause(); } } else if (base.forceForwardVelocity && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection)) { Vector3 val = ((EntityState)this).characterDirection.forward * base.forwardVelocityCurve.Evaluate(((EntityState)this).fixedAge / base.duration); _ = ((EntityState)this).characterMotor.velocity; ((EntityState)this).characterMotor.AddDisplacement(new Vector3(val.x, 0f, val.z)); } base.authorityHitThisFixedUpdate = false; if (base.overlapAttack != null) { if (string.IsNullOrEmpty(MechanimHitboxParameter) && AlternateActiveParameter()) { ((BasicMeleeAttack)this).AuthorityFireAttack(); } else if ((!string.IsNullOrEmpty(MechanimHitboxParameter) && base.animator.GetFloat(base.mecanimHitboxActiveParameter) > 0.5f) || base.forceFire) { ((BasicMeleeAttack)this).AuthorityFireAttack(); } } if (base.duration <= ((EntityState)this).fixedAge) { ((BasicMeleeAttack)this).AuthorityOnFinish(); } } } [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] internal sealed class AutoRunAttribute : Attribute { } internal sealed class AutoRunCollector { public static void HandleAutoRun() { Type[] types = Assembly.GetExecutingAssembly().GetTypes(); List<Type> list = types.ToList(); list.RemoveAll(asdf); types = list.ToArray(); Type[] array = types; foreach (Type type in array) { if (!type.FullName.Contains("CustomEmotesAPI")) { continue; } TypeInfo typeInfo = type.GetTypeInfo(); MethodInfo[] methods = typeInfo.GetMethods((BindingFlags)(-1)); foreach (MethodInfo methodInfo in methods) { AutoRunAttribute customAttribute = methodInfo.GetCustomAttribute<AutoRunAttribute>(); if (customAttribute != null && methodInfo.IsStatic) { methodInfo.Invoke(null, null); } } } } private static bool asdf(Type s) { return s.FullName.Contains("CustomEmotesAPI"); } } public class CallNetworkedMethod : INetMessage, ISerializableObject { private GameObject obj; private string method; private uint id; public CallNetworkedMethod(GameObject obj, string method) { //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) this.obj = obj; this.method = method; NetworkInstanceId netId = obj.GetComponent<NetworkIdentity>().netId; id = ((NetworkInstanceId)(ref netId)).Value; } public void Serialize(NetworkWriter writer) { writer.Write(id); writer.Write(method); } public void Deserialize(NetworkReader reader) { id = reader.ReadUInt32(); method = reader.ReadString(); } public void OnReceived() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) obj = Util.FindNetworkObject(new NetworkInstanceId(id)); obj.SendMessage(method, (SendMessageOptions)1); } public CallNetworkedMethod() { } } public class LockLocalTransform : MonoBehaviour { public Vector3 Position; public Vector3 Rotation; public Vector3 Scale; public void LateUpdate() { //IL_0008: 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_001f: 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) ((Component)this).transform.localPosition = Position; ((Component)this).transform.localRotation = Quaternion.Euler(Rotation); ((Component)this).transform.localScale = Scale; } } public static class DamageColourHelper { [CompilerGenerated] private static class <>O { public static hook_FindColor <0>__DamageColor_FindColor; } public static List<DamageColorIndex> registeredColorIndicies = new List<DamageColorIndex>(); internal static void Init() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown object obj = <>O.<0>__DamageColor_FindColor; if (obj == null) { hook_FindColor val = DamageColor_FindColor; <>O.<0>__DamageColor_FindColor = val; obj = (object)val; } DamageColor.FindColor += (hook_FindColor)obj; } private static Color DamageColor_FindColor(orig_FindColor orig, DamageColorIndex colorIndex) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: 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_0028: Unknown result type (might be due to invalid IL or missing references) if (registeredColorIndicies.Contains(colorIndex)) { return DamageColor.colors[colorIndex]; } return orig.Invoke(colorIndex); } public static DamageColorIndex RegisterDamageColor(Color color) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_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_0029: Unknown result type (might be due to invalid IL or missing references) int num = DamageColor.colors.Length; DamageColorIndex val = (DamageColorIndex)(byte)num; ArrayUtils.ArrayAppend<Color>(ref DamageColor.colors, ref color); registeredColorIndicies.Add(val); return val; } } public static class CharacterExtensions { public static bool HasSkillEquipped(this CharacterBody body, SkillDef skill) { GenericSkill[] components = ((Component)body).GetComponents<GenericSkill>(); foreach (GenericSkill val in components) { if ((Object)(object)val.skillDef == (Object)(object)skill) { return true; } } return false; } public static void ClearInventory(this CharacterBody body) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)body.inventory)) { return; } List<ItemDef> list = new List<ItemDef>(); foreach (ItemIndex item in body.inventory.itemAcquisitionOrder) { ItemDef itemDef = ItemCatalog.GetItemDef(item); list.Add(itemDef); } foreach (ItemDef item2 in list) { body.inventory.RemoveItem(item2, body.inventory.GetItemCount(item2)); } } public static void ClearInventory(this CharacterBody body, bool hidden) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)body.inventory)) { return; } List<ItemDef> list = new List<ItemDef>(); foreach (ItemIndex item in body.inventory.itemAcquisitionOrder) { ItemDef itemDef = ItemCatalog.GetItemDef(item); if (hidden) { list.Add(itemDef); } else if (!itemDef.hidden) { list.Add(itemDef); } } foreach (ItemDef item2 in list) { body.inventory.RemoveItem(item2, body.inventory.GetItemCount(item2)); } } } public static class EnumeratorExtensions { public static T GetRandom<T>(this IEnumerable<T> self) { return self.ElementAt(Random.Range(0, self.Count())); } public static T GetRandom<T>(this IEnumerable<T> self, Xoroshiro128Plus rng) { return self.ElementAt(rng.RangeInt(0, self.Count())); } public static T GetRandom<T>(this IEnumerable<T> self, Func<T, bool> predicate) { try { return self.Where(predicate).ElementAt(Random.Range(0, self.Count())); } catch { return default(T); } } public static T GetRandom<T>(this IEnumerable<T> self, Xoroshiro128Plus rng, Func<T, bool> predicate) { try { return self.Where(predicate).ElementAt(rng.RangeInt(0, self.Count())); } catch { return default(T); } } } public static class StringExtensions { public static void Add(this string str, string text) { LanguageAPI.Add(str, text); } public static T Load<T>(this string str) { //IL_0003: 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) try { return Addressables.LoadAssetAsync<T>((object)str).WaitForCompletion(); } catch { return default(T); } } public static string RemoveUnsafeCharacters(this string str) { string[] array = new string[17] { "\n", "'", " ", "!", "`", "&", "-", ")", "(", "{", "}", "|", "@", "<", ">", ".", "\\" }; string text = str; string[] array2 = array; foreach (string oldValue in array2) { text = text.Replace(oldValue, ""); } return text; } public static string RemoveUnsafeCharacters(this string str, string[] unsafeChars) { string text = str; foreach (string oldValue in unsafeChars) { text = text.Replace(oldValue, ""); } return text; } public static string AutoFormat(this string str) { return Formatter.FormatString(str); } } internal class Formatter { internal struct Format { public string match; public string expanded; } private static List<Format> formats = new List<Format> { new Format { match = "$su", expanded = "<style=cIsUtility>" }, new Format { match = "$sd", expanded = "<style=cIsDamage>" }, new Format { match = "$ss", expanded = "<style=cStack>" }, new Format { match = "$sr", expanded = "<style=cDeath>" }, new Format { match = "$sh", expanded = "<style=cIsHealing>" }, new Format { match = "$se", expanded = "</style>" }, new Format { match = "$rc", expanded = "<color=#36D7A9>" }, new Format { match = "$ec", expanded = "</color>" }, new Format { match = "$pc", expanded = "<color=#406096>" }, new Format { match = "$sv", expanded = "<style=cIsVoid>" } }; internal static string FormatString(string str) { foreach (Format format in formats) { str = str.Replace(format.match, format.expanded); } return str; } } public static class UnityExtensions { public static void RemoveComponent<T>(this GameObject self) where T : Component { Object.Destroy((Object)(object)self.GetComponent<T>()); } public static void RemoveComponents<T>(this GameObject self) where T : Component { T[] components = self.GetComponents<T>(); for (int i = 0; i < components.Length; i++) { Object.Destroy((Object)(object)components[i]); } } public static void CallNetworkedMethod(this GameObject self, string method, NetworkDestination dest = 1) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) NetMessageExtensions.Send((INetMessage)(object)new CallNetworkedMethod(self, method), dest); } public static T FindComponent<T>(this GameObject self, string name) where T : Component { return self.GetComponentsInChildren<T>().FirstOrDefault((T x) => ((Object)((Component)x).gameObject).name == name); } public static void RemoveComponent<T>(this Component self) where T : Component { Object.Destroy((Object)(object)self.GetComponent<T>()); } public static void RemoveComponents<T>(this Component self) where T : Component { T[] components = self.GetComponents<T>(); for (int i = 0; i < components.Length; i++) { Object.Destroy((Object)(object)components[i]); } } public static T AddComponent<T>(this Component self) where T : Component { return self.gameObject.AddComponent<T>(); } public static T AddComponent<T>(this Component self, Action<T> modification) where T : Component { T val = self.gameObject.AddComponent<T>(); modification(val); return val; } public static T GetComponent<T>(this Component self, Action<T> modification) where T : Component { T component = self.gameObject.GetComponent<T>(); modification(component); return component; } public static T AddComponent<T>(this GameObject self, Action<T> modification) where T : Component { T val = self.AddComponent<T>(); modification(val); return val; } public static T GetComponent<T>(this GameObject self, Action<T> modification) where T : Component { T component = self.GetComponent<T>(); modification(component); return component; } public static void EditComponent<T>(this Component self, Action<T> modification) where T : Component { T component = self.GetComponent<T>(); modification(component); } public static void EditComponent<T>(this GameObject self, Action<T> modification) where T : Component { T component = self.GetComponent<T>(); modification(component); } public static Sprite MakeSprite(this Texture2D self) { //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(self, new Rect(0f, 0f, (float)((Texture)self).width, (float)((Texture)self).height), new Vector2(0.5f, 0.5f), 100f); } } [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] public class HookAttribute : SearchableAttribute { public Type type; public string eventName; public HookAttribute(Type type, string eventName) { this.type = type; this.eventName = eventName; } } public class HookAttributeHandler { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static hook_OnLoad <>9__0_0; internal IEnumerator <Hook>b__0_0(orig_OnLoad orig, RoR2Application self) { Initialize(); return orig.Invoke(self); } } [AutoRun] internal static void Hook() { //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_0020: Expected O, but got Unknown object obj = <>c.<>9__0_0; if (obj == null) { hook_OnLoad val = delegate(orig_OnLoad orig, RoR2Application self) { Initialize(); return orig.Invoke(self); }; <>c.<>9__0_0 = val; obj = (object)val; } RoR2Application.OnLoad += (hook_OnLoad)obj; } internal static void Initialize() { List<HookAttribute> list = new List<HookAttribute>(); SearchableAttribute.GetInstances<HookAttribute>(list); foreach (HookAttribute item in list) { if ((((SearchableAttribute)item).target as MethodInfo).IsStatic) { EventInfo @event = item.type.GetEvent(item.eventName); Delegate handler = Delegate.CreateDelegate(@event.EventHandlerType, null, ((SearchableAttribute)item).target as MethodInfo); @event.AddEventHandler(@event.DeclaringType, handler); } } } } public static class ItemHelpers { public static RendererInfo[] ItemDisplaySetup(GameObject obj, bool debugmode = false) { //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) List<Renderer> list = new List<Renderer>(); MeshRenderer[] componentsInChildren = obj.GetComponentsInChildren<MeshRenderer>(); if (componentsInChildren.Length != 0) { list.AddRange((IEnumerable<Renderer>)(object)componentsInChildren); } SkinnedMeshRenderer[] componentsInChildren2 = obj.GetComponentsInChildren<SkinnedMeshRenderer>(); if (componentsInChildren2.Length != 0) { list.AddRange((IEnumerable<Renderer>)(object)componentsInChildren2); } RendererInfo[] array = (RendererInfo[])(object)new RendererInfo[list.Count]; for (int i = 0; i < list.Count; i++) { if (debugmode) { MaterialControllerComponents.HGControllerFinder hGControllerFinder = ((Component)list[i]).gameObject.AddComponent<MaterialControllerComponents.HGControllerFinder>(); hGControllerFinder.Renderer = list[i]; } array[i] = new RendererInfo { defaultMaterial = ((list[i] is SkinnedMeshRenderer) ? list[i].sharedMaterial : list[i].material), renderer = list[i], defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = false }; } return array; } public static string OrderManifestLoreFormatter(string deviceName, string estimatedDelivery, string sentTo, string trackingNumber, string devicePickupDesc, string shippingMethod, string orderDetails) { string[] value = new string[19] { "<align=left>Estimated Delivery:<indent=70%>Sent To:</indent></align>", "<align=left>" + estimatedDelivery + "<indent=70%>" + sentTo + "</indent></align>", "", "<indent=1%><style=cIsDamage><size=125%><u> Shipping Details:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0</u></size></style></indent>", "", "<indent=2%>-Order: <style=cIsUtility>" + deviceName + "</style></indent>", "<indent=4%><style=cStack>Tracking Number: " + trackingNumber + "</style></indent>", "", "<indent=2%>-Order Description: " + devicePickupDesc + "</indent>", "", "<indent=2%>-Shipping Method: <style=cIsHealth>" + shippingMethod + "</style></indent>", "", "", "", "<indent=2%>-Order Details: " + orderDetails + "</indent>", "", "", "", "<style=cStack>Delivery being brought to you by the brand new </style><style=cIsUtility>Orbital Drop-Crate System (TM)</style>. <style=cStack><u>No refunds.</u></style>" }; return string.Join("\n", value); } public static void RefreshTimedBuffs(CharacterBody body, BuffDef buffDef, float duration) { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)body) || body.GetBuffCount(buffDef) <= 0) { return; } foreach (TimedBuff timedBuff in body.timedBuffs) { if (buffDef.buffIndex == timedBuff.buffIndex) { timedBuff.timer = duration; } } } public static void RefreshTimedBuffs(CharacterBody body, BuffDef buffDef, float taperStart, float taperDuration) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)body) || body.GetBuffCount(buffDef) <= 0) { return; } int num = 0; foreach (TimedBuff timedBuff in body.timedBuffs) { if (buffDef.buffIndex == timedBuff.buffIndex) { timedBuff.timer = taperStart + (float)num * taperDuration; num++; } } } public static void AddBuffAndDot(BuffDef buff, float duration, int stackCount, CharacterBody body) { //IL_0033: 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_003b: Invalid comparison between Unknown and I4 //IL_0075: 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) if (!NetworkServer.active) { return; } DotIndex val = (DotIndex)Array.FindIndex(DotController.dotDefs, (DotDef dotDef) => (Object)(object)dotDef.associatedBuff == (Object)(object)buff); for (int i = 0; i < stackCount; i++) { if ((int)val != -1) { DotController.InflictDot(((Component)body).gameObject, ((Component)body).gameObject, val, duration, 0.25f, (uint?)null); } else { body.AddTimedBuff(buff.buffIndex, duration); } } } public static DotIndex FindAssociatedDotForBuff(BuffDef buff) { //IL_0024: 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_0029: Unknown result type (might be due to invalid IL or missing references) return (DotIndex)Array.FindIndex(DotController.dotDefs, (DotDef dotDef) => (Object)(object)dotDef.associatedBuff == (Object)(object)buff); } } public static class Keywords { public static string Poison = "KEYWORD_POISON"; public static string Regenerative = "KEYWORD_RAPID_REGEN"; public static string Agile = "KEYWORD_AGILE"; public static string HealthCost = "KEYWORD_PERCENT_HP"; public static string Disperse = "KEYWORD_SONIC_BOOM"; public static string Weak = "KEYWORD_WEAK"; public static string Heavy = "KEYWORD_HEAVY"; public static string Freeze = "KEYWORD_FREEZING"; public static string Stun = "KEYWORD_STUNNING"; public static string Expose = "KEYWORD_EXPOSE"; public static string Shock = "KEYWORD_SHOCKING"; public static string Slayer = "KEYWORD_SLAYER"; public static string Hemorrhage = "KEYWORD_SUPERBLEED"; public static string Ignite = "KEYWORD_IGNITE"; public static string Weakpoint = "KEYWORD_WEAKPOINT"; public static string ActiveReload = "KEYWORD_ACTIVERELOAD"; public static string VoidCorruption = "KEYWORD_VOIDCORRUPTION"; public static string OverdriveFormPrimary = "GreenEnforcer_KEYWORD_OVERDRIVE_PRIMARY"; public static string OverdriveFormSecondary = "GreenEnforcer_KEYWORD_OVERDRIVE_SECONDARY"; public static string OverdriveFormAltSecondary = "GreenEnforcer_KEYWORD_OVERDRIVE_SECONDARY_ALT"; public static string OverdriveFormUtility = "GreenEnforcer_KEYWORD_OVERDRIVE_UTILITY"; public static string OverdriveFormSpecial = "GreenEnforcer_KEYWORD_OVERDRIVE_SPECIAL"; public static void SetupKeywords() { OverdriveFormPrimary.Add("<style=cKeywordName>Overdriven Form</style><style=cIsUtility>Agile</style>. Fire a rapid stream of bullets for <style=cIsDamage>90% damage</style>. <style=cDeath>Heat increases spread and ignite chance</style>."); OverdriveFormSecondary.Add("<style=cKeywordName>Overdriven Form</style><style=cIsDamage>Ignite</style>. Fire a short-range heat burst for <style=cIsDamage>8x180% damage</style>. Increase <style=cDeath>heat</style> by <style=cDeath>15%</style>."); OverdriveFormAltSecondary.Add("<style=cKeywordName>Overdriven Form</style><style=cIsDamage>Ignite</style>. Fire off a <style=cIsDamage>blazing ball</style> for <style=cIsDamage>600%</style> damage that <style=cIsDamage>engulfs</style> the ground on impact for <style=cIsDamage>250%</style> damage per second. Reduce $srheat$se by $su20%$se."); OverdriveFormUtility.Add("<style=cKeywordName>Overdriven Form</style><style=cIsUtility>Agile</style>. <style=cIsDamage>Stunning</style>. <style=cIsUtility>Sidestep</style> a very short distance and deal <style=cIsDamage>250% damage</style>. Hitting enemies generates <color=#36D7A9>3 Charge</style>."); OverdriveFormSpecial.Add("<style=cKeywordName>Overdriven Form</style><style=cIsUtility>Agile</style>. <style=cIsDamage>Ignite</style>. Release a <style=cIsDamage>fire nova</style> around you that deals <style=cIsDamage>300%</style> damage, increasing up to <style=cIsDamage>900%</style> in full heat. <style=cIsUtility>Consume all heat</style>, gaining an <style=cIsDamage>attack speed</style> boost, and <style=cDeath>exit overdrive</style>."); } } public static class MathHelpers { public static string FloatToPercentageString(float number, float numberBase = 100f) { return (number * numberBase).ToString("##0") + "%"; } public static Vector3 ClosestPointOnSphereToPoint(Vector3 origin, float radius, Vector3 targetPosition) { //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_0003: 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_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: 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) Vector3 val = targetPosition - origin; val = Vector3.Normalize(val); val *= radius; return origin + val; } public static List<Vector3> DistributePointsEvenlyAroundSphere(int points, float radius, Vector3 origin) { //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) List<Vector3> list = new List<Vector3>(); double num = Math.PI * (3.0 - Math.Sqrt(5.0)); for (int i = 0; i < points; i++) { int num2 = 1 - i / (points - 1) * 2; double num3 = Math.Sqrt(1 - num2 * num2); double num4 = num * (double)i; float num5 = (float)(Math.Cos(num4) * num3); float num6 = (float)(Math.Sin(num4) * num3); Vector3 val = origin + new Vector3(num5, (float)num2, num6); list.Add(val * radius); } return list; } public static List<Vector3> DistributePointsEvenlyAroundCircle(int points, float radius, Vector3 origin, float angleOffset = 0f) { //IL_002c: 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_0044: 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) List<Vector3> list = new List<Vector3>(); Vector3 item = default(Vector3); for (int i = 0; i < points; i++) { double num = Math.PI * 2.0 / (double)points; double num2 = num * (double)i + (double)angleOffset; ((Vector3)(ref item))..ctor((float)((double)radius * Math.Cos(num2) + (double)origin.x), origin.y, (float)((double)radius * Math.Sin(num2) + (double)origin.z)); list.Add(item); } return list; } public static Vector3 GetPointOnUnitSphereCap(Quaternion targetDirection, float angle) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002e: 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_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) float num = Random.Range(0f, angle) * (MathF.PI / 180f); Vector2 insideUnitCircle = Random.insideUnitCircle; Vector2 val = ((Vector2)(ref insideUnitCircle)).normalized * Mathf.Sin(num); Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(val.x, val.y, Mathf.Cos(num)); return targetDirection * val2; } public static Vector3 GetPointOnUnitSphereCap(Vector3 targetDirection, float angle) { //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_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) return GetPointOnUnitSphereCap(Quaternion.LookRotation(targetDirection), angle); } public static Vector3 RandomPointOnCircle(Vector3 origin, float radius, Xoroshiro128Plus random) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: 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_0037: Unknown result type (might be due to invalid IL or missing references) float num = random.RangeFloat(0f, MathF.PI * 2f); return origin + new Vector3(Mathf.Cos(num), 0f, Mathf.Sin(num)) * radius; } public static float InverseHyperbolicScaling(float baseValue, float additionalValue, float maxValue, int itemCount) { return baseValue + (maxValue - baseValue) * (1f - 1f / (1f + additionalValue * (float)(itemCount - 1))); } public static float CustomHyperbolic(float amplificationPercentage, float max = 100f) { return (1f - max / (max + amplificationPercentage)) * max; } } public static class MiscUtils { public static Vector3? RaycastToDirection(Vector3 position, float maxDistance, Vector3 direction, int layer) { //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_0003: 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) RaycastHit val = default(RaycastHit); if (Physics.Raycast(new Ray(position, direction), ref val, maxDistance, layer, (QueryTriggerInteraction)1)) { return ((RaycastHit)(ref val)).point; } return null; } public static IEnumerable<T> Shuffle<T>(this IEnumerable<T> toShuffle, Xoroshiro128Plus random) { List<T> list = new List<T>(); foreach (T item in toShuffle) { list.Insert(random.RangeInt(0, list.Count + 1), item); } return list; } public static Vector3 FindClosestNodeToPosition(Vector3 position, HullClassification hullClassification, bool checkAirNodes = false) { //IL_001c: 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_0023: 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) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_0044: 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) NodeGraph val = (checkAirNodes ? SceneInfo.instance.airNodes : SceneInfo.instance.groundNodes); NodeIndex val2 = val.FindClosestNode(position, hullClassification, float.PositiveInfinity); if (val2 != NodeIndex.invalid) { Vector3 result = default(Vector3); val.GetNodePosition(val2, ref result); return result; } return Vector3.zero; } public static bool TeleportBody(CharacterBody characterBody, GameObject target, GameObject teleportEffect, HullClassification hullClassification, Xoroshiro128Plus rng, float minDistance = 20f, float maxDistance = 45f, bool teleportAir = false) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Expected O, but got Unknown //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Expected O, but got Unknown //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)characterBody)) { return false; } SpawnCard val = ScriptableObject.CreateInstance<SpawnCard>(); val.hullSize = hullClassification; val.nodeGraphType = (GraphType)(teleportAir ? 1 : 0); val.prefab = Resources.Load<GameObject>("SpawnCards/HelperPrefab"); GameObject val2 = DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest(val, new DirectorPlacementRule { placementMode = (PlacementMode)1, position = target.transform.position, minDistance = minDistance, maxDistance = maxDistance }, rng)); if (Object.op_Implicit((Object)(object)val2)) { TeleportHelper.TeleportBody(characterBody, val2.transform.position); if (Object.op_Implicit((Object)(object)teleportEffect)) { EffectManager.SimpleEffect(teleportEffect, val2.transform.position, Quaternion.identity, true); } Object.Destroy((Object)(object)val2); Object.Destroy((Object)(object)val); return true; } Object.Destroy((Object)(object)val); return false; } public static Vector3? AboveTargetVectorFromDamageInfo(DamageInfo damageInfo, float distanceAboveTarget) { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_012d: 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_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) if (damageInfo.rejected || !Object.op_Implicit((Object)(object)damageInfo.attacker)) { return null; } CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>(); if (Object.op_Implicit((Object)(object)component)) { TeamMask enemyTeams = TeamMask.GetEnemyTeams(component.teamComponent.teamIndex); HurtBox val = new SphereSearch { radius = 1f, mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask, origin = damageInfo.position }.RefreshCandidates().FilterCandidatesByHurtBoxTeam(enemyTeams).OrderCandidatesByDistance() .FilterCandidatesByDistinctHurtBoxEntities() .GetHurtBoxes() .FirstOrDefault(); if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.healthComponent) && Object.op_Implicit((Object)(object)val.healthComponent.body)) { CharacterBody body = val.healthComponent.body; Vector3 val2 = body.mainHurtBox.collider.ClosestPointOnBounds(body.transform.position + new Vector3(0f, 10000f, 0f)); Vector3? val3 = RaycastToDirection(val2, distanceAboveTarget, Vector3.up, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask)); if (val3.HasValue) { return val3.Value; } return val2 + Vector3.up * distanceAboveTarget; } } return null; } public static Vector3? AboveTargetBody(CharacterBody body, float distanceAbove) { //IL_0030: 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_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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)body)) { return null; } Vector3 val = body.mainHurtBox.collider.ClosestPointOnBounds(body.transform.position + new Vector3(0f, 10000f, 0f)); Vector3? val2 = RaycastToDirection(val, distanceAbove, Vector3.up, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask)); if (val2.HasValue) { return val2.Value; } return val + Vector3.up * distanceAbove; } public static Dictionary<string, Vector3> GetAimSurfaceAlignmentInfo(Ray ray, int layerMask, float distance) { //IL_0007: 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) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_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_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005f: 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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) Dictionary<string, Vector3> dictionary = new Dictionary<string, Vector3>(); RaycastHit val = default(RaycastHit); if (!Physics.Raycast(ray, ref val, distance, layerMask, (QueryTriggerInteraction)1)) { return null; } Vector3 point = ((RaycastHit)(ref val)).point; Vector3 val2 = Vector3.Cross(((Ray)(ref ray)).direction, Vector3.up); Vector3 val3 = Vector3.ProjectOnPlane(((RaycastHit)(ref val)).normal, val2); Vector3 value = Vector3.Cross(val2, val3); dictionary.Add("Position", point); dictionary.Add("Right", val2); dictionary.Add("Forward", value); dictionary.Add("Up", val3); return dictionary; } public static FireProjectileInfo GetProjectile(GameObject prefab, float coeff, CharacterBody owner, DamageTypeCombo? damageTypeCombo = null) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) FireProjectileInfo val = default(FireProjectileInfo); val.damage = owner.damage * coeff; val.crit = owner.RollCrit(); val.projectilePrefab = prefab; val.