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 PEAKLib.Core;
using PEAKLib.Items.UnityEditor;
using Photon.Pun;
using UnityEngine;
using UnityEngine.SceneManagement;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("com.github.TheCodinPro.UTYPlushies")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("0.1.0.0")]
[assembly: AssemblyInformationalVersion("0.1.0")]
[assembly: AssemblyProduct("com.github.TheCodinPro.UTYPlushies")]
[assembly: AssemblyTitle("UTYPlushies")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.1.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.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
internal sealed class NullableAttribute : Attribute
{
public readonly byte[] NullableFlags;
public NullableAttribute(byte P_0)
{
NullableFlags = new byte[1] { P_0 };
}
public NullableAttribute(byte[] P_0)
{
NullableFlags = P_0;
}
}
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
internal sealed class NullableContextAttribute : Attribute
{
public readonly byte Flag;
public NullableContextAttribute(byte P_0)
{
Flag = P_0;
}
}
[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 BepInEx
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
[Conditional("CodeGeneration")]
internal sealed class BepInAutoPluginAttribute : Attribute
{
public BepInAutoPluginAttribute(string? id = null, string? name = null, string? version = null)
{
}
}
}
namespace BepInEx.Preloader.Core.Patching
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
[Conditional("CodeGeneration")]
internal sealed class PatcherAutoPluginAttribute : Attribute
{
public PatcherAutoPluginAttribute(string? id = null, string? name = null, string? version = null)
{
}
}
}
namespace UTYPlushies
{
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("com.github.TheCodinPro.UTYPlushies", "UTYPlushies", "0.1.0")]
public class Plugin : BaseUnityPlugin
{
[CompilerGenerated]
private sealed class <<OnSceneLoaded>g__PatchAfterLoadFinished|15_0>d : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <<OnSceneLoaded>g__PatchAfterLoadFinished|15_0>d(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
break;
case 1:
<>1__state = -1;
break;
}
if (LoadingScreenHandler.loading)
{
<>2__current = null;
<>1__state = 1;
return true;
}
createItemSpawners();
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();
}
}
private static readonly DateTime December1St = new DateTime((DateTime.Now.Month == 1) ? (DateTime.Now.Year - 1) : DateTime.Now.Year, 12, 1);
private static readonly DateTime January6St = new DateTime(((DateTime.Now.Month == 1) ? (DateTime.Now.Year - 1) : DateTime.Now.Year) + 1, 1, 6);
private Coroutine? LevelLoadCompleteCoroutine;
private static GameObject cerobaPlush;
private static GameObject martletPlush;
private static GameObject zenithMartletPlush;
public const string Id = "com.github.TheCodinPro.UTYPlushies";
public static bool IsHoliday { get; private set; } = false;
internal static ManualLogSource Log { get; private set; } = null;
public static string Name => "UTYPlushies";
public static string Version => "0.1.0";
private void Awake()
{
Log = ((BaseUnityPlugin)this).Logger;
DateTime now = DateTime.Now;
if (now > December1St && now < January6St)
{
IsHoliday = true;
Log.LogInfo((object)$"Happy Holidays! The holiday season will end in {January6St - now:%d} days");
}
else
{
IsHoliday = false;
Log.LogInfo((object)$"Next holiday season will start in {December1St - now:%d} days.");
}
Log.LogInfo((object)"Patching sceneLoaded...");
SceneManager.sceneLoaded += OnSceneLoaded;
LocalizationFix();
BundleLoader.LoadBundleWithName((BaseUnityPlugin)(object)this, "martletplush.peakbundle", (Action<PeakBundle>)delegate(PeakBundle peakBundle)
{
UnityItemContent val3 = peakBundle.LoadAsset<UnityItemContent>("IC_BluebirdPlush");
martletPlush = val3.ItemPrefab;
peakBundle.Mod.RegisterContent();
});
BundleLoader.LoadBundleWithName((BaseUnityPlugin)(object)this, "zenithmartletplush.peakbundle", (Action<PeakBundle>)delegate(PeakBundle peakBundle)
{
UnityItemContent val2 = peakBundle.LoadAsset<UnityItemContent>("IC_BluebirdZenithPlush");
zenithMartletPlush = val2.ItemPrefab;
peakBundle.Mod.RegisterContent();
});
BundleLoader.LoadBundleWithName((BaseUnityPlugin)(object)this, "cerobaplush.peakbundle", (Action<PeakBundle>)delegate(PeakBundle peakBundle)
{
UnityItemContent val = peakBundle.LoadAsset<UnityItemContent>("IC_KitsunePlush");
cerobaPlush = val.ItemPrefab;
peakBundle.Mod.RegisterContent();
});
Log.LogInfo((object)("Plugin " + Name + " is loaded!"));
}
private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
{
if (((Scene)(ref scene)).path.StartsWith("Assets/8_SCENES/Generated/"))
{
Log.LogInfo((object)"started loading level scenes...");
if (LevelLoadCompleteCoroutine != null)
{
((MonoBehaviour)this).StopCoroutine(LevelLoadCompleteCoroutine);
LevelLoadCompleteCoroutine = null;
}
LevelLoadCompleteCoroutine = ((MonoBehaviour)this).StartCoroutine(PatchAfterLoadFinished());
}
[IteratorStateMachine(typeof(<<OnSceneLoaded>g__PatchAfterLoadFinished|15_0>d))]
static IEnumerator PatchAfterLoadFinished()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <<OnSceneLoaded>g__PatchAfterLoadFinished|15_0>d(0);
}
}
private static void createItemSpawners()
{
//IL_0044: 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_00c0: Unknown result type (might be due to invalid IL or missing references)
//IL_00df: Unknown result type (might be due to invalid IL or missing references)
//IL_013c: Unknown result type (might be due to invalid IL or missing references)
//IL_015b: Unknown result type (might be due to invalid IL or missing references)
GameObject val = GameObject.Find("BingBong_Spawner");
GameObject val2 = Object.Instantiate<GameObject>(val, val.transform.parent);
val2.SetActive(false);
((Object)val2).name = "MartletPlush_Spawner";
val2.transform.localPosition = new Vector3(-10.9056f, 1.5401f, -5.6609f);
val2.transform.rotation = Quaternion.Euler(12.9197f, 257.9503f, 345.5268f);
Log.LogInfo((object)("Creating " + ((Object)val2).name));
GameObject val3 = Object.Instantiate<GameObject>(val, val.transform.parent);
val3.SetActive(false);
((Object)val3).name = "ZenithMartletPlush_Spawner";
val3.transform.localPosition = new Vector3(-13.0111f, 1.5401f, -5.9445f);
val3.transform.rotation = Quaternion.Euler(12.9197f, 257.9503f, 345.5268f);
Log.LogInfo((object)("Creating " + ((Object)val3).name));
GameObject val4 = Object.Instantiate<GameObject>(val, val.transform.parent);
val4.SetActive(false);
((Object)val4).name = "CerobaPlush_Spawner";
val4.transform.localPosition = new Vector3(-14.91965f, 1.300095f, -6.260532f);
val4.transform.rotation = Quaternion.Euler(12.9197f, 257.9503f, 345.5268f);
Log.LogInfo((object)("Creating " + ((Object)val4).name));
try
{
val2.GetComponent<SingleItemSpawner>().prefab = martletPlush;
Log.LogInfo((object)("Setting " + ((Object)val2).name + "'s prefab to " + ((Object)val2.GetComponent<SingleItemSpawner>().prefab).name));
val2.SetActive(true);
val2.GetComponent<SingleItemSpawner>().TrySpawnItems();
}
catch (Exception ex)
{
Log.LogInfo((object)("Failed to spawn items for " + ((Object)val2).name + ": " + ex.Message));
}
try
{
val3.GetComponent<SingleItemSpawner>().prefab = zenithMartletPlush;
Log.LogInfo((object)("Setting " + ((Object)val3).name + "'s prefab to " + ((Object)val3.GetComponent<SingleItemSpawner>().prefab).name));
val3.SetActive(true);
val3.GetComponent<SingleItemSpawner>().TrySpawnItems();
}
catch (Exception ex2)
{
Log.LogInfo((object)("Failed to spawn items for " + ((Object)val3).name + ": " + ex2.Message));
}
try
{
val4.GetComponent<SingleItemSpawner>().prefab = cerobaPlush;
Log.LogInfo((object)("Setting " + ((Object)val4).name + "'s prefab to " + ((Object)val4.GetComponent<SingleItemSpawner>().prefab).name));
val4.SetActive(true);
val4.GetComponent<SingleItemSpawner>().TrySpawnItems();
}
catch (Exception ex3)
{
Log.LogInfo((object)("Failed to spawn items for " + ((Object)val4).name + ": " + ex3.Message));
}
}
private static void LocalizationFix()
{
LocalizedText.mainTable["NAME_MARTLET PLUSH"] = new List<string>(15)
{
"MARTLET PLUSH", "MARTLET PLUSH", "MARTLET PLUSH", "MARTLET PLUSH", "PELUCHE MARTLET", "PELUCHE MARTLET", "MARTLET PLUSH", "MARTLET PLUSH", "MARTLET PLUSH", "MARTLET PLUSH",
"MARTLET PLUSH", "MARTLET PLUSH", "MARTLET PLUSH", "PLUSZOWA MARTLETKA", "MARTLET PLUSH"
};
LocalizedText.mainTable["NAME_ZENITH MARTLET PLUSH"] = new List<string>(15)
{
"ZENITH MARTLET PLUSH", "ZENITH MARTLET PLUSH", "ZENITH MARTLET PLUSH", "ZENITH MARTLET PLUSH", "PELUCHE ZENITH MARTLET", "PELUCHE ZENITH MARTLET", "ZENITH MARTLET PLUSH", "ZENITH MARTLET PLUSH", "ZENITH MARTLET PLUSH", "ZENITH MARTLET PLUSH",
"ZENITH MARTLET PLUSH", "ZENITH MARTLET PLUSH", "ZENITH MARTLET PLUSH", "ZENITH MARTLET PELÚCIA", "ZENITH MARTLET PLUSH"
};
LocalizedText.mainTable["NAME_KEET PLUSH"] = new List<string>(15)
{
"KEET PLUSH", "KEET PLUSH", "KEET PLUSH", "KEET PLUSH", "PELUCHE KEET", "PELUCHE KEET", "KEET PLUSH", "KEET PLUSH", "KEET PLUSH", "KEET PLUSH",
"KEET PLUSH", "KEET PLUSH", "KEET PLUSH", "MANTER PELUCIA", "KEET PLUSH"
};
LocalizedText.mainTable["NAME_CEROBA PLUSH"] = new List<string>(15)
{
"CEROBA PLUSH", "CEROBA PLUSH", "CEROBA PLUSH", "CEROBA PLUSH", "PELUCHE CEROBA", "PELUCHE CEROBA", "CEROBA PLUSH", "CEROBA PLUSH", "CEROBA PLUSH", "CEROBA PLUSH",
"CEROBA PLUSH", "CEROBA PLUSH", "CEROBA PLUSH", "PELUCHE CEROBA", "CEROBA PLUSH"
};
}
}
[RequireComponent(typeof(PhotonView))]
public class SpawnerObject : MonoBehaviour
{
private Item item;
public bool breakOnCollision;
public float minBreakVelocity;
[SerializeField]
public GameObject instantiateOnBreak;
public Transform instantiatePoint;
public bool stickToNormal;
private bool alreadyBroke;
private void Awake()
{
item = ((Component)this).GetComponent<Item>();
IPunPrefabPool prefabPool = PhotonNetwork.PrefabPool;
DefaultPool val = (DefaultPool)(object)((prefabPool is DefaultPool) ? prefabPool : null);
if (val != null && (Object)(object)instantiateOnBreak != (Object)null)
{
val.ResourceCache.Add(((Object)instantiateOnBreak).name, instantiateOnBreak);
}
}
private void OnCollisionEnter(Collision collision)
{
//IL_0018: 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)
if (((MonoBehaviourPun)item).photonView.IsMine && (int)item.itemState == 0 && breakOnCollision && Object.op_Implicit((Object)(object)item.rig))
{
Vector3 relativeVelocity = collision.relativeVelocity;
if (((Vector3)(ref relativeVelocity)).magnitude > minBreakVelocity)
{
((MonoBehaviourPun)item).photonView.RPC("RPC_Break", (RpcTarget)0, new object[1] { collision });
}
}
}
public void Break(Collision coll)
{
//IL_003e: Unknown result type (might be due to invalid IL or missing references)
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_0075: 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_004c: Unknown result type (might be due to invalid IL or missing references)
//IL_005d: Unknown result type (might be due to invalid IL or missing references)
//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)
if (!alreadyBroke)
{
alreadyBroke = true;
string text = "0_Items/" + ((Object)instantiateOnBreak).name;
Quaternion val = Quaternion.Euler(0f, (float)Random.Range(0, 360), 0f);
if (stickToNormal)
{
val = Quaternion.LookRotation(Vector3.forward, ((ContactPoint)(ref coll.contacts[0])).normal);
}
PhotonNetwork.Instantiate(text, ((ContactPoint)(ref coll.contacts[0])).point, val, (byte)0, (object[])null);
PhotonNetwork.Destroy(((Component)this).gameObject);
}
}
[PunRPC]
public void RPC_Break(Collision coll)
{
//IL_003e: Unknown result type (might be due to invalid IL or missing references)
//IL_0043: 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)
//IL_0079: 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_005d: Unknown result type (might be due to invalid IL or missing references)
//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)
if (!alreadyBroke)
{
alreadyBroke = true;
string text = "0_Items/" + ((Object)instantiateOnBreak).name;
Quaternion val = Quaternion.Euler(0f, (float)Random.Range(0, 360), 0f);
if (stickToNormal)
{
val = Quaternion.LookRotation(Vector3.forward, ((ContactPoint)(ref coll.contacts[0])).normal);
}
Object.Instantiate<GameObject>(instantiateOnBreak, ((Component)this).transform.position, val);
PhotonNetwork.Destroy(((Component)this).gameObject);
}
}
public static string GetGameObjectPath(GameObject obj)
{
string text = "/" + ((Object)obj).name;
while ((Object)(object)obj.transform.parent != (Object)null)
{
obj = ((Component)obj.transform.parent).gameObject;
text = "/" + ((Object)obj).name + text;
}
return text;
}
}
}
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
internal sealed class IgnoresAccessChecksToAttribute : Attribute
{
public IgnoresAccessChecksToAttribute(string assemblyName)
{
}
}
}