Decompiled source of HealthMan v1.0.0

HealthMan/HealthMan.dll

Decompiled 2 weeks ago
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using Configgy;
using HarmonyLib;
using TMPro;
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("HealthMan")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("HealthMan")]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("54deaba8-b590-4d34-b3cb-6001c1dcb4eb")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace HealthMan;

[HarmonyPatch(typeof(EnemyIdentifier), "DeliverDamage")]
public class HarmoPatch_EnemyDanage
{
	private static void Postfix(EnemyIdentifier __instance, GameObject target, Vector3 force, Vector3 hitPoint, float multiplier, bool tryForExplode, float critMultiplier = 0f, GameObject sourceWeapon = null, bool ignoreTotalDamageTakenMultiplier = false, bool fromExplosion = false)
	{
		//IL_00b9: 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)
		if (__instance.dead)
		{
			return;
		}
		HealthMan_Actual.DamageThisSecond += multiplier;
		HealthMan_Actual.DPS_ToShow += multiplier;
		if (HealthMan_Actual.damageNumsEnabled)
		{
			float num = 0f;
			TextRenderParent lastDmgNum = HealthMan_Actual.lastDmgNum;
			if (HealthMan_Actual.sinceLastDamage > 0f && (Object)(object)lastDmgNum != (Object)null)
			{
				num = lastDmgNum.damageNum;
			}
			float num2 = multiplier + num;
			int num3 = Mathf.Floor(num2).ToString().Length + 3;
			string text = num2.ToString();
			if (text.Length - num3 > 0)
			{
				text.Remove(num3, text.Length - num3);
			}
			GameObject val = HealthMan_Actual.CreateTextRenderer(hitPoint, text, new Color((float)(HealthMan_Actual.dmgNumbersColorR / 100), (float)(HealthMan_Actual.dmgNumbersColorG / 100), (float)(HealthMan_Actual.dmgNumbersColorB / 100)), HealthMan_Actual.dmgNumbersSize, HealthMan_Actual.dmgNumbersRiseSpeed, HealthMan_Actual.dmgNumbersLife, num2);
			if (num > 0f)
			{
				lastDmgNum.DestroyMyText(bootleg: true);
			}
			HealthMan_Actual.lastDmgNum = val.GetComponent<TextRenderParent>();
			HealthMan_Actual.sinceLastDamage = 0.5f;
		}
	}
}
[HarmonyPatch(typeof(EnemyIdentifier), "Start")]
public class HarmoPatch_EnemySpawn
{
	private static void Postfix(EnemyIdentifier __instance)
	{
		if (HealthMan_Actual.healthBarsEnabled)
		{
			HealthMan_Actual.AddHealthBar(__instance);
		}
	}
}
[HarmonyPatch(typeof(Speedometer), "FixedUpdate")]
public class HarmoPatch_Speedometer
{
	private static void Postfix(Speedometer __instance)
	{
		//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_0102: Unknown result type (might be due to invalid IL or missing references)
		//IL_0107: Unknown result type (might be due to invalid IL or missing references)
		//IL_010c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0111: Unknown result type (might be due to invalid IL or missing references)
		//IL_019c: Unknown result type (might be due to invalid IL or missing references)
		if (!HealthMan_Actual.DPS_enabled)
		{
			return;
		}
		bool dPS_override = HealthMan_Actual.DPS_override;
		FieldInfo field = ((object)__instance).GetType().GetField("type", BindingFlags.Instance | BindingFlags.NonPublic);
		int num = (int)field.GetValue(__instance);
		string text = $"{HealthMan_Actual.DPS_ToShow:0.00}";
		Vector3 val;
		switch (num)
		{
		case 1:
		{
			val = MonoSingleton<PlayerTracker>.Instance.GetPlayerVelocity(true);
			float magnitude2 = ((Vector3)(ref val)).magnitude;
			string text2 = $"{magnitude2:0.00}";
			((TMP_Text)__instance.textMesh).fontSize = 15f;
			if (!dPS_override)
			{
				((TMP_Text)__instance.textMesh).text = "UpS: " + text2 + "; DpS: " + text;
			}
			else
			{
				((TMP_Text)__instance.textMesh).text = "DAMAGE: " + text;
			}
			break;
		}
		case 2:
		{
			val = Vector3.ProjectOnPlane(MonoSingleton<PlayerTracker>.Instance.GetPlayerVelocity(true), Vector3.up);
			float magnitude = ((Vector3)(ref val)).magnitude;
			string text2 = $"{magnitude:0.00}";
			((TMP_Text)__instance.textMesh).fontSize = 14f;
			if (!dPS_override)
			{
				((TMP_Text)__instance.textMesh).text = "HUpS: " + text2 + "; DpS: " + text;
			}
			else
			{
				((TMP_Text)__instance.textMesh).text = "DAMAGE: " + text;
			}
			break;
		}
		case 3:
		{
			float num2 = Mathf.Abs(MonoSingleton<PlayerTracker>.Instance.GetPlayerVelocity(true).y);
			string text2 = $"{num2:0.00}";
			((TMP_Text)__instance.textMesh).fontSize = 14f;
			if (!dPS_override)
			{
				((TMP_Text)__instance.textMesh).text = "VUpS: " + text2 + "; DpS: " + text;
			}
			else
			{
				((TMP_Text)__instance.textMesh).text = "DAMAGE: " + text;
			}
			break;
		}
		}
	}
}
public class HealthBarRenderer : MonoBehaviour
{
	public float maxVal;

