using 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.Bootstrap;
using BepInEx.Configuration;
using FuukaChef.Components;
using FuukaChef.Modules;
using Microsoft.CodeAnalysis;
using R2API;
using RiskOfOptions;
using RiskOfOptions.Options;
using RoR2;
using RoR2.ContentManagement;
using UnityEngine;
using UnityEngine.AddressableAssets;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("FuukaChef")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("FuukaChef")]
[assembly: AssemblyTitle("FuukaChef")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
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;
}
}
}
namespace FuukaChef
{
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("com.Schale.FuukaChefVoiceover", "FuukaChefVoiceover", "1.0.0")]
public class FuukaChefVoiceoverPlugin : BaseUnityPlugin
{
public class NSEInfo
{
public NetworkSoundEventDef nse;
public uint akId = 0u;
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 ConfigEntry<KeyboardShortcut> btnNyCafe1;
public static ConfigEntry<KeyboardShortcut> btnThanks;
public static ConfigEntry<KeyboardShortcut> btnTitle;
public static ConfigEntry<KeyboardShortcut> btnEx1;
public static ConfigEntry<KeyboardShortcut> btnEx2;
public static ConfigEntry<KeyboardShortcut> btnEx3;
public static ConfigEntry<KeyboardShortcut> btnExLv1;
public static ConfigEntry<KeyboardShortcut> btnExLv2;
public static ConfigEntry<KeyboardShortcut> btnExLv3;
public static ConfigEntry<KeyboardShortcut> btnNYEx1;
public static ConfigEntry<KeyboardShortcut> btnNYEx2;
public static ConfigEntry<KeyboardShortcut> btnNYEx3;
public static ConfigEntry<KeyboardShortcut> btnNYExLv1;
public static ConfigEntry<KeyboardShortcut> btnNYExLv2;
public static ConfigEntry<KeyboardShortcut> btnNYExLv3;
public static ConfigEntry<KeyboardShortcut> btnDoushimashou;
public static bool playedSeasonalVoiceline = false;
public static AssetBundle assetBundle;
public static SurvivorDef survivorDef = Addressables.LoadAssetAsync<SurvivorDef>((object)"RoR2/DLC2/Chef/Chef.asset").WaitForCompletion();
public static List<NSEInfo> nseList = new List<NSEInfo>();
public void Awake()
{
//IL_007e: Unknown result type (might be due to invalid IL or missing references)
//IL_008f: Unknown result type (might be due to invalid IL or missing references)
//IL_0099: Expected O, but got Unknown
//IL_0099: Expected O, but got Unknown
//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
//IL_00d5: Expected O, but got Unknown
//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
//IL_00fa: Expected O, but got Unknown
//IL_010f: Unknown result type (might be due to invalid IL or missing references)
//IL_0114: Unknown result type (might be due to invalid IL or missing references)
//IL_011f: Expected O, but got Unknown
//IL_0134: 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_0144: Expected O, but got Unknown
//IL_0159: Unknown result type (might be due to invalid IL or missing references)
//IL_015e: Unknown result type (might be due to invalid IL or missing references)
//IL_0169: Expected O, but got Unknown
//IL_017e: 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_018e: Expected O, but got Unknown
//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
//IL_01b3: Expected O, but got Unknown
//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
//IL_01d8: Expected O, but got Unknown
//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
//IL_01fd: Expected O, but got Unknown
//IL_0212: Unknown result type (might be due to invalid IL or missing references)
//IL_0217: Unknown result type (might be due to invalid IL or missing references)
//IL_0222: Expected O, but got Unknown
//IL_0237: Unknown result type (might be due to invalid IL or missing references)
//IL_023c: Unknown result type (might be due to invalid IL or missing references)
//IL_0247: Expected O, but got Unknown
//IL_025c: Unknown result type (might be due to invalid IL or missing references)
//IL_0261: Unknown result type (might be due to invalid IL or missing references)
//IL_026c: Expected O, but got Unknown
//IL_0281: Unknown result type (might be due to invalid IL or missing references)
//IL_0286: Unknown result type (might be due to invalid IL or missing references)
//IL_0291: Expected O, but got Unknown
//IL_02a6: Unknown result type (might be due to invalid IL or missing references)
//IL_02ab: Unknown result type (might be due to invalid IL or missing references)
//IL_02b6: Expected O, but got Unknown
//IL_02cb: Unknown result type (might be due to invalid IL or missing references)
//IL_02d0: Unknown result type (might be due to invalid IL or missing references)
//IL_02db: Expected O, but got Unknown
//IL_02f0: Unknown result type (might be due to invalid IL or missing references)
//IL_02f5: Unknown result type (might be due to invalid IL or missing references)
//IL_0300: Expected O, but got Unknown
Files.PluginInfo = ((BaseUnityPlugin)this).Info;
RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(OnLoad));
new Content().Initialize();
using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("FuukaChef.fuukachefvoiceoverbundle"))
{
assetBundle = AssetBundle.LoadFromStream(stream);
}
SoundBanks.Init();
InitNSE();
enableVoicelines = ((BaseUnityPlugin)this).Config.Bind<bool>(new ConfigDefinition("Settings", "Enable Voicelines"), true, new ConfigDescription("Enable voicelines when using the FuukaChef Skin.", (AcceptableValueBase)null, Array.Empty<object>()));
enableVoicelines.SettingChanged += EnableVoicelines_SettingChanged;
btnTitle = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "Blue Archive"), KeyboardShortcut.Empty, (ConfigDescription)null);
btnEx1 = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "EX 1"), KeyboardShortcut.Empty, (ConfigDescription)null);
btnEx2 = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "EX 2"), KeyboardShortcut.Empty, (ConfigDescription)null);
btnEx3 = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "EX 3"), KeyboardShortcut.Empty, (ConfigDescription)null);
btnExLv1 = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "EX Lv 1"), KeyboardShortcut.Empty, (ConfigDescription)null);
btnExLv2 = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "EX Lv 2"), KeyboardShortcut.Empty, (ConfigDescription)null);
btnExLv3 = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "EX Lv 3"), KeyboardShortcut.Empty, (ConfigDescription)null);
btnNYEx1 = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "EX 1 (NY)"), KeyboardShortcut.Empty, (ConfigDescription)null);
btnNYEx2 = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "EX 2 (NY)"), KeyboardShortcut.Empty, (ConfigDescription)null);
btnNYEx3 = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "EX 3 (NY)"), KeyboardShortcut.Empty, (ConfigDescription)null);
btnNYExLv1 = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "EX Lv 1 (NY)"), KeyboardShortcut.Empty, (ConfigDescription)null);
btnNYExLv2 = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "EX Lv 2 (NY)"), KeyboardShortcut.Empty, (ConfigDescription)null);
btnNYExLv3 = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "EX Lv 3 (NY)"), KeyboardShortcut.Empty, (ConfigDescription)null);
btnDoushimashou = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "Doushimashou"), KeyboardShortcut.Empty, (ConfigDescription)null);
btnThanks = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "Thanks"), KeyboardShortcut.Empty, (ConfigDescription)null);
btnNyCafe1 = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "Cafe 1 (NY)"), KeyboardShortcut.Empty, (ConfigDescription)null);
if (Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions"))
{
RiskOfOptionsCompat();
}
}
[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
private void RiskOfOptionsCompat()
{
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_0025: Expected O, but got Unknown
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Expected O, but got Unknown
//IL_003b: Unknown result type (might be due to invalid IL or missing references)
//IL_0045: Expected O, but got Unknown
//IL_004b: Unknown result type (might be due to invalid IL or missing references)
//IL_0055: Expected O, but got Unknown
//IL_005b: Unknown result type (might be due to invalid IL or missing references)
//IL_0065: Expected O, but got Unknown
//IL_006b: Unknown result type (might be due to invalid IL or missing references)
//IL_0075: Expected O, but got Unknown
//IL_007b: Unknown result type (might be due to invalid IL or missing references)
//IL_0085: Expected O, but got Unknown
//IL_008b: Unknown result type (might be due to invalid IL or missing references)
//IL_0095: Expected O, but got Unknown
//IL_009b: Unknown result type (might be due to invalid IL or missing references)
//IL_00a5: Expected O, but got Unknown
//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
//IL_00b5: Expected O, but got Unknown
//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
//IL_00c5: Expected O, but got Unknown
//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
//IL_00d5: Expected O, but got Unknown
//IL_00db: Unknown result type (might be due to invalid IL or missing references)
//IL_00e5: Expected O, but got Unknown
//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
//IL_00f5: Expected O, but got Unknown
//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
//IL_0105: Expected O, but got Unknown
//IL_010b: Unknown result type (might be due to invalid IL or missing references)
//IL_0115: Expected O, but got Unknown
//IL_011b: Unknown result type (might be due to invalid IL or missing references)
//IL_0125: Expected O, but got Unknown
ModSettingsManager.SetModIcon(assetBundle.LoadAsset<Sprite>("fuuka"));
ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(enableVoicelines));
ModSettingsManager.AddOption((BaseOption)new KeyBindOption(btnTitle));
ModSettingsManager.AddOption((BaseOption)new KeyBindOption(btnEx1));
ModSettingsManager.AddOption((BaseOption)new KeyBindOption(btnEx2));
ModSettingsManager.AddOption((BaseOption)new KeyBindOption(btnEx3));
ModSettingsManager.AddOption((BaseOption)new KeyBindOption(btnExLv1));
ModSettingsManager.AddOption((BaseOption)new KeyBindOption(btnExLv2));
ModSettingsManager.AddOption((BaseOption)new KeyBindOption(btnExLv3));
ModSettingsManager.AddOption((BaseOption)new KeyBindOption(btnNYEx1));
ModSettingsManager.AddOption((BaseOption)new KeyBindOption(btnNYEx2));
ModSettingsManager.AddOption((BaseOption)new KeyBindOption(btnNYEx3));
ModSettingsManager.AddOption((BaseOption)new KeyBindOption(btnNYExLv1));
ModSettingsManager.AddOption((BaseOption)new KeyBindOption(btnNYExLv2));
ModSettingsManager.AddOption((BaseOption)new KeyBindOption(btnNYExLv3));
ModSettingsManager.AddOption((BaseOption)new KeyBindOption(btnDoushimashou));
ModSettingsManager.AddOption((BaseOption)new KeyBindOption(btnThanks));
ModSettingsManager.AddOption((BaseOption)new KeyBindOption(btnNyCafe1));
}
private void FuukaSelect(GameObject mannequinObject)
{
if (!enableVoicelines.Value)
{
return;
}
bool flag = false;
if (!playedSeasonalVoiceline)
{
if ((DateTime.Today.Month == 1 && DateTime.Today.Day == 1) || (DateTime.Today.Month == 12 && DateTime.Today.Day == 31))
{
Util.PlaySound("Play_FuukaChef_Lobby_Newyear", mannequinObject);
flag = true;
}
else if (DateTime.Today.Month == 4 && DateTime.Today.Day == 30)
{
Util.PlaySound("Play_FuukaChef_Lobby_bday", mannequinObject);
flag = true;
}
else if (DateTime.Today.Month == 10 && DateTime.Today.Day == 31)
{
Util.PlaySound("Play_FuukaChef_Lobby_Halloween", mannequinObject);
flag = true;
}
else if (DateTime.Today.Month == 12 && (DateTime.Today.Day == 25 || DateTime.Today.Day == 24))
{
Util.PlaySound("Play_FuukaChef_Lobby_xmas", mannequinObject);
flag = true;
}
if (flag)
{
playedSeasonalVoiceline = true;
}
}
if (!flag)
{
if (Util.CheckRoll(5f, 0f, (CharacterMaster)null))
{
Util.PlaySound("Play_FuukaChef_Title", mannequinObject);
}
else
{
Util.PlaySound("Play_FuukaChef_Lobby", mannequinObject);
}
}
}
private void OnLoad()
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_0077: Unknown result type (might be due to invalid IL or missing references)
//IL_007e: Expected O, but got Unknown
//IL_008d: Unknown result type (might be due to invalid IL or missing references)
//IL_0097: Expected O, but got Unknown
//IL_0097: Unknown result type (might be due to invalid IL or missing references)
//IL_00a1: Expected O, but got Unknown
SkinDef val = null;
SkinDef[] array = SkinCatalog.FindSkinsForBody(BodyCatalog.FindBodyIndex("ChefBody"));
SkinDef[] array2 = array;
foreach (SkinDef val2 in array2)
{
if (((Object)val2).name == "FuukaCartDef")
{
val = val2;
break;
}
}
if (!Object.op_Implicit((Object)(object)val))
{
Debug.LogError((object)"FuukaChefVoiceover: Chef Fuuka SkinDef not found. Voicelines will not work!");
}
else
{
VoiceoverInfo val3 = new VoiceoverInfo(typeof(FuukaChefVoiceoverComponent), val, "ChefBody");
val3.selectActions = (LobbySelectActions)Delegate.Combine((Delegate?)(object)val3.selectActions, (Delegate?)new LobbySelectActions(FuukaSelect));
}
RefreshNSE();
PopulateFoodList();
}
private void PopulateFoodList()
{
AddItemIfValid("Mushroom");
AddItemIfValid("MushroomVoid");
AddItemIfValid("FlatHealth");
AddItemIfValid("Squid");
AddItemIfValid("Clover");
AddItemIfValid("Plant");
AddItemIfValid("Seed");
AddItemIfValid("CHARGED_URCHIN");
AddItemIfValid("MysticsItems_Cookie");
AddItemIfValid("MysticsItems_HealOrbOnBarrel");
AddItemIfValid("CLASSICITEMSRETURNS_ITEM_BITTERROOT");
AddItemIfValid("CLASSICITEMSRETURNS_ITEM_56LEAFCLOVER");
AddItemIfValid("HealWhileSafe");
AddEquipmentIfValid("Fruit");
AddEquipmentIfValid("HealAndRevive");
AddEquipmentIfValid("HealAndReviveConsumed");
AddEggItemIfValid("ParentEgg");
AddEggItemIfValid("HopooEgg");
AddEggEquipmentIfValid("FireBallDash");
}
private void AddItemIfValid(string itemName)
{
//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)
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_000a: Invalid comparison between Unknown and I4
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
ItemIndex val = ItemCatalog.FindItemIndex(itemName);
if ((int)val != -1)
{
FuukaChefVoiceoverComponent.foodItems.Add(val);
}
}
private void AddEquipmentIfValid(string equipmentName)
{
//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)
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_000a: Invalid comparison between Unknown and I4
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
EquipmentIndex val = EquipmentCatalog.FindEquipmentIndex(equipmentName);
if ((int)val != -1)
{
FuukaChefVoiceoverComponent.foodEquipment.Add(val);
}
}
private void AddEggItemIfValid(string itemName)
{
//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)
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_000a: Invalid comparison between Unknown and I4
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
ItemIndex val = ItemCatalog.FindItemIndex(itemName);
if ((int)val != -1)
{
FuukaChefVoiceoverComponent.eggItems.Add(val);
}
}
private void AddEggEquipmentIfValid(string equipmentName)
{
//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)
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_000a: Invalid comparison between Unknown and I4
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
EquipmentIndex val = EquipmentCatalog.FindEquipmentIndex(equipmentName);
if ((int)val != -1)
{
FuukaChefVoiceoverComponent.eggEquipment.Add(val);
}
}
private void EnableVoicelines_SettingChanged(object sender, EventArgs e)
{
RefreshNSE();
}
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();
}
}
private void InitNSE()
{
FuukaChefVoiceoverComponent.nseDoushimashou = RegisterNSE("Play_FuukaChef_Doushimashou");
FuukaChefVoiceoverComponent.nseNYCommon = RegisterNSE("Play_FuukaChef_NY_Common");
FuukaChefVoiceoverComponent.nseTitle = RegisterNSE("Play_FuukaChef_Title");
FuukaChefVoiceoverComponent.nseNYEx1 = RegisterNSE("Play_FuukaChef_NY_Ex1");
FuukaChefVoiceoverComponent.nseNYEx2 = RegisterNSE("Play_FuukaChef_NY_Ex2");
FuukaChefVoiceoverComponent.nseNYEx3 = RegisterNSE("Play_FuukaChef_NY_Ex3");
FuukaChefVoiceoverComponent.nseNYExLv1 = RegisterNSE("Play_FuukaChef_NY_Ex_Lv1");
FuukaChefVoiceoverComponent.nseNYExLv2 = RegisterNSE("Play_FuukaChef_NY_Ex_Lv2");
FuukaChefVoiceoverComponent.nseNYExLv3 = RegisterNSE("Play_FuukaChef_NY_Ex_Lv3");
FuukaChefVoiceoverComponent.nseEx1 = RegisterNSE("Play_FuukaChef_Ex1");
FuukaChefVoiceoverComponent.nseEx2 = RegisterNSE("Play_FuukaChef_Ex2");
FuukaChefVoiceoverComponent.nseEx3 = RegisterNSE("Play_FuukaChef_Ex3");
FuukaChefVoiceoverComponent.nseExLv1 = RegisterNSE("Play_FuukaChef_Ex_Lv1");
FuukaChefVoiceoverComponent.nseExLv2 = RegisterNSE("Play_FuukaChef_Ex_Lv2");
FuukaChefVoiceoverComponent.nseExLv3 = RegisterNSE("Play_FuukaChef_Ex_Lv3");
FuukaChefVoiceoverComponent.nseNYCafe1 = RegisterNSE("Play_FuukaChef_NY_Cafe_1");
}
}
}
namespace FuukaChef.Modules
{
public class Content : IContentPackProvider
{
internal ContentPack contentPack = new ContentPack();
public static List<NetworkSoundEventDef> networkSoundEventDefs = new List<NetworkSoundEventDef>();
public string identifier => "com.Schale.FuukaChefVoiceover";
public void Initialize()
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Expected O, but got Unknown
ContentManager.collectContentPackProviders += new CollectContentPackProvidersDelegate(ContentManager_collectContentPackProviders);
}
private void ContentManager_collectContentPackProviders(AddContentPackProviderDelegate addContentPackProvider)
{
addContentPackProvider.Invoke((IContentPackProvider)(object)this);
}
public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args)
{
contentPack.identifier = identifier;
contentPack.networkSoundEventDefs.Add(networkSoundEventDefs.ToArray());
args.ReportProgress(1f);
yield break;
}
public IEnumerator GenerateContentPackAsync(GetContentPackAsyncArgs args)
{
ContentPack.Copy(contentPack, args.output);
args.ReportProgress(1f);
yield break;
}
public IEnumerator FinalizeAsync(FinalizeAsyncArgs args)
{
args.ReportProgress(1f);
yield break;
}
}
public static class Files
{
public static PluginInfo PluginInfo;
internal static string assemblyDir => Path.GetDirectoryName(PluginInfo.Location);
internal static void Init(PluginInfo info)
{
PluginInfo = info;
}
internal static string GetPathToFile(string folderName, string fileName)
{
return Path.Combine(assemblyDir, folderName, fileName);
}
}
public static class SoundBanks
{
private static bool initialized;
public static string SoundBankDirectory => Files.assemblyDir;
public static void Init()
{
if (initialized)
{
return;
}
initialized = true;
using Stream stream = new FileStream(SoundBankDirectory + "\\FuukaChefSoundbank.bnk", FileMode.Open);
byte[] array = new byte[stream.Length];
stream.Read(array, 0, array.Length);
SoundBanks.Add(array);
}
}
}
namespace FuukaChef.Components
{
public class FuukaChefVoiceoverComponent : BaseVoiceoverComponent
{
private bool acquiredScepter = false;
private float specialCooldown = 0f;
private float utilityCooldown = 0f;
private float secondaryCooldown = 0f;
private float levelCooldown = 0f;
private float shrineFailCooldown = 0f;
private float lowHealthCooldown = 0f;
private float foodCommentCooldown = 0f;
public static NetworkSoundEventDef nseNYCafe1;
public static NetworkSoundEventDef nseThanks;
public static NetworkSoundEventDef nseDoushimashou;
public static NetworkSoundEventDef nseNYCommon;
public static NetworkSoundEventDef nseNYEx1;
public static NetworkSoundEventDef nseNYEx2;
public static NetworkSoundEventDef nseNYEx3;
public static NetworkSoundEventDef nseNYExLv1;
public static NetworkSoundEventDef nseNYExLv2;
public static NetworkSoundEventDef nseNYExLv3;
public static NetworkSoundEventDef nseEx1;
public static NetworkSoundEventDef nseEx2;
public static NetworkSoundEventDef nseEx3;
public static NetworkSoundEventDef nseExLv1;
public static NetworkSoundEventDef nseExLv2;
public static NetworkSoundEventDef nseExLv3;
public static NetworkSoundEventDef nseTitle;
public static HashSet<ItemIndex> foodItems = new HashSet<ItemIndex>();
public static HashSet<ItemIndex> eggItems = new HashSet<ItemIndex>();
public static HashSet<EquipmentIndex> foodEquipment = new HashSet<EquipmentIndex>();
public static HashSet<EquipmentIndex> eggEquipment = new HashSet<EquipmentIndex>();
protected override void Start()
{
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
((BaseVoiceoverComponent)this).Start();
if (Object.op_Implicit((Object)(object)base.inventory) && base.inventory.GetItemCount(BaseVoiceoverComponent.scepterIndex) > 0)
{
acquiredScepter = true;
}
}
protected override void FixedUpdate()
{
((BaseVoiceoverComponent)this).FixedUpdate();
if (specialCooldown > 0f)
{
specialCooldown -= Time.fixedDeltaTime;
}
if (utilityCooldown > 0f)
{
utilityCooldown -= Time.fixedDeltaTime;
}
if (secondaryCooldown > 0f)
{
secondaryCooldown -= Time.fixedDeltaTime;
}
if (levelCooldown > 0f)
{
levelCooldown -= Time.fixedDeltaTime;
}
if (lowHealthCooldown > 0f)
{
lowHealthCooldown -= Time.fixedDeltaTime;
}
if (shrineFailCooldown > 0f)
{
shrineFailCooldown -= Time.fixedDeltaTime;
}
if (foodCommentCooldown > 0f)
{
foodCommentCooldown -= Time.fixedDeltaTime;
}
}
public override void PlayLevelUp()
{
if (!(levelCooldown > 0f) && ((!Util.CheckRoll(50f, 0f, (CharacterMaster)null)) ? ((BaseVoiceoverComponent)this).TryPlaySound("Play_FuukaChef_LevelUp_Long", 3.3f, false) : ((BaseVoiceoverComponent)this).TryPlaySound("Play_FuukaChef_LevelUp_Short", 2.1f, false)))
{
levelCooldown = 60f;
}
}
protected override void Inventory_onEquipmentChangedClient(EquipmentIndex equipmentIndex, uint equipmentSlot)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
((BaseVoiceoverComponent)this).Inventory_onEquipmentChangedClient(equipmentIndex, equipmentSlot);
if (eggEquipment.Contains(equipmentIndex))
{
PlayEggGet();
}
else if (foodEquipment.Contains(equipmentIndex))
{
PlayFoodGet();
}
}
protected override void Inventory_onItemAddedClient(ItemIndex itemIndex)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0009: 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_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_002c: 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_0042: Invalid comparison between Unknown and I4
//IL_005b: 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)
((BaseVoiceoverComponent)this).Inventory_onItemAddedClient(itemIndex);
if ((int)BaseVoiceoverComponent.scepterIndex != -1 && itemIndex == BaseVoiceoverComponent.scepterIndex)
{
PlayAcquireScepter();
return;
}
ItemDef itemDef = ItemCatalog.GetItemDef(itemIndex);
if (Object.op_Implicit((Object)(object)itemDef) && (int)itemDef.tier == 2)
{
PlayAcquireLegendary();
}
else if (eggItems.Contains(itemIndex))
{
PlayEggGet();
}
else if (foodItems.Contains(itemIndex))
{
PlayFoodGet();
}
}
public void PlayAcquireScepter()
{
if (!acquiredScepter)
{
((BaseVoiceoverComponent)this).TryPlaySound("Play_FuukaChef_AcquireScepter", 8f, true);
acquiredScepter = true;
}
}
public void PlayEggGet()
{
if (!(foodCommentCooldown > 0f) && ((BaseVoiceoverComponent)this).TryPlaySound("Play_FuukaChef_Egg", 7f, true))
{
foodCommentCooldown = 30f;
}
}
public void PlayFoodGet()
{
if (!(foodCommentCooldown > 0f))
{
bool flag = false;
if (Random.Range(1, 6) switch
{
1 => ((BaseVoiceoverComponent)this).TryPlaySound("Play_FuukaChef_Lobby_2", 4f, false),
2 => ((BaseVoiceoverComponent)this).TryPlaySound("Play_FuukaChef_Lobby_5", 7f, false),
3 => ((BaseVoiceoverComponent)this).TryPlaySound("Play_FuukaChef_Cafe_1", 2.1f, false),
4 => ((BaseVoiceoverComponent)this).TryPlaySound("Play_FuukaChef_Cafe_3", 2.6f, false),
_ => ((BaseVoiceoverComponent)this).TryPlaySound("Play_FuukaChef_NY_Cafe_1", 3.5f, false),
})
{
foodCommentCooldown = 30f;
}
}
}
public void PlayAcquireLegendary()
{
switch (Random.Range(1, 5))
{
case 1:
((BaseVoiceoverComponent)this).TryPlaySound("Play_FuukaChef_Relationship_1", 4f, false);
break;
case 2:
((BaseVoiceoverComponent)this).TryPlaySound("Play_FuukaChef_Relationship_2", 3.1f, false);
break;
case 3:
((BaseVoiceoverComponent)this).TryPlaySound("Play_FuukaChef_Relationship_3", 3.3f, false);
break;
default:
((BaseVoiceoverComponent)this).TryPlaySound("Play_FuukaChef_Relationship_4", 6.25f, false);
break;
}
}
public override void PlayLowHealth()
{
if (!(lowHealthCooldown > 0f) && ((BaseVoiceoverComponent)this).TryPlaySound("Play_FuukaChef_Lobby_3", 4.2f, false))
{
lowHealthCooldown = 60f;
}
}
public override void PlaySpawn()
{
switch (Random.Range(1, 6))
{
case 1:
((BaseVoiceoverComponent)this).TryPlaySound("Play_FuukaChef_Battle_In_1", 2.3f, true);
break;
case 2:
((BaseVoiceoverComponent)this).TryPlaySound("Play_FuukaChef_Battle_TSA_1", 4.3f, true);
break;
case 3:
((BaseVoiceoverComponent)this).TryPlaySound("Play_FuukaChef_Battle_TSA_2", 2.7f, true);
break;
case 4:
((BaseVoiceoverComponent)this).TryPlaySound("Play_FuukaChef_Cafe_Act_2", 1.45f, true);
break;
default:
((BaseVoiceoverComponent)this).TryPlaySound("Play_FuukaChef_CookingSkills", 4.7f, true);
break;
}
}
public override void PlayTeleporterStart()
{
switch (Random.Range(1, 6))
{
case 1:
((BaseVoiceoverComponent)this).TryPlaySound("Play_FuukaChef_Battle_In_1", 2.3f, false);
break;
case 2:
((BaseVoiceoverComponent)this).TryPlaySound("Play_FuukaChef_Battle_TSA_1", 4.3f, false);
break;
case 3:
((BaseVoiceoverComponent)this).TryPlaySound("Play_FuukaChef_Battle_TSA_2", 2.7f, true);
break;
case 4:
((BaseVoiceoverComponent)this).TryPlaySound("Play_FuukaChef_Cafe_Act_2", 1.45f, false);
break;
default:
((BaseVoiceoverComponent)this).TryPlaySound("Play_FuukaChef_CookingSkills", 4.7f, false);
break;
}
}
public override void PlayTeleporterFinish()
{
switch (Random.Range(1, 5))
{
case 1:
((BaseVoiceoverComponent)this).TryPlaySound("Play_FuukaChef_EventEnd", 7.5f, false);
break;
case 2:
((BaseVoiceoverComponent)this).TryPlaySound("Play_FuukaChef_CommonSkill", 1.5f, false);
break;
case 3:
((BaseVoiceoverComponent)this).TryPlaySound("Play_FuukaChef_Ex2", 1.55f, false);
break;
default:
((BaseVoiceoverComponent)this).TryPlaySound("Play_FuukaChef_Ex3", 2.3f, false);
break;
}
}
public override void PlayVictory()
{
((BaseVoiceoverComponent)this).TryPlaySound("Play_FuukaChef_Memorial5", 17f, true);
}
public override void PlayShrineOfChanceFailServer()
{
if (!(shrineFailCooldown > 0f) && Util.CheckRoll(15f, 0f, (CharacterMaster)null) && ((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseDoushimashou, 1.5f, false))
{
shrineFailCooldown = 60f;
}
}
public override void PlaySecondaryAuthority(GenericSkill skill)
{
if (!(secondaryCooldown > 0f))
{
bool flag = false;
switch (Random.Range(1, 5))
{
case 1:
((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseEx1, 1f, false);
break;
case 2:
((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseExLv1, 1.7f, false);
break;
case 3:
((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseExLv2, 1.5f, false);
break;
default:
((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseExLv3, 1.65f, false);
break;
}
if (flag)
{
secondaryCooldown = 12f;
}
}
}
public override void PlayUtilityAuthority(GenericSkill skill)
{
if (!(utilityCooldown > 0f))
{
bool flag = false;
switch (Random.Range(1, 4))
{
case 1:
((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseNYCommon, 1.3f, false);
break;
case 2:
((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseNYEx1, 1.5f, false);
break;
default:
((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseNYEx3, 1f, false);
break;
}
if (flag)
{
utilityCooldown = 30f;
}
}
}
public override void PlaySpecialAuthority(GenericSkill skill)
{
if (!(specialCooldown > 0f))
{
bool flag = false;
switch (Random.Range(1, 4))
{
case 1:
((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseNYEx2, 1.65f, false);
break;
case 2:
((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseNYExLv2, 1.45f, false);
break;
default:
((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseNYExLv3, 2.05f, false);
break;
}
if (flag)
{
specialCooldown = 12f;
}
}
}
protected override void CheckInputs()
{
if (Utils.GetKeyPressed(FuukaChefVoiceoverPlugin.btnTitle))
{
((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseTitle, 1.7f, false);
}
else if (Utils.GetKeyPressed(FuukaChefVoiceoverPlugin.btnEx1))
{
((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseEx1, 1f, false);
}
else if (Utils.GetKeyPressed(FuukaChefVoiceoverPlugin.btnEx2))
{
((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseEx2, 1.55f, false);
}
else if (Utils.GetKeyPressed(FuukaChefVoiceoverPlugin.btnEx3))
{
((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseEx3, 2.3f, false);
}
else if (Utils.GetKeyPressed(FuukaChefVoiceoverPlugin.btnExLv1))
{
((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseExLv1, 1.7f, false);
}
else if (Utils.GetKeyPressed(FuukaChefVoiceoverPlugin.btnExLv2))
{
((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseExLv2, 1.5f, false);
}
else if (Utils.GetKeyPressed(FuukaChefVoiceoverPlugin.btnExLv3))
{
((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseExLv3, 1.65f, false);
}
else if (Utils.GetKeyPressed(FuukaChefVoiceoverPlugin.btnNYEx1))
{
((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseNYEx1, 1.5f, false);
}
else if (Utils.GetKeyPressed(FuukaChefVoiceoverPlugin.btnNYEx2))
{
((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseNYEx2, 1.65f, false);
}
else if (Utils.GetKeyPressed(FuukaChefVoiceoverPlugin.btnNYEx3))
{
((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseNYEx3, 1f, false);
}
else if (Utils.GetKeyPressed(FuukaChefVoiceoverPlugin.btnNYExLv1))
{
((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseNYExLv1, 1.85f, false);
}
else if (Utils.GetKeyPressed(FuukaChefVoiceoverPlugin.btnNYExLv2))
{
((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseNYExLv2, 1.45f, false);
}
else if (Utils.GetKeyPressed(FuukaChefVoiceoverPlugin.btnNYExLv3))
{
((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseNYExLv3, 2.05f, false);
}
else if (Utils.GetKeyPressed(FuukaChefVoiceoverPlugin.btnDoushimashou))
{
((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseDoushimashou, 1.2f, false);
}
else if (Utils.GetKeyPressed(FuukaChefVoiceoverPlugin.btnThanks))
{
((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseThanks, 1.2f, false);
}
else if (Utils.GetKeyPressed(FuukaChefVoiceoverPlugin.btnNyCafe1))
{
((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseNYCafe1, 3.5f, false);
}
}
}
}