using System;
using System.Collections;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("NoFlashMod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("NoFlashMod")]
[assembly: AssemblyCopyright("Copyright © 2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("c8b3f424-e26d-44f5-a439-a7b575fb54e2")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
[BepInPlugin("mig_noflash4ghost", "No Flash Silksong", "1.0.0")]
public class NoFlashPlugin : BaseUnityPlugin
{
private void Awake()
{
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: Expected O, but got Unknown
((BaseUnityPlugin)this).Logger.LogInfo((object)"No Flash Mod activated successfully!");
Harmony val = new Harmony("mig_noflash4ghost");
val.PatchAll();
}
}
[HarmonyPatch(typeof(SimpleSpriteFade), "Awake")]
public class SpriteFadeAwakePatch
{
private static readonly string[] BlockedNames = new string[2] { "White Flash R(Clone)", "White Flash" };
private static bool Prefix(SimpleSpriteFade __instance)
{
if (BlockedNames.Contains(((Object)((Component)__instance).gameObject).name))
{
Object.Destroy((Object)(object)((Component)__instance).gameObject);
return false;
}
return true;
}
}
[HarmonyPatch(typeof(AutoRecycleSelf), "Awake")]
public class FailedBindBurstPatch
{
private static readonly string[] BlockedNames = new string[3] { "ThreadedEnemy Hit Pt(Clone)", "standard_health_hit(Clone)", "Bind_Fail_Burst(Clone)" };
private static bool Prefix(AutoRecycleSelf __instance)
{
if (BlockedNames.Contains(((Object)((Component)__instance).gameObject).name))
{
Object.Destroy((Object)(object)((Component)__instance).gameObject);
return false;
}
return true;
}
}
[HarmonyPatch(typeof(SpriteFlash), "Awake")]
internal class SpriteFlashAwakePatch
{
private static void Prefix(SpriteFlash __instance)
{
FieldInfo field = typeof(SpriteFlash).GetField("singleFlashRoutine", BindingFlags.Instance | BindingFlags.NonPublic);
object? value = field.GetValue(__instance);
Coroutine val = (Coroutine)((value is Coroutine) ? value : null);
if (val != null)
{
((MonoBehaviour)__instance).StopCoroutine(val);
field.SetValue(__instance, null);
}
FieldInfo field2 = typeof(SpriteFlash).GetField("repeatingFlashes", BindingFlags.Instance | BindingFlags.NonPublic);
if (field2.GetValue(__instance) is IList list)
{
list.Clear();
}
}
}
[HarmonyPatch(typeof(SpriteFlash), "Flash", new Type[]
{
typeof(Color),
typeof(float),
typeof(float),
typeof(float),
typeof(float),
typeof(float),
typeof(bool),
typeof(int),
typeof(int),
typeof(bool)
})]
internal class FlashColorPatch
{
private static bool Prefix(SpriteFlash __instance, Color flashColour, float amount, float timeUp, float stayTime, float timeDown, float stayDownTime, bool repeating, int repeatTimes, int repeatingPriority, bool requireExplicitCancel)
{
return false;
}
}
[HarmonyPatch(typeof(SpriteFlash), "Flash", new Type[] { typeof(FlashConfig) })]
internal class FlashConfigPatch
{
private static bool Prefix(SpriteFlash __instance, FlashConfig config)
{
return false;
}
}
[HarmonyPatch(typeof(ToolItemSkill), "get_PromptGlowSprite")]
internal class PromptGlowSpritePatch
{
private static bool Prefix(ref Sprite __result)
{
__result = null;
return false;
}
}
[HarmonyPatch(typeof(SpriteFlash), "flashBenchRest")]
internal class BenchFlashPatch
{
private static bool Prefix(SpriteFlash __instance)
{
return false;
}
}