	public List<GameObject> sliderClidren = new List<GameObject>();

	public Color[] colors = (Color[])(object)new Color[3];

	public Vector2 scales;

	public float sinceChange = 0f;

	public float lastValue;

	private void Start()
	{
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_001d: Expected O, but got Unknown
		//IL_002e: Unknown result type (might be due to invalid IL or missing references)
		lastValue = maxVal;
		for (int i = 0; i < 3; i++)
		{
			GameObject val = new GameObject("HealthManBarPart");
			val.transform.position = ((Component)this).gameObject.transform.position;
			HealthManSlider healthManSlider = val.AddComponent<HealthManSlider>();
			healthManSlider.thisSliderType = (HealthManSlider.SliderType)i;
			healthManSlider.thisSliderParent = ((Component)this).gameObject.GetComponent<HealthBarRenderer>();
			sliderClidren.Add(val);
			val.SetActive(true);
		}
	}

	private void Update()
	{
		EnemyIdentifier component = ((Component)this).gameObject.GetComponent<EnemyIdentifier>();
		float health = component.health;
		sinceChange = Mathf.Clamp(sinceChange - Time.deltaTime, 0f, 1f);
		if (sinceChange <= 0f)
		{
			lastValue = Mathf.Clamp(lastValue - maxVal / 2f * Time.deltaTime, health, maxVal);
		}
		if (!component.dead && !((Object)(object)component == (Object)null))
		{
			return;
		}
		foreach (GameObject item in sliderClidren)
		{
			if (((MonoBehaviour)item.GetComponent<HealthManSlider>()).IsInvoking("UpdateText"))
			{
				((MonoBehaviour)item.GetComponent<HealthManSlider>()).CancelInvoke("UpdateText");
			}
			Object.DestroyImmediate((Object)(object)item);
		}
		Object.DestroyImmediate((Object)(object)((Component)this).gameObject.GetComponent<HealthBarRenderer>());
	}
}
public class HealthManSlider : MonoBehaviour
{
	public enum SliderType
	{
		EmptyBar,
		ValueBar,
		ChangeBar
	}

	public SliderType thisSliderType;

	public HealthBarRenderer thisSliderParent;

	private float myEnemyHeight;

	private bool startedTexting = false;

	private void Start()
	{
		//IL_0068: 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)
		SpriteRenderer val = ((Component)this).gameObject.AddComponent<SpriteRenderer>();
		if (thisSliderType == SliderType.EmptyBar)
		{
			val.sprite = HealthMan_Actual.barSpr_back;
		}
		else
		{
			val.sprite = HealthMan_Actual.barSpr_fill;
		}
		if (thisSliderType == SliderType.ChangeBar)
		{
			val.color = thisSliderParent.colors[1];
		}
		else
		{
			val.color = thisSliderParent.colors[0];
		}
		((Renderer)val).enabled = true;
		myEnemyHeight = GetEnemyHeight(((Component)thisSliderParent).gameObject);
	}

