Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of BlightReturns v1.0.4
plugins/BlightReturnsRework/BlightReturnsRework.dll
Decompiled a day agousing System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Bootstrap; using IL.RoR2; using Microsoft.CodeAnalysis; using Mono.Cecil.Cil; using MonoMod.Cil; using On.RoR2; using RoR2; using RoR2.Projectile; using RoR2.Skills; using SneedHooks; using UnityEngine; using UnityEngine.AddressableAssets; [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: AssemblyCompany("BlightReturnsRework")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+1d613e4aecf773c97d8b99be486e7804c4c0629b")] [assembly: AssemblyProduct("BlightReturnsRework")] [assembly: AssemblyTitle("BlightReturnsRework")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } } namespace R2API.Utils { [AttributeUsage(AttributeTargets.Assembly)] public class ManualNetworkRegistrationAttribute : Attribute { } } namespace BlightReturnsRework { [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.Moffein.BlightReturnsRework", "BlightReturnsRework", "1.0.3")] public class BlightReturnsReworkPlugin : BaseUnityPlugin { public static float damageMultPerBuff = 0.05f; public static PluginInfo pluginInfo; private void Awake() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Expected O, but got Unknown //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Expected O, but got Unknown //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Expected O, but got Unknown //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Expected O, but got Unknown //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Expected O, but got Unknown //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) pluginInfo = ((BaseUnityPlugin)this).Info; if (Chainloader.PluginInfos.ContainsKey("com.RiskyLives.RiskyMod")) { Debug.LogWarning((object)"BlightReturnsRework: RiskyMod is loaded, disabling mod. RiskyMod's version of the tweak will be used instead."); return; } Language.SetFolders += new hook_SetFolders(LoadLanguage.fixme); if (Chainloader.PluginInfos.ContainsKey("com.Moffein.LinearDamage")) { ModifyFinalDamage.ModifyFinalDamageActions = (ModifyFinalDamageDelegate)Delegate.Combine((Delegate?)(object)ModifyFinalDamage.ModifyFinalDamageActions, (Delegate?)new ModifyFinalDamageDelegate(ModifyFinalDamage_Additive)); } else { ModifyFinalDamage.ModifyFinalDamageActions = (ModifyFinalDamageDelegate)Delegate.Combine((Delegate?)(object)ModifyFinalDamage.ModifyFinalDamageActions, (Delegate?)new ModifyFinalDamageDelegate(ModifyFinalDamage)); } DotController.AddDot_GameObject_float_HurtBox_DotIndex_float_ProcChainMask_Nullable1_Nullable1_Nullable1 += new hook_AddDot_GameObject_float_HurtBox_DotIndex_float_ProcChainMask_Nullable1_Nullable1_Nullable1(ModifyBlight); GlobalEventManager.ProcessHitEnemy += new Manipulator(GlobalEventManager_ProcessHitEnemy); RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(OnLoadActions)); SuppressBlightComponent suppressBlightComponent = Addressables.LoadAssetAsync<GameObject>((object)"5954b24e8404c1e4695488397f07fd14").WaitForCompletion().AddComponent<SuppressBlightComponent>(); } private void OnLoadActions() { //IL_0006: 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) Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/Base/Croco/CrocoPassiveBlight.asset").WaitForCompletion().skillDescriptionToken = "CROCO_PASSIVE_ALT_DESCRIPTION_RETURNSREWORK"; } private void GlobalEventManager_ProcessHitEnemy(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func<Instruction, bool>[2] { (Instruction x) => ILPatternMatchingExt.MatchLdfld<DamageInfo>(x, "damageType"), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 1048576) }) && val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1] { (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 5f) })) { val.EmitDelegate<Func<float, float>>((Func<float, float>)((float x) => 10f)); } } private void ModifyFinalDamage(DamageModifierArgs damageModifierArgs, DamageInfo damageInfo, HealthComponent victim, CharacterBody victimBody) { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Invalid comparison between Unknown and I4 //IL_0045: Unknown result type (might be due to invalid IL or missing references) int buffCount = victimBody.GetBuffCount(Buffs.Blight); if (buffCount > 0) { damageModifierArgs.damageMultFinal *= 1f + damageMultPerBuff * (float)buffCount; if ((int)damageInfo.dotIndex != 5) { damageInfo.damageColorIndex = (DamageColorIndex)9; } } } private void ModifyFinalDamage_Additive(DamageModifierArgs damageModifierArgs, DamageInfo damageInfo, HealthComponent victim, CharacterBody victimBody) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Invalid comparison between Unknown and I4 //IL_003f: Unknown result type (might be due to invalid IL or missing references) int buffCount = victimBody.GetBuffCount(Buffs.Blight); if (buffCount > 0) { damageModifierArgs.damageMultAdd += damageMultPerBuff * (float)buffCount; if ((int)damageInfo.dotIndex != 5) { damageInfo.damageColorIndex = (DamageColorIndex)9; } } } private void ModifyBlight(orig_AddDot_GameObject_float_HurtBox_DotIndex_float_ProcChainMask_Nullable1_Nullable1_Nullable1 orig, DotController self, GameObject attackerObject, float duration, HurtBox hitHurtBox, DotIndex dotIndex, float damageMultiplier, ProcChainMask procChainMask, uint? maxStacksFromAttacker, float? totalDamage, DotIndex? preUpgradeDotIndex) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Invalid comparison between Unknown and I4 //IL_006f: 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_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Invalid comparison between Unknown and I4 //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) if ((int)dotIndex == 5) { foreach (DotStack dotStack in self.dotStackList) { if ((Object)(object)dotStack.attackerObject == (Object)(object)attackerObject && dotStack.dotIndex == dotIndex) { damageMultiplier = 0f; break; } } } orig.Invoke(self, attackerObject, duration, hitHurtBox, dotIndex, damageMultiplier, procChainMask, maxStacksFromAttacker, totalDamage, preUpgradeDotIndex); if ((int)dotIndex != 5) { return; } for (int i = 0; i < self.dotStackList.Count; i++) { if ((int)self.dotStackList[i].dotIndex == 5) { self.dotStackList[i].timer = Mathf.Max(self.dotStackList[i].timer, duration); } } } } [RequireComponent(typeof(ProjectileDamage), typeof(ProjectileDotZone))] public class SuppressBlightComponent : MonoBehaviour { public int ticksPerBlight = 3; private ProjectileDamage projectileDamage; private ProjectileDotZone dotZone; private float previousResetStopwatch; private int tickCount; private void Awake() { projectileDamage = ((Component)this).GetComponent<ProjectileDamage>(); } private void Start() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Invalid comparison between Unknown and I4 //IL_0037: Unknown result type (might be due to invalid IL or missing references) if ((int)projectileDamage.damageType.damageType != 1048576) { Object.Destroy((Object)(object)this); return; } projectileDamage.damageType.damageType = (DamageType)0; dotZone = ((Component)this).GetComponent<ProjectileDotZone>(); previousResetStopwatch = dotZone.resetStopwatch; } private void FixedUpdate() { //IL_0069: 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) if (dotZone.resetStopwatch < previousResetStopwatch) { tickCount++; if (tickCount >= ticksPerBlight) { projectileDamage.damageType.damageType = (DamageType)1048576; tickCount = 0; } else { projectileDamage.damageType.damageType = (DamageType)0; } } previousResetStopwatch = dotZone.resetStopwatch; } } internal class LoadLanguage { internal static string assemblyDir => Path.GetDirectoryName(BlightReturnsReworkPlugin.pluginInfo.Location); internal static string languageRoot => Path.Combine(assemblyDir, "language"); internal static void fixme(orig_SetFolders orig, Language self, IEnumerable<string> newFolders) { if (Directory.Exists(languageRoot)) { IEnumerable<string> second = Directory.EnumerateDirectories(Path.Combine(languageRoot), self.name); orig.Invoke(self, newFolders.Union(second)); } else { orig.Invoke(self, newFolders); } } } }