Decompiled source of TrialsOfTheSunThunderkit v0.0.3

TrialsOfTheSunThunderkit.dll

Decompiled 2 days ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using BepInEx;
using KinematicCharacterController;
using On.RoR2;
using R2API;
using RoR2;
using RoR2.ContentManagement;
using RoR2.Navigation;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyVersion("0.0.0.0")]
public class EnemySpawner : MonoBehaviour
{
	public class ItemEntry
	{
		[Tooltip("The internal name of the item (e.g., 'Syringe', 'Hoof', 'Crowbar')")]
		public string name;

		public int count;
	}

	[Header("Spawn Settings")]
	public string masterName = "GolemMaster";

	[Header("Stats")]
	public int healthStacks;

	public int damageStacks;

	[Header("Inventory")]
	[Tooltip("List of items to give the monster immediately upon spawning.")]
	public ItemEntry[] startingItems;

	public ItemDef itemDropped;

	public bool triggersJumpPad;

	public CapsuleCollider jumpPadCollision;

	private bool enemySpawned;

	private CharacterSpawnCard runtimeSpawnCard;

	private void Start()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: 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_00af: Unknown result type (might be due to invalid IL or missing references)
		MasterIndex val = MasterCatalog.FindMasterIndex(masterName);
		if (val == MasterIndex.none)
		{
			Debug.LogError((object)("[EnemySpawner] Could not find Master with name: " + masterName));
			return;
		}
		GameObject masterPrefab = MasterCatalog.GetMasterPrefab(val);
		runtimeSpawnCard = ScriptableObject.CreateInstance<CharacterSpawnCard>();
		((SpawnCard)runtimeSpawnCard).prefab = masterPrefab;
		((SpawnCard)runtimeSpawnCard).sendOverNetwork = true;
		CharacterMaster component = masterPrefab.GetComponent<CharacterMaster>();
		if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.bodyPrefab))
		{
			GameObject bodyPrefab = component.bodyPrefab;
			((SpawnCard)runtimeSpawnCard).nodeGraphType = (GraphType)(((Object)(object)bodyPrefab.GetComponent<CharacterMotor>() == (Object)null && ((Object)(object)bodyPrefab.GetComponent<RigidbodyMotor>() != (Object)null || Object.op_Implicit((Object)(object)bodyPrefab.GetComponent<KinematicCharacterMotor>()))) ? 1 : 0);
		}
		if (triggersJumpPad && Object.op_Implicit((Object)(object)jumpPadCollision))
		{
			((Collider)jumpPadCollision).enabled = false;
		}
	}

	private void OnTriggerEnter(Collider other)
	{
		if (((Component)other).gameObject.layer == 22 && !enemySpawned && (Object)(object)runtimeSpawnCard != (Object)null)
		{
			enemySpawned = true;
			SpawnEnemy();
		}
	}

	private void SpawnEnemy()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		//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_002d: Expected O, but got Unknown
		//IL_0028: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Expected O, but got Unknown
		//IL_004d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0052: 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_00ed: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f7: Invalid comparison between Unknown and I4
		//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
		DirectorSpawnRequest val = new DirectorSpawnRequest((SpawnCard)(object)runtimeSpawnCard, new DirectorPlacementRule
		{
			placementMode = (PlacementMode)0,
			position = ((Component)this).transform.position
		}, RoR2Application.rng);
		val.teamIndexOverride = (TeamIndex)2;
		val.ignoreTeamMemberLimit = true;
		GameObject spawnedInstance = ((SpawnCard)runtimeSpawnCard).DoSpawn(((Component)this).transform.position, Quaternion.identity, val).spawnedInstance;
		if (!Object.op_Implicit((Object)(object)spawnedInstance))
		{
			return;
		}
		CharacterMaster component = spawnedInstance.GetComponent<CharacterMaster>();
		if (Object.op_Implicit((Object)(object)component.inventory))
		{
			if (healthStacks > 0)
			{
				component.inventory.GiveItemPermanent(Items.BoostHp, healthStacks);
			}
			if (damageStacks > 0)
			{
				component.inventory.GiveItemPermanent(Items.BoostDamage, damageStacks);
			}
			if (startingItems != null && startingItems.Length != 0)
			{
				ItemEntry[] array = startingItems;
				foreach (ItemEntry itemEntry in array)
				{
					ItemIndex val2 = ItemCatalog.FindItemIndex(itemEntry.name);
					if ((int)val2 != -1)
					{
						component.inventory.GiveItemPermanent(val2, itemEntry.count);
					}
					else
					{
						Debug.LogWarning((object)("[EnemySpawner] Could not find item with name: '" + itemEntry.name + "'. Check spelling!"));
					}
				}
			}
		}
		if ((Object)(object)itemDropped != (Object)null)
		{
			ItemDropper itemDropper = spawnedInstance.AddComponent<ItemDropper>();
			itemDropper.itemToDrop = itemDropped;
			itemDropper.spawnerScript = this;
		}
		else if (triggersJumpPad)
		{
			ItemDropper itemDropper2 = spawnedInstance.AddComponent<ItemDropper>();
			itemDropper2.itemToDrop = null;
			itemDropper2.spawnerScript = this;
		}
	}

	public void NotifyEnemyDied()
	{
		if (triggersJumpPad && Object.op_Implicit((Object)(object)jumpPadCollision))
		{
			((Collider)jumpPadCollision).enabled = true;
		}
	}
}
public class ItemDropper : MonoBehaviour
{
	public ItemDef itemToDrop;