	private void Update()
	{
		//IL_0077: 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_0099: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e2: 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_0125: Unknown result type (might be due to invalid IL or missing references)
		//IL_010b: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b7: 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_01c9: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)thisSliderParent == (Object)null)
		{
			Object.DestroyImmediate((Object)(object)((Component)this).gameObject);
			return;
		}
		SpriteRenderer component = ((Component)this).GetComponent<SpriteRenderer>();
		GameObject gameObject = ((Component)thisSliderParent).gameObject;
		EnemyIdentifier component2 = gameObject.GetComponent<EnemyIdentifier>();
		Vector3 val = default(Vector3);
		((Vector3)(ref val))..ctor(thisSliderParent.scales.x / 100f, thisSliderParent.scales.y / 50f, 1f);
		val *= 10f;
		if (thisSliderType == SliderType.EmptyBar)
		{
			((Component)this).transform.localScale = val;
			((Renderer)component).sortingOrder = 9;
		}
		else if (thisSliderType == SliderType.ValueBar)
		{
			val.x *= component2.health / thisSliderParent.maxVal;
			((Component)this).transform.localScale = val;
			((Renderer)component).sortingOrder = 11;
			if (component2.blessed)
			{
				component.color = thisSliderParent.colors[2];
			}
			else
			{
				component.color = thisSliderParent.colors[0];
			}
		}
		else if (thisSliderType == SliderType.ChangeBar)
		{
			val.x *= thisSliderParent.lastValue / thisSliderParent.maxVal;
			((Component)this).transform.localScale = val;
			((Renderer)component).sortingOrder = 10;
		}
		Renderer componentInChildren = gameObject.GetComponentInChildren<Renderer>();
		float num = 9f;
		if (myEnemyHeight > 0f)
		{
			num = myEnemyHeight;
		}
		((Component)this).transform.position = gameObject.transform.position + Vector3.up * (num + 2f);
		((Component)this).transform.LookAt(((Component)MonoSingleton<CameraController>.Instance).transform);
		if (!startedTexting && thisSliderType == SliderType.ValueBar)
		{
			if (HealthMan_Actual.Bars_DisplayName || HealthMan_Actual.Bars_DisplayHealth)
			{
				UpdateText();
			}
			startedTexting = true;
		}
	}

	private float GetEnemyHeight(GameObject obj)
	{
		//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_0022: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: Unknown result type (might be due to invalid IL or missing references)
		//IL_003b: 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)
		float num = 0f;
		Renderer[] components = obj.GetComponents<Renderer>();
		foreach (Renderer val in components)
		{
			Bounds bounds = val.bounds;
			if (((Bounds)(ref bounds)).size.y > num)
			{
				bounds = val.bounds;
				num = ((Bounds)(ref bounds)).size.y;
			}
		}
		return num * 0.5f;
	}

	private void UpdateText()
	{
		//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
		EnemyIdentifier component = ((Component)thisSliderParent).gameObject.GetComponent<EnemyIdentifier>();
		string text = "";
		if (HealthMan_Actual.Bars_DisplayName && HealthMan_Actual.Bars_DisplayHealth)
		{
			text = $"{component.FullName}: {Mathf.Ceil(component.health)}";
		}
		else if (HealthMan_Actual.Bars_DisplayName && !HealthMan_Actual.Bars_DisplayHealth)
		{
			text = component.FullName ?? "";
		}
		else if (!HealthMan_Actual.Bars_DisplayName && HealthMan_Actual.Bars_DisplayHealth)
		{
			text = $"{Mathf.Ceil(component.health)}";
		}
		TextRenderParent[] array = Object.FindObjectsOfType<TextRenderParent>();
		foreach (TextRenderParent textRenderParent in array)
		{
			if ((Object)(object)textRenderParent.followTransform == (Object)(object)((Component)this).transform)
			{
				textRenderParent.DestroyMyText(bootleg: true);
			}
		}
		GameObject val = HealthMan_Actual.CreateTextRenderer(((Component)this).transform.position, text, Color.white, 2f, 0f, 1.1f);
		val.GetComponent<TextRenderParent>().followTransform = ((Component)this).transform;
		((MonoBehaviour)this).Invoke("UpdateText", 1f);
	}
}
[BepInPlugin("com.exmagikguy.healthBarAddon", "HealthMan", "1.0.0")]
public class HealthMan_Actual : BaseUnityPlugin
{
	private string modPath = Path.Combine(Paths.PluginPath, "HealthMan");

	private string fontPath = Path.Combine(Paths.PluginPath, "HealthMan", "font");

