using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using Microsoft.CodeAnalysis;
using On.RoR2;
using RoR2;
using RoR2.Orbs;
using UnityEngine;
[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.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("NewtoPoloPlugin")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+f780b2975b74dd6b513d6333dac2d631340cf77c")]
[assembly: AssemblyProduct("NewtoPoloPlugin")]
[assembly: AssemblyTitle("NewtoPoloPlugin")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace NewtoPoloPlugin
{
internal static class Log
{
private static ManualLogSource _logSource;
internal static void Init(ManualLogSource logSource)
{
_logSource = logSource;
}
internal static void Debug(object data)
{
_logSource.LogDebug(data);
}
internal static void Error(object data)
{
_logSource.LogError(data);
}
internal static void Fatal(object data)
{
_logSource.LogFatal(data);
}
internal static void Info(object data)
{
_logSource.LogInfo(data);
}
internal static void Message(object data)
{
_logSource.LogMessage(data);
}
internal static void Warning(object data)
{
_logSource.LogWarning(data);
}
}
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("Coffee.NewtoPolo", "NewtoPolo", "0.1.2")]
public class NewtoPoloPlugin : BaseUnityPlugin
{
public const string PluginGUID = "Coffee.NewtoPolo";
public const string PluginAuthor = "Coffee";
public const string PluginName = "NewtoPolo";
public const string PluginVersion = "0.1.2";
public void Awake()
{
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
//IL_001e: Expected O, but got Unknown
Log.Init(((BaseUnityPlugin)this).Logger);
UserChatMessage.OnProcessed += new hook_OnProcessed(UserChatMessageOnProcessed);
}
private void UserChatMessageOnProcessed(orig_OnProcessed orig, UserChatMessage self)
{
//IL_00aa: 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_00b2: Unknown result type (might be due to invalid IL or missing references)
//IL_00e7: 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_00fd: Unknown result type (might be due to invalid IL or missing references)
//IL_0218: Unknown result type (might be due to invalid IL or missing references)
//IL_021d: Unknown result type (might be due to invalid IL or missing references)
//IL_022d: Expected O, but got Unknown
//IL_01c6: Unknown result type (might be due to invalid IL or missing references)
bool flag = self.text.ToLower().Contains("newto");
bool flag2 = self.text.ToLower().Contains("saplo");
bool flag3 = self.text.ToLower().Contains("nodo");
if (!Object.op_Implicit((Object)(object)self.sender) || !Object.op_Implicit((Object)(object)self.sender.GetComponent<NetworkUser>()) || (!flag && !flag2 && !flag3))
{
return;
}
int num = 0;
if ((Object)(object)AccessCodesMissionController.instance != (Object)null)
{
AccessCodesNodeData[] nodes = AccessCodesMissionController.instance.nodes;
foreach (AccessCodesNodeData val in nodes)
{
if (((Object)val.node.gameObject).name.Contains("Access Codes Node") && flag3)
{
sendElectricity(self.sender.GetComponent<NetworkUser>().GetCurrentBody(), val.node.transform.position, "ACCESSCODES", val.node.gameObject, "Access Node");
num++;
}
}
}
foreach (PurchaseInteraction instances in InstanceTracker.GetInstancesList<PurchaseInteraction>())
{
if (((!(instances.displayNameToken.ToUpper() != "NEWT_STATUE_NAME") && flag) || (instances.displayNameToken.ToUpper().Contains("SS2_SHRINE_ETHEREAL") && flag2) || (instances.displayNameToken.ToUpper().Contains("ACCESSCODES") && flag3)) && instances.Networkavailable)
{
sendElectricity(self.sender.GetComponent<NetworkUser>().GetCurrentBody(), ((Component)instances).transform.position, instances.displayNameToken.ToUpper(), ((Component)instances).gameObject, instances.GetDisplayName());
num++;
}
}
if (num == 0)
{
Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage
{
baseToken = "You hear nothing but the void and it's deafening silence."
});
}
}
public void sendElectricity(CharacterBody playerBody, Vector3 pos, string token, GameObject gameObject, string displayName)
{
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_0044: 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_0065: Unknown result type (might be due to invalid IL or missing references)
//IL_0072: Unknown result type (might be due to invalid IL or missing references)
//IL_0077: Unknown result type (might be due to invalid IL or missing references)
//IL_007c: Unknown result type (might be due to invalid IL or missing references)
//IL_0081: Unknown result type (might be due to invalid IL or missing references)
//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
Transform transform = playerBody.transform;
Vector3 val = pos - transform.localPosition;
Vector3 localPosition = transform.localPosition;
Vector3 val2 = new Vector3
{
x = val.x,
y = 0f,
z = val.z
};
Vector3 effectSpawn = localPosition + 25f * ((Vector3)(ref val2)).normalized;
string text = "";
text = ((((Vector3)(ref val)).magnitude > 350f) ? (text + "that sounded like it came from very far away") : ((!(((Vector3)(ref val)).magnitude > 75f)) ? (text + "that sounded like it was nearby") : (text + "that sounded like it was in the distance")));
if (val.y > 75f)
{
text += ", up above the clouds";
}
else if (val.y < -75f)
{
text += ", in dark depths of the world";
}
string text2 = "#02f7e7";
string text3 = "POLO";
if (token.Contains("SS2_SHRINE_ETHEREAL"))
{
text2 = "#02f77d";
text3 = "SAPOLO";
}
else if (token.Contains("ACCESSCODES"))
{
text2 = "#ff4c76";
text3 = "ACCESSOLO";
}
string chatMessage = "<color=" + text2 + ">" + displayName + "</color>: " + text3 + " (" + text + ")";
((MonoBehaviour)(object)this).Invoke(delegate
{
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
announceAltar(chatMessage, gameObject, effectSpawn, playerBody);
}, 0.5f);
}
public void announceAltar(string chatMessage, GameObject altar, Vector3 effectSpawn, CharacterBody player)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Expected O, but got Unknown
//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_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_003a: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
//IL_004a: 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_0051: Unknown result type (might be due to invalid IL or missing references)
//IL_005c: Expected O, but got Unknown
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_0067: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: 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_007a: 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_00be: Unknown result type (might be due to invalid IL or missing references)
//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
//IL_00c6: 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_00d1: Unknown result type (might be due to invalid IL or missing references)
//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
//IL_00ed: Expected O, but got Unknown
Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage
{
baseToken = chatMessage
});
EffectManager.SpawnEffect(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/ShrineUseEffect"), new EffectData
{
origin = altar.transform.position,
rotation = Quaternion.identity,
scale = 10f,
color = ColorCatalog.GetColor((ColorIndex)4)
}, true);
OrbManager.instance.AddOrb((Orb)new LightningOrb
{
origin = effectSpawn,
attacker = altar.gameObject,
target = player.mainHurtBox,
damageValue = 25f + Run.instance.difficultyCoefficient * (float)Math.Pow(1.8, Run.instance.shopPortalCount) * 5f,
damageColorIndex = (DamageColorIndex)9,
damageType = DamageTypeCombo.op_Implicit((DamageType)33554432),
isCrit = true,
procCoefficient = 1f
});
}
}
public static class Utility
{
[CompilerGenerated]
private sealed class <InvokeRoutine>d__1 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public Action f;
public float delay;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <InvokeRoutine>d__1(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
//IL_0031: Expected O, but got Unknown
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<>2__current = (object)new WaitForSeconds(delay);
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
f();
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 static void Invoke(this MonoBehaviour mb, Action f, float delay)
{
mb.StartCoroutine(InvokeRoutine(f, delay));
}
[IteratorStateMachine(typeof(<InvokeRoutine>d__1))]
private static IEnumerator InvokeRoutine(Action f, float delay)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <InvokeRoutine>d__1(0)
{
f = f,
delay = delay
};
}
}
}