	public EnemySpawner spawnerScript;

	private CharacterMaster myMaster;

	private void Awake()
	{
		myMaster = ((Component)this).GetComponent<CharacterMaster>();
	}

	private void OnEnable()
	{
		GlobalEventManager.onCharacterDeathGlobal += OnDeath;
	}

	private void OnDisable()
	{
		GlobalEventManager.onCharacterDeathGlobal -= OnDeath;
	}

	private void OnDeath(DamageReport report)
	{
		if ((Object)(object)report.victimMaster == (Object)(object)myMaster)
		{
			if ((Object)(object)itemToDrop != (Object)null && Object.op_Implicit((Object)(object)report.attackerMaster) && Object.op_Implicit((Object)(object)report.attackerMaster.inventory))
			{
				report.attackerMaster.inventory.GiveItemPermanent(itemToDrop, 1);
			}
			if (Object.op_Implicit((Object)(object)spawnerScript))
			{
				spawnerScript.NotifyEnemyDied();
			}
		}
	}
}
public class ProvidenceShrineManager : NetworkBehaviour
{
	public PurchaseInteraction purchaseInteraction;

	public SceneDef saveStage5 { get; private set; }

	private void Start()
	{
	}

	public void TeleportTrials()
	{
		saveStage5 = Run.instance.nextStageScene;
		Stage.instance.sceneDef.preventStageAdvanceCounter = true;
		Run.instance.AdvanceStage(SceneCatalog.FindSceneDef("tots_trialstage"));
	}

	private void Update()
	{
	}

	private void UNetVersion()
	{
	}

	public override bool OnSerialize(NetworkWriter writer, bool forceAll)
	{
		bool result = default(bool);
		return result;
	}

	public override void OnDeserialize(NetworkReader reader, bool initialState)
	{
	}

	public override void PreStartClient()
	{
	}
}
public class SetSpawnPoints : MonoBehaviour
{
	public Transform[] spawnPoints;

	public bool closestNode = true;

	public float minDistance = 10f;

	public float maxDistance = 40f;