	public static Dictionary<string, Sprite> fontDict = new Dictionary<string, Sprite>();

	public static Sprite barSpr_fill;

	public static Sprite barSpr_back;

	public static TextRenderParent lastDmgNum;

	public static float sinceLastDamage = 0f;

	[Configgable("Damage Numbers", "Numbers Rise Speed", 0, "The speed (units per second) at which the damage numbers will go up.")]
	[Range(0f, 5f)]
	public static float dmgNumbersRiseSpeed = 1f;

	[Configgable("Damage Numbers", "Numbers Lifetime", 1, "The time (seconds) after which the damage numbers will dissapear.")]
	[Range(0.1f, 5f)]
	public static float dmgNumbersLife = 1f;

	[Configgable("Damage Numbers", "Numbers Size", 2, "The size of the damage numbers.")]
	[Range(0.1f, 5f)]
	public static float dmgNumbersSize = 2f;

	[Configgable("Damage Numbers/Color", "R", 0, "Amount of Red in the damage numbers color.")]
	[Range(0f, 100f)]
	public static int dmgNumbersColorR = 100;

	[Configgable("Damage Numbers/Color", "G", 1, "Amount of Green in the damage numbers color.")]
	[Range(0f, 100f)]
	public static int dmgNumbersColorG = 50;

	[Configgable("Damage Numbers/Color", "B", 2, "Amount of Blue in the damage numbers color.")]
	[Range(0f, 100f)]
	public static int dmgNumbersColorB = 0;

	[Configgable("Health Bars/Colors/Normal", "R", 0, null)]
	[Range(0f, 100f)]
	public static int healthBarColorR = 100;

	[Configgable("Health Bars/Colors/Normal", "G", 1, null)]
	[Range(0f, 100f)]
	public static int healthBarColorG = 0;

	[Configgable("Health Bars/Colors/Normal", "B", 2, null)]
	[Range(0f, 100f)]
	public static int healthBarColorB = 0;

	[Configgable("Health Bars/Colors/Change", "R", 0, null)]
	[Range(0f, 100f)]
	public static int changeBarColorR = 100;

	[Configgable("Health Bars/Colors/Change", "G", 1, null)]
	[Range(0f, 100f)]
	public static int changeBarColorG = 100;

	[Configgable("Health Bars/Colors/Change", "B", 2, null)]
	[Range(0f, 100f)]
	public static int changeBarColorB = 0;

	[Configgable("Health Bars/Colors/Idoled", "R", 0, null)]
	[Range(0f, 100f)]
	public static int idolBarColorR = 0;

	[Configgable("Health Bars/Colors/Idoled", "G", 1, null)]
	[Range(0f, 100f)]
	public static int idolBarColorG = 100;

	[Configgable("Health Bars/Colors/Idoled", "B", 2, null)]
	[Range(0f, 100f)]
	public static int idolBarColorB = 100;

	[Configgable("Health Bars/Sizes", "Width", 0, "The width of the bar.")]
	[Range(10f, 300f)]
	public static int barScaleX = 100;

	[Configgable("Health Bars/Sizes", "Height", 1, "The height of the bar.")]
	[Range(10f, 300f)]
	public static int barScaleY = 18;

	[Configgable("Health Bars", "Transparecy", 0, null)]
	[Range(0f, 99f)]
	public static int healthBarAlpha = 50;

	[Configgable("", "Enable Health Bars", 0, null)]
	public static bool healthBarsEnabled = true;

	[Configgable("", "Enable Damage Numbers", 1, null)]
	public static bool damageNumsEnabled = true;

	[Configgable("Health Bars/Enemy Info", "Show Enemy Health", 0, null)]
	public static bool Bars_DisplayHealth = false;

	[Configgable("Health Bars/Enemy Info", "Show Enemy Name", 1, null)]
	public static bool Bars_DisplayName = false;

	[Configgable("DPS Counter", "Enabled (READ INFO)", 0, "DPS Counter is an addition to speedometer, so, don't forget to enable speedometer before enabling DPS Counter.")]
	public static bool DPS_enabled = false;

	[Configgable("DPS Counter", "Override Speedometer", 1, "If you didn't want speedometer with the DPS Counter, you can enable this.")]
	public static bool DPS_override = false;

	public static float DPS_ToShow = 0f;

	public static float DamageThisSecond = 0f;

	public static float SavedDPS = 0f;

