Decompiled source of GupAttackTelegraph v1.0.0

GupAttackTelegraph.dll

Decompiled a month ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using EntityStates;
using EntityStates.Gup;
using On.EntityStates.Gup;
using RoR2;
using UnityEngine;
using UnityEngine.AddressableAssets;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("GupAttackTelegraph")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("GupAttackTelegraph")]
[assembly: AssemblyTitle("GupAttackTelegraph")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace GupAttackTelegraph;

[BepInPlugin("com.rob.GupAttackTelegraph", "GupAttackTelegraph", "1.0.0")]
public class Plugin : BaseUnityPlugin
{
	public const string MODUID = "com.rob.GupAttackTelegraph";

	public static Material overlayMat;

	private void Awake()
	{
		//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_0027: Unknown result type (might be due to invalid IL or missing references)
		//IL_0063: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Expected O, but got Unknown
		overlayMat = Object.Instantiate<Material>(Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Common/matEnergyShield.mat").WaitForCompletion());
		overlayMat.SetColor("_TintColor", Color.yellow);
		overlayMat.SetFloat("_Boost", 5f);
		overlayMat.SetFloat("_AlphaBoost", 2f);
		GupSpikesState.OnEnter += new hook_OnEnter(GupSpikesState_OnEnter);
	}

	private void GupSpikesState_OnEnter(orig_OnEnter orig, GupSpikesState self)
	{
		orig.Invoke(self);
		Util.PlaySound("Play_commando_M2_grenade_bounce", ((EntityState)self).gameObject);
		Util.PlaySound("Play_commando_M2_grenade_bounce", ((EntityState)self).gameObject);
		Util.PlaySound("Play_commando_M2_grenade_bounce", ((EntityState)self).gameObject);
		if (Object.op_Implicit((Object)(object)((EntityState)self).modelLocator) && Object.op_Implicit((Object)(object)((EntityState)self).modelLocator.modelTransform))
		{
			TemporaryOverlay val = ((Component)((EntityState)self).modelLocator.modelTransform).gameObject.AddComponent<TemporaryOverlay>();
			val.duration = 0.75f;
			val.destroyComponentOnEnd = true;
			val.originalMaterial = overlayMat;
			val.inspectorCharacterModel = ((Component)((EntityState)self).modelLocator.modelTransform).GetComponent<CharacterModel>();
			val.alphaCurve = AnimationCurve.EaseInOut(0f, 2f, 0.75f, 0f);
			val.animateShaderAlpha = true;
		}
	}
}