	private void OnEnable()
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Expected O, but got Unknown
		SceneDirector.onPreGeneratePlayerSpawnPointsServer += new GenerateSpawnPointsDelegate(SceneDirector_onPreGeneratePlayerSpawnPointsServer);
	}

	private void OnDisable()
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Expected O, but got Unknown
		SceneDirector.onPreGeneratePlayerSpawnPointsServer -= new GenerateSpawnPointsDelegate(SceneDirector_onPreGeneratePlayerSpawnPointsServer);
	}

	private void SceneDirector_onPreGeneratePlayerSpawnPointsServer(SceneDirector sceneDirector, ref Action generationMethod)
	{
		generationMethod = GeneratePlayerSpawnPointsServer;
	}

	private void GeneratePlayerSpawnPointsServer()
	{
		//IL_0047: Unknown result type (might be due to invalid IL or missing references)
		//IL_004c: 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_005e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0069: Unknown result type (might be due to invalid IL or missing references)
		//IL_006e: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b2: 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_00ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b1: 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_00ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
		if (!Object.op_Implicit((Object)(object)SceneInfo.instance) || spawnPoints.Length == 0)
		{
			return;
		}
		NodeGraph groundNodes = SceneInfo.instance.groundNodes;
		if (!Object.op_Implicit((Object)(object)groundNodes))
		{
			return;
		}
		Vector3 val2 = default(Vector3);
		for (int i = 0; i < spawnPoints.Length && ((Component)spawnPoints[i]).gameObject.activeSelf; i++)
		{
			NodeIndex val = NodeIndex.invalid;
			if (closestNode)
			{
				val = groundNodes.FindClosestNode(spawnPoints[i].position, (HullClassification)0, float.PositiveInfinity);
			}
			else
			{
				List<NodeIndex> list = groundNodes.FindNodesInRange(spawnPoints[i].position, minDistance, maxDistance, (HullMask)1);
				if (list.Count > 0)
				{
					val = list[Random.Range(0, list.Count)];
				}
			}
			if (!(val == NodeIndex.invalid) && groundNodes.GetNodePosition(val, ref val2))
			{
				SpawnPoint.AddSpawnPoint(val2, spawnPoints[i].rotation);
			}
		}
	}
}
public class TPToStage5 : MonoBehaviour
{
	private ProvidenceShrineManager providenceShrineManager;

	private void Start()
	{
	}

	public void TPStage5()
	{
		try
		{
			Run.instance.AdvanceStage(providenceShrineManager.saveStage5);
		}
		catch
		{
			Run.instance.EndStage();
		}
	}

	private void Update()
	{
	}
}
namespace TrialsOfTheSunThunderkit;

public class TrialsOfTheSunThunderkitContent : IContentPackProvider
{
	[Serializable]
	[CompilerGenerated]
	private sealed class <>c
	{
		public static readonly <>c <>9 = new <>c();

		public static hook_Heal <>9__23_0;

		internal float <FinalizeAsync>b__23_0(orig_Heal orig, HealthComponent self, float amount, ProcChainMask procChainMask, bool nonRegen)
		{
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)self.body.inventory))
			{
				amount *= ((self.body.inventory.GetItemCount(bindingBlood.itemIndex) > 0) ? 0.1f : 1f);
			}
			return orig.Invoke(self, amount, procChainMask, nonRegen);
		}
	}

	private static ItemDef bindingBlood;

	private static ItemDef bindingMass;

	private static ItemDef bindingSoul;

	private static ItemDef bindingDesign;

	private static SceneDef trialStage;

	private static GenericPickupController genericPickupController;

	private static InteractableSpawnCard shrineProvidenceSpawnCard;

	private static DirectorCardHolder providenceShrineCardHolder;

	private static AssetBundle itemBundle;

	private static AssetBundle stageBundle;

	private static Material solarTitanMaterial;

	private SkinDef solarSkinDef;

	private SkinnedMeshRenderer customMesh;

	private GameObject bodyPrefab;

	public string identifier => "com.WeatherForecast.TrialsOfTheSunThunderkit";

	public static ReadOnlyContentPack readOnlyContentPack => new ReadOnlyContentPack(TrialsOfTheSunThunderkitContentPack);

	internal static ContentPack TrialsOfTheSunThunderkitContentPack { get; } = new ContentPack();


	public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args)
	{
		AssetBundleCreateRequest asyncOperationItems = AssetBundle.LoadFromFileAsync(TrialsOfTheSunThunderkitMain.itemBundleDir);
		while (!((AsyncOperation)asyncOperationItems).isDone)
		{
			args.ReportProgress(((AsyncOperation)asyncOperationItems).progress);
			yield return null;
		}
		itemBundle = asyncOperationItems.assetBundle;
		AssetBundleCreateRequest asyncOperationStage = AssetBundle.LoadFromFileAsync(TrialsOfTheSunThunderkitMain.stageBundleDir);
		while (!((AsyncOperation)asyncOperationStage).isDone)
		{
			args.ReportProgress(((AsyncOperation)asyncOperationStage).progress);
			yield return null;
		}
		stageBundle = asyncOperationStage.assetBundle;
		bindingBlood = itemBundle.LoadAsset<ItemDef>("BindingBloodItemDef");
		bindingMass = itemBundle.LoadAsset<ItemDef>("BindingMassItemDef");
		bindingSoul = itemBundle.LoadAsset<ItemDef>("BindingSoulItemDef");
		bindingDesign = itemBundle.LoadAsset<ItemDef>("BindingDesignItemDef");
		LanguageAPI.Add("ITEM_BINDINGBLOOD_NAME", "Binding of Blood");
		LanguageAPI.Add("ITEM_BINDINGBLOOD_PICKUP", "Life flows reluctantly. Your healing is restrained.");
		LanguageAPI.Add("ITEM_BINDINGBLOOD_DESC", "Reduce all healing received by <style=cIsDamage>90%</style>.");
		LanguageAPI.Add("ITEM_BINDINGBLOOD_LORE", "It drips. Drop by drop, into the earth. It stains the soil, sings in the veins, and whispers throughout your marrows.\nI used to think blood was something you lost. Now I know better. Blood is the river that fuels us, the engine of life. \nAnd in the end, it always finds its way back to the earth.");
		LanguageAPI.Add("ITEM_BINDINGSOUL_NAME", "Binding of Soul");
		LanguageAPI.Add("ITEM_BINDINGSOUL_PICKUP", "Damage weakens as the soul clings to the body.");
		LanguageAPI.Add("ITEM_BINDINGSOUL_DESC", "Reduce all damage dealt by <style=cIsDamage>90%</style>.");
		LanguageAPI.Add("ITEM_BINDINGSOUL_LORE", "You cannot weigh it nor catch it. It lives inside every being. But what defines a soul? I've seen how it tugs at a man's eye \nHow it bends his will, how it refuses to let him go even as the body fails.\nAnd you will know when it leaves \ufffd for the silence afterward is deafening.");
		LanguageAPI.Add("ITEM_BINDINGDESIGN_NAME", "Binding of Design");
		LanguageAPI.Add("ITEM_BINDINGDESIGN_PICKUP", "Order requires cost. Design demands sacrifice.");
		LanguageAPI.Add("ITEM_BINDINGDESIGN_DESC", "Damage taken is increased by 25%");
		LanguageAPI.Add("ITEM_BINDINGDESIGN_LORE", "Nothing is decided without purpose. Every curve, every edge, every stroke of the hammer is deliberate.\nFind order in the chaos. To design is not to give life, but to surpass it. \nEvery object made is a reflection of the hands that carved it.");
		LanguageAPI.Add("ITEM_BINDINGMASS_NAME", "Binding of Mass");
		LanguageAPI.Add("ITEM_BINDINGMASS_PICKUP", "Weight anchors your body and your potential.");
		LanguageAPI.Add("ITEM_BINDINGMASS_DESC", "Reduce movement speed by <style=cIsDamage>90%</style>.");
		LanguageAPI.Add("ITEM_BINDINGMASS_LORE", "The saying goes, 'mass is boring, but required.' Without it, blood would not flow, souls would not linger, and design would hold no shape. \nThis mundane constant is never elegant nor divine, yet no soul escapes it. All things rise \ufffd but all are destined to fall.");
		trialStage = itemBundle.LoadAsset<SceneDef>("tots_trialstage");
		shrineProvidenceSpawnCard = itemBundle.LoadAsset<InteractableSpawnCard>("ShrineProvidenceSpawnCard");
		providenceShrineCardHolder = new DirectorCardHolder
		{
			Card = new DirectorCard
			{
				selectionWeight = 10000,
				spawnCard = (SpawnCard)(object)shrineProvidenceSpawnCard
			},
			InteractableCategory = (InteractableCategory)4
		};
		Helpers.AddNewInteractable(providenceShrineCardHolder);
		GameObject val = itemBundle.LoadAsset<GameObject>("SolarTitan");
		CharacterSpawnCard val2 = itemBundle.LoadAsset<CharacterSpawnCard>("SolarTitanCard");
		solarTitanMaterial = itemBundle.LoadAsset<Material>("M_SolarTitan");
		customMesh = itemBundle.LoadAsset<GameObject>("SolarTitan").GetComponentInChildren<SkinnedMeshRenderer>(true);
		solarSkinDef = itemBundle.LoadAsset<SkinDef>("SolarTitanSkinDef");
		bodyPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Titan/TitanBody.prefab").WaitForCompletion();
		if (!Object.op_Implicit((Object)(object)val2) || !Object.op_Implicit((Object)(object)solarTitanMaterial))
		{
			Debug.LogError((object)"CRITICAL ERROR: 'SolarTitanCard' could not be found in the AssetBundle! Check your spelling or Unity build.");
		}
		else
		{
			solarSkinDef.rootObject = val;
			Debug.LogError((object)("This is RootObject: " + (object)solarSkinDef.rootObject));
			Helpers.AddNewMonster(new DirectorCardHolder
			{
				Card = new DirectorCard
				{
					selectionWeight = 0,
					spawnCard = (SpawnCard)(object)val2
				},
				MonsterCategory = (MonsterCategory)5
			}, false);
		}
		TrialsOfTheSunThunderkitContentPack.bodyPrefabs.Add((GameObject[])(object)new GameObject[1] { val });
		TrialsOfTheSunThunderkitContentPack.itemDefs.Add((ItemDef[])(object)new ItemDef[4] { bindingBlood, bindingMass, bindingSoul, bindingDesign });
		TrialsOfTheSunThunderkitContentPack.sceneDefs.Add((SceneDef[])(object)new SceneDef[1] { trialStage });
	}

	public IEnumerator GenerateContentPackAsync(GetContentPackAsyncArgs args)
	{
		ContentPack.Copy(TrialsOfTheSunThunderkitContentPack, args.output);
		args.ReportProgress(1f);
		yield break;
	}

	public IEnumerator FinalizeAsync(FinalizeAsyncArgs args)
	{
		object obj = <>c.<>9__23_0;
		if (obj == null)
		{
			hook_Heal val = delegate(orig_Heal orig, HealthComponent self, float amount, ProcChainMask procChainMask, bool nonRegen)
			{
				//IL_0042: Unknown result type (might be due to invalid IL or missing references)
				//IL_0023: Unknown result type (might be due to invalid IL or missing references)
				if (Object.op_Implicit((Object)(object)self.body.inventory))
				{
					amount *= ((self.body.inventory.GetItemCount(bindingBlood.itemIndex) > 0) ? 0.1f : 1f);
				}
				return orig.Invoke(self, amount, procChainMask, nonRegen);
			};
			<>c.<>9__23_0 = val;
			obj = (object)val;
		}
		HealthComponent.Heal += (hook_Heal)obj;
		SetShrine();
		ApplyBossSkin();
		TeleporterInteraction.onTeleporterFinishGlobal += SetShrineTP;
		RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)delegate(CharacterBody sender, StatHookEventArgs args)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			float num = 1f;
			float num2 = 1f;
			if (Object.op_Implicit((Object)(object)sender.inventory))
			{
				num = ((sender.inventory.GetItemCount(bindingMass.itemIndex) > 0) ? 0.1f : 1f);
				num2 = ((sender.inventory.GetItemCount(bindingSoul.itemIndex) > 0) ? 0.1f : 1f);
				if (sender.inventory.GetItemCount(bindingDesign.itemIndex) > 0)
				{
					_ = 1f / Mathf.Pow(1.03f, (float)GetTotalItemCount(sender));
				}
			}
			args.moveSpeedTotalMult *= num;
			args.damageTotalMult *= num2;
			args.armorTotalMult -= num2;
		};
		args.ReportProgress(1f);
		yield break;
	}

	private void ApplyCustomInstances(Run RUN)
	{
		Debug.LogError((object)"RUNNING APPLYCUSTOMINSTANCES");
	}

	private void SetShrine()
	{
		//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_0024: Unknown result type (might be due to invalid IL or missing references)
		Debug.LogError((object)"SETTING SHRINE");
		foreach (Stage item in new List<Stage>())
		{
			Helpers.AddNewInteractableToStage(providenceShrineCardHolder, item, "");
		}
	}

	private void SetShrineTP(TeleporterInteraction tp)
	{
		//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)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: 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_0022: Unknown result type (might be due to invalid IL or missing references)
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0031: 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_003c: Expected O, but got Unknown
		//IL_0049: Unknown result type (might be due to invalid IL or missing references)
		//IL_0053: Expected O, but got Unknown
		//IL_004e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0058: Expected O, but got Unknown
		Debug.LogError((object)"SETTING SHRINE AT TP");
		DirectorPlacementRule val = new DirectorPlacementRule
		{
			placementMode = (PlacementMode)3,
			position = ((Component)tp).transform.position + Vector3.up * 5f
		};
		DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest((SpawnCard)(object)shrineProvidenceSpawnCard, val, new Xoroshiro128Plus(0uL)));
	}

	private static void LogInfo(object data)
	{
		TrialsOfTheSunThunderkitMain.LogInfo(data);
	}

	private void ApplyBossSkin()
	{
		Debug.LogError((object)"APPLYBOSSSKIN IS STARTING");
		if (Object.op_Implicit((Object)(object)bodyPrefab))
		{
			Debug.LogError((object)("INDEX: " + 212));
			Skins.AddSkinToCharacter(bodyPrefab, solarSkinDef);
			SkinDef[] skins = bodyPrefab.GetComponentInChildren<ModelSkinController>().skins;
			Debug.LogError((object)skins[0].skinDefParams);
			_ = skins[0].skinDefParams;
			_ = 0;
		}
		else
		{
			Debug.LogError((object)"SOMETHINGS WRONG WITH APPLYSKIN");
		}
	}

	private int GetTotalItemCount(CharacterBody sender)
	{
		ItemTier[] array = new ItemTier[9];
		RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
		return ((IEnumerable<ItemTier>)(object)array).Sum((ItemTier tier) => sender.inventory.GetTotalItemCountOfTier(tier));
	}

	private void AddSelf(AddContentPackProviderDelegate addContentPackProvider)
	{
		addContentPackProvider.Invoke((IContentPackProvider)(object)this);
	}

	internal TrialsOfTheSunThunderkitContent()
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Expected O, but got Unknown
		ContentManager.collectContentPackProviders += new CollectContentPackProvidersDelegate(AddSelf);
	}
}
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("com.WeatherForecast.TrialsOfTheSunThunderkit", "Trials of the Sun (Thunderkit)", "0.0.3")]
public class TrialsOfTheSunThunderkitMain : BaseUnityPlugin
{
	public const string GUID = "com.WeatherForecast.TrialsOfTheSunThunderkit";

