using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("ClassLibrary1")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ClassLibrary1")]
[assembly: AssemblyCopyright("Copyright © 2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("ea6ea58e-d09c-4f46-af20-25e8bde849a6")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
[BepInPlugin("com.user.peak.catmouse_final", "猫鼠游戏正式版", "1.3.1")]
public class CatMousePlugin : BaseUnityPlugin
{
private const ushort ID_FLARE = 84;
private const ushort ID_COCONUT = 105;
private const ushort ID_MARSHMALLOW = 118;
private const ushort ID_HOOK = 140;
private const ushort ID_PANACEA = 45;
private void Update()
{
if (Input.GetKeyDown((KeyCode)111))
{
GiveMouseLoadout();
}
if (Input.GetKeyDown((KeyCode)112))
{
GiveCatLoadout();
}
}
private void GiveMouseLoadout()
{
((BaseUnityPlugin)this).Logger.LogInfo((object)">>> 正在为老鼠生成装备...");
SpawnItemByID(84, 2);
SpawnItemByID(105, 1);
SpawnItemByID(118, 1);
}
private void GiveCatLoadout()
{
((BaseUnityPlugin)this).Logger.LogInfo((object)">>> 正在为猫生成装备...");
SpawnItemByID(140, 3);
SpawnItemByID(45, 1);
}
private void SpawnItemByID(ushort id, int count)
{
Item val = default(Item);
if (ItemDatabase.TryGetItem(id, ref val))
{
for (int i = 0; i < count; i++)
{
ItemDatabase.Add(val);
}
((BaseUnityPlugin)this).Logger.LogInfo((object)$"[成功] 已生成 ID:{id} 共 {count} 个");
}
else
{
((BaseUnityPlugin)this).Logger.LogWarning((object)$"[警告] 数据库中找不到 ID: {id},请确认游戏是否更新。");
}
}
}