This is all the code for it is. It just registers a custom condition like that, you're welcome to yoink it into yours
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using BepInEx;
using BepInEx.Bootstrap;
using HarmonyLib;
using loaforcsSoundAPI.SoundPacks.Data.Conditions;
using loaforcsSoundAPI;
namespace LalalatteLoadstone
{
[BepInPlugin(modGUID, modName, modVersion)]
[BepInDependency(Loadstone.PluginInfo.PLUGIN_GUID, BepInDependency.DependencyFlags.HardDependency)]
[BepInDependency(SoundAPI.PLUGIN_GUID, BepInDependency.DependencyFlags.HardDependency)]
public class LalalatteBase : BaseUnityPlugin
{
private const string modGUID = "ZetaArcade.LalalatteLoadstone";
private const string modName = "LalalatteLoadstone";
private const string modVersion = "1.0.8";
private readonly Harmony harmony = new Harmony(modGUID);
private void Awake()
{
SoundAPI.RegisterAll(Assembly.GetExecutingAssembly());
Logger.LogInfo($"Loadstone music replacements are loaded!");
}
}
[SoundAPICondition("LethalCompany:weather:name")]
public class WeatherNameCondition : Condition
{
public string Value { get; internal set; }
public override bool Evaluate(IContext context)
{
if (!StartOfRound.Instance) return false;
if (!StartOfRound.Instance.currentLevel) return false;
string weatherName = StartOfRound.Instance.currentLevel.currentWeather.ToString();
return string.Equals(Value, weatherName, StringComparison.InvariantCultureIgnoreCase);
}
}
}