Decompiled source of phantheon of silksong v1.0.0

s.dll

Decompiled 4 days ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using UnityEngine;
using UnityEngine.SceneManagement;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("s")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("s")]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("5f4c4378-aceb-4385-8b2a-cedd224fa28c")]
[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")]
namespace SilksongBossRush;

[BepInPlugin("com.silksong.bossrush", "Act 1 Boss Rush", "2.2.0")]
public class all3ActBossRushPlugin : BaseUnityPlugin
{
	private class BossData
	{
		public string Name;

		public string SceneName;

		public string GateName;

		public string PlayerDataFlag;

		public string[] AdditionalFlags;

		public Vector3? CustomPosition;

		public BossData(string name, string scene, string gate, string flag, params string[] additionalFlags)
		{
			Name = name;
			SceneName = scene;
			GateName = gate;
			PlayerDataFlag = flag;
			AdditionalFlags = additionalFlags;
			CustomPosition = null;
		}

		public BossData(string name, string scene, Vector3 pos, string flag, params string[] additionalFlags)
		{
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			Name = name;
			SceneName = scene;
			GateName = null;
			PlayerDataFlag = flag;
			AdditionalFlags = additionalFlags;
			CustomPosition = pos;
		}
	}

	[CompilerGenerated]
	private sealed class <ResetTransitionFlag>d__30 : IEnumerator<object>, IDisposable, IEnumerator
	{
		private int <>1__state;

		private object <>2__current;

		public float delay;

		public all3ActBossRushPlugin <>4__this;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <ResetTransitionFlag>d__30(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Expected O, but got Unknown
			int num = <>1__state;
			all3ActBossRushPlugin all3ActBossRushPlugin2 = <>4__this;
			switch (num)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				<>2__current = (object)new WaitForSeconds(delay);
				<>1__state = 1;
				return true;
			case 1:
				<>1__state = -1;
				all3ActBossRushPlugin2.isTransitioning = false;
				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();
		}
	}

	[CompilerGenerated]
	private sealed class <TeleportWithPosition>d__29 : IEnumerator<object>, IDisposable, IEnumerator
	{
		private int <>1__state;

		private object <>2__current;

		public BossData boss;

		public all3ActBossRushPlugin <>4__this;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <TeleportWithPosition>d__29(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: 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_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Expected O, but got Unknown
			//IL_0049: 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)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: 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_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Expected O, but got Unknown
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Expected O, but got Unknown
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Expected O, but got Unknown
			//IL_012d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Expected O, but got Unknown
			//IL_017b: Unknown result type (might be due to invalid IL or missing references)
			//IL_019b: Unknown result type (might be due to invalid IL or missing references)
			int num = <>1__state;
			all3ActBossRushPlugin all3ActBossRushPlugin2 = <>4__this;
			Scene activeScene;
			switch (num)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				if (boss.Name == "Cog Dancers")
				{
					GameManager.instance.BeginSceneTransition(new SceneLoadInfo
					{
						SceneName = boss.SceneName,
						EntryGateName = "left1",
						PreventCameraFadeOut = false,
						WaitForSceneTransitionCameraFade = true,
						Visualization = (SceneLoadVisualizations)0
					});
				}
				else
				{
					GameManager.instance.BeginSceneTransition(new SceneLoadInfo
					{
						SceneName = boss.SceneName,
						EntryGateName = "top1",
						PreventCameraFadeOut = false,
						WaitForSceneTransitionCameraFade = true,
						Visualization = (SceneLoadVisualizations)0
					});
				}
				<>2__current = (object)new WaitForSeconds(0.5f);
				<>1__state = 1;
				return true;
			case 1:
				<>1__state = -1;
				goto IL_0108;
			case 2:
				<>1__state = -1;
				goto IL_0108;
			case 3:
				{
					<>1__state = -1;
					if ((Object)(object)HeroController.instance != (Object)null && boss.CustomPosition.HasValue)
					{
						((Component)HeroController.instance).transform.position = boss.CustomPosition.Value;
						all3ActBossRushPlugin2.log.LogInfo((object)$"Moved hero to {boss.CustomPosition.Value}");
					}
					all3ActBossRushPlugin2.isTransitioning = false;
					return false;
				}
				IL_0108:
				activeScene = SceneManager.GetActiveScene();
				if (((Scene)(ref activeScene)).name != boss.SceneName)
				{
					<>2__current = (object)new WaitForSeconds(0.1f);
					<>1__state = 2;
					return true;
				}
				<>2__current = (object)new WaitForSeconds(0.3f);
				<>1__state = 3;
				return true;
			}
		}

		bool IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			throw new NotSupportedException();
		}
	}

	[CompilerGenerated]
	private sealed class <UnlockAllCoroutine>d__34 : IEnumerator<object>, IDisposable, IEnumerator
	{
		private int <>1__state;

		private object <>2__current;

		public all3ActBossRushPlugin <>4__this;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <UnlockAllCoroutine>d__34(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Expected O, but got Unknown
			int num = <>1__state;
			all3ActBossRushPlugin all3ActBossRushPlugin2 = <>4__this;
			switch (num)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				<>2__current = (object)new WaitUntil((Func<bool>)(() => PlayerData.instance != null && ToolItemManager.GetAllTools() != null));
				<>1__state = 1;
				return true;
			case 1:
			{
				<>1__state = -1;
				int num2 = 0;
				foreach (ToolItem allTool in ToolItemManager.GetAllTools())
				{
					if (!((Object)(object)allTool == (Object)null) && !allTool.IsUnlocked)
					{
						allTool.Unlock((Action)null, (PopupFlags)0);
						num2++;
					}
				}
				all3ActBossRushPlugin2.log.LogInfo((object)$"Unlocked {num2} tools!");
				all3ActBossRushPlugin2.gotalltools = true;
				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();
		}
	}

	public bool gotalltools;

	private ManualLogSource log;

	private bool isTransitioning;

	private bool fought;

	private bool act1done;

	private bool act2done;

	private bool act3done;

	public int a;

	public bool temp1 = true;

	public bool temp2 = true;

	public bool temp3 = true;

	public bool bench0 = true;

	public bool bench1 = true;

	public bool bench2 = true;

	public bool bench3 = true;

	public bool bench4 = true;

	public bool bench5 = true;

	public bool bench6 = true;

	public GameObject popupPrefab;

	private List<BossData> act1Bosses = new List<BossData>
	{
		new BossData("Moss Mother", "Tut_03", "right1", "defeatedMossMother"),
		new BossData("Bell Beast", "Bone_05", new Vector3(83.40305f, 3.567686f, 0.004f), "defeatedBellBeast"),
		new BossData("Lace", "Bone_East_12", new Vector3(92.13885f, 7.567686f, 0.004f), "defeatedLace1", "laceLeftDocks"),
		new BossData("Fourth Chorus", "Bone_East_08", new Vector3(82.46f, 12.26745f, 0.004f), "defeatedFourthChorus"),
		new BossData("Savage Beastfly", "Ant_19", new Vector3(50.61314f, 34.56768f, 0.004f), "defeatedSavageBeastfly"),
		new BossData("Sister Splinter", "Shellwood_18", new Vector3(55.44654f, 8.567684f, 0.004f), "defeatedSplinterQueen"),
		new BossData("Skull Tyrant", "Bone_15", new Vector3(74.93963f, 14.56769f, 0.004f), "skullKingDefeated"),
		new BossData("moorwing", "Greymoor_08", new Vector3(37.91465f, 4.567685f, 0.004f), ""),
		new BossData("Widow", "Belltown_Shrine", new Vector3(51.51193f, 8.567684f, 0.004f), "hasNeedolin"),
		new BossData("MossEvolver", "Weave_03", new Vector3(32.89833f, 20.56768f, 0.004f), "defeatedMossEvolver"),
		new BossData("Great Conchflies", "Coral_11", new Vector3(54.95525f, 14.56769f, 0.004f), "defeatedCoralDrillers"),
		new BossData("Phantom", "Organ_01", new Vector3(83.79173f, 104.5677f, 0.004f), "defeatedPhantom"),
		new BossData("Last Judge", "Coral_Judge_Arena", new Vector3(45.96228f, 24.56768f, 0.004f), "defeatedLastJudge")
	};

	private List<BossData> act2Bosses = new List<BossData>
	{
		new BossData("Cog Dancers", "Cog_Dancers", new Vector3(40f, 4.59697f, 0.004f), "defeatedCogworkDancers"),
		new BossData("Trobbio", "Library_13", new Vector3(74.04997f, 14.56769f, 0.004f), "defeatedTrobbio"),
		new BossData("Garmond and Zaza", "Library_09", new Vector3(77.44103f, 15.56768f, 0.004f), "garmondLibraryDefeatedHornet"),
		new BossData("Forebrothers Signis and Gron", "Dock_09", new Vector3(34.44567f, 7.567685f, 0.004f), "defeatedDockForemen"),
		new BossData("Disgraced Chef Lugoli", "Dust_Chef", new Vector3(44.87098f, 35.58335f, 0.004f), "defeatedRoachkeeperChef"),
		new BossData("Father Of The Flame", "Belltown_08", new Vector3(56.90835f, 11.56769f, 0.004f), "defeatedWispPyreEffigy"),
		new BossData("Groal The Great", "Shadow_18", new Vector3(65.7369f, 11.44238f, 0.004f), "DefeatedSwampShaman"),
		new BossData("Voltvyrm", "Coral_29", new Vector3(170.0934f, 24.56778f, 0.004f), "defeatedZapCoreEnemy"),
		new BossData("Raging Conchfly", "Coral_27", new Vector3(20.88691f, 33.56768f, 0.004f), "defeatedCoralDrillerSolo"),
		new BossData("First Sinner", "Slab_10b", new Vector3(43.05967f, 9.567684f, 0.004f), "defeatedFirstWeaver"),
		new BossData("Broodmother", "Slab_16b", new Vector3(60.44946f, 5.567685f, 0.004f), "idk"),
		new BossData("Second Sentinel", "Hang_17b", new Vector3(41.44738f, 4.567685f, 0.004f), "defeatedSongChevalierBoss"),
		new BossData("Lace2", "Song_Tower_01", new Vector3(50.84962f, 100.5677f, 0.004f), "defeatedLaceTower"),
		new BossData("Grand Mother Silk", "Cradle_03", new Vector3(48.20269f, 133.5677f, 0.004f), "idk"),
		new BossData("craw father", "Room_CrowCourt_02", new Vector3(34.70296f, 21.56768f, 0.004f), "PickedUpCrowMemento")
	};

	private List<BossData> act3Bosses = new List<BossData>
	{
		new BossData("clover dancers", "Clover_10", new Vector3(83.90851f, 37.56768f, 0.004f), "defeatedCloverDancers"),
		new BossData("seth", "Shellwood_22", new Vector3(114.3001f, 6.567686f, 0.004f), "defeatedSeth"),
		new BossData("nyleth", "Shellwood_11b_Memory", new Vector3(14.74757f, 109.5577f, 0.004f), "CollectedHeartFlower"),
		new BossData("karmelita", "Memory_Ant_Queen", new Vector3(149.1029f, 19.56768f, 0.004f), "CollectedHeartHunter"),
		new BossData("Crust King Khann", "Memory_Coral_Tower", "door_wakeInMemory", "CollectedHeartCoral"),
		new BossData("lost lace", "Abyss_Cocoon", "door_entry", ""),
		new BossData("Pinstress", "Peak_07", new Vector3(32.55001f, 88.56767f, 0.004f), "idk"),
		new BossData("Gurr The Outcast", "Bone_East_18b", new Vector3(183.0475f, 6.327685f, 0.004f), "defeatedAntTrapper")
	};

	private void Awake()
	{
		log = ((BaseUnityPlugin)this).Logger;
		log.LogInfo((object)"========================================");
		log.LogInfo((object)"ACT 1 BOSS RUSH MOD LOADED!");
		log.LogInfo((object)"========================================");
		log.LogInfo((object)"Press 1: Move to next boss");
		log.LogInfo((object)"Press 2: To tp to bench");
	}

	private void Start()
	{
	}

	private void Update()
	{
		if (PlayerData.instance != null && (Input.GetKeyDown((KeyCode)49) || Input.GetKeyDown((KeyCode)338)) && !isTransitioning)
		{
			if (!act1done)
			{
				movebossact1();
			}
			else if (!act2done)
			{
				movebossact2();
			}
			else if (!act3done)
			{
				movebossact3();
			}
			else
			{
				log.LogInfo((object)"u finished the phantheon gg");
			}
		}
	}

	private void getcords()
	{
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		Vector3 position = ((Component)HeroController.instance).transform.position;
		log.LogInfo((object)(position.x + " " + position.y + " " + position.z));
	}

	private void ShowSceneInfo()
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		Scene activeScene = SceneManager.GetActiveScene();
		string name = ((Scene)(ref activeScene)).name;
		log.LogInfo((object)("Current Scene: " + name));
		TransitionPoint[] array = Object.FindObjectsOfType<TransitionPoint>();
		foreach (TransitionPoint val in array)
		{
			log.LogInfo((object)("Gate: " + ((Object)val).name));
		}
	}

	private void TeleportToBossSmart(BossData boss)
	{
		//IL_00cf: 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_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_00f3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fa: 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_0106: Expected O, but got Unknown
		if (boss == null || isTransitioning)
		{
			log.LogError((object)"BossData is null or already transitioning!");
			return;
		}
		if ((Object)(object)GameManager.instance == (Object)null || PlayerData.instance == null)
		{
			log.LogError((object)"GameManager or PlayerData missing!");
			return;
		}
		isTransitioning = true;
		_ = PlayerData.instance;
		if (boss.CustomPosition.HasValue)
		{
			log.LogInfo((object)("Teleporting to " + boss.Name + " using GameManager with position..."));
			((MonoBehaviour)this).StartCoroutine(TeleportWithPosition(boss));
			return;
		}
		log.LogInfo((object)("Teleporting to " + boss.Name + " via gate " + boss.GateName + "..."));
		GameManager.instance.BeginSceneTransition(new SceneLoadInfo
		{
			SceneName = boss.SceneName,
			EntryGateName = boss.GateName,
			PreventCameraFadeOut = false,
			WaitForSceneTransitionCameraFade = true,
			Visualization = (SceneLoadVisualizations)0
		});
		((MonoBehaviour)this).StartCoroutine(ResetTransitionFlag(1f));
	}

	[IteratorStateMachine(typeof(<TeleportWithPosition>d__29))]
	private IEnumerator TeleportWithPosition(BossData boss)
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <TeleportWithPosition>d__29(0)
		{
			<>4__this = this,
			boss = boss
		};
	}

	[IteratorStateMachine(typeof(<ResetTransitionFlag>d__30))]
	private IEnumerator ResetTransitionFlag(float delay)
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <ResetTransitionFlag>d__30(0)
		{
			<>4__this = this,
			delay = delay
		};
	}

	private void movebossact1()
	{
		PlayerData instance = PlayerData.instance;
		if (instance == null)
		{
			log.LogWarning((object)"PlayerData missing!");
		}
		else if (!instance.defeatedMossMother)
		{
			((MonoBehaviour)this).StartCoroutine(UnlockAllCoroutine());
			TeleportToBossSmart(act1Bosses[0]);
			log.LogInfo((object)"Going to Moss Mother");
		}
		else if (bench0)
		{
			bench0 = false;
			bench();
		}
		else if (!instance.defeatedBellBeast)
		{
			TeleportToBossSmart(act1Bosses[1]);
			log.LogInfo((object)"Going to Bell Beast");
			instance.hasSilkSpecial = true;
			instance.hasNeedleThrow = true;
			UnlockStations();
		}
		else if (!instance.defeatedLace1)
		{
			TeleportToBossSmart(act1Bosses[2]);
			log.LogInfo((object)"Going to Lace");
			instance.hasDash = true;
		}
		else if (!instance.defeatedSongGolem)
		{
			if (temp1)
			{
				instance.AddToMaxHealth(1);
				log.LogInfo((object)("hp added now player is " + instance.maxHealth + "hp"));
				temp1 = false;
			}
			TeleportToBossSmart(act1Bosses[3]);
			log.LogInfo((object)"Going to Fourth Chorus");
			instance.hasBrolly = true;
		}
		else if (bench1)
		{
			bench1 = false;
			unlockcrest(7);
			unlockcrest(6);
			bench();
		}
		else if (!instance.completedMemory_beast)
		{
			TeleportToBossSmart(act1Bosses[4]);
			log.LogInfo((object)"Going to Savage Beastfly");
			if (temp2)
			{
				instance.AddToMaxHealth(1);
				temp2 = false;
			}
			instance.nailUpgrades = 2;
		}
		else if (!instance.defeatedSplinterQueen)
		{
			TeleportToBossSmart(act1Bosses[5]);
			log.LogInfo((object)"Going to Sister Splinter");
			instance.completedMemory_beast = true;
		}
		else if (!instance.skullKingDefeated)
		{
			instance.hasWalljump = true;
			TeleportToBossSmart(act1Bosses[6]);
			log.LogInfo((object)"Going to Skull tyrant");
		}
		else if (!instance.visitedBellhart)
		{
			TeleportToBossSmart(act1Bosses[7]);
			log.LogInfo((object)"Going to moorwing");
		}
		else if (!instance.hasNeedolin)
		{
			TeleportToBossSmart(act1Bosses[8]);
			log.LogInfo((object)"Going to Widow");
		}
		else if (bench2)
		{
			bench2 = false;
			unlockcrest(8);
			bench();
		}
		else if (!instance.defeatedCoralDrillers)
		{
			TeleportToBossSmart(act1Bosses[10]);
			log.LogInfo((object)"Going to Great Conchflies");
		}
		else if (!instance.defeatedPhantom)
		{
			instance.hasChargeSlash = true;
			TeleportToBossSmart(act1Bosses[11]);
			log.LogInfo((object)"Going to Great Conchflies");
		}
		else if (!instance.defeatedLastJudge)
		{
			TeleportToBossSmart(act1Bosses[12]);
			log.LogInfo((object)"Going to Last Judge");
			instance.bellShrineBellhart = true;
			instance.bellShrineBoneForest = true;
			instance.bellShrineEnclave = true;
			instance.bellShrineGreymoor = true;
			instance.bellShrineShellwood = true;
			instance.bellShrineWilds = true;
			instance.aspid_04_gate = true;
			instance.gatePilgrimNoNeedolinConvo = true;
			instance.slab_cloak_gate_reopened = true;
			instance.slab_05_gateOpen = true;
			instance.slab_07_gateOpen = true;
			instance.SeenLastJudgeGateOpen = true;
			instance.cog7_gateOpened = true;
			instance.greatBoneGateOpened = true;
			instance.openedDust05Gate = true;
			instance.visitedGrandGate = true;
		}
		else
		{
			if (temp3)
			{
				instance.AddToMaxHealth(1);
				log.LogInfo((object)("hp added now player is " + instance.maxHealth + "hp"));
			}
			log.LogInfo((object)"========================================");
			log.LogInfo((object)"ALL ACT 1 BOSSES DEFEATED!");
			log.LogInfo((object)"========================================");
			log.LogInfo((object)"========================================");
			log.LogInfo((object)"ACT 2 BOSS RUSH STARTED!");
			log.LogInfo((object)"========================================");
			act1done = true;
		}
	}

	private void movebossact2()
	{
		//IL_030d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0313: Invalid comparison between Unknown and I4
		PlayerData.instance.act2Started = true;
		PlayerData.instance.cog7_automatonRepairingComplete = true;
		PlayerData instance = PlayerData.instance;
		if (instance == null)
		{
			log.LogWarning((object)"PlayerData missing!");
			return;
		}
		instance.completedMemory_reaper = true;
		instance.completedMemory_shaman = true;
		instance.completedMemory_toolmaster = true;
		instance.completedMemory_wanderer = true;
		instance.completedMemory_witch = true;
		if (!instance.defeatedCogworkDancers)
		{
			instance.AddToMaxHealth(1);
			log.LogInfo((object)("hp added now player is " + instance.maxHealth + "hp"));
			TeleportToBossSmart(act2Bosses[0]);
			log.LogInfo((object)"Going to gogwork dancers");
			instance.nailUpgrades = 3;
			log.LogInfo((object)"nail in last upgrade");
			instance.silkMax = 12;
		}
		else if (bench3)
		{
			bench3 = false;
			bench();
		}
		else if (!instance.defeatedTrobbio)
		{
			TeleportToBossSmart(act2Bosses[1]);
			log.LogInfo((object)"Going to Trobbio");
			instance.hasDoubleJump = true;
			instance.hasHarpoonDash = true;
		}
		else if (!instance.defeatedDockForemen)
		{
			TeleportToBossSmart(act2Bosses[3]);
			log.LogInfo((object)"Going to Forebrothers Signis and Gron");
		}
		else if (!instance.defeatedRoachkeeperChef)
		{
			TeleportToBossSmart(act2Bosses[4]);
			log.LogInfo((object)"Going to Disgraced Chef Lugoli");
		}
		else if (!instance.defeatedWispPyreEffigy)
		{
			TeleportToBossSmart(act2Bosses[5]);
			log.LogInfo((object)"Going to Father Of The Flame");
		}
		else if (!instance.DefeatedSwampShaman)
		{
			TeleportToBossSmart(act2Bosses[6]);
			log.LogInfo((object)"Going to Groal The Great");
		}
		else if (!instance.defeatedZapCoreEnemy)
		{
			TeleportToBossSmart(act2Bosses[7]);
			log.LogInfo((object)"Going to Voltvyrm");
		}
		else if (!instance.defeatedCoralDrillerSolo)
		{
			TeleportToBossSmart(act2Bosses[8]);
			log.LogInfo((object)"Going to Raging Conchfly");
		}
		else if (!instance.hasSilkBomb)
		{
			TeleportToBossSmart(act2Bosses[9]);
			log.LogInfo((object)"Going to First Sinner");
		}
		else if (!instance.defeatedBroodMother)
		{
			TeleportToBossSmart(act2Bosses[10]);
			log.LogInfo((object)"Going to Broodmother");
		}
		else if (bench4)
		{
			bench4 = false;
			bench();
		}
		else if (!instance.PickedUpCrowMemento)
		{
			TeleportToBossSmart(act2Bosses[14]);
			log.LogInfo((object)"Going to Craw father");
		}
		else if (!instance.defeatedSongChevalierBoss)
		{
			TeleportToBossSmart(act2Bosses[11]);
			log.LogInfo((object)"Going to Second Sentinel");
		}
		else if (!instance.defeatedLaceTower)
		{
			TeleportToBossSmart(act2Bosses[12]);
			log.LogInfo((object)"Going to Lace 2");
		}
		else if ((int)instance.CompletedEndings != 4)
		{
			instance.hasNeedolinMemoryPowerup = true;
			instance.hasSuperJump = true;
			PlayerData.instance.soulSnareReady = true;
			TeleportToBossSmart(act2Bosses[13]);
			log.LogInfo((object)"Going to Grand Mother Silk");
		}
		else
		{
			log.LogInfo((object)"===================================");
			log.LogInfo((object)"ALL ACT 2 BOSSES DEFEATED!");
			log.LogInfo((object)"===================================");
			act2done = true;
		}
	}

	private void movebossact3()
	{
		try
		{
			PlayerData instance = PlayerData.instance;
			if (instance == null)
			{
				log.LogWarning((object)"PlayerData missing!");
			}
			else if (!instance.CollectedHeartClover)
			{
				TeleportToBossSmart(act3Bosses[0]);
				log.LogInfo((object)"Going to Clover dancerss");
				QuestManager.GetQuest("Pinstress Battle").BeginQuest((Action)null, true);
			}
			else if (bench5)
			{
				bench5 = false;
				unlockcrest(5);
				unlockcrest(9);
				bench();
			}
			else if (!QuestManager.GetQuest("Pinstress Battle").IsCompleted)
			{
				TeleportToBossSmart(act3Bosses[6]);
				log.LogInfo((object)"going to pinstress");
			}
			else if (!instance.defeatedSeth)
			{
				TeleportToBossSmart(act3Bosses[1]);
				log.LogInfo((object)"Going to Seth");
			}
			else if (!instance.CollectedHeartFlower)
			{
				TeleportToBossSmart(act3Bosses[2]);
				log.LogInfo((object)"Going to nyleth");
			}
			else if (!instance.defeatedAntTrapper)
			{
				TeleportToBossSmart(act3Bosses[7]);
				log.LogInfo((object)"Gurr The Outcast");
			}
			else if (!instance.CollectedHeartHunter)
			{
				TeleportToBossSmart(act3Bosses[3]);
				log.LogInfo((object)"Going to karmelita");
			}
			else if (bench6)
			{
				bench6 = false;
				bench();
			}
			else if (!instance.CollectedHeartCoral)
			{
				TeleportToBossSmart(act3Bosses[4]);
				log.LogInfo((object)"Going to Coral King Heart Arena");
			}
			else if (!act3done)
			{
				TeleportToBossSmart(act3Bosses[5]);
				log.LogInfo((object)"Going to Lost Lace");
			}
			else
			{
				log.LogInfo((object)"===================================");
				log.LogInfo((object)"ALL ACT 3 BOSSES DEFEATED!");
				log.LogInfo((object)"===================================");
				act3done = true;
			}
		}
		catch (Exception)
		{
			log.LogInfo((object)"ERROR");
		}
	}

	[IteratorStateMachine(typeof(<UnlockAllCoroutine>d__34))]
	private IEnumerator UnlockAllCoroutine()
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <UnlockAllCoroutine>d__34(0)
		{
			<>4__this = this
		};
	}

	public void UnlockStations()
	{
		PlayerData instance = PlayerData.instance;
		if (instance == null)
		{
			Debug.LogError((object)"❌ PlayerData.instance is null!");
			return;
		}
		int num = 0;
		FieldInfo[] fields = ((object)instance).GetType().GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
		foreach (FieldInfo fieldInfo in fields)
		{
			if (fieldInfo.FieldType == typeof(bool) && fieldInfo.Name.ToLower().Contains("station"))
			{
				try
				{
					fieldInfo.SetValue(instance, true);
					num++;
					Debug.Log((object)("✅ Unlocked station: " + fieldInfo.Name));
				}
				catch (Exception ex)
				{
					Debug.LogError((object)("⚠\ufe0f Failed to unlock " + fieldInfo.Name + ": " + ex.Message));
				}
			}
		}
		Debug.Log((object)$"All stations unlocked! ({num} total)");
	}

	public void PrintAllPlayerData()
	{
		PlayerData instance = PlayerData.instance;
		if (instance == null)
		{
			Debug.LogError((object)"❌ PlayerData.instance is null!");
			return;
		}
		FieldInfo[] fields = ((object)instance).GetType().GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
		Debug.Log((object)$"----- \ud83e\uddfe PlayerData Dump: {fields.Length} fields -----");
		FieldInfo[] array = fields;
		foreach (FieldInfo fieldInfo in array)
		{
			try
			{
				object value = fieldInfo.GetValue(instance);
				string text = ((value == null) ? "null" : value.ToString());
				Debug.Log((object)(fieldInfo.Name + " = " + text));
			}
			catch (Exception ex)
			{
				Debug.LogError((object)("Error reading " + fieldInfo.Name + ": " + ex.Message));
			}
		}
		Debug.Log((object)"----- ✅ PlayerData Dump Complete -----");
	}

	private void bench()
	{
		//IL_0046: Unknown result type (might be due to invalid IL or missing references)
		if (PlayerData.instance != null)
		{
			PlayerData instance = PlayerData.instance;
			if (!gotalltools)
			{
				((MonoBehaviour)this).StartCoroutine(UnlockAllCoroutine());
			}
			instance.ShellShards = 800;
			TeleportToBossSmart(new BossData("", "Bone_04", new Vector3(11.27499f, 18.56768f, 0.004f), "", ""));
		}
	}

	private void unlockcrest(int number)
	{
		_ = new string[10] { "Cloakless", "Cursed", "Witch", "Warrior", "Toolmaster", "Spell", "Reaper", "Wanderer", "Hunter_v2", "Hunter_v3" };
		if (!Resources.FindObjectsOfTypeAll<ToolCrest>()[number].IsUnlocked)
		{
			Resources.FindObjectsOfTypeAll<ToolCrest>()[number].Unlock();
		}
		else
		{
			log.LogInfo((object)"crest already unlocked");
		}
	}
}