Some mods may be broken due to the recent Alloyed Collective update.
Decompiled source of Bocchi The Mando v1.0.1
Bocchi.dll
Decompiled a week 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 Bocchi; [BepInPlugin("com.Dannyduartemgs.Bocchi", "Bocchi", "1.0.0")] public class BocchiPlugin : 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 BocchiPlugin Instance { get; private set; } internal static ManualLogSource InstanceLogger { get { BocchiPlugin instance = Instance; return (instance != null) ? ((BaseUnityPlugin)instance).Logger : null; } } private void Start() { Instance = this; using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Bocchi.dannyduartemgsbocchi")) { 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/Bocchi.mat", "Assets/Resources/Weapons.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_BOCCHISKIN_NAME", "Bocchi"); } 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)); AddCommandoBodyBocchiSkinSkin(); HookEndpointManager.Remove((MethodBase)method, (Delegate)new Action<Action<SkinDef>, SkinDef>(Nothing)); } private static void AddCommandoBodyBocchiSkinSkin() { //IL_0273: Unknown result type (might be due to invalid IL or missing references) string text = "CommandoBody"; string text2 = "BocchiSkin"; 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\\Bocchi\\Icons\\BocchiSkinIcon.png"); }); ((Object)skin).name = text2; skin.nameToken = "DANNYDUARTEMGS_SKIN_BOCCHISKIN_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 == "Bocchi")); }); 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_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0056: 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_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: 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_00d7: Unknown result type (might be due to invalid IL or missing references) skin.rendererInfos = (RendererInfo[])(object)new RendererInfo[3] { new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/Resources/Bocchi.mat"), defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = false, renderer = renderers[6] }, new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/Resources/Weapons.mat"), defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = false, renderer = renderers[3] }, new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/Resources/Weapons.mat"), defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = false, renderer = renderers[0] } }; }); TryCatchThrow("Mesh Replacements", delegate { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0046: 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_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: 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) skin.meshReplacements = (MeshReplacement[])(object)new MeshReplacement[3] { new MeshReplacement { mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\Bocchi\\Meshes\\Bocchi_mesh.mesh"), renderer = renderers[6] }, new MeshReplacement { mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\Bocchi\\Meshes\\bocchi the glock.002.mesh"), renderer = renderers[3] }, new MeshReplacement { mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\Bocchi\\Meshes\\bocchi the glock.mesh"), renderer = renderers[0] } }; }); 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); } } }
BocchiVoiceMod.dll
Decompiled a week 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 BocchiVoiceMod.Components; using BocchiVoiceMod.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("BocchiVoiceMod")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+f934d27a8dfbd3c445ce4b5c1aed8a3bede820bc")] [assembly: AssemblyProduct("BocchiVoiceMod")] [assembly: AssemblyTitle("BocchiVoiceMod")] [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 BocchiVoiceMod { [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.Dannyduartemgs.BocchiVoiceMod", "BocchiVoiceMod", "1.0.0")] public class BocchiVoiceMod : 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 Bocchi 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("CommandoBody"); SkinDef val2 = null; if ((int)val != -1) { SkinDef[] array = SkinCatalog.FindSkinsForBody(val); foreach (SkinDef val3 in array) { if (((Object)val3).name == "BocchiSkin") { val2 = val3; break; } } } if (!Object.op_Implicit((Object)(object)val2)) { ((BaseUnityPlugin)this).Logger.LogError((object)"[BocchiVoiceMod] ❌ SkinDef not found. Voicelines will not work!"); return; } VoiceoverInfo val4 = new VoiceoverInfo(typeof(BocchiVoiceoverComponent), val2, "CommandoBody"); 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_bocchi_NewYear", mannequinObject); flag = true; } else if (DateTime.Today.Month == 12 && (DateTime.Today.Day == 24 || DateTime.Today.Day == 25)) { Util.PlaySound("Play_bocchi_Xmas", mannequinObject); flag = true; } if (flag) { playedSeasonalVoiceline = true; } } if (!flag) { if (Util.CheckRoll(10f, 0f, (CharacterMaster)null)) { Util.PlaySound("Play_bocchi_select2", mannequinObject); } else { Util.PlaySound("Play_bocchi_select", mannequinObject); } ((BaseUnityPlugin)this).Logger.LogInfo((object)"[BocchiVoiceMod] Played skin select voiceline."); } } private void InitNSE() { BocchiVoiceoverComponent.nseSpecial = RegisterNSE("Play_bocchi_skill1"); BocchiVoiceoverComponent.nseBlock = RegisterNSE("Play_Bocchi_Blocked"); BocchiVoiceoverComponent.nseShrineFail = RegisterNSE("Play_bocchi_skill4"); BocchiVoiceoverComponent.nseShout = RegisterNSE("Play_bocchi_skill1"); BocchiVoiceoverComponent.nseTitle = RegisterNSE("Play_Bocchi_TitleDrop"); BocchiVoiceoverComponent.nseIntro = RegisterNSE("Play_Bocchi_Intro"); BocchiVoiceoverComponent.nseHurt = RegisterNSE("Play_Bocchi_TakeDamage"); BocchiVoiceoverComponent.nseKanpeki = RegisterNSE("Play_Bocchi_Kanpeki"); BocchiVoiceoverComponent.nseSmart = RegisterNSE("Play_Bocchi_Smart"); BocchiVoiceoverComponent.nseLogic = RegisterNSE("Play_Bocchi_Logic"); BocchiVoiceoverComponent.nseFactor = RegisterNSE("Play_Bocchi_Factor"); BocchiVoiceoverComponent.nseThanks = RegisterNSE("Play_Bocchi_Thanks"); BocchiVoiceoverComponent.nseIku = RegisterNSE("Play_bocchi_jump"); BocchiVoiceoverComponent.nseMathTruth = RegisterNSE("Play_Bocchi_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 BocchiVoiceMod.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.BocchiVoiceMod"; 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, "BocchiSoundbank.sound"); if (!File.Exists(text)) { Debug.LogError((object)("[BocchiVoiceMod] ❌ Soundbank not found: " + text)); return; } SoundBanks.Add(File.ReadAllBytes(text)); Debug.Log((object)("[BocchiVoiceMod] ✅ Loaded soundbank: " + text)); } } } } namespace BocchiVoiceMod.Components { public class BocchiVoiceoverComponent : 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 levelCooldown; private float shrineOfChanceFailCooldown; 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 (levelCooldown > 0f) { levelCooldown -= Time.fixedDeltaTime; } if (shrineOfChanceFailCooldown > 0f) { levelCooldown -= Time.fixedDeltaTime; } } public override void PlaySpawn() { ((BaseVoiceoverComponent)this).TryPlaySound("Play_bocchi_spawn", 1f, false); } public override void PlayJump() { ((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseIku, 0f, false); } public override void PlayDeath() { ((BaseVoiceoverComponent)this).TryPlaySound("Play_bocchi_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) { ((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseShout, 0f, false); } public override void PlayTeleporterStart() { ((BaseVoiceoverComponent)this).TryPlaySound("Play_bocchi_skill3", 1.95f, false); } public override void PlayTeleporterFinish() { ((BaseVoiceoverComponent)this).TryPlaySound("Play_bocchi_levelup", 3.8f, false); } public override void PlayVictory() { ((BaseVoiceoverComponent)this).TryPlaySound("Play_bocchi_yay", 3.8f, true); } public override void PlayLevelUp() { if (!(levelCooldown > 0f) && ((BaseVoiceoverComponent)this).TryPlaySound("Play_bocchi_levelup", 3f, false)) { levelCooldown = 60f; } } public override void PlayLowHealth() { if (!(lowHealthCooldown > 0f) && ((BaseVoiceoverComponent)this).TryPlaySound("Play_bocchi_LowHealth", 1f, false)) { lowHealthCooldown = 45f; } } public override void PlaySpecialAuthority(GenericSkill skill) { if (!(specialCooldown > 0f) && ((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseSpecial, 0f, false)) { specialCooldown = 15f; } } public void PlayAcquireLegendary() { ((BaseVoiceoverComponent)this).TryPlaySound("Play_bocchi_yay", 5.75f, false); } public override void PlayShrineOfChanceFailServer() { if (NetworkServer.active && !(shrineOfChanceFailCooldown > 0f) && ((BaseVoiceoverComponent)this).TryPlaySound("Play_bocchi_skill4", 1f, false)) { shrineOfChanceFailCooldown = 60f; } } public override bool ComponentEnableVoicelines() { return BocchiVoiceMod.enableVoicelines.Value; } } }