Decompiled source of Ultra Despair Mod v1.0.0

UltraDespairMod.dll

Decompiled 6 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using Alexandria.ItemAPI;
using Alexandria.Misc;
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("Mod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Mod")]
[assembly: AssemblyCopyright("Copyright ©  2020")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("d6d7a494-722e-4763-959b-c2d6b6a42b01")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace UltraDespairMod;

internal class BlackFlag : PassiveItem
{
	public static void Init()
	{
		//IL_000e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0014: Expected O, but got Unknown
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: 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_005d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0062: Unknown result type (might be due to invalid IL or missing references)
		//IL_0064: Unknown result type (might be due to invalid IL or missing references)
		//IL_006e: Expected O, but got Unknown
		//IL_0070: Unknown result type (might be due to invalid IL or missing references)
		//IL_0075: Unknown result type (might be due to invalid IL or missing references)
		//IL_0080: 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_0087: Unknown result type (might be due to invalid IL or missing references)
		//IL_0089: Unknown result type (might be due to invalid IL or missing references)
		//IL_0093: Expected O, but got Unknown
		//IL_0095: Unknown result type (might be due to invalid IL or missing references)
		//IL_009a: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a5: 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_00ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_00af: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b9: Expected O, but got Unknown
		//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00de: Expected O, but got Unknown
		string text = "Black Flag";
		string text2 = "UltraDespairMod/Resources/blackflag.png";
		GameObject val = new GameObject(text);
		BlackFlag blackFlag = val.AddComponent<BlackFlag>();
		ItemBuilder.AddSpriteToObject(text, text2, val, (Assembly)null);
		string text3 = "I Am The OMEGA";
		string text4 = "All stats up. Don't you address me unless it's with four letters, I thought you'd known better.";
		ItemBuilder.SetupItem((PickupObject)(object)blackFlag, text3, text4, "despair");
		((PickupObject)blackFlag).quality = (ItemQuality)5;
		ItemBuilder.AddPassiveStatModifier((PickupObject)(object)blackFlag, new StatModifier
		{
			amount = 0.3f,
			modifyType = (ModifyMethod)0,
			statToBoost = (StatType)5
		});
		ItemBuilder.AddPassiveStatModifier((PickupObject)(object)blackFlag, new StatModifier
		{
			amount = 3f,
			modifyType = (ModifyMethod)0,
			statToBoost = (StatType)4
		});
		ItemBuilder.AddPassiveStatModifier((PickupObject)(object)blackFlag, new StatModifier
		{
			amount = 0.5f,
			modifyType = (ModifyMethod)1,
			statToBoost = (StatType)10
		});
		ItemBuilder.AddPassiveStatModifier((PickupObject)(object)blackFlag, new StatModifier
		{
			amount = 1.2f,
			modifyType = (ModifyMethod)1,
			statToBoost = (StatType)1
		});
	}
}
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("ultimatedespair.etg.ultradespairmod", "Ultra Despair Mod", "1.0.0")]
public class Module : BaseUnityPlugin
{
	public const string MOD_NAME = "Ultra Despair Mod";

	public const string VERSION = "1.0.0";

	public const string GUID = "ultimatedespair.etg.ultradespairmod";

	public void Start()
	{
		Debug.Log((object)"");
		ETGModMainBehaviour.WaitForGameManagerStart((Action<GameManager>)GMStart);
	}

	public void GMStart(GameManager g)
	{
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		try
		{
			MonokumasSpecialPoison.Init();
			BlackFlag.Init();
			new Harmony("ultimatedespair.etg.ultradespairmod").PatchAll();
			Log("Despair into tomorrow! Despair into your memories! Despair into nothingness!", "#442222");
		}
		catch (Exception ex)
		{
			Log(ex.ToString());
		}
	}

	public static void Log(string text, string color = "#FFFFFF")
	{
		ETGModConsole.Log((object)("<color=" + color + ">" + text + "</color>"), false);
	}
}
public class MonokumasSpecialPoison : PassiveItem
{
	public static void Init()
	{
		//IL_000e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0014: Expected O, but got Unknown
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		string text = "Poison Gas";
		string text2 = "UltraDespairMod/Resources/secretpoison.png";
		GameObject val = new GameObject(text);
		MonokumasSpecialPoison monokumasSpecialPoison = val.AddComponent<MonokumasSpecialPoison>();
		ItemBuilder.AddSpriteToObject(text, text2, val, (Assembly)null);
		string text3 = "Ultimate Weapon";
		string text4 = "Poisoned enemies spawn poison goop on death";
		ItemBuilder.SetupItem((PickupObject)(object)monokumasSpecialPoison, text3, text4, "despair");
		((PickupObject)monokumasSpecialPoison).quality = (ItemQuality)2;
	}

	public override void Pickup(PlayerController player)
	{
		((PassiveItem)this).Pickup(player);
		player.OnAnyEnemyReceivedDamage = (Action<float, bool, HealthHaver>)Delegate.Combine(player.OnAnyEnemyReceivedDamage, new Action<float, bool, HealthHaver>(Dead));
	}

	private void Dead(float arg1, bool arg2, HealthHaver arg3)
	{
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		if (arg2 && Object.op_Implicit((Object)(object)arg3) && Object.op_Implicit((Object)(object)((BraveBehaviour)arg3).specRigidbody) && Object.op_Implicit((Object)(object)((BraveBehaviour)arg3).aiActor) && ((GameActor)((BraveBehaviour)arg3).aiActor).GetEffect("poison") != null)
		{
			DeadlyDeadlyGoopManager.GetGoopManagerForGoopType(GoopUtility.PoisonDef).TimedAddGoopCircle(((BraveBehaviour)arg3).specRigidbody.UnitCenter, 8f, 1f, false);
		}
	}

	public override DebrisObject Drop(PlayerController player)
	{
		player.OnAnyEnemyReceivedDamage = (Action<float, bool, HealthHaver>)Delegate.Remove(player.OnAnyEnemyReceivedDamage, new Action<float, bool, HealthHaver>(Dead));
		return ((PassiveItem)this).Drop(player);
	}
}