using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using AmpMod.Modules; using AmpMod.SkillStates; using AmpMod.SkillStates.Amp; using AmpMod.SkillStates.BaseStates; using AmpMod.SkillStates.Nemesis_Amp; using AmpMod.SkillStates.Nemesis_Amp.Orbs; using BepInEx; using BepInEx.Logging; using BetterAmp.Changes; using BetterAmp.Modules; using EntityStates; using HarmonyLib; using Microsoft.CodeAnalysis; using Mono.Cecil; using Mono.Cecil.Cil; using MonoMod.Cil; using MonoMod.RuntimeDetour; using On.RoR2; using R2API; using RoR2; using RoR2.ContentManagement; using RoR2.Orbs; using RoR2.Projectile; using RoR2.Skills; using UnityEngine; using UnityEngine.Networking; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: IgnoresAccessChecksTo("AmpMod")] [assembly: IgnoresAccessChecksTo("Morris")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("BetterAmp")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("BetterAmp")] [assembly: AssemblyTitle("BetterAmp")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace BetterAmp { [BepInPlugin("com.Bloonjitsu7.BetterAmp", "BetterAmp", "1.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Main : BaseUnityPlugin { public const string PluginGUID = "Bloonjitsu7.BetterAmp"; public const string PluginAuthor = "Bloonjitsu7"; public const string PluginName = "BetterAmp"; public const string PluginVersion = "1.0.0"; public void Awake() { Log.Init(((BaseUnityPlugin)this).Logger); new ContentPacks().Initialize(); SurvivorChanges survivorChanges = new SurvivorChanges(); survivorChanges.Initialize(); } } internal static class Log { private static ManualLogSource _logSource; internal static void Init(ManualLogSource logSource) { _logSource = logSource; } internal static void Debug(object data) { _logSource.LogDebug(data); } internal static void Error(object data) { _logSource.LogError(data); } internal static void Fatal(object data) { _logSource.LogFatal(data); } internal static void Info(object data) { _logSource.LogInfo(data); } internal static void Message(object data) { _logSource.LogMessage(data); } internal static void Warning(object data) { _logSource.LogWarning(data); } } } namespace BetterAmp.Modules { public static class DamageTypes { } public static class Projectiles { internal static List projectilePrefabs = new List(); internal static void RegisterProjectiles() { } } public static class Buffs { internal static List buffDefs = new List(); internal static BuffDef AddNewBuff(string buffName, Sprite buffIcon, Color buffColor, bool canStack, bool isDebuff, bool isCooldown, bool isHidden) { //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) BuffDef val = ScriptableObject.CreateInstance(); ((Object)val).name = buffName; val.buffColor = buffColor; val.canStack = canStack; val.isDebuff = isDebuff; val.eliteDef = null; val.iconSprite = buffIcon; val.isCooldown = isCooldown; val.isHidden = isHidden; buffDefs.Add(val); return val; } } internal class ContentPacks : IContentPackProvider { internal ContentPack contentPack = new ContentPack(); public string identifier => "com.Bloonjitsu7.BetterAmp"; public void Initialize() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown Projectiles.RegisterProjectiles(); ContentManager.collectContentPackProviders += new CollectContentPackProvidersDelegate(ContentManager_collectContentPackProviders); } private void ContentManager_collectContentPackProviders(AddContentPackProviderDelegate addContentPackProvider) { addContentPackProvider.Invoke((IContentPackProvider)(object)this); } public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args) { contentPack.identifier = identifier; contentPack.buffDefs.Add(Buffs.buffDefs.ToArray()); contentPack.projectilePrefabs.Add(Projectiles.projectilePrefabs.ToArray()); args.ReportProgress(1f); yield break; } public IEnumerator GenerateContentPackAsync(GetContentPackAsyncArgs args) { ContentPack.Copy(contentPack, args.output); args.ReportProgress(1f); yield break; } public IEnumerator FinalizeAsync(FinalizeAsyncArgs args) { args.ReportProgress(1f); yield break; } } } namespace BetterAmp.Changes { public class SurvivorChanges { private Hook ampEnterHook; private Hook ampEnterHook2; private ILHook ampBaseMeleeHook; private ILHook ampMeleeHook; private Hook ampSlashHook; private Hook surgeEnterHook; private Hook surgeUpdateHook; private Hook surgeExitHook; private Hook ferroEnterHook; private Hook bombardEnterHook; private ILHook bombardFireHook; private Hook nemOrbHook; private ILHook nemOrbDamageHook; private ILHook pulseUpdateHook; private ILHook pulseEnterHook; private ILHook pulseFireHook; private Hook nemBladesHook; private ILHook chargeBlastHook; private Hook fulminationDamageHook; private ILHook fulminationDamageHook2; private Hook nemSpearHook; private ILHook nemBeamHook; private Hook nemLightningHook; public void Initialize() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Expected O, but got Unknown //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Expected O, but got Unknown //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Expected O, but got Unknown //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Expected O, but got Unknown //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Expected O, but got Unknown //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Expected O, but got Unknown //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Expected O, but got Unknown //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Expected O, but got Unknown //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Expected O, but got Unknown //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Expected O, but got Unknown //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Expected O, but got Unknown //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Expected O, but got Unknown //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Expected O, but got Unknown //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Expected O, but got Unknown //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Expected O, but got Unknown //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Expected O, but got Unknown //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Expected O, but got Unknown //IL_029d: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Expected O, but got Unknown //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Expected O, but got Unknown //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: Expected O, but got Unknown //IL_02ff: Unknown result type (might be due to invalid IL or missing references) //IL_0309: Expected O, but got Unknown //IL_0330: Unknown result type (might be due to invalid IL or missing references) //IL_033a: Expected O, but got Unknown //IL_0361: Unknown result type (might be due to invalid IL or missing references) //IL_036b: Expected O, but got Unknown //IL_038d: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Expected O, but got Unknown //IL_0392: Unknown result type (might be due to invalid IL or missing references) //IL_039c: Expected O, but got Unknown //IL_03c3: Unknown result type (might be due to invalid IL or missing references) //IL_03cd: Expected O, but got Unknown //IL_03f4: Unknown result type (might be due to invalid IL or missing references) //IL_03fe: Expected O, but got Unknown //IL_0420: Unknown result type (might be due to invalid IL or missing references) //IL_042a: Expected O, but got Unknown //IL_0425: Unknown result type (might be due to invalid IL or missing references) //IL_042f: Expected O, but got Unknown //IL_0456: Unknown result type (might be due to invalid IL or missing references) //IL_0460: Expected O, but got Unknown MethodInfo methodInfo = AccessTools.Method(typeof(AmpPlugin), "overChargeStatGrant", (Type[])null, (Type[])null); chargeBlastHook = new ILHook((MethodBase)methodInfo, new Manipulator(IL_ChargeBlast)); MethodInfo methodInfo2 = AccessTools.Method(typeof(AltPulseLeap), "OnEnter", (Type[])null, (Type[])null); pulseEnterHook = new ILHook((MethodBase)methodInfo2, new Manipulator(IL_PulseLeapEnter)); MethodInfo methodInfo3 = AccessTools.Method(typeof(AltPulseLeap), "FixedUpdate", (Type[])null, (Type[])null); pulseUpdateHook = new ILHook((MethodBase)methodInfo3, new Manipulator(IL_PulseLeapUpdate)); MethodInfo methodInfo4 = AccessTools.Method(typeof(AltPulseLeap), "FireLaunchBlast", (Type[])null, (Type[])null); pulseFireHook = new ILHook((MethodBase)methodInfo4, new Manipulator(IL_PulseLeapFire)); MethodInfo methodInfo5 = AccessTools.Method(typeof(VoltaicBombardmentFire), "Fire", (Type[])null, (Type[])null); bombardFireHook = new ILHook((MethodBase)methodInfo5, new Manipulator(IL_BombardFire)); MethodInfo methodInfo6 = AccessTools.Method(typeof(VoltaicBombardmentFire), "OnEnter", (Type[])null, (Type[])null); bombardEnterHook = new Hook((MethodBase)methodInfo6, (Delegate)new Action, VoltaicBombardmentFire>(OnBombardEnter)); MethodInfo methodInfo7 = AccessTools.Method(typeof(Ferroshot), "OnEnter", (Type[])null, (Type[])null); ferroEnterHook = new Hook((MethodBase)methodInfo7, (Delegate)new Action, Ferroshot>(OnFerroEnter)); MethodInfo methodInfo8 = AccessTools.Method(typeof(PlasmaSlash), "OnEnter", (Type[])null, (Type[])null); ampSlashHook = new Hook((MethodBase)methodInfo8, (Delegate)new Action, PlasmaSlash>(OnSlashEnter)); MethodInfo methodInfo9 = AccessTools.Method(typeof(BaseMeleeAttack), "OnEnter", (Type[])null, (Type[])null); ampBaseMeleeHook = new ILHook((MethodBase)methodInfo9, new Manipulator(IL_BaseMeleeEnter)); MethodInfo methodInfo10 = AccessTools.Method(typeof(SlashCombo), "OnEnter", (Type[])null, (Type[])null); ampMeleeHook = new ILHook((MethodBase)methodInfo10, new Manipulator(IL_MeleeEnter)); MethodInfo methodInfo11 = AccessTools.Method(typeof(Surge), "OnExit", (Type[])null, (Type[])null); surgeExitHook = new Hook((MethodBase)methodInfo11, (Delegate)new Action, Surge>(OnSurgeExit)); MethodInfo methodInfo12 = AccessTools.Method(typeof(Surge), "FixedUpdate", (Type[])null, (Type[])null); surgeUpdateHook = new Hook((MethodBase)methodInfo12, (Delegate)new Action, Surge>(OnSurgeUpdate)); MethodInfo methodInfo13 = AccessTools.Method(typeof(Surge), "OnEnter", (Type[])null, (Type[])null); surgeEnterHook = new Hook((MethodBase)methodInfo13, (Delegate)new Action, Surge>(OnSurgeEnter)); MethodInfo methodInfo14 = AccessTools.Method(typeof(FulminationOrb), "Begin", (Type[])null, (Type[])null); fulminationDamageHook = new Hook((MethodBase)methodInfo14, (Delegate)new Action, FulminationOrb>(OnFulminationDamage)); MethodInfo methodInfo15 = AccessTools.Method(typeof(Fulmination), "FireLightning", (Type[])null, (Type[])null); fulminationDamageHook2 = new ILHook((MethodBase)methodInfo15, new Manipulator(IL_FulminationDamage)); MethodInfo methodInfo16 = AccessTools.Method(typeof(Fulmination), "OnEnter", (Type[])null, (Type[])null); ampEnterHook2 = new Hook((MethodBase)methodInfo16, (Delegate)new Action, Fulmination>(OnFulminationEnter)); MethodInfo methodInfo17 = AccessTools.Method(typeof(LightningStream), "OnEnter", (Type[])null, (Type[])null); ampEnterHook = new Hook((MethodBase)methodInfo17, (Delegate)new Action, LightningStream>(OnNemFulminationEnter)); MethodInfo methodInfo18 = AccessTools.Method(typeof(SyncDamage), "createDmgOrb", (Type[])null, (Type[])null); nemOrbHook = new Hook((MethodBase)methodInfo18, (Delegate)new Func, SyncDamage, GameObject, NemAmpLightningLockOrb>(OnCreateNemOrb)); MethodInfo methodInfo19 = AccessTools.Method(typeof(NemAmpLightningLockOrb), "OnArrival", (Type[])null, (Type[])null); nemOrbDamageHook = new ILHook((MethodBase)methodInfo19, new Manipulator(IL_OrbArrival)); MethodInfo methodInfo20 = AccessTools.Method(typeof(FluxBlades), "OnEnter", (Type[])null, (Type[])null); nemBladesHook = new Hook((MethodBase)methodInfo20, (Delegate)new Action, FluxBlades>(OnFluxBladesEnter)); MethodInfo methodInfo21 = AccessTools.Method(typeof(FireLightningSpear), "OnEnter", (Type[])null, (Type[])null); nemSpearHook = new Hook((MethodBase)methodInfo21, (Delegate)new Action, FireLightningSpear>(OnLightningSpearEnter)); MethodInfo methodInfo22 = AccessTools.Method(typeof(FireLightningBeam), "Fire", (Type[])null, (Type[])null); nemBeamHook = new ILHook((MethodBase)methodInfo22, new Manipulator(IL_BeamDamage)); MethodInfo methodInfo23 = AccessTools.Method(typeof(NemAmpLightningStrikeOrb), "OnArrival", (Type[])null, (Type[])null); nemLightningHook = new Hook((MethodBase)methodInfo23, (Delegate)new Action, NemAmpLightningStrikeOrb>(OnNemLightningArrival)); Projectiles.bladeProjectilePrefab.GetComponent().procCoefficient = 1f; Projectiles.bladeProjectilePrefabBlue.GetComponent().procCoefficient = 1f; UpdateText(); } public void UpdateText() { string text = "Agile. Use electromagnetic fields to fire an array of 6 iron sand bullets, each dealing 175% damage. Bullets home onto charged & electrified enemies."; LanguageAPI.Add("NT_BETTERAMP_BODY_SECONDARY_FERROSHOT_DESCRIPTION", text); string text2 = "Ignite. While grounded, slash with your sword for 950% damage. While airborne, launch a wave of plasma for 750% damage. Charged & electrified enemies burn stronger."; LanguageAPI.Add("NT_BETTERAMP_BODY_SECONDARY_PLASMASLASH_DESCRIPTION", text2); string text3 = "Agile. Shocking. Blast yourself forward and upwards, dealing 800% damage in an area around you."; LanguageAPI.Add("NT_BETTERAMP_BODY_UTILITY_DASH_DESCRIPTION", text3); string text4 = "Magnetically boost yourself forwards, gaining a brief period of invulnerability. At the end of the boost, create a charged explosion around you that deals 250% damage. Can boost up to 3 times."; LanguageAPI.Add("NT_BETTERAMP_BODY_UTILITY_BOOST_DESCRIPTION", text4); string text5 = "Agile. Fire a close-ranged stream of chaining lightning that deals 2000% total damage. Each hit has a 25% chance of being Charged."; LanguageAPI.Add("NT_BETTERAMP_BODY_SPECIAL_CHAIN_DESCRIPTION", text5); string text6 = "Fire 3 tracking iron sand daggers, each dealing 250% damage on hit. At maximum Gathering Storm charge, fire 6 blades."; LanguageAPI.Add("NT_BETTERNEMAMP_BODY_PRIMARY_BLADES_DESCRIPTION", text6); foreach (SkillDef skillDef in Skills.skillDefs) { Log.Message(skillDef.skillNameToken); if (skillDef.skillNameToken.Contains("NT_AMP_BODY_SPECIAL_LIGHTNING")) { skillDef.baseRechargeInterval = 11f; } else if (skillDef.skillNameToken.Contains("FERROSHOT")) { skillDef.skillDescriptionToken = "NT_BETTERAMP_BODY_SECONDARY_FERROSHOT_DESCRIPTION"; } else if (skillDef.skillNameToken.Contains("PLASMASLASH")) { skillDef.skillDescriptionToken = "NT_BETTERAMP_BODY_SECONDARY_PLASMASLASH_DESCRIPTION"; skillDef.keywordTokens = new string[2] { "KEYWORD_IGNITE", "NT_AMP_BODY_KEYWORD_CHARGE" }; } else if (skillDef.skillNameToken.Contains("NT_AMP_BODY_UTILITY_DASH")) { skillDef.skillDescriptionToken = "NT_BETTERAMP_BODY_UTILITY_DASH_DESCRIPTION"; skillDef.keywordTokens = new string[2] { "KEYWORD_SHOCKING", "KEYWORD_AGILE" }; skillDef.cancelSprintingOnActivation = false; skillDef.canceledFromSprinting = false; } else if (skillDef.skillNameToken.Contains("NT_AMP_BODY_UTILITY_BOOST")) { skillDef.skillDescriptionToken = "NT_BETTERAMP_BODY_UTILITY_BOOST_DESCRIPTION"; } else if (skillDef.skillNameToken.Contains("NT_AMP_BODY_SPECIAL_CHAIN")) { skillDef.skillDescriptionToken = "NT_BETTERAMP_BODY_SPECIAL_CHAIN_DESCRIPTION"; } else if (skillDef.skillNameToken.Contains("NT_NEMAMP_BODY_PRIMARY_BLADES")) { skillDef.skillDescriptionToken = "NT_BETTERNEMAMP_BODY_PRIMARY_BLADES_DESCRIPTION"; } } } public void OnTakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo info) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) Log.Message(info.damageType); orig.Invoke(self, info); } public void IL_BombardFire(ILContext il) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_000f: 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_009b: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); MoveType val2 = (MoveType)2; int loc1 = -1; if (val.TryGotoNext(val2, new Func[4] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, typeof(BlastAttack), "teamIndex"), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref loc1), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, loc1), (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(DamageTypes), "apply2Charge") })) { val.Index -= 2; val.Emit(OpCodes.Ldloc, loc1); val.EmitDelegate>((Action)delegate(BlastAttack self) { //IL_0007: 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) self.damageType = new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)131072), (DamageTypeExtended)8192, (DamageSource)8); }); } else { Log.Error(((MemberReference)il.Method).Name + " Hook 1 failed!"); } } public void OnBombardEnter(Action orig, VoltaicBombardmentFire self) { VoltaicBombardmentFire.lightningChargeTimer = 0.05f; orig(self); } public void OnFerroEnter(Action orig, Ferroshot self) { Ferroshot.damageCoefficient = 1.75f; orig(self); } public void OnSlashEnter(Action orig, PlasmaSlash self) { self.damageCoefficient = 9.5f; self.fireBeamDamage = 7f; orig(self); } public void IL_BaseMeleeEnter(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0009: 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_0041: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); MoveType val2 = (MoveType)2; if (val.TryGotoNext(val2, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, typeof(OverlapAttack), "damageType") })) { val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Action)delegate(BaseMeleeAttack self) { //IL_0008: 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_0014: Unknown result type (might be due to invalid IL or missing references) self.attack.damageType = new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)0), (DamageTypeExtended)0, (DamageSource)1); }); } else { Log.Error(((MemberReference)il.Method).Name + " Hook 1 failed!"); } } public void IL_MeleeEnter(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0009: 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_0043: 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_009b: Expected O, but got Unknown ILCursor val = new ILCursor(il); MoveType val2 = (MoveType)2; if (val.TryGotoNext(val2, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, typeof(BaseMeleeAttack), "damageType") })) { val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Action)delegate(SlashCombo self) { //IL_0003: 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_0014: Unknown result type (might be due to invalid IL or missing references) ((BaseMeleeAttack)self).damageType = DamageTypeCombo.op_Implicit(new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)0), (DamageTypeExtended)0, (DamageSource)1)); }); } else { Log.Error(((MemberReference)il.Method).Name + " Hook 2 failed!"); } ILCursor val3 = new ILCursor(il); ILCursor val4 = val3; if (val4.TryGotoNext((MoveType)0, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 0.1f) })) { val3.Next.Operand = 1f; } else { Log.Error(((MemberReference)il.Method).Name + " Hook 1 failed!"); } } public void OnSurgeEnter(Action orig, Surge self) { if (Object.op_Implicit((Object)(object)((EntityState)self).characterBody)) { ((BaseState)self).attackSpeedStat = ((EntityState)self).characterBody.attackSpeed; ((BaseState)self).damageStat = ((EntityState)self).characterBody.damage; ((BaseState)self).critStat = ((EntityState)self).characterBody.crit; ((BaseState)self).moveSpeedStat = ((EntityState)self).characterBody.moveSpeed; } if (NetworkServer.active) { self.lightningController = ((EntityState)self).GetComponent(); self.networkBehaviour = ((EntityState)self).GetComponent(); } Util.PlaySound("Play_mage_m2_impact", ((EntityState)self).gameObject); self.duration = 0.05f; } public void OnSurgeUpdate(Action orig, Surge self) { //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_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_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_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_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_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_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Expected O, but got Unknown //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Expected O, but got Unknown //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0182: 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_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Expected O, but got Unknown ((EntityState)self).fixedAge = ((EntityState)self).fixedAge + ((EntityState)self).GetDeltaTime(); Ray aimRay = ((BaseState)self).GetAimRay(); if (((EntityState)self).isAuthority && ((EntityState)self).fixedAge >= self.duration && (Object)(object)((EntityState)self).characterBody != (Object)null) { BlastAttack val = new BlastAttack { attacker = ((EntityState)self).gameObject, baseDamage = 8f * ((EntityState)self).characterBody.damage, baseForce = 0f, attackerFiltering = (AttackerFiltering)2, crit = ((EntityState)self).characterBody.RollCrit(), damageColorIndex = (DamageColorIndex)16, damageType = new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)16777216), (DamageTypeExtended)8192, (DamageSource)4), falloffModel = (FalloffModel)4, inflictor = ((EntityState)self).gameObject, position = ((EntityState)self).characterBody.transform.position, procChainMask = default(ProcChainMask), procCoefficient = 1f, radius = 15f, teamIndex = ((EntityState)self).characterBody.teamComponent.teamIndex }; EffectData val2 = new EffectData { origin = ((EntityState)self).characterBody.corePosition, scale = 18f }; EffectManager.SpawnEffect(self.lightningController.chargeExplosion, val2, true); val.Fire(); Vector3 val3 = 3500f * ((Ray)(ref aimRay)).direction; Vector3 val4 = 1500f * Vector3.up; ((EntityState)self).characterMotor.ApplyForce(val3 + val4, false, false); if (NetworkServer.active && !((Enum)((EntityState)self).characterBody.bodyFlags).HasFlag((Enum)(object)(BodyFlags)1)) { CharacterBody characterBody = ((EntityState)self).characterBody; characterBody.bodyFlags = (BodyFlags)(characterBody.bodyFlags | 1); ((EntityState)self).characterMotor.onHitGroundAuthority += new HitGroundDelegate(self.CharacterMotor_onHitGround); } ((EntityState)self).outer.SetNextStateToMain(); } } public void OnSurgeExit(Action orig, Surge self) { } public void IL_PulseLeapEnter(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); MoveType val2 = (MoveType)2; val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Action)delegate(AltPulseLeap self) { ((EntityState)self).characterBody.AddTimedBuff(Buffs.HiddenInvincibility, 0.3f); }); if (val.TryGotoNext(val2, new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchCall(x, typeof(AltPulseLeap), "FireLaunchBlast") })) { Instruction next = val.Next; val.Index -= 2; val.Emit(OpCodes.Br, next); } else { Log.Error(((MemberReference)il.Method).Name + " Hook 1 failed!"); } MethodReference val3 = default(MethodReference); if (val.TryGotoNext(val2, new Func[5] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchCall(x, ref val3), (Instruction x) => ILPatternMatchingExt.MatchCall(x, ref val3), (Instruction x) => ILPatternMatchingExt.MatchCall(x, typeof(AltPulseLeap), "CreateBlinkEffect") })) { Instruction next2 = val.Next; val.Index -= 5; val.Emit(OpCodes.Br, next2); } else { Log.Error(((MemberReference)il.Method).Name + " Hook 2 failed!"); } } public void IL_PulseLeapUpdate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); MoveType val2 = (MoveType)2; if (val.TryGotoNext(val2, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, typeof(AltPulseLeap), "hasFlown") })) { val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Action)delegate(AltPulseLeap self) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) self.FireLaunchBlast(); self.CreateBlinkEffect(Util.GetCorePosition(((EntityState)self).gameObject)); }); } else { Log.Error(((MemberReference)il.Method).Name + " Hook 1 failed!"); } } private void OnPulseLeapExit(Action orig, AltPulseLeap self) { //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_0014: 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_002b: Expected O, but got Unknown self.FireLaunchBlast(); EffectData val = new EffectData { origin = ((EntityState)self).characterBody.corePosition, scale = 18f }; EffectManager.SpawnEffect(self.lightningController.chargeExplosion, val, true); orig(self); } public void IL_PulseLeapFire(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); MoveType val2 = (MoveType)2; if (val.TryGotoNext(val2, new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, typeof(AltPulseLeap), "boostBlast"), (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(DamageTypes), "applyCharge") })) { val.Index -= 3; val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Action)delegate(AltPulseLeap self) { //IL_000c: 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_001c: Unknown result type (might be due to invalid IL or missing references) self.boostBlast.damageType = new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)131072), (DamageTypeExtended)8192, (DamageSource)4); }); } else { Log.Error(((MemberReference)il.Method).Name + " Hook 1 failed!"); } } private void OnFulminationEnter(Action orig, Fulmination self) { self.entryDuration = 0f; orig(self); ((EntityState)self).characterBody.SetAimTimer(self.entryDuration + self.fulminationDuration); self.tickDamageCoefficient = 1.25f; } private void OnFulminationDamage(Action orig, FulminationOrb self) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) self.damageType = DamageTypeCombo.op_Implicit(new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)0), (DamageTypeExtended)8192, (DamageSource)8)); orig(self); } public void IL_FulminationDamage(ILContext il) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_000f: 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_005b: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); MoveType val2 = (MoveType)2; int loc1 = -1; if (val.TryGotoNext(val2, new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, typeof(BulletAttack), "damageType"), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref loc1) })) { val.Emit(OpCodes.Ldloc, loc1); val.EmitDelegate>((Action)delegate(BulletAttack self) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) self.damageType = new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)0), (DamageTypeExtended)8192, (DamageSource)8); }); } else { Log.Error(((MemberReference)il.Method).Name + " Hook 1 failed!"); } } private void OnNemFulminationEnter(Action orig, LightningStream self) { orig(self); self.procCoefficient = 1f; self.baseTickTime = 0.4f; self.lightningTickDamage = 1.2f; } private NemAmpLightningLockOrb OnCreateNemOrb(Func orig, SyncDamage self, GameObject attacker) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: 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) NemAmpLightningLockOrb val = orig(self, attacker); val.procCoefficient = 1f; val.damageType = DamageTypeCombo.op_Implicit(new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)0), (DamageTypeExtended)8192, (DamageSource)1)); return val; } public void IL_OrbArrival(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); MoveType val2 = (MoveType)2; if (val.TryGotoNext(val2, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, typeof(DamageInfo), "damageType") })) { val.Emit(OpCodes.Ldloc_3); val.EmitDelegate>((Action)delegate(DamageInfo self) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) self.damageType = new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)0), (DamageTypeExtended)8192, (DamageSource)1); }); } else { Log.Error(((MemberReference)il.Method).Name + " Hook 1 failed!"); } } private void OnFluxBladesEnter(Action orig, FluxBlades self) { orig(self); self.damageCoefficient = 2.5f; } private void OnLightningSpearEnter(Action orig, FireLightningSpear self) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) orig(self); ((Component)self.projectilePrefab.GetComponent()).GetComponent().damageType = new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)131072), (DamageTypeExtended)8192, (DamageSource)1); } public void IL_BeamDamage(ILContext il) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_000f: 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_005b: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); MoveType val2 = (MoveType)2; int loc1 = -1; if (val.TryGotoNext(val2, new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, typeof(BulletAttack), "damageType"), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref loc1) })) { val.Emit(OpCodes.Ldloc, loc1); val.EmitDelegate>((Action)delegate(BulletAttack self) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) self.damageType = new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)0), (DamageTypeExtended)8192, (DamageSource)2); }); } else { Log.Error(((MemberReference)il.Method).Name + " Hook 1 failed!"); } } private void OnNemLightningArrival(Action orig, NemAmpLightningStrikeOrb self) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: 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_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) EffectManager.SpawnEffect(self.lightningEffect, new EffectData { origin = self.lastKnownTargetPosition }, true); if (Object.op_Implicit((Object)(object)((GenericDamageOrb)self).attacker)) { new BlastAttack { attacker = ((GenericDamageOrb)self).attacker, baseDamage = ((GenericDamageOrb)self).damageValue, baseForce = 0f, bonusForce = Vector3.down * 3000f, crit = ((GenericDamageOrb)self).isCrit, damageColorIndex = (DamageColorIndex)3, damageType = new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)32), (DamageTypeExtended)8192, (DamageSource)8), falloffModel = (FalloffModel)0, inflictor = null, position = self.lastKnownTargetPosition, procChainMask = ((GenericDamageOrb)self).procChainMask, procCoefficient = 1f, radius = 4.5f, teamIndex = TeamComponent.GetObjectTeam(((GenericDamageOrb)self).attacker) }.Fire(); } } public void IL_ChargeBlast(ILContext il) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_000f: 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_006a: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); MoveType val2 = (MoveType)2; int loc1 = -1; if (val.TryGotoNext(val2, new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref loc1), (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, typeof(BlastAttack), "Fire") })) { val.Index -= 2; val.Emit(OpCodes.Ldloc, loc1); val.EmitDelegate>((Action)delegate(BlastAttack self) { //IL_0007: 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) self.damageType = new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)131072), (DamageTypeExtended)8192, (DamageSource)0); }); } else { Log.Error(((MemberReference)il.Method).Name + " Hook 1 failed!"); } } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } }