using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using BepInEx;
using UnityEngine;
using UnityEngine.SceneManagement;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyCompany("DuskRegen")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("DuskRegen")]
[assembly: AssemblyTitle("DuskRegen")]
[assembly: AssemblyVersion("1.0.0.0")]
[BepInPlugin("com.newblood.plugins.dusk.regen", "DUSK Regen Mod", "1.0.0.0")]
public class DuskRegenPlugin : BaseUnityPlugin
{
private float regenTimer;
private float currentWaveValue = 1f;
private void Awake()
{
}
private void Update()
{
//IL_0025: Unknown result type (might be due to invalid IL or missing references)
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
GameObject val = GameObject.Find("Player");
GameObject val2 = GameObject.Find("Endless Mode Controller");
PlayerHealthManagement component = val.GetComponent<PlayerHealthManagement>();
EndlessModeSpawnerControllerScript component2 = val2.GetComponent<EndlessModeSpawnerControllerScript>();
Scene activeScene = SceneManager.GetActiveScene();
if (!(((Scene)(ref activeScene)).name == "EndlessArena1") && !(((Scene)(ref activeScene)).name == "EndlessArena2") && !(((Scene)(ref activeScene)).name == "EndlessArena3"))
{
return;
}
if (regenTimer > 0f)
{
regenTimer -= Time.deltaTime;
}
if (regenTimer <= 0f)
{
if (component.myhealth < 50f)
{
component.myhealth += 10f;
}
regenTimer = 5f;
}
if (currentWaveValue != (float)component2.currentwave)
{
if (component.myhealth < 100f)
{
component.myhealth = 100f;
}
currentWaveValue = component2.currentwave;
}
}
}