	public const string MODNAME = "Trials of the Sun (Thunderkit)";

	public const string VERSION = "0.0.3";

	public static PluginInfo pluginInfo { get; private set; }

	public static TrialsOfTheSunThunderkitMain instance { get; private set; }

	internal static AssetBundle assetBundle { get; private set; }

	internal static string itemBundleDir => Path.Combine(Path.GetDirectoryName(pluginInfo.Location), "TrialsOfTheSunThunderkitAssets");

	internal static string stageBundleDir => Path.Combine(Path.GetDirectoryName(pluginInfo.Location), "TrialsOfTheSunThunderkitTrialStage");

	private void Awake()
	{
		instance = this;
		pluginInfo = ((BaseUnityPlugin)this).Info;
		new TrialsOfTheSunThunderkitContent();
	}

	internal static void LogFatal(object data)
	{
		((BaseUnityPlugin)instance).Logger.LogFatal(data);
	}

	internal static void LogError(object data)
	{
		((BaseUnityPlugin)instance).Logger.LogError(data);
	}

	internal static void LogWarning(object data)
	{
		((BaseUnityPlugin)instance).Logger.LogWarning(data);
	}

	internal static void LogMessage(object data)
	{
		((BaseUnityPlugin)instance).Logger.LogMessage(data);
	}

	internal static void LogInfo(object data)
	{
		((BaseUnityPlugin)instance).Logger.LogInfo(data);
	}

	internal static void LogDebug(object data)
	{
		((BaseUnityPlugin)instance).Logger.LogDebug(data);
	}

	private void Update()
	{
		//IL_006e: 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 (Input.GetKeyDown((KeyCode)284))
		{
			HealthComponent component = PlayerCharacterMasterController.instances[0].master.GetBodyObject().GetComponent<HealthComponent>();
			component.health *= 0.5f;
			LogInfo("Player pressed F3. Halving player health.");
		}
		if (Input.GetKeyDown((KeyCode)285))
		{
			PlayerCharacterMasterController.instances[0].master.GetBodyObject().GetComponent<HealthComponent>().Heal(10f, default(ProcChainMask), true);
			LogInfo("Player pressed F4. Healing 10 health.");
		}
	}
}