	public static ConfigBuilder ConfigMenu;

	private Harmony harmony;

	private void Awake()
	{
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0015: Expected O, but got Unknown
		//IL_0030: Unknown result type (might be due to invalid IL or missing references)
		//IL_003a: Expected O, but got Unknown
		ConfigMenu = new ConfigBuilder("ultrakill.exmagikguy.healthBarAddon", "HealthMan");
		ConfigMenu.BuildType(typeof(HealthMan_Actual));
		harmony = new Harmony("ultrakill.exmagikguy.healthBarAddon");
		harmony.PatchAll();
	}

	private void Start()
	{
		((BaseUnityPlugin)this).Logger.LogInfo((object)"Health Bars Mod Loading...");
		string[] array = new string[26]
		{
			"a", "b", "c", "d", "e", "f", "g", "h", "i", "j",
			"k", "l", "m", "n", "o", "p", "q", "r", "s", "t",
			"u", "v", "w", "x", "y", "z"
		};
		string[] array2 = array;
		foreach (string text in array2)
		{
			fontDict.Add(text, LoadPNG(Path.Combine(fontPath, "lowercase", text.ToUpper() + ".png")));
			fontDict.Add(text.ToUpper(), LoadPNG(Path.Combine(fontPath, "capital", text.ToUpper() + ".png")));
		}
		string[] array3 = new string[28]
		{
			"!", "%", ",", "'", "-", ";", "~", "+", "0", "1",
			"2", "3", "4", "5", "6", "7", "8", "9", "Backslash", "Dot",
			"DoubleDot", "LBracket", "QMark", "Quote", "RBracket", "Slash", "Space", "Star"
		};
		string[] array4 = new string[28]
		{
			"!", "%", ",", "'", "-", ";", "~", "+", "0", "1",
			"2", "3", "4", "5", "6", "7", "8", "9", "\\", ".",
			":", "{", "?", "\"", "}", "/", " ", "*"
		};
		for (int j = 0; j < array3.Length; j++)
		{
			string text2 = array3[j];
			string key = array4[j];
			fontDict.Add(key, LoadPNG(Path.Combine(fontPath, "symbols", text2 + ".png")));
		}
		barSpr_fill = LoadPNG(Path.Combine(modPath, "graphics", "HealthPixel.png"));
		barSpr_back = LoadPNG(Path.Combine(modPath, "graphics", "DamagePixel.png"));
		if ((Object)(object)barSpr_back == (Object)null)
		{
			((BaseUnityPlugin)this).Logger.LogWarning((object)"WARNING! BAR SPRITES ARE NULL!");
		}
		UpdateDPS();
		((BaseUnityPlugin)this).Logger.LogInfo((object)"Health Bars Mod Loaded!");
	}

	private void Update()
	{
		sinceLastDamage = Mathf.Clamp(sinceLastDamage - Time.deltaTime, 0f, 0.5f);
		DPS_ToShow = Mathf.Clamp(DPS_ToShow - SavedDPS * Time.deltaTime, 0f, float.PositiveInfinity);
	}

