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 BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyCompany("ultrabossintro")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("ultrabossintro")]
[assembly: AssemblyTitle("ultrabossintro")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
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;
}
}
}
[BepInPlugin("com.clippton.bossintro", "Ultrabossintro", "1.3.7")]
public class CustomBossIntroPlugin : BaseUnityPlugin
{
internal static CustomBossIntroPlugin Instance;
internal static ManualLogSource Log;
private void Awake()
{
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
Instance = this;
Log = ((BaseUnityPlugin)this).Logger;
new Harmony("com.clippton.bossintro").PatchAll();
((BaseUnityPlugin)this).Logger.LogInfo((object)"Ultrabossintro loaded and Harmony patches applied.");
}
}
[HarmonyPatch(typeof(BossHealthBarTemplate))]
public class BossIntroPatch
{
[CompilerGenerated]
private sealed class <PlayIntro>d__5 : IEnumerator<object>, IDisposable, IEnumerator
{
private int <>1__state;
private object <>2__current;
public string rawText;
public BossHealthBarTemplate instance;
private string <text>5__2;
private bool <isSpecial>5__3;
private GameObject <go>5__4;
private TextMeshProUGUI <tmp>5__5;
private List<TextMeshProUGUI> <glowCopies>5__6;
private CanvasGroup <group>5__7;
private float <duration>5__8;
private float <t>5__9;
private int <i>5__10;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <PlayIntro>d__5(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<text>5__2 = null;
<go>5__4 = null;
<tmp>5__5 = null;
<glowCopies>5__6 = null;
<group>5__7 = null;
<>1__state = -2;
}
private bool MoveNext()
{
//IL_007a: Unknown result type (might be due to invalid IL or missing references)
//IL_0084: Expected O, but got Unknown
//IL_02ed: Unknown result type (might be due to invalid IL or missing references)
//IL_02f7: Expected O, but got Unknown
//IL_03cc: Unknown result type (might be due to invalid IL or missing references)
//IL_03d6: Expected O, but got Unknown
//IL_0164: 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)
//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
//IL_01da: Unknown result type (might be due to invalid IL or missing references)
//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
//IL_01fa: 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_0219: Unknown result type (might be due to invalid IL or missing references)
//IL_0335: Unknown result type (might be due to invalid IL or missing references)
//IL_033f: Expected O, but got Unknown
switch (<>1__state)
{
default:
return false;
case 0:
{
<>1__state = -1;
<text>5__2 = rawText.ToUpperInvariant();
<isSpecial>5__3 = specialNames.Contains(<text>5__2);
if ((Object)(object)activeIntro != (Object)null)
{
Object.Destroy((Object)(object)activeIntro);
activeIntro = null;
}
Canvas orCreateCanvas = GetOrCreateCanvas();
<go>5__4 = new GameObject("BossIntroText");
activeIntro = <go>5__4;
<go>5__4.transform.SetParent(((Component)orCreateCanvas).transform, false);
<tmp>5__5 = <go>5__4.AddComponent<TextMeshProUGUI>();
((Graphic)<tmp>5__5).raycastTarget = false;
((TMP_Text)<tmp>5__5).alignment = (TextAlignmentOptions)514;
((TMP_Text)<tmp>5__5).enableWordWrapping = false;
((TMP_Text)<tmp>5__5).overflowMode = (TextOverflowModes)0;
if ((Object)(object)instance != (Object)null && (Object)(object)instance.bossNameText != (Object)null && (Object)(object)instance.bossNameText.font != (Object)null)
{
((TMP_Text)<tmp>5__5).font = instance.bossNameText.font;
}
((TMP_Text)<tmp>5__5).fontSize = (<isSpecial>5__3 ? 62f : 48f);
((Graphic)<tmp>5__5).color = Color.white;
((TMP_Text)<tmp>5__5).alpha = 1f;
((TMP_Text)<tmp>5__5).enableVertexGradient = false;
((TMP_Text)<tmp>5__5).outlineWidth = 0f;
((TMP_Text)<tmp>5__5).outlineColor = Color32.op_Implicit(Color.clear);
RectTransform rectTransform = ((TMP_Text)<tmp>5__5).rectTransform;
rectTransform.anchorMin = new Vector2(0.5f, 0.5f);
rectTransform.anchorMax = new Vector2(0.5f, 0.5f);
rectTransform.pivot = new Vector2(0.5f, 0.5f);
rectTransform.anchoredPosition = Vector2.zero;
rectTransform.sizeDelta = new Vector2(1800f, 180f);
((Transform)rectTransform).localScale = Vector3.one;
<glowCopies>5__6 = null;
if (<isSpecial>5__3)
{
<glowCopies>5__6 = CreateGlowRing(<go>5__4.transform, <tmp>5__5);
}
<group>5__7 = <go>5__4.AddComponent<CanvasGroup>();
<group>5__7.alpha = 1f;
<group>5__7.blocksRaycasts = false;
<group>5__7.interactable = false;
((TMP_Text)<tmp>5__5).text = "";
if (!<isSpecial>5__3)
{
<i>5__10 = 0;
goto IL_0317;
}
<>2__current = (object)new WaitForSeconds(0.5f);
<>1__state = 2;
return true;
}
case 1:
<>1__state = -1;
<i>5__10++;
goto IL_0317;
case 2:
<>1__state = -1;
((TMP_Text)<tmp>5__5).text = <text>5__2;
((TMP_Text)<tmp>5__5).ForceMeshUpdate(false, false);
if (<glowCopies>5__6 != null)
{
foreach (TextMeshProUGUI item in <glowCopies>5__6)
{
((TMP_Text)item).text = <text>5__2;
((TMP_Text)item).ForceMeshUpdate(false, false);
}
}
goto IL_03b7;
case 3:
<>1__state = -1;
<duration>5__8 = (<isSpecial>5__3 ? 1f : 0.6f);
<t>5__9 = 0f;
break;
case 4:
{
<>1__state = -1;
break;
}
IL_03b7:
<>2__current = (object)new WaitForSeconds(<isSpecial>5__3 ? 2f : 1f);
<>1__state = 3;
return true;
IL_0317:
if (<i>5__10 < <text>5__2.Length)
{
TextMeshProUGUI obj = <tmp>5__5;
((TMP_Text)obj).text = ((TMP_Text)obj).text + <text>5__2[<i>5__10];
((TMP_Text)<tmp>5__5).ForceMeshUpdate(false, false);
<>2__current = (object)new WaitForSeconds(0.04f);
<>1__state = 1;
return true;
}
goto IL_03b7;
}
if (<t>5__9 < <duration>5__8)
{
<t>5__9 += Time.deltaTime;
<group>5__7.alpha = 1f - Mathf.Clamp01(<t>5__9 / <duration>5__8);
<>2__current = null;
<>1__state = 4;
return true;
}
if ((Object)(object)activeIntro == (Object)(object)<go>5__4)
{
activeIntro = null;
}
Object.Destroy((Object)(object)<go>5__4);
return false;
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
private static GameObject activeIntro;
private static Canvas introCanvas;
private static readonly HashSet<string> specialNames = new HashSet<string> { "MINOS PRIME", "GABRIEL, JUDGE OF HELL", "SISYPHUS PRIME", "GABRIEL, APOSTATE OF HATE", "GERYON, WATCHER OF THE SKIES", "1000-THR \"EARTHMOVER\"" };
[HarmonyPostfix]
[HarmonyPatch("Initialize", new Type[]
{
typeof(BossHealthBar),
typeof(SliderLayer[])
})]
private static void InitializePostfix(BossHealthBarTemplate __instance, BossHealthBar bossBar, SliderLayer[] colorLayers)
{
if ((Object)(object)__instance == (Object)null || (Object)(object)bossBar == (Object)null || string.IsNullOrEmpty(bossBar.bossName))
{
return;
}
ManualLogSource log = CustomBossIntroPlugin.Log;
if (log != null)
{
log.LogInfo((object)("Boss intro starting for: " + bossBar.bossName));
}
if ((Object)(object)CustomBossIntroPlugin.Instance == (Object)null)
{
ManualLogSource log2 = CustomBossIntroPlugin.Log;
if (log2 != null)
{
log2.LogError((object)"Boss intro failed: plugin instance was null.");
}
}
else
{
((MonoBehaviour)CustomBossIntroPlugin.Instance).StartCoroutine(PlayIntro(__instance, bossBar.bossName));
}
}
private static Canvas GetOrCreateCanvas()
{
//IL_0018: 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: Expected O, but got Unknown
//IL_0023: 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_0060: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)introCanvas != (Object)null)
{
return introCanvas;
}
GameObject val = new GameObject("BossIntroCanvas");
Object.DontDestroyOnLoad((Object)val);
introCanvas = val.AddComponent<Canvas>();
introCanvas.renderMode = (RenderMode)0;
introCanvas.sortingOrder = 32767;
CanvasScaler obj = val.AddComponent<CanvasScaler>();
obj.uiScaleMode = (ScaleMode)1;
obj.referenceResolution = new Vector2(1920f, 1080f);
obj.screenMatchMode = (ScreenMatchMode)0;
obj.matchWidthOrHeight = 0.5f;
val.AddComponent<GraphicRaycaster>();
return introCanvas;
}
[IteratorStateMachine(typeof(<PlayIntro>d__5))]
private static IEnumerator PlayIntro(BossHealthBarTemplate instance, string rawText)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <PlayIntro>d__5(0)
{
instance = instance,
rawText = rawText
};
}
private static List<TextMeshProUGUI> CreateGlowRing(Transform parent, TextMeshProUGUI source)
{
//IL_0019: 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_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_0045: 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_005b: 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_0071: 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_0087: Unknown result type (might be due to invalid IL or missing references)
//IL_008c: 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_00b3: Unknown result type (might be due to invalid IL or missing references)
//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
//IL_00e5: 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_00fc: Unknown result type (might be due to invalid IL or missing references)
//IL_010e: Unknown result type (might be due to invalid IL or missing references)
//IL_0113: 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_012a: 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_0141: Unknown result type (might be due to invalid IL or missing references)
//IL_0153: Unknown result type (might be due to invalid IL or missing references)
//IL_0158: 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_016f: Unknown result type (might be due to invalid IL or missing references)
//IL_0181: 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_0198: Unknown result type (might be due to invalid IL or missing references)
//IL_019d: Unknown result type (might be due to invalid IL or missing references)
//IL_01af: Unknown result type (might be due to invalid IL or missing references)
//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
//IL_01c6: Unknown result type (might be due to invalid IL or missing references)
//IL_01cb: Unknown result type (might be due to invalid IL or missing references)
//IL_01dd: Unknown result type (might be due to invalid IL or missing references)
//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
//IL_020b: Unknown result type (might be due to invalid IL or missing references)
//IL_0210: Unknown result type (might be due to invalid IL or missing references)
//IL_0222: Unknown result type (might be due to invalid IL or missing references)
//IL_0227: Unknown result type (might be due to invalid IL or missing references)
//IL_0255: Unknown result type (might be due to invalid IL or missing references)
List<TextMeshProUGUI> list = new List<TextMeshProUGUI>();
Vector2[] array = (Vector2[])(object)new Vector2[24]
{
new Vector2(2f, 0f),
new Vector2(-2f, 0f),
new Vector2(0f, 2f),
new Vector2(0f, -2f),
new Vector2(1.5f, 1.5f),
new Vector2(-1.5f, 1.5f),
new Vector2(1.5f, -1.5f),
new Vector2(-1.5f, -1.5f),
new Vector2(4f, 0f),
new Vector2(-4f, 0f),
new Vector2(0f, 4f),
new Vector2(0f, -4f),
new Vector2(3f, 3f),
new Vector2(-3f, 3f),
new Vector2(3f, -3f),
new Vector2(-3f, -3f),
new Vector2(7f, 0f),
new Vector2(-7f, 0f),
new Vector2(0f, 7f),
new Vector2(0f, -7f),
new Vector2(5f, 5f),
new Vector2(-5f, 5f),
new Vector2(5f, -5f),
new Vector2(-5f, -5f)
};
for (int i = 0; i < array.Length; i++)
{
float alpha = ((i >= 8) ? ((i >= 16) ? 0.055f : 0.1f) : 0.18f);
list.Add(CreateGlowCopy(parent, source, array[i], alpha));
}
return list;
}
private static TextMeshProUGUI CreateGlowCopy(Transform parent, TextMeshProUGUI source, Vector2 offset, float alpha)
{
//IL_0005: 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_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_0030: 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_007b: Unknown result type (might be due to invalid IL or missing references)
//IL_0098: 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_00b6: Unknown result type (might be due to invalid IL or missing references)
//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
//IL_00da: 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_00e0: 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_00f6: Unknown result type (might be due to invalid IL or missing references)
GameObject val = new GameObject("BossIntroGlow");
val.transform.SetParent(parent, false);
val.transform.SetAsFirstSibling();
TextMeshProUGUI obj = val.AddComponent<TextMeshProUGUI>();
((Graphic)obj).raycastTarget = false;
((TMP_Text)obj).alignment = ((TMP_Text)source).alignment;
((TMP_Text)obj).enableWordWrapping = ((TMP_Text)source).enableWordWrapping;
((TMP_Text)obj).overflowMode = ((TMP_Text)source).overflowMode;
((TMP_Text)obj).font = ((TMP_Text)source).font;
((TMP_Text)obj).fontSize = ((TMP_Text)source).fontSize;
((Graphic)obj).color = new Color(1f, 1f, 1f, alpha);
((TMP_Text)obj).enableVertexGradient = false;
((TMP_Text)obj).outlineWidth = 0f;
((TMP_Text)obj).outlineColor = Color32.op_Implicit(Color.clear);
RectTransform rectTransform = ((TMP_Text)source).rectTransform;
RectTransform rectTransform2 = ((TMP_Text)obj).rectTransform;
rectTransform2.anchorMin = rectTransform.anchorMin;
rectTransform2.anchorMax = rectTransform.anchorMax;
rectTransform2.pivot = rectTransform.pivot;
rectTransform2.anchoredPosition = rectTransform.anchoredPosition + offset;
rectTransform2.sizeDelta = rectTransform.sizeDelta;
((Transform)rectTransform2).localScale = Vector3.one;
return obj;
}
}