using System;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using EntityStates;
using LinkPaladinSkins;
using Microsoft.CodeAnalysis;
using On.EntityStates;
using On.RoR2;
using On.RoR2.UI;
using RoR2;
using RoR2.UI;
using UnityEngine;
[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("LinkPaladin")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("LinkPaladin")]
[assembly: AssemblyTitle("LinkPaladin")]
[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 LinkPaladin
{
[BepInPlugin("prodzpod.LinkPaladin", "LinkPaladin", "1.0.0")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class Main : BaseUnityPlugin
{
[Serializable]
[CompilerGenerated]
private sealed class <>c
{
public static readonly <>c <>9 = new <>c();
public static Func<string, Material> <>9__17_0;
public static hook_ProcessJump <>9__17_2;
public static hook_OnCharacterHitGroundSFX <>9__17_3;
public static Action<DamageReport> <>9__17_4;
public static hook_OnExecute <>9__17_5;
public static hook_OnLevelUp <>9__17_6;
public static Action<Run> <>9__17_7;
public static hook_OnInteractionBegin <>9__17_8;
public static hook_AddShrineStack <>9__17_9;
public static hook_AttemptGrant <>9__17_10;
public static hook_ClientSetReady <>9__17_11;
public static Action<Run, RunReport> <>9__17_12;
internal Material <Init>b__17_0(string x)
{
return LinkPaladinSkinsPlugin.assetBundle.LoadAsset<Material>("Assets/Resources/" + x + ".mat");
}
internal void <Init>b__17_2(orig_ProcessJump orig, GenericCharacterMain self)
{
if (((BaseCharacterMain)self).hasCharacterMotor && self.jumpInputReceived && Object.op_Implicit((Object)(object)((EntityState)self).characterBody) && ((EntityState)self).characterMotor.jumpCount < ((EntityState)self).characterBody.maxJumpCount && IsLink(((EntityState)self).characterBody))
{
Util.PlaySound("Play_OOT_AdultLink_Jump", ((Component)((EntityState)self).characterBody).gameObject);
}
orig.Invoke(self);
}
internal void <Init>b__17_3(orig_OnCharacterHitGroundSFX orig, GlobalEventManager self, CharacterBody body, HitGroundInfo info, bool damage)
{
//IL_0004: Unknown result type (might be due to invalid IL or missing references)
orig.Invoke(self, body, info, damage);
if (damage && IsLink(body))
{
Util.PlaySound("Play_OOT_Link_FallDown_Dirt", ((Component)body).gameObject);
Util.PlaySound("Play_OOT_AdultLink_FallDown", ((Component)body).gameObject);
}
}
internal void <Init>b__17_4(DamageReport report)
{
if (IsLink(report.victimBody))
{
Util.PlaySound("Play_OOT_AdultLink_Hurt", ((Component)report.victimBody).gameObject);
}
if (IsLink(report.attackerBody) && Object.op_Implicit((Object)(object)report.victimBody) && ((DamageTypeCombo)(ref report.damageInfo.damageType)).IsDamageSourceSkillBased)
{
Util.PlaySound("Play_OOT_Enemy_Hit", ((Component)report.victimBody).gameObject);
}
}
internal void <Init>b__17_5(orig_OnExecute orig, GenericSkill self)
{
orig.Invoke(self);
if (IsLink(self.characterBody))
{
if ((Object)(object)self == (Object)(object)self.characterBody.skillLocator.primary)
{
Util.PlaySound("Play_OOT_AdultLink_Attack", ((Component)self.characterBody).gameObject);
Util.PlaySound("Play_OOT_Sword", ((Component)self.characterBody).gameObject);
}
if ((Object)(object)self == (Object)(object)self.characterBody.skillLocator.secondary)
{
Util.PlaySound("Play_OOT_AdultLink_StrongAttack", ((Component)self.characterBody).gameObject);
Util.PlaySound("Play_OOT_Sword_Spin", ((Component)self.characterBody).gameObject);
}
if ((Object)(object)self == (Object)(object)self.characterBody.skillLocator.special)
{
Util.PlaySound("Play_OOT_AdultLink_DinsFire", ((Component)self.characterBody).gameObject);
Util.PlaySound("Play_OOT_Sword_Spin_Magic", ((Component)self.characterBody).gameObject);
}
if ((Object)(object)self == (Object)(object)self.characterBody.skillLocator.utility)
{
Util.PlaySound("Play_OOT_AdultLink_Grunt", ((Component)self.characterBody).gameObject);
Util.PlaySound("Play_OOT_Sword_Rock", ((Component)self.characterBody).gameObject);
}
}
}
internal void <Init>b__17_6(orig_OnLevelUp orig, CharacterBody self)
{
orig.Invoke(self);
if (IsLink(self))
{
Util.PlaySound("Play_OOT_Get_Heart", ((Component)self).gameObject);
}
}
internal void <Init>b__17_7(Run self)
{
if (IsLink(LocalUserManager.GetFirstLocalUser().cachedBody))
{
Util.PlaySound("Play_MM_Clocktower_Bell", ((Component)LocalUserManager.GetFirstLocalUser().cachedBody).gameObject);
}
}
internal void <Init>b__17_8(orig_OnInteractionBegin orig, PurchaseInteraction self, Interactor i)
{
orig.Invoke(self, i);
if (IsLink(LocalUserManager.GetFirstLocalUser().cachedBody))
{
if (((Object)((Component)self).gameObject).name.StartsWith("Chest1") || ((Object)((Component)self).gameObject).name.StartsWith("CategoryChest") || ((Object)((Component)self).gameObject).name.StartsWith("EquipmentBarrel"))
{
Util.PlaySound("Play_OOT_Chest_Small", ((Component)self).gameObject);
}
else if (((Object)((Component)self).gameObject).name.StartsWith("Chest2") || ((Object)((Component)self).gameObject).name.StartsWith("GoldChest") || ((Object)((Component)self).gameObject).name.StartsWith("CommandChest"))
{
Util.PlaySound("Play_OOT_Chest_Big", ((Component)self).gameObject);
}
if (((Object)((Component)self).gameObject).name.StartsWith("MultiShop"))
{
Util.PlaySound("Play_OOT_Get_Rupee", ((Component)self).gameObject);
}
if (((Object)((Component)self).gameObject).name.StartsWith("ShrineRestack") || ((Object)((Component)self).gameObject).name.StartsWith("ShrineCleanse"))
{
Util.PlaySound("Play_OOT_Secret", ((Component)self).gameObject);
}
if (((Object)((Component)self).gameObject).name.StartsWith("ShrineBoss") || ((Object)((Component)self).gameObject).name.StartsWith("ShrineCombat"))
{
Util.PlaySound("Play_OOT_Switch", ((Component)self).gameObject);
}
if (((Object)((Component)self).gameObject).name.StartsWith("ShrineHealing"))
{
Util.PlaySound("Play_OOT_Fairy", ((Component)self).gameObject);
}
if (((Object)((Component)self).gameObject).name.Contains("Drone"))
{
Util.PlaySound("Play_OOT_Navi_In", ((Component)self).gameObject);
}
}
}
internal void <Init>b__17_9(orig_AddShrineStack orig, ShrineChanceBehavior self, Interactor i)
{
int successfulPurchaseCount = self.successfulPurchaseCount;
orig.Invoke(self, i);
if (self.successfulPurchaseCount > successfulPurchaseCount)
{
Util.PlaySound("Play_OOT_Secret", ((Component)self).gameObject);
}
else
{
Util.PlaySound("Play_OOT_Error", ((Component)self).gameObject);
}
}
internal void <Init>b__17_10(orig_AttemptGrant orig, GenericPickupController self, CharacterBody body)
{
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_0039: Invalid comparison between Unknown and I4
//IL_0059: Unknown result type (might be due to invalid IL or missing references)
//IL_005f: Invalid comparison between Unknown and I4
//IL_006e: Unknown result type (might be due to invalid IL or missing references)
//IL_0078: Unknown result type (might be due to invalid IL or missing references)
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
//IL_007f: Unknown result type (might be due to invalid IL or missing references)
//IL_0081: Unknown result type (might be due to invalid IL or missing references)
//IL_0083: Unknown result type (might be due to invalid IL or missing references)
//IL_00ae: Expected I4, but got Unknown
if (IsLink(body))
{
PickupDef pickupDef = PickupCatalog.GetPickupDef(self.pickupIndex);
if (pickupDef == null)
{
orig.Invoke(self, body);
return;
}
if ((int)pickupDef.equipmentIndex != -1)
{
Util.PlaySound("Play_OOT_HandTriforce", ((Component)body).gameObject);
}
else if ((int)pickupDef.itemIndex != -1)
{
ItemTier tier = ItemCatalog.GetItemDef(pickupDef.itemIndex).tier;
ItemTier val = tier;
switch ((int)val)
{
case 0:
Util.PlaySound("Play_OOT_Get_SmallItem", ((Component)body).gameObject);
break;
case 3:
case 6:
Util.PlaySound("Play_OOT_GoldSkulltula_Token", ((Component)body).gameObject);
break;
case 1:
case 7:
Util.PlaySound("Play_OOT_Fanfare_SmallItem", ((Component)body).gameObject);
break;
case 2:
case 8:
Util.PlaySound("Play_OOT_Fanfare_Item", ((Component)body).gameObject);
break;
default:
Util.PlaySound("Play_OOT_Fanfare_HeartContainer", ((Component)body).gameObject);
break;
}
}
}
orig.Invoke(self, body);
}
internal void <Init>b__17_11(orig_ClientSetReady orig, CharacterSelectController self)
{
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_0040: Unknown result type (might be due to invalid IL or missing references)
orig.Invoke(self);
BodyIndex val = BodyCatalog.FindBodyIndex("RobPaladinBody");
if (self.currentSurvivorDef.survivorIndex == SurvivorCatalog.FindSurvivorIndex("RobPaladin") && ((Object)SkinCatalog.GetBodySkinDef(val, (int)LocalUserManager.GetFirstLocalUser().userProfile.loadout.bodyLoadoutManager.GetSkinIndex(val))).name.StartsWith("Link"))
{
Util.PlaySound("Play_OOT_PressStart", ((Component)self).gameObject);
}
}
internal void <Init>b__17_12(Run run, RunReport report)
{
CharacterBody cachedBody = LocalUserManager.GetFirstLocalUser().cachedBody;
if (IsLink(cachedBody))
{
if (report.gameEnding.isWin)
{
Util.PlaySound("Play_OOT_Fanfare_Item", ((Component)cachedBody).gameObject);
}
else
{
Util.PlaySound("Play_OOT_GameOver", ((Component)cachedBody).gameObject);
}
}
}
}
public const string PluginGUID = "prodzpod.LinkPaladin";
public const string PluginAuthor = "prodzpod";
public const string PluginName = "LinkPaladin";
public const string PluginVersion = "1.0.0";
public static ManualLogSource Log;
public static PluginInfo pluginInfo;
public static ConfigFile Config;
public static ConfigEntry<bool> EnableJumpFall;
public static ConfigEntry<bool> EnableHitHurt;
public static ConfigEntry<bool> EnableSkill;
public static ConfigEntry<bool> EnableLevel;
public static ConfigEntry<bool> EnableDifficulty;
public static ConfigEntry<bool> EnableChest;
public static ConfigEntry<bool> EnableItem;
public static ConfigEntry<bool> EnableMisc;
public static Material[] materials;
public void Awake()
{
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
//IL_0031: Expected O, but got Unknown
pluginInfo = ((BaseUnityPlugin)this).Info;
Log = ((BaseUnityPlugin)this).Logger;
Config = new ConfigFile(Path.Combine(Paths.ConfigPath, "prodzpod.LinkPaladin.cfg"), true);
EnableJumpFall = Config.Bind<bool>("Soundpack", "Enable Jump/Fall", true, "");
EnableHitHurt = Config.Bind<bool>("Soundpack", "Enable Hit/Hurt", true, "");
EnableSkill = Config.Bind<bool>("Soundpack", "Enable Skill Usage", true, "");
EnableLevel = Config.Bind<bool>("Soundpack", "Enable Level Up", true, "");
EnableDifficulty = Config.Bind<bool>("Soundpack", "Enable Difficulty Up", true, "note: MM sound");
EnableChest = Config.Bind<bool>("Soundpack", "Enable Chest Open", true, "");
EnableItem = Config.Bind<bool>("Soundpack", "Enable Item Get", true, "");
EnableMisc = Config.Bind<bool>("Soundpack", "Enable Miscellaneous", true, "");
RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(Init));
}
public void Init()
{
//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
//IL_00aa: Expected O, but got Unknown
//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
//IL_00d9: Expected O, but got Unknown
//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
//IL_00fe: Expected O, but got Unknown
//IL_015d: Unknown result type (might be due to invalid IL or missing references)
//IL_0162: Unknown result type (might be due to invalid IL or missing references)
//IL_0168: Expected O, but got Unknown
//IL_0194: Unknown result type (might be due to invalid IL or missing references)
//IL_0199: Unknown result type (might be due to invalid IL or missing references)
//IL_019f: Expected O, but got Unknown
//IL_0202: Unknown result type (might be due to invalid IL or missing references)
//IL_0207: Unknown result type (might be due to invalid IL or missing references)
//IL_020d: Expected O, but got Unknown
//IL_025e: Unknown result type (might be due to invalid IL or missing references)
//IL_0263: Unknown result type (might be due to invalid IL or missing references)
//IL_0269: Expected O, but got Unknown
//IL_0227: Unknown result type (might be due to invalid IL or missing references)
//IL_022c: Unknown result type (might be due to invalid IL or missing references)
//IL_0232: Expected O, but got Unknown
//IL_0295: Unknown result type (might be due to invalid IL or missing references)
//IL_029a: Unknown result type (might be due to invalid IL or missing references)
//IL_02a0: Expected O, but got Unknown
string[] strings = new string[10] { "link_01g_png.001", "p_tex02_png.001", "p_tex01_png.001", "p_tex09_png.001", "p_tex09_3", "link_00_png.001", "link_m00_png.001", "link_f00_png.001", "link_f01_png.001", "link_e00_png.001" };
materials = strings.Select((string x) => LinkPaladinSkinsPlugin.assetBundle.LoadAsset<Material>("Assets/Resources/" + x + ".mat")).ToArray();
CharacterModel.UpdateRendererMaterials += (hook_UpdateRendererMaterials)delegate(orig_UpdateRendererMaterials orig, CharacterModel self, Renderer renderer, Material mat, bool a)
{
//IL_0072: Unknown result type (might be due to invalid IL or missing references)
//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
//IL_0095: 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_00b6: Unknown result type (might be due to invalid IL or missing references)
//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
//IL_010e: Unknown result type (might be due to invalid IL or missing references)
//IL_0120: Unknown result type (might be due to invalid IL or missing references)
//IL_0131: Unknown result type (might be due to invalid IL or missing references)
//IL_013b: Unknown result type (might be due to invalid IL or missing references)
orig.Invoke(self, renderer, mat, a);
if (strings.Contains(((Object)mat).name))
{
renderer.materials = materials;
GameObject val11 = GameObject.Find("SwordStuff");
if (Object.op_Implicit((Object)(object)val11))
{
val11.SetActive(false);
}
GameObject val12 = GameObject.Find("meshPaladinDefault");
if (Object.op_Implicit((Object)(object)val12))
{
if (val12.transform.localScale.x > 0f)
{
val12.transform.localScale = new Vector3(0f - val12.transform.localScale.x, val12.transform.localScale.y, val12.transform.localScale.z);
}
Transform val13 = val12.transform.parent.Find("Armature");
if (((Component)val13).transform.localScale.x > 0f)
{
((Component)val13).transform.localScale = new Vector3(0f - ((Component)val13).transform.localScale.x, ((Component)val13).transform.localScale.y, ((Component)val13).transform.localScale.z);
}
}
}
};
if (EnableJumpFall.Value)
{
object obj = <>c.<>9__17_2;
if (obj == null)
{
hook_ProcessJump val = delegate(orig_ProcessJump orig, GenericCharacterMain self)
{
if (((BaseCharacterMain)self).hasCharacterMotor && self.jumpInputReceived && Object.op_Implicit((Object)(object)((EntityState)self).characterBody) && ((EntityState)self).characterMotor.jumpCount < ((EntityState)self).characterBody.maxJumpCount && IsLink(((EntityState)self).characterBody))
{
Util.PlaySound("Play_OOT_AdultLink_Jump", ((Component)((EntityState)self).characterBody).gameObject);
}
orig.Invoke(self);
};
<>c.<>9__17_2 = val;
obj = (object)val;
}
GenericCharacterMain.ProcessJump += (hook_ProcessJump)obj;
object obj2 = <>c.<>9__17_3;
if (obj2 == null)
{
hook_OnCharacterHitGroundSFX val2 = delegate(orig_OnCharacterHitGroundSFX orig, GlobalEventManager self, CharacterBody body, HitGroundInfo info, bool damage)
{
//IL_0004: Unknown result type (might be due to invalid IL or missing references)
orig.Invoke(self, body, info, damage);
if (damage && IsLink(body))
{
Util.PlaySound("Play_OOT_Link_FallDown_Dirt", ((Component)body).gameObject);
Util.PlaySound("Play_OOT_AdultLink_FallDown", ((Component)body).gameObject);
}
};
<>c.<>9__17_3 = val2;
obj2 = (object)val2;
}
GlobalEventManager.OnCharacterHitGroundSFX += (hook_OnCharacterHitGroundSFX)obj2;
}
if (EnableHitHurt.Value)
{
GlobalEventManager.onServerDamageDealt += delegate(DamageReport report)
{
if (IsLink(report.victimBody))
{
Util.PlaySound("Play_OOT_AdultLink_Hurt", ((Component)report.victimBody).gameObject);
}
if (IsLink(report.attackerBody) && Object.op_Implicit((Object)(object)report.victimBody) && ((DamageTypeCombo)(ref report.damageInfo.damageType)).IsDamageSourceSkillBased)
{
Util.PlaySound("Play_OOT_Enemy_Hit", ((Component)report.victimBody).gameObject);
}
};
}
if (EnableSkill.Value)
{
object obj3 = <>c.<>9__17_5;
if (obj3 == null)
{
hook_OnExecute val3 = delegate(orig_OnExecute orig, GenericSkill self)
{
orig.Invoke(self);
if (IsLink(self.characterBody))
{
if ((Object)(object)self == (Object)(object)self.characterBody.skillLocator.primary)
{
Util.PlaySound("Play_OOT_AdultLink_Attack", ((Component)self.characterBody).gameObject);
Util.PlaySound("Play_OOT_Sword", ((Component)self.characterBody).gameObject);
}
if ((Object)(object)self == (Object)(object)self.characterBody.skillLocator.secondary)
{
Util.PlaySound("Play_OOT_AdultLink_StrongAttack", ((Component)self.characterBody).gameObject);
Util.PlaySound("Play_OOT_Sword_Spin", ((Component)self.characterBody).gameObject);
}
if ((Object)(object)self == (Object)(object)self.characterBody.skillLocator.special)
{
Util.PlaySound("Play_OOT_AdultLink_DinsFire", ((Component)self.characterBody).gameObject);
Util.PlaySound("Play_OOT_Sword_Spin_Magic", ((Component)self.characterBody).gameObject);
}
if ((Object)(object)self == (Object)(object)self.characterBody.skillLocator.utility)
{
Util.PlaySound("Play_OOT_AdultLink_Grunt", ((Component)self.characterBody).gameObject);
Util.PlaySound("Play_OOT_Sword_Rock", ((Component)self.characterBody).gameObject);
}
}
};
<>c.<>9__17_5 = val3;
obj3 = (object)val3;
}
GenericSkill.OnExecute += (hook_OnExecute)obj3;
}
if (EnableLevel.Value)
{
object obj4 = <>c.<>9__17_6;
if (obj4 == null)
{
hook_OnLevelUp val4 = delegate(orig_OnLevelUp orig, CharacterBody self)
{
orig.Invoke(self);
if (IsLink(self))
{
Util.PlaySound("Play_OOT_Get_Heart", ((Component)self).gameObject);
}
};
<>c.<>9__17_6 = val4;
obj4 = (object)val4;
}
CharacterBody.OnLevelUp += (hook_OnLevelUp)obj4;
}
if (EnableDifficulty.Value)
{
Run.onRunAmbientLevelUp += delegate
{
if (IsLink(LocalUserManager.GetFirstLocalUser().cachedBody))
{
Util.PlaySound("Play_MM_Clocktower_Bell", ((Component)LocalUserManager.GetFirstLocalUser().cachedBody).gameObject);
}
};
}
if (EnableChest.Value)
{
object obj5 = <>c.<>9__17_8;
if (obj5 == null)
{
hook_OnInteractionBegin val5 = delegate(orig_OnInteractionBegin orig, PurchaseInteraction self, Interactor i)
{
orig.Invoke(self, i);
if (IsLink(LocalUserManager.GetFirstLocalUser().cachedBody))
{
if (((Object)((Component)self).gameObject).name.StartsWith("Chest1") || ((Object)((Component)self).gameObject).name.StartsWith("CategoryChest") || ((Object)((Component)self).gameObject).name.StartsWith("EquipmentBarrel"))
{
Util.PlaySound("Play_OOT_Chest_Small", ((Component)self).gameObject);
}
else if (((Object)((Component)self).gameObject).name.StartsWith("Chest2") || ((Object)((Component)self).gameObject).name.StartsWith("GoldChest") || ((Object)((Component)self).gameObject).name.StartsWith("CommandChest"))
{
Util.PlaySound("Play_OOT_Chest_Big", ((Component)self).gameObject);
}
if (((Object)((Component)self).gameObject).name.StartsWith("MultiShop"))
{
Util.PlaySound("Play_OOT_Get_Rupee", ((Component)self).gameObject);
}
if (((Object)((Component)self).gameObject).name.StartsWith("ShrineRestack") || ((Object)((Component)self).gameObject).name.StartsWith("ShrineCleanse"))
{
Util.PlaySound("Play_OOT_Secret", ((Component)self).gameObject);
}
if (((Object)((Component)self).gameObject).name.StartsWith("ShrineBoss") || ((Object)((Component)self).gameObject).name.StartsWith("ShrineCombat"))
{
Util.PlaySound("Play_OOT_Switch", ((Component)self).gameObject);
}
if (((Object)((Component)self).gameObject).name.StartsWith("ShrineHealing"))
{
Util.PlaySound("Play_OOT_Fairy", ((Component)self).gameObject);
}
if (((Object)((Component)self).gameObject).name.Contains("Drone"))
{
Util.PlaySound("Play_OOT_Navi_In", ((Component)self).gameObject);
}
}
};
<>c.<>9__17_8 = val5;
obj5 = (object)val5;
}
PurchaseInteraction.OnInteractionBegin += (hook_OnInteractionBegin)obj5;
object obj6 = <>c.<>9__17_9;
if (obj6 == null)
{
hook_AddShrineStack val6 = delegate(orig_AddShrineStack orig, ShrineChanceBehavior self, Interactor i)
{
int successfulPurchaseCount = self.successfulPurchaseCount;
orig.Invoke(self, i);
if (self.successfulPurchaseCount > successfulPurchaseCount)
{
Util.PlaySound("Play_OOT_Secret", ((Component)self).gameObject);
}
else
{
Util.PlaySound("Play_OOT_Error", ((Component)self).gameObject);
}
};
<>c.<>9__17_9 = val6;
obj6 = (object)val6;
}
ShrineChanceBehavior.AddShrineStack += (hook_AddShrineStack)obj6;
}
if (EnableItem.Value)
{
object obj7 = <>c.<>9__17_10;
if (obj7 == null)
{
hook_AttemptGrant val7 = delegate(orig_AttemptGrant orig, GenericPickupController self, CharacterBody body)
{
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_0039: Invalid comparison between Unknown and I4
//IL_0059: Unknown result type (might be due to invalid IL or missing references)
//IL_005f: Invalid comparison between Unknown and I4
//IL_006e: Unknown result type (might be due to invalid IL or missing references)
//IL_0078: Unknown result type (might be due to invalid IL or missing references)
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
//IL_007f: Unknown result type (might be due to invalid IL or missing references)
//IL_0081: Unknown result type (might be due to invalid IL or missing references)
//IL_0083: Unknown result type (might be due to invalid IL or missing references)
//IL_00ae: Expected I4, but got Unknown
if (IsLink(body))
{
PickupDef pickupDef = PickupCatalog.GetPickupDef(self.pickupIndex);
if (pickupDef == null)
{
orig.Invoke(self, body);
return;
}
if ((int)pickupDef.equipmentIndex != -1)
{
Util.PlaySound("Play_OOT_HandTriforce", ((Component)body).gameObject);
}
else if ((int)pickupDef.itemIndex != -1)
{
ItemTier tier = ItemCatalog.GetItemDef(pickupDef.itemIndex).tier;
ItemTier val10 = tier;
switch ((int)val10)
{
case 0:
Util.PlaySound("Play_OOT_Get_SmallItem", ((Component)body).gameObject);
break;
case 3:
case 6:
Util.PlaySound("Play_OOT_GoldSkulltula_Token", ((Component)body).gameObject);
break;
case 1:
case 7:
Util.PlaySound("Play_OOT_Fanfare_SmallItem", ((Component)body).gameObject);
break;
case 2:
case 8:
Util.PlaySound("Play_OOT_Fanfare_Item", ((Component)body).gameObject);
break;
default:
Util.PlaySound("Play_OOT_Fanfare_HeartContainer", ((Component)body).gameObject);
break;
}
}
}
orig.Invoke(self, body);
};
<>c.<>9__17_10 = val7;
obj7 = (object)val7;
}
GenericPickupController.AttemptGrant += (hook_AttemptGrant)obj7;
}
if (!EnableMisc.Value)
{
return;
}
object obj8 = <>c.<>9__17_11;
if (obj8 == null)
{
hook_ClientSetReady val8 = delegate(orig_ClientSetReady orig, CharacterSelectController self)
{
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_0040: Unknown result type (might be due to invalid IL or missing references)
orig.Invoke(self);
BodyIndex val9 = BodyCatalog.FindBodyIndex("RobPaladinBody");
if (self.currentSurvivorDef.survivorIndex == SurvivorCatalog.FindSurvivorIndex("RobPaladin") && ((Object)SkinCatalog.GetBodySkinDef(val9, (int)LocalUserManager.GetFirstLocalUser().userProfile.loadout.bodyLoadoutManager.GetSkinIndex(val9))).name.StartsWith("Link"))
{
Util.PlaySound("Play_OOT_PressStart", ((Component)self).gameObject);
}
};
<>c.<>9__17_11 = val8;
obj8 = (object)val8;
}
CharacterSelectController.ClientSetReady += (hook_ClientSetReady)obj8;
Run.onClientGameOverGlobal += delegate(Run run, RunReport report)
{
CharacterBody cachedBody = LocalUserManager.GetFirstLocalUser().cachedBody;
if (IsLink(cachedBody))
{
if (report.gameEnding.isWin)
{
Util.PlaySound("Play_OOT_Fanfare_Item", ((Component)cachedBody).gameObject);
}
else
{
Util.PlaySound("Play_OOT_GameOver", ((Component)cachedBody).gameObject);
}
}
};
}
public static bool IsLink(CharacterBody body)
{
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
return Object.op_Implicit((Object)(object)body) && body.bodyIndex == BodyCatalog.FindBodyIndex("RobPaladinBody") && ((Object)SkinCatalog.GetBodySkinDef(body.bodyIndex, (int)body.skinIndex)).name.StartsWith("Link");
}
}
}