	private Sprite LoadPNG(string path)
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Expected O, but got Unknown
		//IL_002f: 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)
		Texture2D val = new Texture2D(2, 2);
		ImageConversion.LoadImage(val, File.ReadAllBytes(path));
		return Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f), 250f);
	}

	public static GameObject CreateTextRenderer(Vector3 position, string text, Color color, float scale = 2f, float risingSpeed = 1f, float lifespan = 1f, float damageNum = 0f)
	{
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0015: Expected O, but got Unknown
		//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)
		//IL_002e: 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_0057: 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_00d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d7: Expected O, but got Unknown
		//IL_00de: Unknown result type (might be due to invalid IL or missing references)
		//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f0: 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_0108: Unknown result type (might be due to invalid IL or missing references)
		//IL_0128: Unknown result type (might be due to invalid IL or missing references)
		scale *= 2f;
		GameObject val = new GameObject("HeathManText");
		val.transform.position = position;
		val.transform.localScale = Vector3.one * scale;
		TextRenderParent textRenderParent = val.AddComponent<TextRenderParent>();
		textRenderParent.riseSpeed = risingSpeed;
		textRenderParent.lifeTime = lifespan;
		textRenderParent.longScale = Vector3.one * scale;
		textRenderParent.damageNum = damageNum;
		char[] array = text.ToCharArray();
		float num = 0.06f * scale;
		float num2 = num * (float)text.Length;
		List<GameObject> list = new List<GameObject>();
		for (int num3 = array.Length - 1; num3 >= 0; num3--)
		{
			int num4 = array.Length - 1 - num3;
			float num5 = 0f - num2 / 2f + num * (float)num4;
			Sprite sprite = fontDict[array[num3].ToString()];
			GameObject val2 = new GameObject("HealthManSymbol");
			val2.transform.position = position + new Vector3(num5, 0f, 0f);
			val2.transform.localScale = Vector3.one * scale;
			SpriteRenderer val3 = val2.AddComponent<SpriteRenderer>();
			val3.sprite = sprite;
			val3.color = color;
			((Renderer)val3).sortingOrder = 12;
			list.Add(val2);
		}
		textRenderParent.symbolObjects = list;
		return val;
	}

	public static void AddHealthBar(EnemyIdentifier enemy)
	{
		//IL_0053: 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_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_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)
		HealthBarRenderer healthBarRenderer = ((Component)enemy).gameObject.AddComponent<HealthBarRenderer>();
		healthBarRenderer.maxVal = enemy.health;
		healthBarRenderer.colors[0] = new Color((float)(healthBarColorR / 100), (float)(healthBarColorG / 100), (float)(healthBarColorB / 100), (1f - (float)healthBarAlpha / 100f) / 3f);
		healthBarRenderer.colors[1] = new Color((float)(changeBarColorR / 100), (float)(changeBarColorG / 100), (float)(changeBarColorB / 100), (1f - (float)healthBarAlpha / 100f) / 3f);
		healthBarRenderer.colors[2] = new Color((float)(idolBarColorR / 100), (float)(idolBarColorG / 100), (float)(idolBarColorB / 100), (1f - (float)healthBarAlpha / 100f) / 3f);
		healthBarRenderer.scales.x = barScaleX;
		healthBarRenderer.scales.y = barScaleY;
	}

	private void UpdateDPS()
	{
		DPS_ToShow = DamageThisSecond;
		SavedDPS = DamageThisSecond;
		DamageThisSecond = 0f;
		((MonoBehaviour)this).Invoke("UpdateDPS", 1f);
	}
}
public class TextRenderParent : MonoBehaviour
{
	public List<GameObject> symbolObjects = new List<GameObject>();

	public float riseSpeed;

	public float lifeTime;

	public Vector3 longScale;

	public float damageNum;

	public Transform followTransform = null;

	private void Update()
	{
		//IL_0087: 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_00a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d0: 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_00e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ef: 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)
		lifeTime -= Time.deltaTime;
		foreach (GameObject symbolObject in symbolObjects)
		{
			symbolObject.transform.SetParent(((Component)this).gameObject.transform);
		}
		CameraController instance = MonoSingleton<CameraController>.Instance;
		if ((Object)(object)instance != (Object)null)
		{
			((Component)this).transform.LookAt(((Component)instance).transform);
		}
		Transform transform = ((Component)this).transform;
		transform.position += new Vector3(0f, riseSpeed * Time.deltaTime, 0f);
		if (lifeTime <= 0f)
		{
			Transform transform2 = ((Component)this).transform;
			transform2.localScale -= longScale * 6f * Time.deltaTime;
		}
		else if ((Object)(object)followTransform != (Object)null)
		{
			((Component)this).transform.position = followTransform.position;
		}
		if (!(lifeTime <= -1f / 6f))
		{
			return;
		}
		foreach (GameObject symbolObject2 in symbolObjects)
		{
			Object.DestroyImmediate((Object)(object)symbolObject2);
		}
		Object.DestroyImmediate((Object)(object)((Component)this).gameObject);
	}

	public void DestroyMyText(bool bootleg = false)
	{
		//IL_005b: Unknown result type (might be due to invalid IL or missing references)
		//IL_006f: 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)
		if (!bootleg)
		{
			foreach (GameObject symbolObject in symbolObjects)
			{
				Object.DestroyImmediate((Object)(object)symbolObject);
			}
			Object.DestroyImmediate((Object)(object)((Component)this).gameObject);
		}
		else
		{
			Transform transform = ((Component)this).transform;
			transform.position -= new Vector3(0f, 100f, 0f);
			lifeTime = -0.1f;
		}
	}
}