Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of Lilya v1.0.0
Lilya.dll
Decompiled 8 hours agousing System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using MonoMod.RuntimeDetour.HookGen; using RoR2; using RoR2.ContentManagement; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Rendering; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] namespace Lilya; [BepInPlugin("com.Dannyduartemgs.Lilya", "Lilya", "1.0.0")] public class LilyaPlugin : BaseUnityPlugin { private class FieldException : Exception { public FieldException(string message, Exception innerException) : base(message, innerException) { } } private static AssetBundle assetBundle; private static readonly List<Material> materialsWithRoRShader = new List<Material>(); internal static LilyaPlugin Instance { get; private set; } internal static ManualLogSource InstanceLogger { get { LilyaPlugin instance = Instance; return (instance != null) ? ((BaseUnityPlugin)instance).Logger : null; } } private void Start() { Instance = this; using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Lilya.dannyduartemgslilya")) { assetBundle = AssetBundle.LoadFromStream(stream); } ((ResourceAvailability)(ref BodyCatalog.availability)).CallWhenAvailable((Action)BodyCatalogInit); HookEndpointManager.Add((MethodBase)typeof(Language).GetMethod("LoadStrings"), (Delegate)new Action<Action<Language>, Language>(LanguageLoadStrings)); ReplaceShaders(); } private static void ReplaceShaders() { LoadMaterialsWithReplacedShader("RoR2/Base/Shaders/HGStandard.shader", "Assets/Resources/Lilya.mat"); } private static void LoadMaterialsWithReplacedShader(string shaderPath, params string[] materialPaths) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) Shader shader = Addressables.LoadAssetAsync<Shader>((object)shaderPath).WaitForCompletion(); foreach (string text in materialPaths) { Material val = assetBundle.LoadAsset<Material>(text); val.shader = shader; materialsWithRoRShader.Add(val); } } private static void LanguageLoadStrings(Action<Language> orig, Language self) { orig(self); self.SetStringByToken("DANNYDUARTEMGS_SKIN_LILYASKIN_NAME", "Lilya"); } private static void Nothing(Action<SkinDef> orig, SkinDef self) { } private static void BodyCatalogInit() { MethodInfo method = typeof(SkinDef).GetMethod("Awake", BindingFlags.Instance | BindingFlags.NonPublic); HookEndpointManager.Add((MethodBase)method, (Delegate)new Action<Action<SkinDef>, SkinDef>(Nothing)); AddMoffeinPilotBodyLilyaSkinSkin(); HookEndpointManager.Remove((MethodBase)method, (Delegate)new Action<Action<SkinDef>, SkinDef>(Nothing)); } private static void AddMoffeinPilotBodyLilyaSkinSkin() { //IL_0273: Unknown result type (might be due to invalid IL or missing references) string text = "MoffeinPilotBody"; string text2 = "LilyaSkin"; try { GameObject val = BodyCatalog.FindBodyPrefab(text); if (!Object.op_Implicit((Object)(object)val)) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin because \"" + text + "\" doesn't exist")); return; } ModelLocator component = val.GetComponent<ModelLocator>(); if (!Object.op_Implicit((Object)(object)component)) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelLocator\" component")); return; } GameObject gameObject = ((Component)component.modelTransform).gameObject; ModelSkinController skinController = (Object.op_Implicit((Object)(object)gameObject) ? gameObject.GetComponent<ModelSkinController>() : null); if (!Object.op_Implicit((Object)(object)skinController)) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelSkinController\" component")); return; } Renderer[] renderers = gameObject.GetComponentsInChildren<Renderer>(true); SkinDef skin = ScriptableObject.CreateInstance<SkinDef>(); TryCatchThrow("Icon", delegate { skin.icon = assetBundle.LoadAsset<Sprite>("Assets\\SkinMods\\Lilya\\Icons\\LilyaSkinIcon.png"); }); ((Object)skin).name = text2; skin.nameToken = "DANNYDUARTEMGS_SKIN_LILYASKIN_NAME"; skin.rootObject = gameObject; TryCatchThrow("Base Skins", delegate { skin.baseSkins = (SkinDef[])(object)new SkinDef[1] { skinController.skins[0] }; }); TryCatchThrow("Unlockable Name", delegate { skin.unlockableDef = ((IEnumerable<UnlockableDef>)ContentManager.unlockableDefs).FirstOrDefault((Func<UnlockableDef, bool>)((UnlockableDef def) => def.cachedName == "Lilya")); }); TryCatchThrow("Game Object Activations", delegate { skin.gameObjectActivations = Array.Empty<GameObjectActivation>(); }); TryCatchThrow("Renderer Infos", delegate { //IL_0011: 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_006e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) skin.rendererInfos = (RendererInfo[])(object)new RendererInfo[1] { new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/Resources/Lilya.mat"), defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = false, renderer = renderers.First((Renderer r) => ((Object)r).name == "PilotBody") } }; }); TryCatchThrow("Mesh Replacements", delegate { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_005f: 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_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: 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) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) skin.meshReplacements = (MeshReplacement[])(object)new MeshReplacement[8] { new MeshReplacement { mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\Lilya\\Meshes\\Lilya.mesh"), renderer = renderers.First((Renderer r) => ((Object)r).name == "PilotBody") }, new MeshReplacement { mesh = null, renderer = renderers.First((Renderer r) => ((Object)r).name == "PilotBody.001") }, new MeshReplacement { mesh = null, renderer = renderers.First((Renderer r) => ((Object)r).name == "PilotBreather") }, new MeshReplacement { mesh = null, renderer = renderers.First((Renderer r) => ((Object)r).name == "PilotEyes") }, new MeshReplacement { mesh = null, renderer = renderers.First((Renderer r) => ((Object)r).name == "Pilotfur") }, new MeshReplacement { mesh = null, renderer = renderers.First((Renderer r) => ((Object)r).name == "PilotMetal") }, new MeshReplacement { mesh = null, renderer = renderers.First((Renderer r) => ((Object)r).name == "PilotHead") }, new MeshReplacement { mesh = null, renderer = renderers.First((Renderer r) => ((Object)r).name == "PilotPouches") } }; }); TryCatchThrow("Minion Skin Replacements", delegate { skin.minionSkinReplacements = Array.Empty<MinionSkinReplacement>(); }); TryCatchThrow("Projectile Ghost Replacements", delegate { skin.projectileGhostReplacements = Array.Empty<ProjectileGhostReplacement>(); }); Array.Resize(ref skinController.skins, skinController.skins.Length + 1); skinController.skins[skinController.skins.Length - 1] = skin; BodyCatalog.skins[BodyCatalog.FindBodyIndex(val)] = skinController.skins; } catch (FieldException ex) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\"")); InstanceLogger.LogWarning((object)("Field causing issue: " + ex.Message)); InstanceLogger.LogError((object)ex.InnerException); } catch (Exception ex2) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\"")); InstanceLogger.LogError((object)ex2); } } private static void TryCatchThrow(string message, Action action) { try { action?.Invoke(); } catch (Exception innerException) { throw new FieldException(message, innerException); } } }
LilyaVoiceMod.dll
Decompiled 8 hours agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BaseVoiceoverLib; using BepInEx; using BepInEx.Configuration; using LilyaVoiceMod.Components; using LilyaVoiceMod.Modules; using Microsoft.CodeAnalysis; using R2API; using RoR2; using RoR2.ContentManagement; using UnityEngine; using UnityEngine.Networking; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("LilyaVoiceMod")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("LilyaVoiceMod")] [assembly: AssemblyTitle("LilyaVoiceMod")] [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 LilyaVoiceMod { [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.Dannyduartemgs.LilyaVoiceMod", "LilyaVoiceMod", "1.0.0")] public class LilyaVoiceMod : BaseUnityPlugin { public class NSEInfo { public NetworkSoundEventDef nse; public uint akId; public string eventName = string.Empty; public NSEInfo(NetworkSoundEventDef source) { nse = source; akId = source.akId; eventName = source.eventName; } private void DisableSound() { nse.akId = 0u; nse.eventName = string.Empty; } private void EnableSound() { nse.akId = akId; nse.eventName = eventName; } public void ValidateParams() { if (akId == 0) { akId = nse.akId; } if (eventName == string.Empty) { eventName = nse.eventName; } if (!enableVoicelines.Value) { DisableSound(); } else { EnableSound(); } } } public static ConfigEntry<bool> enableVoicelines; public static bool playedSeasonalVoiceline = false; public static AssetBundle assetBundle; public static List<NSEInfo> nseList = new List<NSEInfo>(); public void Awake() { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Expected O, but got Unknown //IL_0066: Expected O, but got Unknown Files.PluginInfo = ((BaseUnityPlugin)this).Info; RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(OnLoad)); new Content().Initialize(); InitNSE(); enableVoicelines = ((BaseUnityPlugin)this).Config.Bind<bool>(new ConfigDefinition("Settings", "Enable Voicelines"), true, new ConfigDescription("Enable Lilya voicelines when using the skin.", (AcceptableValueBase)null, Array.Empty<object>())); enableVoicelines.SettingChanged += EnableVoicelines_SettingChanged; } private void EnableVoicelines_SettingChanged(object sender, EventArgs e) { RefreshNSE(); } private void OnLoad() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Invalid comparison between Unknown and I4 //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Expected O, but got Unknown //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Expected O, but got Unknown BodyIndex val = BodyCatalog.FindBodyIndex("MoffeinPilotBody"); SkinDef val2 = null; if ((int)val != -1) { SkinDef[] array = SkinCatalog.FindSkinsForBody(val); foreach (SkinDef val3 in array) { if (((Object)val3).name == "LilyaSkin") { val2 = val3; break; } } } if (!Object.op_Implicit((Object)(object)val2)) { ((BaseUnityPlugin)this).Logger.LogError((object)"[LilyaVoiceMod] ❌ SkinDef not found. Voicelines will not work!"); return; } VoiceoverInfo val4 = new VoiceoverInfo(typeof(LilyaVoiceoverComponent), val2, "MoffeinPilotBody"); val4.selectActions = (LobbySelectActions)Delegate.Combine((Delegate?)(object)val4.selectActions, (Delegate?)new LobbySelectActions(OnSkinSelect)); RefreshNSE(); } private void OnSkinSelect(GameObject mannequinObject) { if (!enableVoicelines.Value) { return; } bool flag = false; if (!playedSeasonalVoiceline) { if (DateTime.Today.Month == 1 && DateTime.Today.Day == 1) { Util.PlaySound("Play_Lilya_NewYear", mannequinObject); flag = true; } else if (DateTime.Today.Month == 12 && (DateTime.Today.Day == 24 || DateTime.Today.Day == 25)) { Util.PlaySound("Play_Lilya_Xmas", mannequinObject); flag = true; } if (flag) { playedSeasonalVoiceline = true; } } if (!flag) { if (Util.CheckRoll(10f, 0f, (CharacterMaster)null)) { Util.PlaySound("Play_Lilya_select2", mannequinObject); } else { Util.PlaySound("Play_Lilya_select", mannequinObject); } ((BaseUnityPlugin)this).Logger.LogInfo((object)"[LilyaVoiceMod] Played skin select voiceline."); } } private void InitNSE() { LilyaVoiceoverComponent.nseSpecial = RegisterNSE("Play_Lilya_special"); LilyaVoiceoverComponent.nseBlock = RegisterNSE("Play_Lilya_Blocked"); LilyaVoiceoverComponent.nseShrineFail = RegisterNSE("Play_Lilya_fail"); LilyaVoiceoverComponent.nseShout = RegisterNSE("Play_Lilya_secondary"); LilyaVoiceoverComponent.nseTitle = RegisterNSE("Play_Lilya_TitleDrop"); LilyaVoiceoverComponent.nseIntro = RegisterNSE("Play_Lilya_Intro"); LilyaVoiceoverComponent.nseHurt = RegisterNSE("Play_Lilya_hurt"); LilyaVoiceoverComponent.nseKanpeki = RegisterNSE("Play_Lilya_Kanpeki"); LilyaVoiceoverComponent.nseSmart = RegisterNSE("Play_Lilya_Smart"); LilyaVoiceoverComponent.nseLogic = RegisterNSE("Play_Lilya_Logic"); LilyaVoiceoverComponent.nseFactor = RegisterNSE("Play_Lilya_Shout"); LilyaVoiceoverComponent.nseThanks = RegisterNSE("Play_Lilya_Thanks"); LilyaVoiceoverComponent.nseIku = RegisterNSE("Play_Lilya_jump"); LilyaVoiceoverComponent.nseMathTruth = RegisterNSE("Play_Lilya_MathTruth"); } private NetworkSoundEventDef RegisterNSE(string eventName) { NetworkSoundEventDef val = ScriptableObject.CreateInstance<NetworkSoundEventDef>(); val.eventName = eventName; Content.networkSoundEventDefs.Add(val); nseList.Add(new NSEInfo(val)); return val; } public void RefreshNSE() { foreach (NSEInfo nse in nseList) { nse.ValidateParams(); } } } } namespace LilyaVoiceMod.Modules { public class Content : IContentPackProvider { [CompilerGenerated] private sealed class <FinalizeAsync>d__8 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public FinalizeAsyncArgs args; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <FinalizeAsync>d__8(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { if (<>1__state != 0) { return false; } <>1__state = -1; args.ReportProgress(1f); 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(); } } [CompilerGenerated] private sealed class <GenerateContentPackAsync>d__7 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Content <>4__this; public GetContentPackAsyncArgs args; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <GenerateContentPackAsync>d__7(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { int num = <>1__state; Content content = <>4__this; if (num != 0) { return false; } <>1__state = -1; ContentPack.Copy(content.contentPack, args.output); args.ReportProgress(1f); 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(); } } [CompilerGenerated] private sealed class <LoadStaticContentAsync>d__6 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Content <>4__this; public LoadStaticContentAsyncArgs args; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <LoadStaticContentAsync>d__6(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { int num = <>1__state; Content content = <>4__this; if (num != 0) { return false; } <>1__state = -1; content.contentPack.identifier = content.identifier; content.contentPack.networkSoundEventDefs.Add(networkSoundEventDefs.ToArray()); args.ReportProgress(1f); 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(); } } internal ContentPack contentPack = new ContentPack(); public static List<NetworkSoundEventDef> networkSoundEventDefs = new List<NetworkSoundEventDef>(); public string identifier => "com.Dannyduartemgs.LilyaVoiceMod"; public void Initialize() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown ContentManager.collectContentPackProviders += new CollectContentPackProvidersDelegate(AddContentPackProvider); } private void AddContentPackProvider(AddContentPackProviderDelegate addContentPackProvider) { addContentPackProvider.Invoke((IContentPackProvider)(object)this); } [IteratorStateMachine(typeof(<LoadStaticContentAsync>d__6))] public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <LoadStaticContentAsync>d__6(0) { <>4__this = this, args = args }; } [IteratorStateMachine(typeof(<GenerateContentPackAsync>d__7))] public IEnumerator GenerateContentPackAsync(GetContentPackAsyncArgs args) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <GenerateContentPackAsync>d__7(0) { <>4__this = this, args = args }; } [IteratorStateMachine(typeof(<FinalizeAsync>d__8))] public IEnumerator FinalizeAsync(FinalizeAsyncArgs args) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <FinalizeAsync>d__8(0) { args = args }; } internal static NetworkSoundEventDef CreateNetworkSoundEventDef(string eventName) { NetworkSoundEventDef val = ScriptableObject.CreateInstance<NetworkSoundEventDef>(); val.akId = AkSoundEngine.GetIDFromString(eventName); val.eventName = eventName; networkSoundEventDefs.Add(val); return val; } } public static class Files { public static PluginInfo PluginInfo; public static string assemblyDir => Path.GetDirectoryName(PluginInfo.Location); } public static class SoundBanks { private static bool initialized; public static string SoundBankDirectory => Files.assemblyDir; public static void Init() { if (!initialized) { initialized = true; string text = Path.Combine(SoundBankDirectory, "LilyaSoundbank.sound"); if (!File.Exists(text)) { Debug.LogError((object)("[LilyaVoiceMod] ❌ Soundbank not found: " + text)); return; } SoundBanks.Add(File.ReadAllBytes(text)); Debug.Log((object)("[LilyaVoiceMod] ✅ Loaded soundbank: " + text)); } } } } namespace LilyaVoiceMod.Components { public class LilyaVoiceoverComponent : BaseVoiceoverComponent { public static NetworkSoundEventDef nseShout; public static NetworkSoundEventDef nseSpecial; public static NetworkSoundEventDef nseBlock; public static NetworkSoundEventDef nseShrineFail; public static NetworkSoundEventDef nseTitle; public static NetworkSoundEventDef nseIntro; public static NetworkSoundEventDef nseHurt; public static NetworkSoundEventDef nseKanpeki; public static NetworkSoundEventDef nseSmart; public static NetworkSoundEventDef nseLogic; public static NetworkSoundEventDef nseFactor; public static NetworkSoundEventDef nseThanks; public static NetworkSoundEventDef nseIku; public static NetworkSoundEventDef nseMathTruth; private float lowHealthCooldown; private float blockedCooldown; private float specialCooldown; private float utilityCooldown; private float levelCooldown; private float shrineOfChanceFailCooldown; private float secondaryCooldown; protected override void Start() { ((BaseVoiceoverComponent)this).Start(); } protected override void FixedUpdate() { ((BaseVoiceoverComponent)this).FixedUpdate(); if (lowHealthCooldown > 0f) { lowHealthCooldown -= Time.fixedDeltaTime; } if (blockedCooldown > 0f) { blockedCooldown -= Time.fixedDeltaTime; } if (specialCooldown > 0f) { specialCooldown -= Time.fixedDeltaTime; } if (utilityCooldown > 0f) { utilityCooldown -= Time.fixedDeltaTime; } if (levelCooldown > 0f) { levelCooldown -= Time.fixedDeltaTime; } if (shrineOfChanceFailCooldown > 0f) { levelCooldown -= Time.fixedDeltaTime; } if (secondaryCooldown > 0f) { secondaryCooldown -= Time.fixedDeltaTime; } } public override void PlaySpawn() { ((BaseVoiceoverComponent)this).TryPlaySound("Play_Lilya_spawn", 1f, false); } public override void PlayJump() { ((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseIku, 0f, false); } public override void PlayDeath() { ((BaseVoiceoverComponent)this).TryPlaySound("Play_Lilya_death", 1.5f, true); } public override void PlayHurt(float percentHPLost) { if (percentHPLost >= 0.1f) { ((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseHurt, 0f, false); } } public override void PlaySecondaryAuthority(GenericSkill skill) { if (!(secondaryCooldown > 0f) && ((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseShout, 0f, false)) { secondaryCooldown = 6.5f; } } public override void PlayTeleporterStart() { ((BaseVoiceoverComponent)this).TryPlaySound("Play_Lilya_tpstart", 3f, false); } public override void PlayTeleporterFinish() { ((BaseVoiceoverComponent)this).TryPlaySound("Play_Lilya_tpend", 3.8f, false); } public override void PlayVictory() { ((BaseVoiceoverComponent)this).TryPlaySound("Play_Lilya_yay", 3.8f, true); } public override void PlayLevelUp() { if (!(levelCooldown > 0f) && ((BaseVoiceoverComponent)this).TryPlaySound("Play_Lilya_levelup", 3f, false)) { levelCooldown = 60f; } } public override void PlayLowHealth() { if (!(lowHealthCooldown > 0f) && ((BaseVoiceoverComponent)this).TryPlaySound("Play_Lilya_lowhealth", 1f, false)) { lowHealthCooldown = 45f; } } public override void PlayUtilityAuthority(GenericSkill skill) { if (!(utilityCooldown > 0f) && ((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseFactor, 0f, false)) { utilityCooldown = 10f; } } public override void PlaySpecialAuthority(GenericSkill skill) { if (!(specialCooldown > 0f) && ((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseSpecial, 0f, false)) { specialCooldown = 15f; } } public void PlayAcquireLegendary() { ((BaseVoiceoverComponent)this).TryPlaySound("Play_Lilya_yay", 5.75f, false); } public override void PlayShrineOfChanceFailServer() { if (NetworkServer.active && !(shrineOfChanceFailCooldown > 0f) && ((BaseVoiceoverComponent)this).TryPlaySound("Play_Lilya_fail", 1f, false)) { shrineOfChanceFailCooldown = 60f; } } public override bool ComponentEnableVoicelines() { return LilyaVoiceMod.enableVoicelines.Value; } } }