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 HiyoriMercVoiceover.Components;
using HiyoriMercVoiceover.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("HiyoriMercVoiceover")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+21811c81810924bd77b19a93988febc5a13503ef")]
[assembly: AssemblyProduct("HiyoriMercVoiceover")]
[assembly: AssemblyTitle("HiyoriMercVoiceover")]
[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 HiyoriMercVoiceover
{
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("com.Schale.HiyoriMercVoiceover", "HiyoriMercVoiceover", "1.0.0")]
public class HiyoriMercVoiceoverPlugin : 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> buttonHurt;
public static ConfigEntry<KeyboardShortcut> buttonShout;
public static ConfigEntry<KeyboardShortcut> buttonTitle;
public static ConfigEntry<KeyboardShortcut> buttonBweh;
public static ConfigEntry<KeyboardShortcut> buttonItai;
public static ConfigEntry<KeyboardShortcut> buttonEX1;
public static ConfigEntry<KeyboardShortcut> buttonEX2;
public static ConfigEntry<KeyboardShortcut> buttonEX3;
public static ConfigEntry<KeyboardShortcut> buttonEXL1;
public static ConfigEntry<KeyboardShortcut> buttonEXL2;
public static ConfigEntry<KeyboardShortcut> buttonEXL3;
public static ConfigEntry<KeyboardShortcut> buttonOwari1;
public static ConfigEntry<KeyboardShortcut> buttonOwari2;
public static ConfigEntry<KeyboardShortcut> buttonOwari3;
public static ConfigEntry<KeyboardShortcut> buttonCommon;
public static ConfigEntry<KeyboardShortcut> buttonNigashimasen;
public static ConfigEntry<KeyboardShortcut> buttonArigatou;
public static ConfigEntry<KeyboardShortcut> buttonGrotesque;
public static bool playedSeasonalVoiceline = false;
public static AssetBundle assetBundle;
public static SurvivorDef survivorDef = Addressables.LoadAssetAsync<SurvivorDef>((object)"RoR2/Base/Merc/Merc.asset").WaitForCompletion();
public static List<NSEInfo> nseList = new List<NSEInfo>();
private 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
//IL_0315: Unknown result type (might be due to invalid IL or missing references)
//IL_031a: Unknown result type (might be due to invalid IL or missing references)
//IL_0325: Expected O, but got Unknown
//IL_033a: Unknown result type (might be due to invalid IL or missing references)
//IL_033f: Unknown result type (might be due to invalid IL or missing references)
//IL_034a: 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("HiyoriMercVoiceover.hiyorimercbundle"))
{
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 Hiyori Mercenary Skin.", (AcceptableValueBase)null, Array.Empty<object>()));
enableVoicelines.SettingChanged += EnableVoicelines_SettingChanged;
buttonTitle = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "Blue Archive"), KeyboardShortcut.Empty, (ConfigDescription)null);
buttonHurt = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "Hurt"), KeyboardShortcut.Empty, (ConfigDescription)null);
buttonShout = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "Shout"), KeyboardShortcut.Empty, (ConfigDescription)null);
buttonBweh = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "Bweh"), KeyboardShortcut.Empty, (ConfigDescription)null);
buttonItai = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "Itai Desu"), KeyboardShortcut.Empty, (ConfigDescription)null);
buttonEX1 = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "EX 1"), KeyboardShortcut.Empty, (ConfigDescription)null);
buttonEX2 = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "EX 2"), KeyboardShortcut.Empty, (ConfigDescription)null);
buttonEX3 = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "EX 3"), KeyboardShortcut.Empty, (ConfigDescription)null);
buttonEXL1 = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "EX Lv1"), KeyboardShortcut.Empty, (ConfigDescription)null);
buttonEXL2 = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "EX Lv2"), KeyboardShortcut.Empty, (ConfigDescription)null);
buttonEXL3 = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "EX Lv3"), KeyboardShortcut.Empty, (ConfigDescription)null);
buttonOwari1 = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "Owari 1"), KeyboardShortcut.Empty, (ConfigDescription)null);
buttonOwari2 = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "Owari 2"), KeyboardShortcut.Empty, (ConfigDescription)null);
buttonOwari3 = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "Owari 3"), KeyboardShortcut.Empty, (ConfigDescription)null);
buttonCommon = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "Common Skill"), KeyboardShortcut.Empty, (ConfigDescription)null);
buttonNigashimasen = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "Nigashimasen"), KeyboardShortcut.Empty, (ConfigDescription)null);
buttonArigatou = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "Arigatou"), KeyboardShortcut.Empty, (ConfigDescription)null);
buttonGrotesque = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "Grotesque"), KeyboardShortcut.Empty, (ConfigDescription)null);
if (Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions"))
{
RiskOfOptionsCompat();
}
}
private void EnableVoicelines_SettingChanged(object sender, EventArgs e)
{
RefreshNSE();
}
[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
//IL_012b: Unknown result type (might be due to invalid IL or missing references)
//IL_0135: Expected O, but got Unknown
//IL_013b: Unknown result type (might be due to invalid IL or missing references)
//IL_0145: Expected O, but got Unknown
ModSettingsManager.SetModIcon(assetBundle.LoadAsset<Sprite>("hiyori"));
ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(enableVoicelines));
ModSettingsManager.AddOption((BaseOption)new KeyBindOption(buttonTitle));
ModSettingsManager.AddOption((BaseOption)new KeyBindOption(buttonHurt));
ModSettingsManager.AddOption((BaseOption)new KeyBindOption(buttonShout));
ModSettingsManager.AddOption((BaseOption)new KeyBindOption(buttonBweh));
ModSettingsManager.AddOption((BaseOption)new KeyBindOption(buttonItai));
ModSettingsManager.AddOption((BaseOption)new KeyBindOption(buttonEX1));
ModSettingsManager.AddOption((BaseOption)new KeyBindOption(buttonEX2));
ModSettingsManager.AddOption((BaseOption)new KeyBindOption(buttonEX3));
ModSettingsManager.AddOption((BaseOption)new KeyBindOption(buttonEXL1));
ModSettingsManager.AddOption((BaseOption)new KeyBindOption(buttonEXL2));
ModSettingsManager.AddOption((BaseOption)new KeyBindOption(buttonEXL3));
ModSettingsManager.AddOption((BaseOption)new KeyBindOption(buttonOwari1));
ModSettingsManager.AddOption((BaseOption)new KeyBindOption(buttonOwari2));
ModSettingsManager.AddOption((BaseOption)new KeyBindOption(buttonOwari3));
ModSettingsManager.AddOption((BaseOption)new KeyBindOption(buttonCommon));
ModSettingsManager.AddOption((BaseOption)new KeyBindOption(buttonNigashimasen));
ModSettingsManager.AddOption((BaseOption)new KeyBindOption(buttonArigatou));
ModSettingsManager.AddOption((BaseOption)new KeyBindOption(buttonGrotesque));
}
private void OnLoad()
{
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
//IL_00a9: Expected O, but got Unknown
//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
//IL_00c2: Expected O, but got Unknown
//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
//IL_00cc: Expected O, but got Unknown
//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
//IL_0100: Expected O, but got Unknown
//IL_010f: Unknown result type (might be due to invalid IL or missing references)
//IL_0119: Expected O, but got Unknown
//IL_0119: Unknown result type (might be due to invalid IL or missing references)
//IL_0123: Expected O, but got Unknown
SkinDef val = null;
SkinDef val2 = null;
SkinDef[] array = SkinCatalog.FindSkinsForBody(BodyCatalog.FindBodyIndex("MercBody"));
SkinDef[] array2 = array;
foreach (SkinDef val3 in array2)
{
if (((Object)val3).name == "HiyoriMercInfo")
{
val = val3;
}
else if (((Object)val3).name == "HiyoriMercNOBKInfo")
{
val2 = val3;
}
if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val2))
{
break;
}
}
if (Object.op_Implicit((Object)(object)val))
{
VoiceoverInfo val4 = new VoiceoverInfo(typeof(HiyoriMercVoiceoverComponent), val, "MercBody");
val4.selectActions = (LobbySelectActions)Delegate.Combine((Delegate?)(object)val4.selectActions, (Delegate?)new LobbySelectActions(HiyoriSelect));
}
else
{
Debug.LogError((object)"HiyoriMercVoiceover: Hiyori Merc SkinDef not found. Voicelines will not work!");
}
if (Object.op_Implicit((Object)(object)val2))
{
VoiceoverInfo val5 = new VoiceoverInfo(typeof(HiyoriMercVoiceoverComponent), val2, "MercBody");
val5.selectActions = (LobbySelectActions)Delegate.Combine((Delegate?)(object)val5.selectActions, (Delegate?)new LobbySelectActions(HiyoriSelect));
}
else
{
Debug.LogError((object)"HiyoriMercVoiceover: Hiyori Merc (No Case) SkinDef not found. Voicelines will not work!");
}
RefreshNSE();
}
private void HiyoriSelect(GameObject mannequinObject)
{
if (!enableVoicelines.Value)
{
return;
}
bool flag = false;
if (!playedSeasonalVoiceline)
{
if (DateTime.Today.Month == 1 && DateTime.Today.Day == 1)
{
Util.PlaySound("Play_HiyoriMerc_Lobby_Newyear", mannequinObject);
flag = true;
}
else if (DateTime.Today.Month == 5 && DateTime.Today.Day == 24)
{
Util.PlaySound("Play_HiyoriMerc_Lobby_bday", mannequinObject);
flag = true;
}
else if (DateTime.Today.Month == 10 && DateTime.Today.Day == 31)
{
Util.PlaySound("Play_HiyoriMerc_Lobby_Halloween", mannequinObject);
flag = true;
}
else if (DateTime.Today.Month == 12 && DateTime.Today.Day == 25)
{
Util.PlaySound("Play_HiyoriMerc_Lobby_xmas", mannequinObject);
flag = true;
}
if (flag)
{
playedSeasonalVoiceline = true;
}
}
if (!flag)
{
if (Util.CheckRoll(5f, 0f, (CharacterMaster)null))
{
Util.PlaySound("Play_HiyoriMerc_Title", mannequinObject);
}
else
{
Util.PlaySound("Play_HiyoriMerc_Lobby", mannequinObject);
}
}
}
private void InitNSE()
{
HiyoriMercVoiceoverComponent.nseHurt = RegisterNSE("Play_HiyoriMerc_Hurt");
HiyoriMercVoiceoverComponent.nseShout = RegisterNSE("Play_HiyoriMerc_Shout");
HiyoriMercVoiceoverComponent.nseTitle = RegisterNSE("Play_HiyoriMerc_Title");
HiyoriMercVoiceoverComponent.nseBweh = RegisterNSE("Play_HiyoriMerc_Bweh");
HiyoriMercVoiceoverComponent.nseItai = RegisterNSE("Play_HiyoriMerc_Itai");
HiyoriMercVoiceoverComponent.nseEX1 = RegisterNSE("Play_HiyoriMerc_ExSkill_1");
HiyoriMercVoiceoverComponent.nseEX2 = RegisterNSE("Play_HiyoriMerc_ExSkill_2");
HiyoriMercVoiceoverComponent.nseEX3 = RegisterNSE("Play_HiyoriMerc_ExSkill_3");
HiyoriMercVoiceoverComponent.nseEXL1 = RegisterNSE("Play_HiyoriMerc_ExSkill_Level_1");
HiyoriMercVoiceoverComponent.nseEXL2 = RegisterNSE("Play_HiyoriMerc_ExSkill_Level_2");
HiyoriMercVoiceoverComponent.nseEXL3 = RegisterNSE("Play_HiyoriMerc_ExSkill_Level_3");
HiyoriMercVoiceoverComponent.nseOwari1 = RegisterNSE("Play_HiyoriMerc_Owari_1");
HiyoriMercVoiceoverComponent.nseOwari2 = RegisterNSE("Play_HiyoriMerc_Owari_2");
HiyoriMercVoiceoverComponent.nseOwari3 = RegisterNSE("Play_HiyoriMerc_Owari_3");
HiyoriMercVoiceoverComponent.nseCommon = RegisterNSE("Play_HiyoriMerc_CommonSkill");
HiyoriMercVoiceoverComponent.nseNigashimasen = RegisterNSE("Play_HiyoriMerc_Special");
HiyoriMercVoiceoverComponent.nseArigatou = RegisterNSE("Play_HiyoriMerc_Arigatou");
HiyoriMercVoiceoverComponent.nseGrotesque = RegisterNSE("Play_HiyoriMerc_Grotesque");
}
public void RefreshNSE()
{
foreach (NSEInfo nse in nseList)
{
nse.ValidateParams();
}
}
private NetworkSoundEventDef RegisterNSE(string eventName)
{
NetworkSoundEventDef val = ScriptableObject.CreateInstance<NetworkSoundEventDef>();
val.eventName = eventName;
Content.networkSoundEventDefs.Add(val);
nseList.Add(new NSEInfo(val));
return val;
}
}
}
namespace HiyoriMercVoiceover.Modules
{
public class Content : IContentPackProvider
{
internal ContentPack contentPack = new ContentPack();
public static List<NetworkSoundEventDef> networkSoundEventDefs = new List<NetworkSoundEventDef>();
public string identifier => "com.Schale.HiyoriMercVoiceover";
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 + "\\HiyoriMercSoundbank.bnk", FileMode.Open);
byte[] array = new byte[stream.Length];
stream.Read(array, 0, array.Length);
SoundBanks.Add(array);
}
}
}
namespace HiyoriMercVoiceover.Components
{
public class HiyoriMercVoiceoverComponent : BaseVoiceoverComponent
{
public static NetworkSoundEventDef nseHurt;
public static NetworkSoundEventDef nseShout;
public static NetworkSoundEventDef nseTitle;
public static NetworkSoundEventDef nseBweh;
public static NetworkSoundEventDef nseItai;
public static NetworkSoundEventDef nseEX1;
public static NetworkSoundEventDef nseEX2;
public static NetworkSoundEventDef nseEX3;
public static NetworkSoundEventDef nseEXL1;
public static NetworkSoundEventDef nseEXL2;
public static NetworkSoundEventDef nseEXL3;
public static NetworkSoundEventDef nseOwari1;
public static NetworkSoundEventDef nseOwari2;
public static NetworkSoundEventDef nseOwari3;
public static NetworkSoundEventDef nseCommon;
public static NetworkSoundEventDef nseNigashimasen;
public static NetworkSoundEventDef nseArigatou;
public static NetworkSoundEventDef nseGrotesque;
private bool acquiredScepter = false;
private float levelCooldown = 0f;
private float lowHealthCooldown = 0f;
private float shrineFailCooldown = 0f;
private float specialCooldown = 0f;
protected override void FixedUpdate()
{
((BaseVoiceoverComponent)this).FixedUpdate();
if (levelCooldown > 0f)
{
levelCooldown -= Time.fixedDeltaTime;
}
if (lowHealthCooldown > 0f)
{
lowHealthCooldown -= Time.fixedDeltaTime;
}
if (shrineFailCooldown > 0f)
{
shrineFailCooldown -= Time.fixedDeltaTime;
}
if (specialCooldown > 0f)
{
specialCooldown -= Time.fixedDeltaTime;
}
}
protected override void Start()
{
//IL_001b: 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;
}
}
public override void PlayUtilityAuthority(GenericSkill skill)
{
((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseShout, 0f, false);
}
public override void PlaySpecialAuthority(GenericSkill skill)
{
if (!(specialCooldown > 0f))
{
bool flag = false;
if ((!Util.CheckRoll(50f, 0f, (CharacterMaster)null)) ? ((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseNigashimasen, 1.2f, false) : ((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseCommon, 3f, false))
{
specialCooldown = 7f;
}
}
}
public override void PlaySpawn()
{
((BaseVoiceoverComponent)this).TryPlaySound("Play_HiyoriMerc_Spawn", 6.2f, true);
}
public override void PlayDeath()
{
if (Util.CheckRoll(33.333332f, 0f, (CharacterMaster)null))
{
((BaseVoiceoverComponent)this).TryPlaySound("Play_HiyoriMerc_Owari_1", 6f, true);
}
else if (Util.CheckRoll(50f, 0f, (CharacterMaster)null))
{
((BaseVoiceoverComponent)this).TryPlaySound("Play_HiyoriMerc_Owari_2", 3.7f, true);
}
else
{
((BaseVoiceoverComponent)this).TryPlaySound("Play_HiyoriMerc_Owari_3", 4.6f, true);
}
}
public override void PlayShrineOfChanceFailServer()
{
if (!(shrineFailCooldown > 0f) && (Util.CheckRoll(70f, 0f, (CharacterMaster)null) ? ((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseEXL3, 4f, false) : (Util.CheckRoll(33.333332f, 0f, (CharacterMaster)null) ? ((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseOwari1, 6f, false) : ((!Util.CheckRoll(50f, 0f, (CharacterMaster)null)) ? ((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseOwari3, 4.6f, false) : ((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseOwari2, 3.7f, false)))))
{
shrineFailCooldown = 20f;
}
}
public override void PlayLevelUp()
{
if (!(levelCooldown > 0f) && (Util.CheckRoll(50f, 0f, (CharacterMaster)null) ? ((!Util.CheckRoll(50f, 0f, (CharacterMaster)null)) ? ((BaseVoiceoverComponent)this).TryPlaySound("Play_HiyoriMerc_Growup_2", 12f, false) : ((BaseVoiceoverComponent)this).TryPlaySound("Play_HiyoriMerc_Growup_1", 10f, false)) : ((!Util.CheckRoll(50f, 0f, (CharacterMaster)null)) ? ((BaseVoiceoverComponent)this).TryPlaySound("Play_HiyoriMerc_Growup_4", 4.7f, false) : ((BaseVoiceoverComponent)this).TryPlaySound("Play_HiyoriMerc_Growup_3", 5.7f, false))))
{
levelCooldown = 60f;
}
}
public override void PlayHurt(float percentHPLost)
{
if (percentHPLost >= 0.1f)
{
((BaseVoiceoverComponent)this).TryPlaySound("Play_HiyoriMerc_Hurt", 0f, false);
}
}
public override void PlayTeleporterStart()
{
if (Util.CheckRoll(33.333332f, 0f, (CharacterMaster)null))
{
((BaseVoiceoverComponent)this).TryPlaySound("Play_HiyoriMerc_ExSkill_1", 4.4f, false);
}
else if (Util.CheckRoll(50f, 0f, (CharacterMaster)null))
{
((BaseVoiceoverComponent)this).TryPlaySound("Play_HiyoriMerc_ExSkill_2", 5.2f, false);
}
else
{
((BaseVoiceoverComponent)this).TryPlaySound("Play_HiyoriMerc_ExSkill_3", 6f, false);
}
}
public override void PlayTeleporterFinish()
{
if (Util.CheckRoll(33.333332f, 0f, (CharacterMaster)null))
{
((BaseVoiceoverComponent)this).TryPlaySound("Play_HiyoriMerc_ExSkill_Level_1", 6.8f, false);
}
else if (Util.CheckRoll(50f, 0f, (CharacterMaster)null))
{
((BaseVoiceoverComponent)this).TryPlaySound("Play_HiyoriMerc_ExSkill_Level_2", 4.2f, false);
}
else
{
((BaseVoiceoverComponent)this).TryPlaySound("Play_HiyoriMerc_ExSkill_Level_3", 4f, false);
}
}
public override void PlayVictory()
{
((BaseVoiceoverComponent)this).TryPlaySound("Play_HiyoriMerc_RunVictory", 7.2f, true);
}
public void PlayAcquireScepter()
{
if (!acquiredScepter)
{
((BaseVoiceoverComponent)this).TryPlaySound("Play_HiyoriMerc_AcquireScepter", 13f, true);
acquiredScepter = true;
}
}
public void PlayAcquireLegendary()
{
if (Util.CheckRoll(50f, 0f, (CharacterMaster)null))
{
if (Util.CheckRoll(50f, 0f, (CharacterMaster)null))
{
((BaseVoiceoverComponent)this).TryPlaySound("Play_HiyoriMerc_Relationship_1", 11f, false);
}
else
{
((BaseVoiceoverComponent)this).TryPlaySound("Play_HiyoriMerc_Relationship_2", 5.3f, false);
}
}
else if (Util.CheckRoll(50f, 0f, (CharacterMaster)null))
{
((BaseVoiceoverComponent)this).TryPlaySound("Play_HiyoriMerc_Relationship_3", 11f, false);
}
else
{
((BaseVoiceoverComponent)this).TryPlaySound("Play_HiyoriMerc_Relationship_4", 7.4f, false);
}
}
public override void PlayLowHealth()
{
if (!(lowHealthCooldown > 0f))
{
bool flag = false;
if ((!Util.CheckRoll(50f, 0f, (CharacterMaster)null)) ? ((BaseVoiceoverComponent)this).TryPlaySound("Play_HiyoriMerc_Itai", 5.8f, false) : ((BaseVoiceoverComponent)this).TryPlaySound("Play_HiyoriMerc_Bweh", 2.25f, false))
{
lowHealthCooldown = 60f;
}
}
}
public void PlaySquid()
{
((BaseVoiceoverComponent)this).TryPlaySound("Play_HiyoriMerc_Grotesque", 1.5f, false);
}
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_0066: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: Invalid comparison between Unknown and I4
((BaseVoiceoverComponent)this).Inventory_onItemAddedClient(itemIndex);
if ((int)BaseVoiceoverComponent.scepterIndex != -1 && itemIndex == BaseVoiceoverComponent.scepterIndex)
{
PlayAcquireScepter();
return;
}
ItemDef itemDef = ItemCatalog.GetItemDef(itemIndex);
if ((Object)(object)itemDef == (Object)(object)Items.Squid || (Object)(object)itemDef == (Object)(object)Items.NovaOnLowHealth)
{
PlaySquid();
}
else if (Object.op_Implicit((Object)(object)itemDef) && (int)itemDef.deprecatedTier == 2)
{
PlayAcquireLegendary();
}
}
protected override void CheckInputs()
{
if (Utils.GetKeyPressed(HiyoriMercVoiceoverPlugin.buttonHurt))
{
((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseHurt, 0.1f, false);
}
else if (Utils.GetKeyPressed(HiyoriMercVoiceoverPlugin.buttonShout))
{
((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseShout, 0.1f, false);
}
else if (Utils.GetKeyPressed(HiyoriMercVoiceoverPlugin.buttonTitle))
{
((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseTitle, 5.6f, false);
}
else if (Utils.GetKeyPressed(HiyoriMercVoiceoverPlugin.buttonBweh))
{
((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseBweh, 2.25f, false);
}
else if (Utils.GetKeyPressed(HiyoriMercVoiceoverPlugin.buttonItai))
{
((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseItai, 5.8f, false);
}
else if (Utils.GetKeyPressed(HiyoriMercVoiceoverPlugin.buttonEX1))
{
((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseEX1, 4.4f, false);
}
else if (Utils.GetKeyPressed(HiyoriMercVoiceoverPlugin.buttonEX2))
{
((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseEX2, 5.2f, false);
}
else if (Utils.GetKeyPressed(HiyoriMercVoiceoverPlugin.buttonEX3))
{
((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseEX3, 6f, false);
}
else if (Utils.GetKeyPressed(HiyoriMercVoiceoverPlugin.buttonEXL1))
{
((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseEXL1, 6.8f, false);
}
else if (Utils.GetKeyPressed(HiyoriMercVoiceoverPlugin.buttonEXL2))
{
((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseEXL2, 4.2f, false);
}
else if (Utils.GetKeyPressed(HiyoriMercVoiceoverPlugin.buttonEXL3))
{
((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseEXL3, 4f, false);
}
else if (Utils.GetKeyPressed(HiyoriMercVoiceoverPlugin.buttonOwari1))
{
((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseOwari1, 6f, false);
}
else if (Utils.GetKeyPressed(HiyoriMercVoiceoverPlugin.buttonOwari2))
{
((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseOwari2, 3.7f, false);
}
else if (Utils.GetKeyPressed(HiyoriMercVoiceoverPlugin.buttonOwari3))
{
((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseOwari3, 4.6f, false);
}
else if (Utils.GetKeyPressed(HiyoriMercVoiceoverPlugin.buttonCommon))
{
((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseCommon, 3f, false);
}
else if (Utils.GetKeyPressed(HiyoriMercVoiceoverPlugin.buttonNigashimasen))
{
((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseNigashimasen, 1.2f, false);
}
else if (Utils.GetKeyPressed(HiyoriMercVoiceoverPlugin.buttonArigatou))
{
((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseArigatou, 4f, false);
}
else if (Utils.GetKeyPressed(HiyoriMercVoiceoverPlugin.buttonGrotesque))
{
((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseGrotesque, 1.5f, false);
}
}
public override bool ComponentEnableVoicelines()
{
return HiyoriMercVoiceoverPlugin.enableVoicelines.Value;
}
}
}