using System; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using HarmonyLib; using IL.RoR2; using Microsoft.CodeAnalysis; using Mono.Cecil.Cil; using MonoMod.Cil; using MonoMod.RuntimeDetour; using On.RoR2; using On.RoR2.Artifacts; using On.RoR2.UI; using R2API; using RoR2; using RoR2.CharacterAI; using RoR2.Items; using RoR2.Navigation; using RoR2.Orbs; using RoR2.UI; using TMPro; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.UI; [assembly: AssemblyTitle("BetterShrines")] [assembly: AssemblyProduct("BetterShrines")] [assembly: AssemblyInformationalVersion("1.0.0+f6e962d982034d5bce0c22436ceeb74322fbffbe")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyCompany("BetterShrines")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: CompilationRelaxations(8)] [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 Evaisa.MoreShrines { internal class CustomDirector : NetworkBehaviour { public class CardPool { public int cost = 0; public List cards = new List(); } private List finalSpawnOrder = new List(); private bool cardPoolInitialized = false; public int countToSpawn = 0; private CombatDirector director; public void Awake() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown CombatDirector.AttemptSpawnOnTarget += new hook_AttemptSpawnOnTarget(AttemptSpawnOnTarget); director = ((Component)this).gameObject.GetComponent(); } private void OnDestroy() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown CombatDirector.AttemptSpawnOnTarget -= new hook_AttemptSpawnOnTarget(AttemptSpawnOnTarget); } public bool AttemptSpawnOnTarget(orig_AttemptSpawnOnTarget orig, CombatDirector self, Transform spawnTarget, PlacementMode placementMode) { //IL_040a: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_0323: Unknown result type (might be due to invalid IL or missing references) //IL_0325: Unknown result type (might be due to invalid IL or missing references) //IL_032a: Unknown result type (might be due to invalid IL or missing references) //IL_0331: Unknown result type (might be due to invalid IL or missing references) //IL_0344: Expected O, but got Unknown //IL_034a: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_0388: Expected O, but got Unknown //IL_0398: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((Component)self).gameObject == (Object)(object)((Component)this).gameObject) { float monsterCredit = self.monsterCredit; DirectorCardCategorySelection monsterCards = self.monsterCards; if (!cardPoolInitialized) { List list = new List(); Category[] categories = monsterCards.categories; foreach (Category val in categories) { DirectorCard[] cards = val.cards; foreach (DirectorCard card in cards) { if (list.Any((CardPool pool) => pool.cost == card.cost)) { list.Find((CardPool pool) => pool.cost == card.cost).cards.Add(card); continue; } CardPool cardPool = new CardPool(); cardPool.cost = card.cost; cardPool.cards.Add(card); list.Add(cardPool); } } cardPoolInitialized = true; list.Sort((CardPool item1, CardPool item2) => item1.cost.CompareTo(item2.cost)); int num = 0; CardPool cardPool2 = list[0]; foreach (CardPool item4 in list) { if ((float)(item4.cost * countToSpawn) < monsterCredit) { cardPool2 = item4; num++; continue; } break; } MoreShrines.Print("Preparing to spawn " + countToSpawn + " monsters."); CardPool item3 = list[0]; int num2 = 0; for (int k = 0; k < countToSpawn; k++) { int num3 = countToSpawn - k; if (list.Count > num + 1 && (float)((countToSpawn - num3) * cardPool2.cost + num3 * list[num + 1].cost) < monsterCredit) { item3 = list[num + 1]; num2++; } } for (int l = 0; l < countToSpawn - num2; l++) { finalSpawnOrder.Add(cardPool2); } for (int m = 0; m < num2; m++) { finalSpawnOrder.Add(item3); } } if (finalSpawnOrder.Count > 0) { self.currentMonsterCard = finalSpawnOrder[0].cards[Random.Range(0, finalSpawnOrder[0].cards.Count - 1)]; SpawnCard spawnCard = self.currentMonsterCard.spawnCard; DirectorPlacementRule val2 = new DirectorPlacementRule { placementMode = placementMode, spawnOnTarget = spawnTarget, preventOverhead = self.currentMonsterCard.preventOverhead }; DirectorCore.GetMonsterSpawnDistance(self.currentMonsterCard.spawnDistance, ref val2.minDistance, ref val2.maxDistance); val2.minDistance *= self.spawnDistanceMultiplier; DirectorSpawnRequest val3 = new DirectorSpawnRequest(spawnCard, val2, self.rng); val3.ignoreTeamMemberLimit = self.ignoreTeamSizeLimit; val3.teamIndexOverride = self.teamIndex; val3.onSpawnedServer = onCardSpawned; if (!Object.op_Implicit((Object)(object)DirectorCore.instance.TrySpawnObject(val3))) { ((Behaviour)self).enabled = false; return false; } self.spawnCountInCurrentWave++; return true; } ((Behaviour)self).enabled = false; return false; } return orig.Invoke(self, spawnTarget, placementMode); } internal void onCardSpawned(SpawnResult result) { //IL_0001: 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_006d: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: 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_00b4: Expected O, but got Unknown //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) if (!result.success) { return; } CharacterMaster component = result.spawnedInstance.GetComponent(); GameObject bodyObject = component.GetBodyObject(); if (Object.op_Implicit((Object)(object)director.combatSquad)) { director.combatSquad.AddMember(component); } if (Object.op_Implicit((Object)(object)director.spawnEffectPrefab) && NetworkServer.active) { Vector3 origin = result.position; CharacterBody component2 = bodyObject.GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { origin = component2.corePosition; } EffectManager.SpawnEffect(director.spawnEffectPrefab, new EffectData { origin = origin }, true); } ((UnityEvent)(object)director.onSpawnedServer)?.Invoke(result.spawnedInstance); } private void UNetVersion() { } public override bool OnSerialize(NetworkWriter writer, bool forceAll) { bool result = default(bool); return result; } public override void OnDeserialize(NetworkReader reader, bool initialState) { } } public class ImpMarkerKiller : MonoBehaviour { public void Update() { PositionIndicator component = ((Component)this).GetComponent(); if (!Object.op_Implicit((Object)(object)component.targetTransform)) { MoreShrines.Print("Destroyed indicator!"); Object.DestroyImmediate((Object)(object)((Component)this).gameObject); } } } internal class InitBuffs { [CompilerGenerated] private static class <>O { public static StatHookEventHandler <0>__RecalculateHP; public static hook_BeginAdvanceStage <1>__Stage_BeginAdvanceStage; public static hook_UpdateIcon <2>__BuffIcon_UpdateIcon; } public static BuffDef maxHPDown; public static BuffDef maxHPDownStage; public static List players = new List(); public static void Add() { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Expected O, but got Unknown //IL_00e4: 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_00ef: Expected O, but got Unknown //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Expected O, but got Unknown maxHPDown = ScriptableObject.CreateInstance(); ((Object)maxHPDown).name = "Max HP Down"; maxHPDown.isDebuff = true; maxHPDown.canStack = true; maxHPDown.iconSprite = EvaResources.HPDebuffIcon; maxHPDown.buffColor = Color.red; ContentAddition.AddBuffDef(maxHPDown); maxHPDownStage = ScriptableObject.CreateInstance(); ((Object)maxHPDownStage).name = "Stage Max HP Down"; maxHPDownStage.isDebuff = true; maxHPDownStage.canStack = true; maxHPDownStage.iconSprite = EvaResources.HPDebuffIcon; maxHPDownStage.buffColor = Color.red; ContentAddition.AddBuffDef(maxHPDownStage); object obj = <>O.<0>__RecalculateHP; if (obj == null) { StatHookEventHandler val = RecalculateHP; <>O.<0>__RecalculateHP = val; obj = (object)val; } RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)obj; object obj2 = <>O.<1>__Stage_BeginAdvanceStage; if (obj2 == null) { hook_BeginAdvanceStage val2 = Stage_BeginAdvanceStage; <>O.<1>__Stage_BeginAdvanceStage = val2; obj2 = (object)val2; } Stage.BeginAdvanceStage += (hook_BeginAdvanceStage)obj2; object obj3 = <>O.<2>__BuffIcon_UpdateIcon; if (obj3 == null) { hook_UpdateIcon val3 = BuffIcon_UpdateIcon; <>O.<2>__BuffIcon_UpdateIcon = val3; obj3 = (object)val3; } BuffIcon.UpdateIcon += (hook_UpdateIcon)obj3; } private static void RecalculateHP(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender)) { int buffCount = sender.GetBuffCount(maxHPDownStage); int buffCount2 = sender.GetBuffCount(maxHPDown); args.healthTotalMult *= 1f - (float)buffCount / 100f; args.healthTotalMult *= 1f - (float)buffCount2 / 100f; } } private static void BuffIcon_UpdateIcon(orig_UpdateIcon orig, BuffIcon self) { //IL_0076: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)self.buffDef)) { self.iconImage.sprite = null; } else if ((Object)(object)self.buffDef == (Object)(object)maxHPDown || (Object)(object)self.buffDef == (Object)(object)maxHPDownStage) { self.iconImage.sprite = self.buffDef.iconSprite; ((Graphic)self.iconImage).color = self.buffDef.buffColor; if (self.buffDef.canStack) { BuffIcon.sharedStringBuilder.Clear(); StringBuilderExtensions.AppendInt(BuffIcon.sharedStringBuilder, self.buffCount, 1u, uint.MaxValue); BuffIcon.sharedStringBuilder.Append("%"); ((Behaviour)self.stackCount).enabled = true; ((TMP_Text)self.stackCount).SetText(BuffIcon.sharedStringBuilder); } else { ((Behaviour)self.stackCount).enabled = false; } } else { orig.Invoke(self); } } private static void Stage_BeginAdvanceStage(orig_BeginAdvanceStage orig, Stage self, SceneDef destinationStage) { foreach (CharacterBody player in players) { for (int i = 0; i < player.GetBuffCount(maxHPDownStage); i++) { player.RemoveBuff(maxHPDownStage); } } orig.Invoke(self, destinationStage); } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.evaisa.moreshrines", "More Shrines", "1.1.9")] public class MoreShrines : BaseUnityPlugin { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Action> <>9__38_0; public static Func <>9__38_2; public static Func <>9__38_3; public static Func <>9__38_5; public static Func <>9__38_6; public static Func <>9__38_7; public static Func <>9__38_8; public static Func <>9__38_9; public static Func <>9__38_10; public static Func <>9__38_11; public static Manipulator <>9__38_4; public static IsAffordableDelegate <>9__40_0; public static PayCostDelegate <>9__40_1; public static IsAffordableDelegate <>9__41_0; public static PayCostDelegate <>9__41_1; public static IsAffordableDelegate <>9__42_0; public static PayCostDelegate <>9__42_1; public static IsAffordableDelegate <>9__43_0; public static PayCostDelegate <>9__43_1; public static IsAffordableDelegate <>9__44_0; public static PayCostDelegate <>9__44_1; public static IsAffordableDelegate <>9__45_0; public static PayCostDelegate <>9__45_1; public static IsAffordableDelegate <>9__46_0; public static PayCostDelegate <>9__46_1; public static IsAffordableDelegate <>9__47_0; public static PayCostDelegate <>9__47_1; internal void <.ctor>b__38_0(List list) { if (costTypeDefShrineDisorder != null) { list.Add(costTypeDefShrineDisorder); } if (costTypeDefShrineFallen != null) { list.Add(costTypeDefShrineFallen); } if (costTypeDefShrineHeresy != null) { list.Add(costTypeDefShrineHeresy); } if (costTypeDefWispGreen != null) { list.Add(costTypeDefWispGreen); } if (costTypeDefWispRed != null) { list.Add(costTypeDefWispRed); } if (costTypeDefWispWhite != null) { list.Add(costTypeDefWispWhite); } if (costTypeDefDamage != null) { list.Add(costTypeDefDamage); } } internal bool <.ctor>b__38_2(Instruction x) { int num = default(int); return ILPatternMatchingExt.MatchLdcI4(x, ref num); } internal int <.ctor>b__38_3(int c) { return c + 10; } internal void <.ctor>b__38_4(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); ILLabel val2 = val.DefineLabel(); val.TryGotoNext((MoveType)0, new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 3), (Instruction x) => ILPatternMatchingExt.MatchNop(x), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 3) }); int index = val.Index + 2; val.TryGotoNext((MoveType)2, new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchNop(x), (Instruction x) => ILPatternMatchingExt.MatchNop(x), (Instruction x) => ILPatternMatchingExt.MatchNop(x) }); val.MarkLabel(val2); val.Index = index; val.Emit(OpCodes.Ldloc, 3); val.EmitDelegate>((Func)((MonoBehaviour x) => (Object)(object)x == (Object)null)); val.Emit(OpCodes.Brtrue, (object)val2); } internal bool <.ctor>b__38_5(Instruction x) { return ILPatternMatchingExt.MatchStloc(x, 3); } internal bool <.ctor>b__38_6(Instruction x) { return ILPatternMatchingExt.MatchNop(x); } internal bool <.ctor>b__38_7(Instruction x) { return ILPatternMatchingExt.MatchLdloc(x, 3); } internal bool <.ctor>b__38_8(Instruction x) { return ILPatternMatchingExt.MatchNop(x); } internal bool <.ctor>b__38_9(Instruction x) { return ILPatternMatchingExt.MatchNop(x); } internal bool <.ctor>b__38_10(Instruction x) { return ILPatternMatchingExt.MatchNop(x); } internal bool <.ctor>b__38_11(MonoBehaviour x) { return (Object)(object)x == (Object)null; } internal bool b__40_0(CostTypeDef costTypeDef, IsAffordableContext context) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) CharacterBody component = ((Component)context.activator).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { Inventory inventory = component.inventory; if (Object.op_Implicit((Object)(object)inventory)) { return inventory.GetTotalItemCountOfTier((ItemTier)0) > 0; } } return false; } internal void b__40_1(PayCostContext context, PayCostResults results) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Invalid comparison between Unknown and I4 //IL_0059: Unknown result type (might be due to invalid IL or missing references) CharacterBody component = ((Component)context.activator).GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { return; } Inventory inventory = component.inventory; List list = new List(); foreach (ItemIndex item in inventory.itemAcquisitionOrder) { if ((int)ItemCatalog.GetItemDef(item).tier == 0) { list.Add(ItemCatalog.GetItemDef(item)); } } ItemDef val = list[Random.Range(0, list.Count)]; context.purchasedObject.GetComponent().wispItem = val; inventory.RemoveItem(val, 1); } internal bool b__41_0(CostTypeDef costTypeDef, IsAffordableContext context) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) CharacterBody component = ((Component)context.activator).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { HealthComponent component2 = ((Component)context.activator).GetComponent(); return Object.op_Implicit((Object)(object)component2) && component2.combinedHealth >= 10f; } return false; } internal void b__41_1(PayCostContext context, PayCostResults results) { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Expected O, but got Unknown HealthComponent component = ((Component)context.activator).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { float combinedHealth = component.combinedHealth; float num = Mathf.Ceil(component.combinedHealth / 100f * (float)context.cost); if (combinedHealth > num) { component.TakeDamage(new DamageInfo { damage = num, attacker = context.purchasedObject, position = context.purchasedObject.transform.position, damageType = DamageTypeCombo.op_Implicit((DamageType)3) }); MultiShopCardUtils.OnNonMoneyPurchase(context); } } } internal bool b__42_0(CostTypeDef costTypeDef, IsAffordableContext context) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) CharacterBody component = ((Component)context.activator).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { Inventory inventory = component.inventory; if (Object.op_Implicit((Object)(object)inventory)) { return inventory.GetTotalItemCountOfTier((ItemTier)1) > 0; } } return false; } internal void b__42_1(PayCostContext context, PayCostResults results) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Invalid comparison between Unknown and I4 //IL_0059: Unknown result type (might be due to invalid IL or missing references) CharacterBody component = ((Component)context.activator).GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { return; } Inventory inventory = component.inventory; List list = new List(); foreach (ItemIndex item in inventory.itemAcquisitionOrder) { if ((int)ItemCatalog.GetItemDef(item).tier == 1) { list.Add(ItemCatalog.GetItemDef(item)); } } ItemDef val = list[Random.Range(0, list.Count)]; context.purchasedObject.GetComponent().wispItem = val; inventory.RemoveItem(val, 1); } internal bool b__43_0(CostTypeDef costTypeDef, IsAffordableContext context) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) CharacterBody component = ((Component)context.activator).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { Inventory inventory = component.inventory; if (Object.op_Implicit((Object)(object)inventory)) { return inventory.GetTotalItemCountOfTier((ItemTier)2) > 0; } } return false; } internal void b__43_1(PayCostContext context, PayCostResults results) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Invalid comparison between Unknown and I4 //IL_0059: Unknown result type (might be due to invalid IL or missing references) CharacterBody component = ((Component)context.activator).GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { return; } Inventory inventory = component.inventory; List list = new List(); foreach (ItemIndex item in inventory.itemAcquisitionOrder) { if ((int)ItemCatalog.GetItemDef(item).tier == 2) { list.Add(ItemCatalog.GetItemDef(item)); } } ItemDef val = list[Random.Range(0, list.Count)]; context.purchasedObject.GetComponent().wispItem = val; inventory.RemoveItem(val, 1); } internal bool b__44_0(CostTypeDef costTypeDef, IsAffordableContext context) { //IL_0001: 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) CharacterBody component = ((Component)context.activator).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { int buffCount = component.GetBuffCount(InitBuffs.maxHPDownStage); int num = (int)Mathf.Ceil((100f - (float)component.GetBuffCount(InitBuffs.maxHPDownStage)) / 100f * (float)context.cost); return buffCount + num < 100 && ShrineFallenBehaviour.IsAnyoneDead(); } return false; } internal void b__44_1(PayCostContext context, PayCostResults results) { CharacterBody component = ((Component)context.activator).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { int buffCount = component.GetBuffCount(InitBuffs.maxHPDownStage); int num = (int)Mathf.Ceil((100f - (float)component.GetBuffCount(InitBuffs.maxHPDownStage)) / 100f * (float)context.cost); for (int i = 0; i < num; i++) { component.AddBuff(InitBuffs.maxHPDownStage); } } } internal bool b__45_0(CostTypeDef costTypeDef, IsAffordableContext context) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) CharacterBody component = ((Component)context.activator).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { CharacterMaster master = component.master; if (Object.op_Implicit((Object)(object)master)) { return (ulong)master.money >= (ulong)context.cost && ShrineFallenBehaviour.IsAnyoneDead(); } } return false; } internal void b__45_1(PayCostContext context, PayCostResults results) { if (Object.op_Implicit((Object)(object)context.activatorMaster)) { CharacterMaster activatorMaster = context.activatorMaster; activatorMaster.money -= (uint)context.cost; } } internal bool b__46_0(CostTypeDef costTypeDef, IsAffordableContext context) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) CharacterBody component = ((Component)context.activator).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { bool flag = false; Inventory inventory = component.inventory; { IEnumerator enumerator = Enum.GetValues(typeof(ItemTier)).GetEnumerator(); try { while (enumerator.MoveNext()) { <>c__DisplayClass46_0 CS$<>8__locals0 = new <>c__DisplayClass46_0 { tier = (ItemTier)enumerator.Current }; int num = int.MaxValue; IEnumerable enumerable = ((IEnumerable)(object)ItemCatalog.allItemDefs).Where((ItemDef x) => x.tier == CS$<>8__locals0.tier); foreach (ItemDef item in enumerable) { int itemCount = inventory.GetItemCount(item); num = Math.Min(num, itemCount); if (itemCount - num > 1) { flag = true; } } } } finally { IDisposable disposable = enumerator as IDisposable; if (disposable != null) { disposable.Dispose(); } } } NetworkUser val = Util.LookUpBodyNetworkUser(((Component)context.activator).gameObject); return Object.op_Implicit((Object)(object)val) && (ulong)val.lunarCoins >= (ulong)context.cost && flag; } return false; } internal void b__46_1(PayCostContext context, PayCostResults results) { NetworkUser val = Util.LookUpBodyNetworkUser(((Component)context.activator).gameObject); if (Object.op_Implicit((Object)(object)val)) { val.DeductLunarCoins((uint)context.cost); } } internal bool b__47_0(CostTypeDef costTypeDef, IsAffordableContext context) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: 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_00b7: Unknown result type (might be due to invalid IL or missing references) CharacterBody component = ((Component)context.activator).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { bool flag = false; Inventory inventory = component.inventory; if (component.inventory.GetItemCount(Items.LunarPrimaryReplacement.itemIndex) <= 0 || component.inventory.GetItemCount(Items.LunarSecondaryReplacement.itemIndex) <= 0 || component.inventory.GetItemCount(Items.LunarUtilityReplacement.itemIndex) <= 0 || component.inventory.GetItemCount(Items.LunarSpecialReplacement.itemIndex) <= 0) { flag = true; } NetworkUser val = Util.LookUpBodyNetworkUser(((Component)context.activator).gameObject); return Object.op_Implicit((Object)(object)val) && (ulong)val.lunarCoins >= (ulong)context.cost && flag; } return false; } internal void b__47_1(PayCostContext context, PayCostResults results) { NetworkUser val = Util.LookUpBodyNetworkUser(((Component)context.activator).gameObject); if (Object.op_Implicit((Object)(object)val)) { val.DeductLunarCoins((uint)context.cost); } } } [CompilerGenerated] private sealed class <>c__DisplayClass46_0 { public ItemTier tier; internal bool b__2(ItemDef x) { //IL_0001: 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) return x.tier == tier; } } private const string ModVer = "1.1.9"; private const string ModName = "More Shrines"; private const string ModGuid = "com.evaisa.moreshrines"; public static MoreShrines instance; public static Xoroshiro128Plus EvaRng; public static CharacterSpawnCard impSpawnCard; public static ConfigEntry impShrineEnabled; public static ConfigEntry impShrineWeight; public static ConfigEntry impCountScale; public static ConfigEntry impShrineTime; public static ConfigEntry itemRarityBasedOnSpeed; public static ConfigEntry dropItemForEveryPlayer; public static ConfigEntry extraItemCount; public static ConfigEntry fallenShrineEnabled; public static ConfigEntry fallenShrineWeight; public static ConfigEntry fallenShrineHPPenalty; public static ConfigEntry fallenShrineMoney; public static ConfigEntry fallenShrineMoneyCost; public static ConfigEntry disorderShrineEnabled; public static ConfigEntry disorderShrineWeight; public static ConfigEntry heresyShrineEnabled; public static ConfigEntry heresyShrineWeight; public static ConfigEntry lightningShrineEnabled; public static ConfigEntry lightningShrineWeight; public static ConfigEntry totemShrineEnabled; public static ConfigEntry totemShrineWeight; public static ConfigEntry wispShrineEnabled; public static ConfigEntry wispShrineScaleDifficulty; public static ConfigEntry wispShrineWeight; public static CostTypeDef costTypeDefShrineFallen; public static CostTypeDef costTypeDefShrineDisorder; public static CostTypeDef costTypeDefShrineHeresy; public static CostTypeDef costTypeDefWispWhite; public static CostTypeDef costTypeDefWispGreen; public static CostTypeDef costTypeDefWispRed; public static CostTypeDef costTypeDefDamage; public static GameObject debugPrefab; public static bool debugMode; public MoreShrines() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected O, but got Unknown //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Expected O, but got Unknown //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Expected O, but got Unknown //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Expected O, but got Unknown //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Expected O, but got Unknown instance = this; DateTime dateTime = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); int num = (int)(DateTime.UtcNow - dateTime).TotalSeconds; EvaResources.Init(); EvaRng = new Xoroshiro128Plus((ulong)num); RegisterConfig(); RegisterLanguageTokens(); InitBuffs.Add(); if (fallenShrineMoney.Value) { CreateCostDefShrineFallenAlt(); } else { CreateCostDefShrineFallen(); } CreateCostDefShrineDisorder(); CreateCostDefShrineHeresy(); CreateCostDefWispWhite(); CreateCostDefWispGreen(); CreateCostDefWispRed(); CreateCostDefDamage(); GenerateTinyImp(); if (fallenShrineEnabled.Value) { GenerateFallenShrine(); } if (disorderShrineEnabled.Value) { GenerateDisorderShrine(); } if (heresyShrineEnabled.Value) { GenerateHeresyShrine(); } if (impShrineEnabled.Value) { GenerateImpShrine(); } if (wispShrineEnabled.Value) { GenerateWispShrine(); } if (lightningShrineEnabled.Value) { GenerateLightningShrine(); } if (totemShrineEnabled.Value) { GenerateTotemShrine(); } SwarmsArtifactManager.OnSpawnCardOnSpawnedServerGlobal += new hook_OnSpawnCardOnSpawnedServerGlobal(SwarmsArtifactManager_OnSpawnCardOnSpawnedServerGlobal); CostTypeCatalog.modHelper.getAdditionalEntries += delegate(List list) { if (costTypeDefShrineDisorder != null) { list.Add(costTypeDefShrineDisorder); } if (costTypeDefShrineFallen != null) { list.Add(costTypeDefShrineFallen); } if (costTypeDefShrineHeresy != null) { list.Add(costTypeDefShrineHeresy); } if (costTypeDefWispGreen != null) { list.Add(costTypeDefWispGreen); } if (costTypeDefWispRed != null) { list.Add(costTypeDefWispRed); } if (costTypeDefWispWhite != null) { list.Add(costTypeDefWispWhite); } if (costTypeDefDamage != null) { list.Add(costTypeDefDamage); } }; CostTypeCatalog.Init += (Manipulator)delegate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val6 = new ILCursor(il); int num2 = default(int); if (val6.TryGotoNext((MoveType)0, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, ref num2) })) { int index2 = val6.Index; val6.Index = index2 + 1; val6.EmitDelegate>((Func)((int c) => c + 10)); } else { ((BaseUnityPlugin)this).Logger.LogError((object)"Failed to apply CostTypeCatalog IL hook"); } }; if (!Chainloader.PluginInfos.ContainsKey("com.themysticsword.mysticsitems")) { return; } PluginInfo val = Chainloader.PluginInfos["com.themysticsword.mysticsitems"]; Assembly assembly = ((object)val.Instance).GetType().Assembly; MethodInfo methodInfo = AccessTools.Method(assembly.GetType("MysticsItems.Items.ExtraShrineUse"), "UpdateShrine", new Type[2] { assembly.GetType("MysticsItems.Items.ExtraShrineUse/MysticsItemsExtraShrineUseBehaviour"), typeof(int) }, (Type[])null); object obj = <>c.<>9__38_4; if (obj == null) { Manipulator val2 = delegate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) ILCursor val4 = new ILCursor(il); ILLabel val5 = val4.DefineLabel(); val4.TryGotoNext((MoveType)0, new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 3), (Instruction x) => ILPatternMatchingExt.MatchNop(x), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 3) }); int index = val4.Index + 2; val4.TryGotoNext((MoveType)2, new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchNop(x), (Instruction x) => ILPatternMatchingExt.MatchNop(x), (Instruction x) => ILPatternMatchingExt.MatchNop(x) }); val4.MarkLabel(val5); val4.Index = index; val4.Emit(OpCodes.Ldloc, 3); val4.EmitDelegate>((Func)((MonoBehaviour x) => (Object)(object)x == (Object)null)); val4.Emit(OpCodes.Brtrue, (object)val5); }; <>c.<>9__38_4 = val2; obj = (object)val2; } ILHook val3 = new ILHook((MethodBase)methodInfo, (Manipulator)obj); } private void Update() { } public void CreateCostDefWispWhite() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Expected O, but got Unknown //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Expected O, but got Unknown costTypeDefWispWhite = new CostTypeDef(); costTypeDefWispWhite.costStringFormatToken = "COST_ITEM_FORMAT"; CostTypeDef obj = costTypeDefWispWhite; object obj2 = <>c.<>9__40_0; if (obj2 == null) { IsAffordableDelegate val = delegate(CostTypeDef costTypeDef, IsAffordableContext context) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) CharacterBody component2 = ((Component)context.activator).GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { Inventory inventory2 = component2.inventory; if (Object.op_Implicit((Object)(object)inventory2)) { return inventory2.GetTotalItemCountOfTier((ItemTier)0) > 0; } } return false; }; <>c.<>9__40_0 = val; obj2 = (object)val; } obj.isAffordable = (IsAffordableDelegate)obj2; CostTypeDef obj3 = costTypeDefWispWhite; object obj4 = <>c.<>9__40_1; if (obj4 == null) { PayCostDelegate val2 = delegate(PayCostContext context, PayCostResults results) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Invalid comparison between Unknown and I4 //IL_0059: Unknown result type (might be due to invalid IL or missing references) CharacterBody component = ((Component)context.activator).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { Inventory inventory = component.inventory; List list = new List(); foreach (ItemIndex item in inventory.itemAcquisitionOrder) { if ((int)ItemCatalog.GetItemDef(item).tier == 0) { list.Add(ItemCatalog.GetItemDef(item)); } } ItemDef val3 = list[Random.Range(0, list.Count)]; context.purchasedObject.GetComponent().wispItem = val3; inventory.RemoveItem(val3, 1); } }; <>c.<>9__40_1 = val2; obj4 = (object)val2; } obj3.payCost = (PayCostDelegate)obj4; costTypeDefWispWhite.colorIndex = (ColorIndex)1; } public void CreateCostDefDamage() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0073: 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_007e: Expected O, but got Unknown costTypeDefDamage = new CostTypeDef(); costTypeDefDamage.costStringFormatToken = "COST_PERCENTHEALTH_FORMAT"; costTypeDefDamage.saturateWorldStyledCostString = false; costTypeDefDamage.darkenWorldStyledCostString = true; CostTypeDef obj = costTypeDefDamage; object obj2 = <>c.<>9__41_0; if (obj2 == null) { IsAffordableDelegate val = delegate(CostTypeDef costTypeDef, IsAffordableContext context) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) CharacterBody component2 = ((Component)context.activator).GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { HealthComponent component3 = ((Component)context.activator).GetComponent(); return Object.op_Implicit((Object)(object)component3) && component3.combinedHealth >= 10f; } return false; }; <>c.<>9__41_0 = val; obj2 = (object)val; } obj.isAffordable = (IsAffordableDelegate)obj2; CostTypeDef obj3 = costTypeDefDamage; object obj4 = <>c.<>9__41_1; if (obj4 == null) { PayCostDelegate val2 = delegate(PayCostContext context, PayCostResults results) { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Expected O, but got Unknown HealthComponent component = ((Component)context.activator).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { float combinedHealth = component.combinedHealth; float num = Mathf.Ceil(component.combinedHealth / 100f * (float)context.cost); if (combinedHealth > num) { component.TakeDamage(new DamageInfo { damage = num, attacker = context.purchasedObject, position = context.purchasedObject.transform.position, damageType = DamageTypeCombo.op_Implicit((DamageType)3) }); MultiShopCardUtils.OnNonMoneyPurchase(context); } } }; <>c.<>9__41_1 = val2; obj4 = (object)val2; } obj3.payCost = (PayCostDelegate)obj4; costTypeDefDamage.colorIndex = (ColorIndex)9; } public void CreateCostDefWispGreen() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Expected O, but got Unknown //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Expected O, but got Unknown costTypeDefWispGreen = new CostTypeDef(); costTypeDefWispGreen.costStringFormatToken = "COST_ITEM_FORMAT"; costTypeDefWispGreen.saturateWorldStyledCostString = true; CostTypeDef obj = costTypeDefWispGreen; object obj2 = <>c.<>9__42_0; if (obj2 == null) { IsAffordableDelegate val = delegate(CostTypeDef costTypeDef, IsAffordableContext context) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) CharacterBody component2 = ((Component)context.activator).GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { Inventory inventory2 = component2.inventory; if (Object.op_Implicit((Object)(object)inventory2)) { return inventory2.GetTotalItemCountOfTier((ItemTier)1) > 0; } } return false; }; <>c.<>9__42_0 = val; obj2 = (object)val; } obj.isAffordable = (IsAffordableDelegate)obj2; CostTypeDef obj3 = costTypeDefWispGreen; object obj4 = <>c.<>9__42_1; if (obj4 == null) { PayCostDelegate val2 = delegate(PayCostContext context, PayCostResults results) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Invalid comparison between Unknown and I4 //IL_0059: Unknown result type (might be due to invalid IL or missing references) CharacterBody component = ((Component)context.activator).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { Inventory inventory = component.inventory; List list = new List(); foreach (ItemIndex item in inventory.itemAcquisitionOrder) { if ((int)ItemCatalog.GetItemDef(item).tier == 1) { list.Add(ItemCatalog.GetItemDef(item)); } } ItemDef val3 = list[Random.Range(0, list.Count)]; context.purchasedObject.GetComponent().wispItem = val3; inventory.RemoveItem(val3, 1); } }; <>c.<>9__42_1 = val2; obj4 = (object)val2; } obj3.payCost = (PayCostDelegate)obj4; costTypeDefWispGreen.colorIndex = (ColorIndex)2; } public void CreateCostDefWispRed() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Expected O, but got Unknown //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Expected O, but got Unknown costTypeDefWispRed = new CostTypeDef(); costTypeDefWispRed.costStringFormatToken = "COST_ITEM_FORMAT"; costTypeDefWispRed.saturateWorldStyledCostString = true; CostTypeDef obj = costTypeDefWispRed; object obj2 = <>c.<>9__43_0; if (obj2 == null) { IsAffordableDelegate val = delegate(CostTypeDef costTypeDef, IsAffordableContext context) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) CharacterBody component2 = ((Component)context.activator).GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { Inventory inventory2 = component2.inventory; if (Object.op_Implicit((Object)(object)inventory2)) { return inventory2.GetTotalItemCountOfTier((ItemTier)2) > 0; } } return false; }; <>c.<>9__43_0 = val; obj2 = (object)val; } obj.isAffordable = (IsAffordableDelegate)obj2; CostTypeDef obj3 = costTypeDefWispRed; object obj4 = <>c.<>9__43_1; if (obj4 == null) { PayCostDelegate val2 = delegate(PayCostContext context, PayCostResults results) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Invalid comparison between Unknown and I4 //IL_0059: Unknown result type (might be due to invalid IL or missing references) CharacterBody component = ((Component)context.activator).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { Inventory inventory = component.inventory; List list = new List(); foreach (ItemIndex item in inventory.itemAcquisitionOrder) { if ((int)ItemCatalog.GetItemDef(item).tier == 2) { list.Add(ItemCatalog.GetItemDef(item)); } } ItemDef val3 = list[Random.Range(0, list.Count)]; context.purchasedObject.GetComponent().wispItem = val3; inventory.RemoveItem(val3, 1); } }; <>c.<>9__43_1 = val2; obj4 = (object)val2; } obj3.payCost = (PayCostDelegate)obj4; costTypeDefWispRed.colorIndex = (ColorIndex)3; } public void CreateCostDefShrineFallen() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0073: 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_007e: Expected O, but got Unknown costTypeDefShrineFallen = new CostTypeDef(); costTypeDefShrineFallen.costStringFormatToken = "COST_PERCENTMAXHEALTH_ROUND_FORMAT"; costTypeDefShrineFallen.saturateWorldStyledCostString = false; costTypeDefShrineFallen.darkenWorldStyledCostString = true; CostTypeDef obj = costTypeDefShrineFallen; object obj2 = <>c.<>9__44_0; if (obj2 == null) { IsAffordableDelegate val = delegate(CostTypeDef costTypeDef, IsAffordableContext context) { //IL_0001: 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) CharacterBody component2 = ((Component)context.activator).GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { int buffCount2 = component2.GetBuffCount(InitBuffs.maxHPDownStage); int num2 = (int)Mathf.Ceil((100f - (float)component2.GetBuffCount(InitBuffs.maxHPDownStage)) / 100f * (float)context.cost); return buffCount2 + num2 < 100 && ShrineFallenBehaviour.IsAnyoneDead(); } return false; }; <>c.<>9__44_0 = val; obj2 = (object)val; } obj.isAffordable = (IsAffordableDelegate)obj2; CostTypeDef obj3 = costTypeDefShrineFallen; object obj4 = <>c.<>9__44_1; if (obj4 == null) { PayCostDelegate val2 = delegate(PayCostContext context, PayCostResults results) { CharacterBody component = ((Component)context.activator).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { int buffCount = component.GetBuffCount(InitBuffs.maxHPDownStage); int num = (int)Mathf.Ceil((100f - (float)component.GetBuffCount(InitBuffs.maxHPDownStage)) / 100f * (float)context.cost); for (int i = 0; i < num; i++) { component.AddBuff(InitBuffs.maxHPDownStage); } } }; <>c.<>9__44_1 = val2; obj4 = (object)val2; } obj3.payCost = (PayCostDelegate)obj4; costTypeDefShrineFallen.colorIndex = (ColorIndex)9; } public void CreateCostDefShrineFallenAlt() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0073: 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_007e: Expected O, but got Unknown costTypeDefShrineFallen = new CostTypeDef(); costTypeDefShrineFallen.costStringFormatToken = "COST_MONEY_FORMAT"; costTypeDefShrineFallen.saturateWorldStyledCostString = true; costTypeDefShrineFallen.darkenWorldStyledCostString = false; CostTypeDef obj = costTypeDefShrineFallen; object obj2 = <>c.<>9__45_0; if (obj2 == null) { IsAffordableDelegate val = delegate(CostTypeDef costTypeDef, IsAffordableContext context) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) CharacterBody component = ((Component)context.activator).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { CharacterMaster master = component.master; if (Object.op_Implicit((Object)(object)master)) { return (ulong)master.money >= (ulong)context.cost && ShrineFallenBehaviour.IsAnyoneDead(); } } return false; }; <>c.<>9__45_0 = val; obj2 = (object)val; } obj.isAffordable = (IsAffordableDelegate)obj2; CostTypeDef obj3 = costTypeDefShrineFallen; object obj4 = <>c.<>9__45_1; if (obj4 == null) { PayCostDelegate val2 = delegate(PayCostContext context, PayCostResults results) { if (Object.op_Implicit((Object)(object)context.activatorMaster)) { CharacterMaster activatorMaster = context.activatorMaster; activatorMaster.money -= (uint)context.cost; } }; <>c.<>9__45_1 = val2; obj4 = (object)val2; } obj3.payCost = (PayCostDelegate)obj4; costTypeDefShrineFallen.colorIndex = (ColorIndex)8; } public void CreateCostDefShrineDisorder() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0073: 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_007e: Expected O, but got Unknown costTypeDefShrineDisorder = new CostTypeDef(); costTypeDefShrineDisorder.costStringFormatToken = "COST_LUNARCOIN_FORMAT"; costTypeDefShrineDisorder.saturateWorldStyledCostString = false; costTypeDefShrineDisorder.darkenWorldStyledCostString = true; CostTypeDef obj = costTypeDefShrineDisorder; object obj2 = <>c.<>9__46_0; if (obj2 == null) { IsAffordableDelegate val = delegate(CostTypeDef costTypeDef, IsAffordableContext context) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) CharacterBody component = ((Component)context.activator).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { bool flag = false; Inventory inventory = component.inventory; foreach (ItemTier tier in Enum.GetValues(typeof(ItemTier))) { int num = int.MaxValue; IEnumerable enumerable = ((IEnumerable)(object)ItemCatalog.allItemDefs).Where((ItemDef x) => x.tier == tier); foreach (ItemDef item in enumerable) { int itemCount = inventory.GetItemCount(item); num = Math.Min(num, itemCount); if (itemCount - num > 1) { flag = true; } } } NetworkUser val4 = Util.LookUpBodyNetworkUser(((Component)context.activator).gameObject); return Object.op_Implicit((Object)(object)val4) && (ulong)val4.lunarCoins >= (ulong)context.cost && flag; } return false; }; <>c.<>9__46_0 = val; obj2 = (object)val; } obj.isAffordable = (IsAffordableDelegate)obj2; CostTypeDef obj3 = costTypeDefShrineDisorder; object obj4 = <>c.<>9__46_1; if (obj4 == null) { PayCostDelegate val2 = delegate(PayCostContext context, PayCostResults results) { NetworkUser val3 = Util.LookUpBodyNetworkUser(((Component)context.activator).gameObject); if (Object.op_Implicit((Object)(object)val3)) { val3.DeductLunarCoins((uint)context.cost); } }; <>c.<>9__46_1 = val2; obj4 = (object)val2; } obj3.payCost = (PayCostDelegate)obj4; costTypeDefShrineDisorder.colorIndex = (ColorIndex)12; } public void CreateCostDefShrineHeresy() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0073: 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_007e: Expected O, but got Unknown costTypeDefShrineHeresy = new CostTypeDef(); costTypeDefShrineHeresy.costStringFormatToken = "COST_LUNARCOIN_FORMAT"; costTypeDefShrineHeresy.saturateWorldStyledCostString = false; costTypeDefShrineHeresy.darkenWorldStyledCostString = true; CostTypeDef obj = costTypeDefShrineHeresy; object obj2 = <>c.<>9__47_0; if (obj2 == null) { IsAffordableDelegate val = delegate(CostTypeDef costTypeDef, IsAffordableContext context) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: 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_00b7: Unknown result type (might be due to invalid IL or missing references) CharacterBody component = ((Component)context.activator).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { bool flag = false; Inventory inventory = component.inventory; if (component.inventory.GetItemCount(Items.LunarPrimaryReplacement.itemIndex) <= 0 || component.inventory.GetItemCount(Items.LunarSecondaryReplacement.itemIndex) <= 0 || component.inventory.GetItemCount(Items.LunarUtilityReplacement.itemIndex) <= 0 || component.inventory.GetItemCount(Items.LunarSpecialReplacement.itemIndex) <= 0) { flag = true; } NetworkUser val4 = Util.LookUpBodyNetworkUser(((Component)context.activator).gameObject); return Object.op_Implicit((Object)(object)val4) && (ulong)val4.lunarCoins >= (ulong)context.cost && flag; } return false; }; <>c.<>9__47_0 = val; obj2 = (object)val; } obj.isAffordable = (IsAffordableDelegate)obj2; CostTypeDef obj3 = costTypeDefShrineHeresy; object obj4 = <>c.<>9__47_1; if (obj4 == null) { PayCostDelegate val2 = delegate(PayCostContext context, PayCostResults results) { NetworkUser val3 = Util.LookUpBodyNetworkUser(((Component)context.activator).gameObject); if (Object.op_Implicit((Object)(object)val3)) { val3.DeductLunarCoins((uint)context.cost); } }; <>c.<>9__47_1 = val2; obj4 = (object)val2; } obj3.payCost = (PayCostDelegate)obj4; costTypeDefShrineHeresy.colorIndex = (ColorIndex)12; } public void RegisterLanguageTokens() { LanguageAPI.Add("SHRINE_IMP_USE_MESSAGE", "{0} inspected the vase and tiny imps appeared!"); LanguageAPI.Add("SHRINE_IMP_USE_MESSAGE_2P", "You inspected the vase and tiny imps appeared!"); LanguageAPI.Add("SHRINE_IMP_COMPLETED", "You killed all the imps and found some items!"); LanguageAPI.Add("SHRINE_IMP_COMPLETED_2P", "{0} killed all the imps and found some items!"); LanguageAPI.Add("SHRINE_IMP_FAILED", "You failed to kill all the imps in time!"); LanguageAPI.Add("SHRINE_IMP_FAILED_2P", "{0} failed to kill all the imps in time!"); LanguageAPI.Add("SHRINE_IMP_NAME", "Shrine of Imps"); LanguageAPI.Add("SHRINE_IMP_CONTEXT", "Inspect the vase."); LanguageAPI.Add("SHRINE_FALLEN_NAME", "Shrine of the Fallen"); LanguageAPI.Add("SHRINE_FALLEN_CONTEXT", "Offer to Shrine of the Fallen"); LanguageAPI.Add("SHRINE_FALLEN_USED", "{0} offered to the Shrine of the Fallen and revived {1}!"); LanguageAPI.Add("SHRINE_FALLEN_USED_2P", "You offer to the Shrine of the Fallen and revived {1}!"); LanguageAPI.Add("OBJECTIVE_KILL_TINY_IMPS", "Kill the tiny imps ({1}/{2}) in {3} seconds!"); LanguageAPI.Add("COST_PERCENTMAXHEALTH_FORMAT", "{0}% MAX HP"); LanguageAPI.Add("COST_PERCENTMAXHEALTH_ROUND_FORMAT", "{0}% STAGE MAX HP"); LanguageAPI.Add("SHRINE_DISORDER_NAME", "Shrine of Disorder"); LanguageAPI.Add("SHRINE_DISORDER_CONTEXT", "Offer to Shrine of Disorder"); LanguageAPI.Add("SHRINE_DISORDER_USE_MESSAGE_2P", "Your order has been disturbed."); LanguageAPI.Add("SHRINE_DISORDER_USE_MESSAGE", "{0}'s order has been disturbed."); LanguageAPI.Add("SHRINE_HERESY_NAME", "Shrine of Heresy"); LanguageAPI.Add("SHRINE_HERESY_CONTEXT", "Offer to Shrine of Heresy"); LanguageAPI.Add("SHRINE_HERESY_USE_MESSAGE_2P", "You have taken a step towards heresy."); LanguageAPI.Add("SHRINE_HERESY_USE_MESSAGE", "{0} has taken a step towards heresy."); LanguageAPI.Add("SHRINE_WISP_NAME", "Shrine of Wisps"); LanguageAPI.Add("SHRINE_WISP_CONTEXT", "Offer to the tree"); LanguageAPI.Add("SHRINE_WISP_ACCEPT_MESSAGE_2P", "The tree accepted your {2} and ghostly Wisps appeared."); LanguageAPI.Add("SHRINE_WISP_ACCEPT_MESSAGE", "The tree accepted {0}'s {2} and ghostly Wisps appeared."); LanguageAPI.Add("SHRINE_WISP_DENY_MESSAGE_2P", "The tree rejected your {2} and angry Wisps appeared.."); LanguageAPI.Add("SHRINE_WISP_DENY_MESSAGE", "The tree rejected {0}'s {2} and angry Wisps appeared.."); LanguageAPI.Add("SHRINE_SHIELDING_NAME", "Shrine of Hardening"); LanguageAPI.Add("SHRINE_SHIELDING_CONTEXT", "Touch the shield."); LanguageAPI.Add("SHRINE_SHIELDING_USE_MESSAGE_2P", "You feel protected."); LanguageAPI.Add("SHRINE_SHIELDING_USE_MESSAGE", "{0} feels protected."); LanguageAPI.Add("SHRINE_THUNDER_NAME", "Rusty Fusebox"); LanguageAPI.Add("SHRINE_THUNDER_CONTEXT", "Interact with the fusebox."); LanguageAPI.Add("SHRINE_THUNDER_USE_MESSAGE_2P", "You hear thunder rumbling."); LanguageAPI.Add("SHRINE_THUNDER_USE_MESSAGE", "You hear thunder rumbling."); LanguageAPI.Add("SHRINE_ENIGMA_NAME", "Totem Pole"); LanguageAPI.Add("SHRINE_ENIGMA_CONTEXT", "Touch the totem."); LanguageAPI.Add("SHRINE_ENIGMA_USE_MESSAGE_2P", "You got a random equipment effect. [{1}]"); LanguageAPI.Add("SHRINE_ENIGMA_USE_MESSAGE", "{0} got a random equipment effect. [{1}]"); } public void RegisterConfig() { impShrineEnabled = ((BaseUnityPlugin)this).Config.Bind("Shrine of Imps", "Enable", true, "Enable the Shrine of Imps."); impShrineWeight = ((BaseUnityPlugin)this).Config.Bind("Shrine of Imps", "Weight", 2, "The spawn weight of this shrine, lower is more rare."); impCountScale = ((BaseUnityPlugin)this).Config.Bind("Shrine of Imps", "Count Scale", true, "Scale the maximum amount of imps with stage difficulty."); impShrineTime = ((BaseUnityPlugin)this).Config.Bind("Shrine of Imps", "Time", 30, "The amount of time you get to finish a Shrine of Imps."); itemRarityBasedOnSpeed = ((BaseUnityPlugin)this).Config.Bind("Shrine of Imps", "Item Rarity Based On Speed", true, "Increase item rarity based on how fast you killed all the imps."); dropItemForEveryPlayer = ((BaseUnityPlugin)this).Config.Bind("Shrine of Imps", "Drop for every player", true, "Drop a item for every player in the session."); extraItemCount = ((BaseUnityPlugin)this).Config.Bind("Shrine of Imps", "Extra Item Count", 0, "Drop X extra items along with the base amount when a Shrine of Imps is beaten."); fallenShrineEnabled = ((BaseUnityPlugin)this).Config.Bind("Shrine of the Fallen", "Enable", false, "Enable the Shrine of the Fallen."); fallenShrineWeight = ((BaseUnityPlugin)this).Config.Bind("Shrine of the Fallen", "Weight", 2, "The spawn weight of this shrine, lower is more rare."); fallenShrineHPPenalty = ((BaseUnityPlugin)this).Config.Bind("Shrine of the Fallen", "HP Penalty", 40, "The max HP penalty the user takes for the rest of the stage when this shrine is used."); fallenShrineMoney = ((BaseUnityPlugin)this).Config.Bind("Shrine of the Fallen", "Use Money", false, "Shrine of the Fallen costs money rather than a HP penalty."); fallenShrineMoneyCost = ((BaseUnityPlugin)this).Config.Bind("Shrine of the Fallen", "Money Base Cost", 300, "The base cost for the shrine. (only applicable if 'Use Money' is enabled)"); disorderShrineEnabled = ((BaseUnityPlugin)this).Config.Bind("Shrine of Disorder", "Enable", true, "Enable the Shrine of Disorder."); disorderShrineWeight = ((BaseUnityPlugin)this).Config.Bind("Shrine of Disorder", "Weight", 1, "The spawn weight of this shrine, lower is more rare."); heresyShrineEnabled = ((BaseUnityPlugin)this).Config.Bind("Shrine of Heresy", "Enable", true, "Enable the Shrine of Heresy."); heresyShrineWeight = ((BaseUnityPlugin)this).Config.Bind("Shrine of Heresy", "Weight", 1, "The spawn weight of this shrine, lower is more rare."); wispShrineEnabled = ((BaseUnityPlugin)this).Config.Bind("Shrine of Wisps", "Enable", true, "Enable the Shrine of Wisps."); wispShrineScaleDifficulty = ((BaseUnityPlugin)this).Config.Bind("Shrine of Wisps", "Scale Count With Difficulty", true, "Scale the number of wisps spawned with difficulty."); wispShrineWeight = ((BaseUnityPlugin)this).Config.Bind("Shrine of Wisps", "Weight", 2, "The spawn weight of this shrine, lower is more rare."); lightningShrineEnabled = ((BaseUnityPlugin)this).Config.Bind("Rusty Fusebox", "Enable", true, "Enable the Rusty Fusebox."); lightningShrineWeight = ((BaseUnityPlugin)this).Config.Bind("Rusty Fusebox", "Weight", 2, "The spawn weight of this shrine, lower is more rare."); totemShrineEnabled = ((BaseUnityPlugin)this).Config.Bind("Totem Pole", "Enable", true, "Enable the Totem Pole."); totemShrineWeight = ((BaseUnityPlugin)this).Config.Bind("Totem Pole", "Weight", 2, "The spawn weight of this shrine, lower is more rare."); } public void GenerateLightningShrine() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Expected O, but got Unknown //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Expected O, but got Unknown //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Expected O, but got Unknown SpawnCard val = LegacyResourcesAPI.Load("SpawnCards/InteractableSpawnCard/iscShrineBlood"); GameObject prefab = val.prefab; ShrineAPI.ShrineInfo shrineInfo = new ShrineAPI.ShrineInfo(ShrineAPI.ShrineBaseType.Blood, new Color(1f, 1f, 1f, 1f), (GameObject)EvaResources.ShrineThunderPrefab); Transform val2 = shrineInfo.shrinePrefab.transform.Find("Symbol"); Transform modelTransform = shrineInfo.modelTransform; GameObject shrinePrefab = shrineInfo.shrinePrefab; ShrineThunderBehaviour shrineThunderBehaviour = shrinePrefab.AddComponent(); shrineThunderBehaviour.shrineEffectColor = new Color(0.337f, 0.827f, 0.921f); shrineThunderBehaviour.symbolTransform = val2; shrineThunderBehaviour.modelBase = modelTransform; shrineThunderBehaviour.lightningParticle = modelTransform.Find("Arc"); Transform val3 = prefab.transform.Find("Symbol"); MeshRenderer component = ((Component)val3).GetComponent(); Material material = ((Renderer)component).material; Shader shader = material.shader; Texture mainTexture = ((Renderer)((Component)shrineThunderBehaviour.lightningParticle).GetComponent()).material.mainTexture; ((Renderer)((Component)shrineThunderBehaviour.lightningParticle).GetComponent()).material = new Material(shader); ((Renderer)((Component)shrineThunderBehaviour.lightningParticle).GetComponent()).material = new Material(material.shader); ((Renderer)((Component)shrineThunderBehaviour.lightningParticle).GetComponent()).material.CopyPropertiesFromMaterial(material); ((Renderer)((Component)shrineThunderBehaviour.lightningParticle).GetComponent()).material.mainTexture = mainTexture; ((Renderer)((Component)shrineThunderBehaviour.lightningParticle).GetComponent()).material.SetColor("_TintColor", new Color(0.686f, 0.835f, 0.894f)); ((Renderer)((Component)val2).gameObject.GetComponent()).enabled = false; InteractableSpawnCard val4 = ScriptableObject.CreateInstance(); DirectorCard val5 = new DirectorCard(); ((SpawnCard)val4).prefab = shrinePrefab; val4.slightlyRandomizeOrientation = false; val5.selectionWeight = lightningShrineWeight.Value; val5.spawnCard = (SpawnCard)(object)val4; ((SpawnCard)val4).directorCreditCost = 10; val4.maxSpawnsPerStage = 2; Helpers.AddNewInteractable(val5, (InteractableCategory)4); } public void GenerateTotemShrine() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Expected O, but got Unknown SpawnCard val = LegacyResourcesAPI.Load("SpawnCards/InteractableSpawnCard/iscShrineChance"); GameObject prefab = val.prefab; ShrineAPI.ShrineInfo shrineInfo = new ShrineAPI.ShrineInfo(ShrineAPI.ShrineBaseType.None, new Color(1f, 1f, 1f, 1f), (GameObject)EvaResources.ShrineTotemPrefab); Transform symbolTransform = shrineInfo.shrinePrefab.transform.Find("Symbol"); Transform modelTransform = shrineInfo.modelTransform; GameObject shrinePrefab = shrineInfo.shrinePrefab; ShrineEnigmaBehaviour shrineEnigmaBehaviour = shrinePrefab.AddComponent(); shrineEnigmaBehaviour.shrineEffectColor = new Color(1f, 0.792f, 0.341f); shrineEnigmaBehaviour.symbolTransform = symbolTransform; shrineEnigmaBehaviour.modelBase = modelTransform; Transform val2 = prefab.transform.Find("Symbol"); MeshRenderer component = ((Component)val2).GetComponent(); Material material = ((Renderer)component).material; Shader shader = material.shader; InteractableSpawnCard val3 = ScriptableObject.CreateInstance(); DirectorCard val4 = new DirectorCard(); ((SpawnCard)val3).prefab = shrinePrefab; val3.slightlyRandomizeOrientation = false; val4.selectionWeight = totemShrineWeight.Value; val4.spawnCard = (SpawnCard)(object)val3; ((SpawnCard)val3).directorCreditCost = 10; val3.maxSpawnsPerStage = 1; Helpers.AddNewInteractable(val4, (InteractableCategory)4); } public void GenerateTinyImp() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0189: 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_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Expected O, but got Unknown CharacterSpawnCard val = ScriptableObject.CreateInstance(); CharacterSpawnCard val2 = Resources.Load("SpawnCards/CharacterSpawnCards/cscImp"); ((SpawnCard)val).directorCreditCost = 10; ((SpawnCard)val).forbiddenFlags = (NodeFlags)0; ((SpawnCard)val).hullSize = (HullClassification)0; ((SpawnCard)val).nodeGraphType = (GraphType)0; ((SpawnCard)val).occupyPosition = false; ((SpawnCard)val).requiredFlags = (NodeFlags)0; ((SpawnCard)val).sendOverNetwork = true; val.forbiddenAsBoss = true; GameObject val3 = PrefabAPI.InstantiateClone(((SpawnCard)val2).prefab, "TinyImpMaster"); CharacterMaster component = val3.GetComponent(); GameObject val4 = (component.bodyPrefab = PrefabAPI.InstantiateClone(component.bodyPrefab, "TinyImpBody")); CharacterBody component2 = val4.GetComponent(); component2.baseNameToken = "IMP_TINY_BODY_NAME"; LanguageAPI.Add("IMP_TINY_BODY_NAME", "Tiny Imp"); Transform modelTransform = val4.GetComponent().modelTransform; modelTransform.localScale /= 2f; AISkillDriver[] components = val3.GetComponents(); component2.baseMaxHealth /= 2f; component2.levelMaxHealth /= 2f; component2.baseJumpPower /= 5f; component2.levelJumpPower = 0f; component2.baseMoveSpeed *= 1.5f; AISkillDriver[] array = components; foreach (AISkillDriver val5 in array) { Object.Destroy((Object)(object)val5); } AISkillDriver val6 = val3.AddComponent(); val6.minDistance = 0f; val6.maxDistance = 500f; val6.aimType = (AimType)4; val6.ignoreNodeGraph = false; val6.moveTargetType = (TargetType)0; val6.shouldSprint = true; val6.movementType = (MovementType)3; val6.moveInputScale = 1f; val6.driverUpdateTimerOverride = -1f; val6.skillSlot = (SkillSlot)(-1); val3.AddComponent(); val3.GetComponent().localNavigator.allowWalkOffCliff = false; ContentAddition.AddMaster(val3); ContentAddition.AddBody(val4); ContentAddition.AddNetworkedObject(val4); ContentAddition.AddNetworkedObject(val3); LocalNavigator.Update += new hook_Update(LocalNavigator_Update); ((SpawnCard)val).prefab = val3; impSpawnCard = val; } private void LocalNavigator_Update(orig_Update orig, LocalNavigator self, float deltaTime) { if (Object.op_Implicit((Object)(object)self.bodyComponents.body) && Object.op_Implicit((Object)(object)self.bodyComponents.body.master) && Object.op_Implicit((Object)(object)((Component)self.bodyComponents.body.master).gameObject) && Object.op_Implicit((Object)(object)((Component)self.bodyComponents.body.master).gameObject.GetComponent())) { self.allowWalkOffCliff = false; } orig.Invoke(self, deltaTime); } private void SwarmsArtifactManager_OnSpawnCardOnSpawnedServerGlobal(orig_OnSpawnCardOnSpawnedServerGlobal orig, SpawnResult result) { //IL_0003: 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_0033: Unknown result type (might be due to invalid IL or missing references) bool flag = true; if (Object.op_Implicit((Object)(object)result.spawnedInstance) && Object.op_Implicit((Object)(object)result.spawnedInstance.GetComponent())) { flag = false; } if (flag) { orig.Invoke(result); } } private WeightedSelection SceneDirector_GenerateInteractableCardSelection(orig_GenerateInteractableCardSelection orig, SceneDirector self) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) WeightedSelection val = orig.Invoke(self); ChoiceInfo[] choices = val.choices; for (int i = 0; i < choices.Length; i++) { ChoiceInfo val2 = choices[i]; DirectorCard value = val2.value; Print("Card Name: " + ((value != null) ? ((Object)value.spawnCard).name : null)); DirectorCard value2 = val2.value; object obj; if (value2 == null) { obj = null; } else { SpawnCard spawnCard = value2.spawnCard; if (spawnCard == null) { obj = null; } else { GameObject prefab = spawnCard.prefab; obj = ((prefab != null) ? ((Object)prefab).name : null); } } Print("Name: " + (string?)obj); Print("Weight: " + val2.weight); } return val; } public static void Print(string printString) { Debug.Log((object)("[Better Shrines] " + printString)); } public void GenerateFallenShrine() { //IL_0021: 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_0035: Expected O, but got Unknown //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Expected O, but got Unknown SpawnCard val = Resources.Load("SpawnCards/InteractableSpawnCard/iscShrineHealing"); ShrineAPI.ShrineInfo shrineInfo = new ShrineAPI.ShrineInfo(ShrineAPI.ShrineBaseType.Order, new Color(1f, 0.8549f, 0.7647f, 1f), (GameObject)EvaResources.ShrineFallenPrefab); Transform symbolTransform = shrineInfo.shrinePrefab.transform.Find("Symbol"); Transform modelTransform = shrineInfo.modelTransform; GameObject shrinePrefab = shrineInfo.shrinePrefab; PurchaseInteraction component = shrinePrefab.GetComponent(); int num = fallenShrineHPPenalty.Value; if (num > 99) { num = 99; } else if (num < 0) { num = 0; } if (fallenShrineMoney.Value) { component.Networkcost = fallenShrineMoneyCost.Value; component.cost = fallenShrineMoneyCost.Value; } else { component.Networkcost = num; component.cost = num; } component.setUnavailableOnTeleporterActivated = false; if (fallenShrineMoney.Value) { component.automaticallyScaleCostWithDifficulty = true; } else { component.automaticallyScaleCostWithDifficulty = false; } ShrineFallenBehaviour shrineFallenBehaviour = shrinePrefab.AddComponent(); shrineFallenBehaviour.shrineEffectColor = new Color(0.384f, 0.874f, 0.435f); shrineFallenBehaviour.symbolTransform = symbolTransform; shrineFallenBehaviour.maxUses = 1; InteractableSpawnCard val2 = ScriptableObject.CreateInstance(); DirectorCard val3 = new DirectorCard(); ((SpawnCard)val2).prefab = shrinePrefab; val2.slightlyRandomizeOrientation = false; val3.selectionWeight = fallenShrineWeight.Value; val3.spawnCard = (SpawnCard)(object)val2; Helpers.AddNewInteractable(val3, (InteractableCategory)4); } public void GenerateHeresyShrine() { //IL_0021: 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_0035: Expected O, but got Unknown //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Expected O, but got Unknown SpawnCard val = Resources.Load("SpawnCards/InteractableSpawnCard/iscShrineRestack"); ShrineAPI.ShrineInfo shrineInfo = new ShrineAPI.ShrineInfo(ShrineAPI.ShrineBaseType.Order, new Color(1f, 0.8549f, 0.7647f, 1f), (GameObject)EvaResources.ShrineHeresyPrefab); Transform symbolTransform = shrineInfo.shrinePrefab.transform.Find("Symbol"); Transform modelTransform = shrineInfo.modelTransform; GameObject shrinePrefab = shrineInfo.shrinePrefab; ShrineHeresyBehaviour shrineHeresyBehaviour = shrinePrefab.AddComponent(); shrineHeresyBehaviour.shrineEffectColor = new Color(1f, 0.23f, 0.6337214f); shrineHeresyBehaviour.symbolTransform = symbolTransform; InteractableSpawnCard val2 = ScriptableObject.CreateInstance(); DirectorCard val3 = new DirectorCard(); ((SpawnCard)val2).prefab = shrinePrefab; val2.slightlyRandomizeOrientation = false; val3.selectionWeight = heresyShrineWeight.Value; val3.spawnCard = (SpawnCard)(object)val2; ((SpawnCard)val2).directorCreditCost = 30; val2.maxSpawnsPerStage = 1; Helpers.AddNewInteractable(val3, (InteractableCategory)4); } public void GenerateDisorderShrine() { //IL_0021: 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_0035: Expected O, but got Unknown //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown SpawnCard val = Resources.Load("SpawnCards/InteractableSpawnCard/iscShrineRestack"); ShrineAPI.ShrineInfo shrineInfo = new ShrineAPI.ShrineInfo(ShrineAPI.ShrineBaseType.Order, new Color(1f, 0.8549f, 0.7647f, 1f), (GameObject)EvaResources.ShrineDisorderPrefab); Transform symbolTransform = shrineInfo.shrinePrefab.transform.Find("Symbol"); Transform modelTransform = shrineInfo.modelTransform; GameObject shrinePrefab = shrineInfo.shrinePrefab; ShrineDisorderBehaviour shrineDisorderBehaviour = shrinePrefab.AddComponent(); shrineDisorderBehaviour.shrineEffectColor = new Color(1f, 0.23f, 0.6337214f); shrineDisorderBehaviour.symbolTransform = symbolTransform; shrineDisorderBehaviour.modelBase = ((Component)modelTransform).transform; InteractableSpawnCard val2 = ScriptableObject.CreateInstance(); DirectorCard val3 = new DirectorCard(); ((SpawnCard)val2).prefab = shrinePrefab; val2.slightlyRandomizeOrientation = false; val3.selectionWeight = disorderShrineWeight.Value; val3.spawnCard = (SpawnCard)(object)val2; ((SpawnCard)val2).directorCreditCost = 30; val2.maxSpawnsPerStage = 1; Helpers.AddNewInteractable(val3, (InteractableCategory)4); } public void GenerateImpShrine() { //IL_0021: 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_0035: Expected O, but got Unknown //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Expected O, but got Unknown SpawnCard val = Resources.Load("SpawnCards/InteractableSpawnCard/iscShrineHealing"); ShrineAPI.ShrineInfo shrineInfo = new ShrineAPI.ShrineInfo(ShrineAPI.ShrineBaseType.Healing, new Color(1f, 0.8549f, 0.7647f, 1f), (GameObject)EvaResources.ShrineImpPrefab); Transform symbolTransform = shrineInfo.shrinePrefab.transform.Find("Symbol"); GameObject shrinePrefab = shrineInfo.shrinePrefab; DirectorCard val2 = new DirectorCard(); val2.spawnCard = (SpawnCard)(object)impSpawnCard; val2.selectionWeight = 10; val2.spawnDistance = (MonsterSpawnDistance)0; val2.preventOverhead = false; val2.minimumStageCompletions = 0; CombatDirector component = shrinePrefab.GetComponent(); DirectorCardCategorySelection val3 = ScriptableObject.CreateInstance(); val3.AddCategory("Imps", 10f); val3.AddCard(0, val2); component.monsterCards = val3; ShrineImpBehaviour shrineImpBehaviour = shrinePrefab.AddComponent(); shrineImpBehaviour.shrineEffectColor = new Color(0.6661001f, 0.5333304f, 85f / 106f); shrineImpBehaviour.symbolTransform = symbolTransform; shrineImpBehaviour.directorCard = val2; CustomDirector customDirector = shrinePrefab.AddComponent(); InteractableSpawnCard val4 = ScriptableObject.CreateInstance(); DirectorCard val5 = new DirectorCard(); ((SpawnCard)val4).prefab = shrinePrefab; val4.slightlyRandomizeOrientation = false; ((SpawnCard)val4).directorCreditCost = 20; val4.maxSpawnsPerStage = 2; val5.selectionWeight = impShrineWeight.Value; val5.spawnCard = (SpawnCard)(object)val4; Helpers.AddNewInteractable(val5, (InteractableCategory)4); } public void GenerateWispShrine() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Expected O, but got Unknown //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Expected O, but got Unknown //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Expected O, but got Unknown //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Expected O, but got Unknown //IL_01ba: Unknown result type (might be due to invalid IL or missing references) SpawnCard val = Resources.Load("SpawnCards/InteractableSpawnCard/iscShrineBlood"); GameObject prefab = val.prefab; ShrineAPI.ShrineInfo shrineInfo = new ShrineAPI.ShrineInfo(ShrineAPI.ShrineBaseType.Blood, new Color(1f, 0.8549f, 0.7647f, 1f), (GameObject)EvaResources.ShrineWispPrefab); Transform symbolTransform = shrineInfo.shrinePrefab.transform.Find("Symbol"); Transform modelTransform = shrineInfo.modelTransform; GameObject shrinePrefab = shrineInfo.shrinePrefab; DirectorCard val2 = new DirectorCard(); val2.spawnCard = (SpawnCard)(object)Resources.Load("spawncards/characterspawncards/cscLesserWisp"); val2.selectionWeight = 10; val2.spawnDistance = (MonsterSpawnDistance)0; val2.preventOverhead = false; val2.minimumStageCompletions = 0; DirectorCard val3 = new DirectorCard(); val3.spawnCard = (SpawnCard)(object)Resources.Load("spawncards/characterspawncards/cscGreaterWisp"); val3.selectionWeight = 3; val3.spawnDistance = (MonsterSpawnDistance)0; val3.preventOverhead = false; val3.minimumStageCompletions = 0; CombatDirector component = shrinePrefab.GetComponent(); DirectorCardCategorySelection val4 = ScriptableObject.CreateInstance(); val4.AddCategory("Imps", 13f); val4.AddCard(0, val2); val4.AddCard(0, val3); component.monsterCards = val4; ShrineWispBehaviour shrineWispBehaviour = shrinePrefab.AddComponent(); shrineWispBehaviour.shrineEffectColor = new Color(0.6661001f, 0.5333304f, 85f / 106f); shrineWispBehaviour.symbolTransform = symbolTransform; InteractableSpawnCard val5 = ScriptableObject.CreateInstance(); DirectorCard val6 = new DirectorCard(); ((SpawnCard)val5).prefab = shrinePrefab; val5.slightlyRandomizeOrientation = false; val6.selectionWeight = wispShrineWeight.Value; val6.spawnCard = (SpawnCard)(object)val5; val6.minimumStageCompletions = 2; ((SpawnCard)val5).directorCreditCost = 15; val5.maxSpawnsPerStage = 2; Stage[] array = (Stage[])(object)new Stage[2] { (Stage)256, (Stage)64 }; Stage[] array2 = array; foreach (Stage val7 in array2) { Helpers.AddNewInteractable(val6, (InteractableCategory)4); } } } public static class EvaResources { public static bool Loaded { get; private set; } public static Object ShrineFallenPrefab { get; private set; } public static Object ShrineImpPrefab { get; private set; } public static Object ShrineDisorderPrefab { get; private set; } public static Object ShrineWispPrefab { get; private set; } public static Object ShrineHeresyPrefab { get; private set; } public static Object ShrineThunderPrefab { get; private set; } public static Object ShrineTotemPrefab { get; private set; } public static Object ShrineShieldPrefab { get; private set; } public static Sprite HPDebuffIcon { get; private set; } public static Sprite ShieldBar { get; private set; } public static void Init() { //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) if (!Loaded) { Loaded = true; AssetBundle val = AssetBundle.LoadFromFile(Assembly.GetExecutingAssembly().Location.Replace("BetterShrines.dll", "bettershrines")); val.LoadAllAssets(); if ((Object)(object)val != (Object)null) { MoreShrines.Print("Bundle data: " + (object)val); MoreShrines.Print("Asset bundle loaded."); ShrineFallenPrefab = val.LoadAsset("Assets/BetterShrines/ShrineOfTheFallen/ShrineFallen.prefab"); ShrineImpPrefab = val.LoadAsset("Assets/BetterShrines/ImpShrine/ShrineImp.prefab"); ShrineDisorderPrefab = val.LoadAsset("Assets/BetterShrines/ShrineOfDisorder/ShrineDisorder.prefab"); ShrineHeresyPrefab = val.LoadAsset("Assets/BetterShrines/ShrineOfHeresy/ShrineHeresy.prefab"); ShrineWispPrefab = val.LoadAsset("Assets/BetterShrines/WispShrine/ShrineWisp.prefab"); ShrineShieldPrefab = val.LoadAsset("Assets/BetterShrines/ShrineOfShielding/ShrineShielding.prefab"); ShrineThunderPrefab = val.LoadAsset("Assets/BetterShrines/ThunderShrine/ShrineThunder.prefab"); ShrineTotemPrefab = val.LoadAsset("Assets/BetterShrines/ShrineOfEnigma/ShrineEnigma.prefab"); ShieldBar = val.LoadAsset("Assets/BetterShrines/textures/texUINonsegmentedHealthbar.png"); Texture2D val2 = val.LoadAsset("Assets/BetterShrines/Buffs/texBuffHealthDownIcon.png"); MoreShrines.Print("Bundle assets loaded."); HPDebuffIcon = Sprite.Create(val2, new Rect(0f, 0f, (float)((Texture)val2).width, (float)((Texture)val2).height), new Vector2(0.5f, 0.5f)); } } } } internal class ShrineAPI { public enum ShrineBaseType { Chance, Healing, Order, Blood, Combat, Gold, None } public class ShrineInfo { public GameObject shrinePrefab; public CombatDirector combatDirector; public Transform modelTransform; public Transform symbolTransform; public void Create(ShrineBaseType baseShrine, GameObject shrinePrefab, Color? symbolColor = null, Shader overrideShader = null, Color? materialColor = null) { //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Expected O, but got Unknown //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) SpawnCard val = Resources.Load(shrineDict[baseShrine]); GameObject prefab = val.prefab; Transform val2 = prefab.transform.Find("Symbol"); MeshRenderer component = ((Component)val2).GetComponent(); Material material = ((Renderer)component).material; if (Object.op_Implicit((Object)(object)shrinePrefab.GetComponent())) { modelTransform = shrinePrefab.GetComponent().modelTransform; MeshRenderer[] componentsInChildren = ((Component)modelTransform).GetComponentsInChildren(); foreach (MeshRenderer val3 in componentsInChildren) { if ((Object)(object)overrideShader != (Object)null) { ((Renderer)val3).material.shader = overrideShader; } else { ((Renderer)val3).material.shader = Shader.Find("Hopoo Games/Deferred/Standard"); } } MeshRenderer[] componentsInChildren2 = ((Component)modelTransform).GetComponentsInChildren(); foreach (MeshRenderer val4 in componentsInChildren2) { if (materialColor.HasValue) { ((Renderer)val4).material.color = materialColor.Value; } else { ((Renderer)val4).material.color = Color.white; } } } if (Object.op_Implicit((Object)(object)shrinePrefab.GetComponent())) { combatDirector = shrinePrefab.GetComponent(); } if (Object.op_Implicit((Object)(object)shrinePrefab.transform.Find("Symbol"))) { symbolTransform = shrinePrefab.transform.Find("Symbol"); if (Object.op_Implicit((Object)(object)((Component)symbolTransform).GetComponent())) { MeshRenderer component2 = ((Component)symbolTransform).gameObject.GetComponent(); Texture mainTexture = ((Renderer)component2).material.mainTexture; ((Renderer)component2).material = new Material(material.shader); ((Renderer)component2).material.CopyPropertiesFromMaterial(material); ((Renderer)component2).material.mainTexture = mainTexture; if (symbolColor.HasValue) { ((Renderer)component2).material.SetColor("_TintColor", symbolColor.Value); } } } this.shrinePrefab = shrinePrefab; ContentAddition.AddNetworkedObject(shrinePrefab); PrefabAPI.RegisterNetworkPrefab(shrinePrefab); } public ShrineInfo(ShrineBaseType baseShrine, GameObject shrinePrefab, Color symbolColor, Shader overrideShader, Color materialColor) { //IL_000b: 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) Create(baseShrine, shrinePrefab, symbolColor, overrideShader, materialColor); } public ShrineInfo(ShrineBaseType baseShrine, GameObject shrinePrefab, Shader overrideShader, Color materialColor) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) Create(baseShrine, shrinePrefab, null, overrideShader, materialColor); } public ShrineInfo(ShrineBaseType baseShrine, Color materialColor, GameObject shrinePrefab) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) Create(baseShrine, shrinePrefab, null, null, materialColor); } public ShrineInfo(ShrineBaseType baseShrine, GameObject shrinePrefab, Color symbolColor, Shader overrideShader) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) Create(baseShrine, shrinePrefab, symbolColor, overrideShader); } public ShrineInfo(ShrineBaseType baseShrine, GameObject shrinePrefab, Color symbolColor) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) Create(baseShrine, shrinePrefab, symbolColor); } public ShrineInfo(ShrineBaseType baseShrine, GameObject shrinePrefab) { Create(baseShrine, shrinePrefab); } } private static Dictionary shrineDict = new Dictionary { { ShrineBaseType.Chance, "spawncards/interactablespawncard/iscShrineChance" }, { ShrineBaseType.Healing, "spawncards/interactablespawncard/iscShrineHealing" }, { ShrineBaseType.Order, "spawncards/interactablespawncard/iscShrineRestack" }, { ShrineBaseType.Blood, "spawncards/interactablespawncard/iscShrineBlood" }, { ShrineBaseType.Combat, "spawncards/interactablespawncard/iscShrineCombat" }, { ShrineBaseType.Gold, "spawncards/interactablespawncard/iscShrineGoldshoresAccess" }, { ShrineBaseType.None, "spawncards/interactablespawncard/iscShrineChance" } }; } [RequireComponent(typeof(PurchaseInteraction))] public class ShrineDisorderBehaviour : NetworkBehaviour { public Transform symbolTransform; public Transform modelBase; public Color shrineEffectColor; public PurchaseInteraction purchaseInteraction; private ItemTier[] tiersToCheck; private static int kRpcRpcAddShrineStackClient; public void Awake() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) purchaseInteraction = ((Component)this).GetComponent(); purchaseInteraction.costType = (CostTypeIndex)Array.IndexOf(CostTypeCatalog.costTypeDefs, MoreShrines.costTypeDefShrineDisorder); purchaseInteraction.cost = 1; purchaseInteraction.Networkcost = 1; ((UnityEvent)(object)purchaseInteraction.onPurchase).AddListener((UnityAction)delegate(Interactor interactor) { AddShrineStack(interactor); }); } [ClientRpc] public void RpcAddShrineStackClient() { ((Component)symbolTransform).gameObject.SetActive(false); Rigidbody[] componentsInChildren = ((Component)((Component)modelBase).transform).GetComponentsInChildren(); foreach (Rigidbody val in componentsInChildren) { val.isKinematic = false; } } public void AddShrineStack(Interactor interactor) { //IL_00a1: 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_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Expected O, but got Unknown //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0062: 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_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Expected O, but got Unknown CallRpcAddShrineStackClient(); if (!NetworkServer.active) { Debug.LogWarning((object)"[Server] function 'System.Void RoR2.TeleporterInteraction::AddShrineStack()' called on client"); return; } CharacterBody component = ((Component)interactor).GetComponent(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.inventory)) { ItemTier[] array = tiersToCheck; foreach (ItemTier itemTier in array) { FlattenInventory(component.inventory, itemTier); } Chat.SendBroadcastChat((ChatMessageBase)new SubjectFormatChatMessage { subjectAsCharacterBody = component, baseToken = "SHRINE_DISORDER_USE_MESSAGE" }); } EffectManager.SpawnEffect(Resources.Load("Prefabs/Effects/ShrineUseEffect"), new EffectData { origin = ((Component)this).transform.position, rotation = Quaternion.identity, scale = 1f, color = Color32.op_Implicit(shrineEffectColor) }, true); } public void FlattenInventory(Inventory inventory, ItemTier itemTier) { //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_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) ItemDef[] array = ((IEnumerable)(object)ItemCatalog.allItemDefs).Where((ItemDef x) => x.tier == itemTier && Run.instance.IsItemAvailable(x.itemIndex)).ToArray(); int[] array2 = new int[array.Length]; int num = int.MaxValue; ItemDef[] array3 = array; foreach (ItemDef val in array3) { num = Math.Min(inventory.GetItemCount(val), num); if (num == 0) { break; } } int num2 = num + 1; int num3 = 0; WeightedSelection val2 = new WeightedSelection(8); ItemDef[] array4 = array; foreach (ItemDef val3 in array4) { int itemCount = inventory.GetItemCount(val3); if (itemCount > num2) { int num4 = itemCount - num2; num3 += num4; inventory.RemoveItem(val3, num4); } else { val2.AddChoice(val3, 1f); } } int num5 = 0; while (num3 > 0) { if (val2.Count > 0) { num3--; int num6 = val2.EvaluateToChoiceIndex(Random.value); array2[Array.IndexOf(array, val2.GetChoice(num6).value)]++; val2.RemoveChoice(num6); continue; } num5 = num3 / array.Length; num3 -= num5 * array.Length; ItemDef[] array5 = array; foreach (ItemDef val4 in array5) { val2.AddChoice(val4, 1f); } } for (int l = 0; l < array.Length; l++) { int num7 = num5 + array2[l]; if (num7 > 0) { inventory.GiveItem(array[l], num7); } } } public ShrineDisorderBehaviour() { ItemTier[] array = new ItemTier[5]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); tiersToCheck = (ItemTier[])(object)array; ((NetworkBehaviour)this)..ctor(); } private void UNetVersion() { } protected static void InvokeRpcRpcAddShrineStackClient(NetworkBehaviour obj, NetworkReader reader) { if (!NetworkClient.active) { Debug.LogError((object)"RPC RpcAddShrineStackClient called on server."); } else { ((ShrineDisorderBehaviour)(object)obj).RpcAddShrineStackClient(); } } public void CallRpcAddShrineStackClient() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { Debug.LogError((object)"RPC Function RpcAddShrineStackClient called on client."); return; } NetworkWriter val = new NetworkWriter(); val.Write((short)0); val.Write((short)2); val.WritePackedUInt32((uint)kRpcRpcAddShrineStackClient); val.Write(((Component)this).GetComponent().netId); ((NetworkBehaviour)this).SendRPCInternal(val, 0, "RpcAddShrineStackClient"); } static ShrineDisorderBehaviour() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown kRpcRpcAddShrineStackClient = 2035029055; NetworkBehaviour.RegisterRpcDelegate(typeof(ShrineDisorderBehaviour), kRpcRpcAddShrineStackClient, new CmdDelegate(InvokeRpcRpcAddShrineStackClient)); NetworkCRC.RegisterBehaviour("ShrineDisorderBehaviour", 0); } public override bool OnSerialize(NetworkWriter writer, bool forceAll) { bool result = default(bool); return result; } public override void OnDeserialize(NetworkReader reader, bool initialState) { } } [RequireComponent(typeof(PurchaseInteraction))] public class ShrineEnigmaBehaviour : NetworkBehaviour { public Transform symbolTransform; public Transform modelBase; public Transform lightningParticle; public Color shrineEffectColor; public PurchaseInteraction purchaseInteraction; public int maxPurchaseCount = 1; public int purchaseCount = 0; public bool waitingForRefresh = false; public float refreshTimer = 0f; private static int kRpcRpcAddShrineStackClient; public void Awake() { purchaseInteraction = ((Component)this).GetComponent(); ((UnityEvent)(object)purchaseInteraction.onPurchase).AddListener((UnityAction)delegate(Interactor interactor) { AddShrineStack(interactor); }); } public void FixedUpdate() { if (waitingForRefresh) { refreshTimer -= Time.fixedDeltaTime; if (refreshTimer <= 0f && purchaseCount < maxPurchaseCount) { purchaseInteraction.SetAvailable(true); waitingForRefresh = false; } } } [ClientRpc] public void RpcAddShrineStackClient() { ((Component)symbolTransform).gameObject.SetActive(false); } public void AddShrineStack(Interactor interactor) { //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Expected O, but got Unknown //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Expected O, but got Unknown //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Expected O, but got Unknown //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) CallRpcAddShrineStackClient(); if (!NetworkServer.active) { Debug.LogWarning((object)"[Server] function 'System.Void RoR2.TeleporterInteraction::AddShrineStack()' called on client"); return; } waitingForRefresh = true; purchaseCount++; refreshTimer = 2f; CharacterBody component = ((Component)interactor).GetComponent(); if (!Object.op_Implicit((Object)(object)component) || !Object.op_Implicit((Object)(object)component.inventory)) { return; } EffectManager.SpawnEffect(LegacyResourcesAPI.Load("Prefabs/Effects/ShrineUseEffect"), new EffectData { origin = ((Component)this).transform.position, rotation = Quaternion.identity, scale = 1f, color = Color32.op_Implicit(shrineEffectColor) }, true); ((Component)symbolTransform).gameObject.SetActive(false); if (EquipmentCatalog.randomTriggerEquipmentList.Count > 0) { List list = new List(EquipmentCatalog.randomTriggerEquipmentList); Util.ShuffleList(list, MoreShrines.EvaRng); EquipmentIndex val = list[MoreShrines.EvaRng.RangeInt(0, list.Count)]; if (val == Equipment.BFG.equipmentIndex) { ModelLocator component2 = ((Component)this).GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { Transform modelTransform = component2.modelTransform; if (Object.op_Implicit((Object)(object)modelTransform)) { CharacterModel component3 = ((Component)modelTransform).GetComponent(); if (Object.op_Implicit((Object)(object)component3)) { Object.Instantiate(Addressables.LoadAssetAsync((object)"RoR2/Base/BFG/ChargeBFG.prefab").WaitForCompletion(), component.aimOriginTransform); } } } } EquipmentDef equipmentDef = EquipmentCatalog.GetEquipmentDef(val); component.equipmentSlot.PerformEquipmentAction(equipmentDef); SubjectFormatChatMessage val2 = new SubjectFormatChatMessage(); ((SubjectChatMessage)val2).subjectAsCharacterBody = component; ((SubjectChatMessage)val2).baseToken = "SHRINE_ENIGMA_USE_MESSAGE"; val2.paramTokens = new string[1] { equipmentDef.nameToken }; Chat.SendBroadcastChat((ChatMessageBase)(object)val2); } EffectData val3 = new EffectData(); val3.origin = component.corePosition; val3.SetNetworkedObjectReference(((Component)this).gameObject); EffectManager.SpawnEffect(LegacyResourcesAPI.Load("Prefabs/Effects/RandomEquipmentTriggerProcEffect"), val3, true); } private void UNetVersion() { } protected static void InvokeRpcRpcAddShrineStackClient(NetworkBehaviour obj, NetworkReader reader) { if (!NetworkClient.active) { Debug.LogError((object)"RPC RpcAddShrineStackClient called on server."); } else { ((ShrineEnigmaBehaviour)(object)obj).RpcAddShrineStackClient(); } } public void CallRpcAddShrineStackClient() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { Debug.LogError((object)"RPC Function RpcAddShrineStackClient called on client."); return; } NetworkWriter val = new NetworkWriter(); val.Write((short)0); val.Write((short)2); val.WritePackedUInt32((uint)kRpcRpcAddShrineStackClient); val.Write(((Component)this).GetComponent().netId); ((NetworkBehaviour)this).SendRPCInternal(val, 0, "RpcAddShrineStackClient"); } static ShrineEnigmaBehaviour() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown kRpcRpcAddShrineStackClient = -178043772; NetworkBehaviour.RegisterRpcDelegate(typeof(ShrineEnigmaBehaviour), kRpcRpcAddShrineStackClient, new CmdDelegate(InvokeRpcRpcAddShrineStackClient)); NetworkCRC.RegisterBehaviour("ShrineEnigmaBehaviour", 0); } public override bool OnSerialize(NetworkWriter writer, bool forceAll) { bool result = default(bool); return result; } public override void OnDeserialize(NetworkReader reader, bool initialState) { } } [RequireComponent(typeof(PurchaseInteraction))] public class ShrineFallenBehaviour : NetworkBehaviour { public Interactor whoInteracted; public Transform symbolTransform; public Color shrineEffectColor; public int maxUses = 1; public List playersToRespawn = new List(); [SyncVar] public int timesUsed = 0; public float wait = 2f; [SyncVar] public float stopwatch; public PurchaseInteraction purchaseInteraction; [SyncVar] public bool inUse = false; [SyncVar] public bool isAvailable = true; private static int kRpcRpcAddShrineStackClient; public int NetworktimesUsed { get { return timesUsed; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar(value, ref timesUsed, 1u); } } public float Networkstopwatch { get { return stopwatch; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar(value, ref stopwatch, 2u); } } public bool NetworkinUse { get { return inUse; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar(value, ref inUse, 4u); } } public bool NetworkisAvailable { get { return isAvailable; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar(value, ref isAvailable, 8u); } } public void Awake() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Expected O, but got Unknown purchaseInteraction = ((Component)this).GetComponent(); purchaseInteraction.costType = (CostTypeIndex)Array.IndexOf(CostTypeCatalog.costTypeDefs, MoreShrines.costTypeDefShrineFallen); ((UnityEvent)(object)purchaseInteraction.onPurchase).AddListener((UnityAction)delegate(Interactor interactor) { AddShrineStack(interactor); }); CharacterMaster.RespawnExtraLife += new hook_RespawnExtraLife(CharacterMaster_RespawnExtraLife); } private void CharacterMaster_RespawnExtraLife(orig_RespawnExtraLife orig, CharacterMaster self) { orig.Invoke(self); if (!playersToRespawn.Contains(self)) { return; } playersToRespawn.Remove(self); CharacterBody body = self.GetBody(); CharacterBody val = body; if (!Object.op_Implicit((Object)(object)val)) { return; } int buffCount = val.GetBuffCount(InitBuffs.maxHPDownStage); int num = (int)Mathf.Ceil((100f - (float)val.GetBuffCount(InitBuffs.maxHPDownStage)) / 100f * (float)purchaseInteraction.cost); if (buffCount + num < 100) { for (int i = 0; i < num; i++) { val.AddBuff(InitBuffs.maxHPDownStage); } } } public void Update() { if (timesUsed < maxUses) { if (inUse) { Networkstopwatch = stopwatch - Time.deltaTime; if (stopwatch < 0f) { NetworkinUse = false; } } else if (IsAnyoneDead()) { ((Component)symbolTransform).gameObject.SetActive(true); NetworkisAvailable = true; } else { ((Component)symbolTransform).gameObject.SetActive(false); NetworkisAvailable = false; } } else { ((Component)symbolTransform).gameObject.SetActive(false); NetworkisAvailable = false; if (NetworkServer.active) { purchaseInteraction.SetAvailable(false); } } } [ClientRpc] public void RpcAddShrineStackClient() { ((Component)symbolTransform).gameObject.SetActive(false); } public void AddShrineStack(Interactor interactor) { //IL_007a: 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_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Expected O, but got Unknown //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Expected O, but got Unknown CallRpcAddShrineStackClient(); if (!NetworkServer.active) { Debug.LogWarning((object)"[Server] function 'System.Void RoR2.ShrineCombatBehavior::AddShrineStack(RoR2.Interactor)' called on client"); return; } MoreShrines.Print(((Object)interactor).name + " has used a Shrine of the Fallen"); if (!IsAnyoneDead()) { return; } NetworktimesUsed = timesUsed + 1; Networkstopwatch = wait; NetworkinUse = true; whoInteracted = interactor; EffectManager.SpawnEffect(Resources.Load("Prefabs/Effects/ShrineUseEffect"), new EffectData { origin = ((Component)this).transform.position, rotation = Quaternion.identity, scale = 1f, color = Color32.op_Implicit(shrineEffectColor) }, true); if (NetworkServer.active) { MoreShrines.Print("attempting to revive user."); PlayerCharacterMasterController randomDeadPlayer = getRandomDeadPlayer(); if ((Object)(object)randomDeadPlayer != (Object)null) { playersToRespawn.Add(randomDeadPlayer.master); ((Component)randomDeadPlayer).GetComponent().RespawnExtraLife(); SubjectFormatChatMessage val = new SubjectFormatChatMessage(); ((SubjectChatMessage)val).subjectAsCharacterBody = ((Component)interactor).GetComponent(); ((SubjectChatMessage)val).baseToken = "SHRINE_FALLEN_USED"; val.paramTokens = new string[1] { randomDeadPlayer.networkUser.userName }; Chat.SendBroadcastChat((ChatMessageBase)(object)val); } } } public static bool IsAnyoneDead() { //IL_005d: Unknown result type (might be due to invalid IL or missing references) bool result = false; foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances) { if (Object.op_Implicit((Object)(object)instance.master)) { CharacterBody body = instance.master.GetBody(); if ((!Object.op_Implicit((Object)(object)body) || !body.healthComponent.alive) && instance.master.inventory.GetItemCount(ItemCatalog.FindItemIndex("ExtraLife")) <= 0) { result = true; } } } return result; } public PlayerCharacterMasterController getRandomDeadPlayer() { //IL_0063: Unknown result type (might be due to invalid IL or missing references) List list = new List(); foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances) { if (Object.op_Implicit((Object)(object)instance.master)) { CharacterBody body = instance.master.GetBody(); if ((!Object.op_Implicit((Object)(object)body) || !body.healthComponent.alive) && instance.master.inventory.GetItemCount(ItemCatalog.FindItemIndex("ExtraLife")) <= 0) { list.Add(instance); } } } if (list.Count == 0) { return null; } return MoreShrines.EvaRng.NextElementUniform(list); } private void UNetVersion() { } protected static void InvokeRpcRpcAddShrineStackClient(NetworkBehaviour obj, NetworkReader reader) { if (!NetworkClient.active) { Debug.LogError((object)"RPC RpcAddShrineStackClient called on server."); } else { ((ShrineFallenBehaviour)(object)obj).RpcAddShrineStackClient(); } } public void CallRpcAddShrineStackClient() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { Debug.LogError((object)"RPC Function RpcAddShrineStackClient called on client."); return; } NetworkWriter val = new NetworkWriter(); val.Write((short)0); val.Write((short)2); val.WritePackedUInt32((uint)kRpcRpcAddShrineStackClient); val.Write(((Component)this).GetComponent().netId); ((NetworkBehaviour)this).SendRPCInternal(val, 0, "RpcAddShrineStackClient"); } static ShrineFallenBehaviour() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown kRpcRpcAddShrineStackClient = 2099343387; NetworkBehaviour.RegisterRpcDelegate(typeof(ShrineFallenBehaviour), kRpcRpcAddShrineStackClient, new CmdDelegate(InvokeRpcRpcAddShrineStackClient)); NetworkCRC.RegisterBehaviour("ShrineFallenBehaviour", 0); } public override bool OnSerialize(NetworkWriter writer, bool forceAll) { if (forceAll) { writer.WritePackedUInt32((uint)timesUsed); writer.Write(stopwatch); writer.Write(inUse); writer.Write(isAvailable); return true; } bool flag = false; if ((((NetworkBehaviour)this).syncVarDirtyBits & (true ? 1u : 0u)) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.WritePackedUInt32((uint)timesUsed); } if ((((NetworkBehaviour)this).syncVarDirtyBits & 2u) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.Write(stopwatch); } if ((((NetworkBehaviour)this).syncVarDirtyBits & 4u) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.Write(inUse); } if ((((NetworkBehaviour)this).syncVarDirtyBits & 8u) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.Write(isAvailable); } if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); } return flag; } public override void OnDeserialize(NetworkReader reader, bool initialState) { if (initialState) { timesUsed = (int)reader.ReadPackedUInt32(); stopwatch = reader.ReadSingle(); inUse = reader.ReadBoolean(); isAvailable = reader.ReadBoolean(); return; } int num = (int)reader.ReadPackedUInt32(); if (((uint)num & (true ? 1u : 0u)) != 0) { timesUsed = (int)reader.ReadPackedUInt32(); } if (((uint)num & 2u) != 0) { stopwatch = reader.ReadSingle(); } if (((uint)num & 4u) != 0) { inUse = reader.ReadBoolean(); } if (((uint)num & 8u) != 0) { isAvailable = reader.ReadBoolean(); } } } [RequireComponent(typeof(PurchaseInteraction))] public class ShrineHeresyBehaviour : NetworkBehaviour { public Transform symbolTransform; public Color shrineEffectColor; public PurchaseInteraction purchaseInteraction; public PickupIndex dropPickup = PickupIndex.none; public List possiblePicks = new List(); private static int kRpcRpcAddShrineStackClient; public void Awake() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) purchaseInteraction = ((Component)this).GetComponent(); ((UnityEvent)(object)purchaseInteraction.onPurchase).AddListener((UnityAction)delegate(Interactor interactor) { AddShrineStack(interactor); }); purchaseInteraction.costType = (CostTypeIndex)Array.IndexOf(CostTypeCatalog.costTypeDefs, MoreShrines.costTypeDefShrineHeresy); possiblePicks.Add(Items.LunarPrimaryReplacement); possiblePicks.Add(Items.LunarSecondaryReplacement); possiblePicks.Add(Items.LunarSpecialReplacement); possiblePicks.Add(Items.LunarUtilityReplacement); } [ClientRpc] public void RpcAddShrineStackClient() { ((Component)symbolTransform).gameObject.SetActive(false); } public void AddShrineStack(Interactor interactor) { //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Expected O, but got Unknown //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Expected O, but got Unknown //IL_00ef: Unknown result type (might be due to invalid IL or missing references) CallRpcAddShrineStackClient(); if (!NetworkServer.active) { Debug.LogWarning((object)"[Server] function 'System.Void RoR2.TeleporterInteraction::AddShrineStack()' called on client"); return; } CharacterBody component = ((Component)interactor).GetComponent(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.inventory)) { if (component.inventory.GetItemCount(Items.LunarPrimaryReplacement.itemIndex) > 0) { possiblePicks.Remove(Items.LunarPrimaryReplacement); } else if (component.inventory.GetItemCount(Items.LunarSecondaryReplacement.itemIndex) > 0) { possiblePicks.Remove(Items.LunarSecondaryReplacement); } else if (component.inventory.GetItemCount(Items.LunarSpecialReplacement.itemIndex) > 0) { possiblePicks.Remove(Items.LunarSpecialReplacement); } else if (component.inventory.GetItemCount(Items.LunarUtilityReplacement.itemIndex) > 0) { possiblePicks.Remove(Items.LunarUtilityReplacement); } Chat.SendBroadcastChat((ChatMessageBase)new SubjectFormatChatMessage { subjectAsCharacterBody = component, baseToken = "SHRINE_HERESY_USE_MESSAGE" }); } dropPickup = PickupCatalog.itemIndexToPickupIndex[possiblePicks[Random.Range(0, possiblePicks.Count)].itemIndex]; if (!(dropPickup == PickupIndex.none)) { PickupDropletController.CreatePickupDroplet(dropPickup, symbolTransform.position + Vector3.up * 1.5f, Vector3.up * 20f + symbolTransform.forward * 2f); EffectManager.SpawnEffect(Resources.Load("Prefabs/Effects/ShrineUseEffect"), new EffectData { origin = ((Component)this).transform.position, rotation = Quaternion.identity, scale = 1f, color = Color32.op_Implicit(shrineEffectColor) }, true); ((Component)symbolTransform).gameObject.SetActive(false); } } private void UNetVersion() { } protected static void InvokeRpcRpcAddShrineStackClient(NetworkBehaviour obj, NetworkReader reader) { if (!NetworkClient.active) { Debug.LogError((object)"RPC RpcAddShrineStackClient called on server."); } else { ((ShrineHeresyBehaviour)(object)obj).RpcAddShrineStackClient(); } } public void CallRpcAddShrineStackClient() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { Debug.LogError((object)"RPC Function RpcAddShrineStackClient called on client."); return; } NetworkWriter val = new NetworkWriter(); val.Write((short)0); val.Write((short)2); val.WritePackedUInt32((uint)kRpcRpcAddShrineStackClient); val.Write(((Component)this).GetComponent().netId); ((NetworkBehaviour)this).SendRPCInternal(val, 0, "RpcAddShrineStackClient"); } static ShrineHeresyBehaviour() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown kRpcRpcAddShrineStackClient = 2076364393; NetworkBehaviour.RegisterRpcDelegate(typeof(ShrineHeresyBehaviour), kRpcRpcAddShrineStackClient, new CmdDelegate(InvokeRpcRpcAddShrineStackClient)); NetworkCRC.RegisterBehaviour("ShrineHeresyBehaviour", 0); } public override bool OnSerialize(NetworkWriter writer, bool forceAll) { bool result = default(bool); return result; } public override void OnDeserialize(NetworkReader reader, bool initialState) { } } [RequireComponent(typeof(PurchaseInteraction))] public class ShrineImpBehaviour : NetworkBehaviour { public PurchaseInteraction purchaseInteraction; public CombatDirector combatDirector; public CombatSquad combatSquad; public Color shrineEffectColor; public Transform symbolTransform; public int baseImpCount = 5; public float baseCredit = 20f; public DirectorCard directorCard; public static List instances; public string objectiveBaseToken = "OBJECTIVE_KILL_TINY_IMPS"; public string objectiveString = "Undefined"; [SyncVar] public float monsterCredit; [SyncVar] public Color impColor; [SyncVar] public string impColorHex; [SyncVar] public int impsSpawned; [SyncVar] public bool active; [SyncVar] public float timeLeftUnrounded; [SyncVar] public int timeLeft; [SyncVar] public int startTime; public bool failedShrine = false; private static int kRpcRpcHandleLoss; private static int kRpcRpcAddShrineStackClient; private static int kRpcRpcOnDefeatedClient; private int impCount { get { //IL_0011: Unknown result type (might be due to invalid IL or missing references) int participatingPlayerCount = Run.instance.participatingPlayerCount; float scalingValue = DifficultyCatalog.GetDifficultyDef(Run.instance.selectedDifficulty).scalingValue; float difficultyCoefficient = Run.instance.difficultyCoefficient; int num = Math.Min((int)Math.Round((float)(baseImpCount - 1) + (float)participatingPlayerCount * scalingValue), 15); if (MoreShrines.impCountScale.Value) { num += (int)Math.Round(difficultyCoefficient * 1.1f); } if (RunArtifactManager.instance.IsArtifactEnabled(Artifacts.Swarms)) { num *= 2; } return num; } } public int impsAlive => combatSquad.memberCount; public float NetworkmonsterCredit { get { return monsterCredit; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar(value, ref monsterCredit, 1u); } } public Color NetworkimpColor { get { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return impColor; } [param: In] set { //IL_0001: Unknown result type (might be due to invalid IL or missing references) ((NetworkBehaviour)this).SetSyncVar(value, ref impColor, 2u); } } public string NetworkimpColorHex { get { return impColorHex; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar(value, ref impColorHex, 4u); } } public int NetworkimpsSpawned { get { return impsSpawned; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar(value, ref impsSpawned, 8u); } } public bool Networkactive { get { return active; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar(value, ref active, 16u); } } public float NetworktimeLeftUnrounded { get { return timeLeftUnrounded; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar(value, ref timeLeftUnrounded, 32u); } } public int NetworktimeLeft { get { return timeLeft; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar(value, ref timeLeft, 64u); } } public int NetworkstartTime { get { return startTime; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar(value, ref startTime, 128u); } } public void Awake() { //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Expected O, but got Unknown //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) purchaseInteraction = ((Component)this).GetComponent(); combatDirector = ((Component)this).GetComponent(); combatSquad = ((Component)this).GetComponent(); instances.Add(this); combatDirector.shouldSpawnOneWave = false; if (NetworkServer.active) { ((UnityEvent)(object)purchaseInteraction.onPurchase).AddListener((UnityAction)delegate(Interactor interactor) { AddShrineStack(interactor); }); NetworkstartTime = MoreShrines.impShrineTime.Value; NetworktimeLeftUnrounded = MoreShrines.impShrineTime.Value; float difficultyCoefficient = Run.instance.difficultyCoefficient; float num = DifficultyCatalog.GetDifficultyDef(Run.instance.selectedDifficulty).scalingValue - 1f; NetworkmonsterCredit = baseCredit * (num + 1f) + (baseCredit + 30f) * (difficultyCoefficient - 1f); NetworkimpColor = Random.ColorHSV(0f, 1f, 0.5f, 0.7f, 1f, 1f); NetworkimpColorHex = "#" + ColorUtility.ToHtmlStringRGB(impColor); combatDirector.combatSquad.onDefeatedServer += OnDefeatedServer; ((UnityEvent)(object)combatDirector.onSpawnedServer).AddListener((UnityAction)delegate(GameObject gameObject) { OnSpawnedServer(gameObject); }); } ((Component)this).gameObject.GetComponent().countToSpawn = impCount; TeleporterInteraction.AddShrineStack += new hook_AddShrineStack(TeleporterInteraction_AddShrineStack); } private void TeleporterInteraction_AddShrineStack(orig_AddShrineStack orig, TeleporterInteraction self) { orig.Invoke(self); ObjectivePanelController.collectObjectiveSources -= CollectSources; } private void OnDestroy() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown ObjectivePanelController.collectObjectiveSources -= CollectSources; TeleporterInteraction.AddShrineStack -= new hook_AddShrineStack(TeleporterInteraction_AddShrineStack); } [ClientRpc] public void RpcHandleLoss() { failedShrine = true; ObjectivePanelController.collectObjectiveSources -= CollectSources; } private void Update() { if (!active) { return; } combatDirector.monsterSpawnTimer = 0f; combatDirector.currentMonsterCard = null; if (NetworkServer.active) { NetworktimeLeftUnrounded = timeLeftUnrounded - Time.deltaTime; NetworktimeLeft = (int)Math.Round(timeLeftUnrounded); if (timeLeft < 0) { Networkactive = false; NetworktimeLeft = 0; CallRpcHandleLoss(); failedShrine = true; for (int num = combatSquad.membersList.Count - 1; num >= 0; num--) { combatSquad.membersList[num].TrueKill(); } } } if (combatSquad.memberCount <= 0) { return; } int num2 = impsSpawned - impsAlive; if (!Application.isBatchMode) { objectiveString = string.Format(Language.GetString(objectiveBaseToken), impColorHex, num2, impsSpawned, timeLeft); } foreach (CharacterMaster members in combatSquad.membersList) { if (Object.op_Implicit((Object)(object)((Component)members).gameObject) && Object.op_Implicit((Object)(object)((Component)members).gameObject.GetComponent()) && !((Component)members).gameObject.GetComponent().hasMarker) { MoreShrines.Print("A imp was marked!"); markImp(members); ((Component)members).gameObject.GetComponent().hasMarker = true; } } } [ClientRpc] public void RpcAddShrineStackClient() { int num = impsSpawned - impsAlive; objectiveString = string.Format(Language.GetString(objectiveBaseToken), impColorHex, num, impsSpawned, timeLeft); ObjectivePanelController.collectObjectiveSources += CollectSources; ((Component)symbolTransform).gameObject.SetActive(false); } private void CollectSources(CharacterMaster master, List list) { } public void AddShrineStack(Interactor interactor) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Expected O, but got Unknown CallRpcAddShrineStackClient(); if (!NetworkServer.active) { Debug.LogWarning((object)"[Server] function 'System.Void RoR2.ShrineCombatBehavior::AddShrineStack(RoR2.Interactor)' called on client"); return; } ImpShrineActivation(interactor, monsterCredit, directorCard); EffectManager.SpawnEffect(Resources.Load("Prefabs/Effects/ShrineUseEffect"), new EffectData { origin = ((Component)this).transform.position, rotation = Quaternion.identity, scale = 1f, color = Color32.op_Implicit(shrineEffectColor) }, true); Networkactive = true; } private void markImp(CharacterMaster imp) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate(Resources.Load("Prefabs/PositionIndicators/PoiPositionIndicator"), imp.GetBodyObject().transform.position, imp.GetBodyObject().transform.rotation); PositionIndicator component = val.GetComponent(); component.insideViewObject.GetComponent().color = impColor; Object.Destroy((Object)(object)component.insideViewObject.GetComponent()); component.insideViewObject.transform.localScale = component.insideViewObject.transform.localScale / 2f; component.insideViewObject.GetComponent().sprite = Resources.Load("textures/miscicons/texAttackIcon"); ((Component)component.outsideViewObject.transform.Find("Sprite")).GetComponent().color = impColor; component.targetTransform = imp.GetBodyObject().transform; val.AddComponent(); } public void ImpShrineActivation(Interactor interactor, float monsterCredit, DirectorCard chosenDirectorCard) { //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Expected O, but got Unknown ((Behaviour)combatDirector).enabled = true; CombatDirector obj = combatDirector; obj.monsterCredit += monsterCredit; combatDirector.maximumNumberToSpawnBeforeSkipping = impCount; combatDirector.OverrideCurrentMonsterCard(chosenDirectorCard); combatDirector.monsterSpawnTimer = 0f; CharacterMaster component = chosenDirectorCard.spawnCard.prefab.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { CharacterBody component2 = component.bodyPrefab.GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { SubjectFormatChatMessage val = new SubjectFormatChatMessage(); ((SubjectChatMessage)val).subjectAsCharacterBody = ((Component)interactor).GetComponent(); ((SubjectChatMessage)val).baseToken = "SHRINE_IMP_USE_MESSAGE"; val.paramTokens = new string[1] { component2.baseNameToken }; Chat.SendBroadcastChat((ChatMessageBase)(object)val); } } } private void OnSpawnedServer(GameObject gameObject) { NetworkimpsSpawned = impsSpawned + 1; if (impsSpawned >= impCount) { ((Behaviour)combatDirector).enabled = false; } } private List weightedTierPickSpeed() { int num = 30; int num2 = 55; int num3 = 15; int num4 = 0; int num5 = 30; int num6 = 70; int value = (int)Math.Floor(Mathf.Lerp((float)num4, (float)num, timeLeftUnrounded / (float)startTime)); int value2 = (int)Math.Floor(Mathf.Lerp((float)num5, (float)num2, timeLeftUnrounded / (float)startTime)); int value3 = (int)Math.Floor(Mathf.Lerp((float)num6, (float)num3, timeLeftUnrounded / (float)startTime)); Dictionary, int> dictionary = new Dictionary, int>(); dictionary.Add(Run.instance.availableTier3DropList, value); dictionary.Add(Run.instance.availableTier2DropList, value2); dictionary.Add(Run.instance.availableTier1DropList, value3); MoreShrines.Print("Time percentage: " + timeLeftUnrounded / (float)startTime); MoreShrines.Print("Tier 3 weight: " + value); MoreShrines.Print("Tier 2 weight: " + value2); MoreShrines.Print("Tier 1 weight: " + value3); return WeightedRandomizer.From(dictionary).TakeOne(); } private List weightedTierPick() { int value = 5; int value2 = 40; int value3 = 55; Dictionary, int> dictionary = new Dictionary, int>(); dictionary.Add(Run.instance.availableTier3DropList, value); dictionary.Add(Run.instance.availableTier2DropList, value2); dictionary.Add(Run.instance.availableTier1DropList, value3); MoreShrines.Print("Time percentage: " + timeLeftUnrounded / (float)startTime); MoreShrines.Print("Tier 3 weight: " + value); MoreShrines.Print("Tier 2 weight: " + value2); MoreShrines.Print("Tier 1 weight: " + value3); return WeightedRandomizer.From(dictionary).TakeOne(); } private void DropRewards() { //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: 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_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) int participatingPlayerCount = Run.instance.participatingPlayerCount; if (participatingPlayerCount != 0 && Object.op_Implicit((Object)(object)symbolTransform)) { List list = new List(); list = ((!MoreShrines.itemRarityBasedOnSpeed.Value) ? weightedTierPick() : weightedTierPickSpeed()); PickupIndex val = MoreShrines.EvaRng.NextElementUniform(list); int num = 1; if (MoreShrines.dropItemForEveryPlayer.Value && !Chainloader.PluginInfos.ContainsKey("com.funkfrog_sipondo.sharesuite") && !Chainloader.PluginInfos.ContainsKey("com.funkfrog_sipondo.sharesuite-r2")) { num *= participatingPlayerCount; } num += MoreShrines.extraItemCount.Value; float num2 = 360f / (float)num; Vector3 val2 = Quaternion.AngleAxis((float)Random.Range(0, 360), Vector3.up) * (Vector3.up * 40f + Vector3.forward * 5f); Quaternion val3 = Quaternion.AngleAxis(num2, Vector3.up); int num3 = 0; while (num3 < num) { PickupDropletController.CreatePickupDroplet(val, symbolTransform.position, val2); num3++; val2 = val3 * val2; } } } [ClientRpc] public void RpcOnDefeatedClient() { objectiveString = string.Format(Language.GetString(objectiveBaseToken), impColorHex, impsSpawned, impsSpawned, timeLeft); ObjectivePanelController.collectObjectiveSources -= CollectSources; Networkactive = false; } public void OnDefeatedServer() { if (!failedShrine) { CallRpcOnDefeatedClient(); DropRewards(); } } static ShrineImpBehaviour() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Expected O, but got Unknown //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Expected O, but got Unknown instances = new List(); kRpcRpcHandleLoss = 1912021557; NetworkBehaviour.RegisterRpcDelegate(typeof(ShrineImpBehaviour), kRpcRpcHandleLoss, new CmdDelegate(InvokeRpcRpcHandleLoss)); kRpcRpcAddShrineStackClient = 806224921; NetworkBehaviour.RegisterRpcDelegate(typeof(ShrineImpBehaviour), kRpcRpcAddShrineStackClient, new CmdDelegate(InvokeRpcRpcAddShrineStackClient)); kRpcRpcOnDefeatedClient = 1901974662; NetworkBehaviour.RegisterRpcDelegate(typeof(ShrineImpBehaviour), kRpcRpcOnDefeatedClient, new CmdDelegate(InvokeRpcRpcOnDefeatedClient)); NetworkCRC.RegisterBehaviour("ShrineImpBehaviour", 0); } private void UNetVersion() { } protected static void InvokeRpcRpcHandleLoss(NetworkBehaviour obj, NetworkReader reader) { if (!NetworkClient.active) { Debug.LogError((object)"RPC RpcHandleLoss called on server."); } else { ((ShrineImpBehaviour)(object)obj).RpcHandleLoss(); } } protected static void InvokeRpcRpcAddShrineStackClient(NetworkBehaviour obj, NetworkReader reader) { if (!NetworkClient.active) { Debug.LogError((object)"RPC RpcAddShrineStackClient called on server."); } else { ((ShrineImpBehaviour)(object)obj).RpcAddShrineStackClient(); } } protected static void InvokeRpcRpcOnDefeatedClient(NetworkBehaviour obj, NetworkReader reader) { if (!NetworkClient.active) { Debug.LogError((object)"RPC RpcOnDefeatedClient called on server."); } else { ((ShrineImpBehaviour)(object)obj).RpcOnDefeatedClient(); } } public void CallRpcHandleLoss() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { Debug.LogError((object)"RPC Function RpcHandleLoss called on client."); return; } NetworkWriter val = new NetworkWriter(); val.Write((short)0); val.Write((short)2); val.WritePackedUInt32((uint)kRpcRpcHandleLoss); val.Write(((Component)this).GetComponent().netId); ((NetworkBehaviour)this).SendRPCInternal(val, 0, "RpcHandleLoss"); } public void CallRpcAddShrineStackClient() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { Debug.LogError((object)"RPC Function RpcAddShrineStackClient called on client."); return; } NetworkWriter val = new NetworkWriter(); val.Write((short)0); val.Write((short)2); val.WritePackedUInt32((uint)kRpcRpcAddShrineStackClient); val.Write(((Component)this).GetComponent().netId); ((NetworkBehaviour)this).SendRPCInternal(val, 0, "RpcAddShrineStackClient"); } public void CallRpcOnDefeatedClient() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { Debug.LogError((object)"RPC Function RpcOnDefeatedClient called on client."); return; } NetworkWriter val = new NetworkWriter(); val.Write((short)0); val.Write((short)2); val.WritePackedUInt32((uint)kRpcRpcOnDefeatedClient); val.Write(((Component)this).GetComponent().netId); ((NetworkBehaviour)this).SendRPCInternal(val, 0, "RpcOnDefeatedClient"); } public override bool OnSerialize(NetworkWriter writer, bool forceAll) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) if (forceAll) { writer.Write(monsterCredit); writer.Write(impColor); writer.Write(impColorHex); writer.WritePackedUInt32((uint)impsSpawned); writer.Write(active); writer.Write(timeLeftUnrounded); writer.WritePackedUInt32((uint)timeLeft); writer.WritePackedUInt32((uint)startTime); return true; } bool flag = false; if ((((NetworkBehaviour)this).syncVarDirtyBits & (true ? 1u : 0u)) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.Write(monsterCredit); } if ((((NetworkBehaviour)this).syncVarDirtyBits & 2u) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.Write(impColor); } if ((((NetworkBehaviour)this).syncVarDirtyBits & 4u) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.Write(impColorHex); } if ((((NetworkBehaviour)this).syncVarDirtyBits & 8u) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.WritePackedUInt32((uint)impsSpawned); } if ((((NetworkBehaviour)this).syncVarDirtyBits & 0x10u) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.Write(active); } if ((((NetworkBehaviour)this).syncVarDirtyBits & 0x20u) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.Write(timeLeftUnrounded); } if ((((NetworkBehaviour)this).syncVarDirtyBits & 0x40u) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.WritePackedUInt32((uint)timeLeft); } if ((((NetworkBehaviour)this).syncVarDirtyBits & 0x80u) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.WritePackedUInt32((uint)startTime); } if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); } return flag; } public override void OnDeserialize(NetworkReader reader, bool initialState) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) if (initialState) { monsterCredit = reader.ReadSingle(); impColor = reader.ReadColor(); impColorHex = reader.ReadString(); impsSpawned = (int)reader.ReadPackedUInt32(); active = reader.ReadBoolean(); timeLeftUnrounded = reader.ReadSingle(); timeLeft = (int)reader.ReadPackedUInt32(); startTime = (int)reader.ReadPackedUInt32(); return; } int num = (int)reader.ReadPackedUInt32(); if (((uint)num & (true ? 1u : 0u)) != 0) { monsterCredit = reader.ReadSingle(); } if (((uint)num & 2u) != 0) { impColor = reader.ReadColor(); } if (((uint)num & 4u) != 0) { impColorHex = reader.ReadString(); } if (((uint)num & 8u) != 0) { impsSpawned = (int)reader.ReadPackedUInt32(); } if (((uint)num & 0x10u) != 0) { active = reader.ReadBoolean(); } if (((uint)num & 0x20u) != 0) { timeLeftUnrounded = reader.ReadSingle(); } if (((uint)num & 0x40u) != 0) { timeLeft = (int)reader.ReadPackedUInt32(); } if (((uint)num & 0x80u) != 0) { startTime = (int)reader.ReadPackedUInt32(); } } } [RequireComponent(typeof(PurchaseInteraction))] public class ShrineShieldingBehaviour : NetworkBehaviour { public Transform symbolTransform; public Color shrineEffectColor; public PurchaseInteraction purchaseInteraction; public int maxPurchaseCount = 1; public int purchaseCount = 0; public bool waitingForRefresh = false; public float refreshTimer = 0f; private static int kRpcRpcAddShrineStackClient; public void Awake() { purchaseInteraction = ((Component)this).GetComponent(); ((UnityEvent)(object)purchaseInteraction.onPurchase).AddListener((UnityAction)delegate(Interactor interactor) { AddShrineStack(interactor); }); } public void FixedUpdate() { if (waitingForRefresh) { refreshTimer -= Time.fixedDeltaTime; if (refreshTimer <= 0f && purchaseCount < maxPurchaseCount) { purchaseInteraction.SetAvailable(true); waitingForRefresh = false; } } } [ClientRpc] public void RpcAddShrineStackClient() { ((Component)symbolTransform).gameObject.SetActive(false); } public void AddShrineStack(Interactor interactor) { //IL_0090: 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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Expected O, but got Unknown CallRpcAddShrineStackClient(); if (!NetworkServer.active) { Debug.LogWarning((object)"[Server] function 'System.Void RoR2.TeleporterInteraction::AddShrineStack()' called on client"); return; } waitingForRefresh = true; purchaseCount++; refreshTimer = 2f; CharacterBody component = ((Component)interactor).GetComponent(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.inventory)) { Chat.SendBroadcastChat((ChatMessageBase)new SubjectFormatChatMessage { subjectAsCharacterBody = component, baseToken = "SHRINE_SHIELDING_USE_MESSAGE" }); } EffectManager.SpawnEffect(LegacyResourcesAPI.Load("Prefabs/Effects/ShrineUseEffect"), new EffectData { origin = ((Component)this).transform.position, rotation = Quaternion.identity, scale = 1f, color = Color32.op_Implicit(shrineEffectColor) }, true); ((Component)symbolTransform).gameObject.SetActive(false); } private void UNetVersion() { } protected static void InvokeRpcRpcAddShrineStackClient(NetworkBehaviour obj, NetworkReader reader) { if (!NetworkClient.active) { Debug.LogError((object)"RPC RpcAddShrineStackClient called on server."); } else { ((ShrineShieldingBehaviour)(object)obj).RpcAddShrineStackClient(); } } public void CallRpcAddShrineStackClient() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { Debug.LogError((object)"RPC Function RpcAddShrineStackClient called on client."); return; } NetworkWriter val = new NetworkWriter(); val.Write((short)0); val.Write((short)2); val.WritePackedUInt32((uint)kRpcRpcAddShrineStackClient); val.Write(((Component)this).GetComponent().netId); ((NetworkBehaviour)this).SendRPCInternal(val, 0, "RpcAddShrineStackClient"); } static ShrineShieldingBehaviour() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown kRpcRpcAddShrineStackClient = 1327660524; NetworkBehaviour.RegisterRpcDelegate(typeof(ShrineShieldingBehaviour), kRpcRpcAddShrineStackClient, new CmdDelegate(InvokeRpcRpcAddShrineStackClient)); NetworkCRC.RegisterBehaviour("ShrineShieldingBehaviour", 0); } public override bool OnSerialize(NetworkWriter writer, bool forceAll) { bool result = default(bool); return result; } public override void OnDeserialize(NetworkReader reader, bool initialState) { } } [RequireComponent(typeof(PurchaseInteraction))] public class ShrineThunderBehaviour : NetworkBehaviour { [CompilerGenerated] private sealed class d__13 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public float time; public ShrineThunderBehaviour <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__13(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(time); <>1__state = 1; return true; case 1: <>1__state = -1; ((Component)<>4__this.lightningParticle).gameObject.SetActive(false); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__14 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public float time; public CharacterBody attacker; public ShrineThunderBehaviour <>4__this; private List.Enumerator <>s__1; private CharacterMaster 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__14(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>s__1 = default(List.Enumerator); 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: 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_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(time); <>1__state = 1; return true; case 1: <>1__state = -1; if (NetworkServer.active) { <>s__1 = <>4__this.GetAllCharactersInRadius(((Component)<>4__this).transform.position, 200).GetEnumerator(); try { while (<>s__1.MoveNext()) { 5__2 = <>s__1.Current; OrbManager.instance.AddOrb((Orb)new LightningStrikeOrb { attacker = ((Component)attacker).gameObject, damageColorIndex = (DamageColorIndex)3, damageValue = attacker.damage * 1500f, isCrit = false, procChainMask = default(ProcChainMask), procCoefficient = 1f, target = 5__2.GetBody().mainHurtBox }); 5__2 = null; } } finally { ((IDisposable)<>s__1).Dispose(); } <>s__1 = default(List.Enumerator); } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public Transform symbolTransform; public Transform modelBase; public Transform lightningParticle; public Color shrineEffectColor; public PurchaseInteraction purchaseInteraction; public int maxPurchaseCount = 1; public int purchaseCount = 0; public bool waitingForRefresh = false; public float refreshTimer = 0f; private static int kRpcRpcAddShrineStackClient; public void Awake() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) purchaseInteraction = ((Component)this).GetComponent(); ((UnityEvent)(object)purchaseInteraction.onPurchase).AddListener((UnityAction)delegate(Interactor interactor) { AddShrineStack(interactor); }); purchaseInteraction.costType = (CostTypeIndex)Array.IndexOf(CostTypeCatalog.costTypeDefs, MoreShrines.costTypeDefDamage); } public void FixedUpdate() { if (waitingForRefresh) { refreshTimer -= Time.fixedDeltaTime; if (refreshTimer <= 0f && purchaseCount < maxPurchaseCount) { purchaseInteraction.SetAvailable(true); waitingForRefresh = false; } } } [ClientRpc] public void RpcAddShrineStackClient() { ((Component)symbolTransform).gameObject.SetActive(false); ((Component)modelBase).GetComponent().SetBool("IsUsed", true); ((Component)lightningParticle).gameObject.SetActive(true); ((MonoBehaviour)this).StartCoroutine(DisableLightning(2f)); } private List GetAllCharactersInRadius(Vector3 position, int radius) { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Invalid comparison between Unknown and I4 //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Invalid comparison between Unknown and I4 //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) ReadOnlyCollection readOnlyInstancesList = CharacterMaster.readOnlyInstancesList; List list = readOnlyInstancesList.Cast().ToList(); List list2 = new List(); foreach (CharacterMaster item in list) { if (item.hasBody && (int)item.teamIndex != 1 && (int)item.teamIndex > 0 && Vector3.Distance(item.GetBodyObject().transform.position, position) <= (float)radius) { list2.Add(item); } } return list2; } [IteratorStateMachine(typeof(d__13))] private IEnumerator DisableLightning(float time) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__13(0) { <>4__this = this, time = time }; } [IteratorStateMachine(typeof(d__14))] private IEnumerator Strike(float time, CharacterBody attacker) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__14(0) { <>4__this = this, time = time, attacker = attacker }; } public void AddShrineStack(Interactor interactor) { //IL_0090: 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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Expected O, but got Unknown CallRpcAddShrineStackClient(); if (!NetworkServer.active) { Debug.LogWarning((object)"[Server] function 'System.Void RoR2.TeleporterInteraction::AddShrineStack()' called on client"); return; } waitingForRefresh = true; purchaseCount++; refreshTimer = 2f; CharacterBody component = ((Component)interactor).GetComponent(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.inventory)) { Chat.SendBroadcastChat((ChatMessageBase)new SubjectFormatChatMessage { subjectAsCharacterBody = component, baseToken = "SHRINE_THUNDER_USE_MESSAGE" }); } EffectManager.SpawnEffect(LegacyResourcesAPI.Load("Prefabs/Effects/ShrineUseEffect"), new EffectData { origin = ((Component)this).transform.position, rotation = Quaternion.identity, scale = 1f, color = Color32.op_Implicit(shrineEffectColor) }, true); ((Component)symbolTransform).gameObject.SetActive(false); ((Component)modelBase).GetComponent().SetBool("IsUsed", true); ((Component)lightningParticle).gameObject.SetActive(true); ((MonoBehaviour)this).StartCoroutine(DisableLightning(2f)); ((MonoBehaviour)this).StartCoroutine(Strike(2f, component)); } private void UNetVersion() { } protected static void InvokeRpcRpcAddShrineStackClient(NetworkBehaviour obj, NetworkReader reader) { if (!NetworkClient.active) { Debug.LogError((object)"RPC RpcAddShrineStackClient called on server."); } else { ((ShrineThunderBehaviour)(object)obj).RpcAddShrineStackClient(); } } public void CallRpcAddShrineStackClient() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { Debug.LogError((object)"RPC Function RpcAddShrineStackClient called on client."); return; } NetworkWriter val = new NetworkWriter(); val.Write((short)0); val.Write((short)2); val.WritePackedUInt32((uint)kRpcRpcAddShrineStackClient); val.Write(((Component)this).GetComponent().netId); ((NetworkBehaviour)this).SendRPCInternal(val, 0, "RpcAddShrineStackClient"); } static ShrineThunderBehaviour() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown kRpcRpcAddShrineStackClient = 406516865; NetworkBehaviour.RegisterRpcDelegate(typeof(ShrineThunderBehaviour), kRpcRpcAddShrineStackClient, new CmdDelegate(InvokeRpcRpcAddShrineStackClient)); NetworkCRC.RegisterBehaviour("ShrineThunderBehaviour", 0); } public override bool OnSerialize(NetworkWriter writer, bool forceAll) { bool result = default(bool); return result; } public override void OnDeserialize(NetworkReader reader, bool initialState) { } } [RequireComponent(typeof(PurchaseInteraction))] public class ShrineWispBehaviour : NetworkBehaviour { public PurchaseInteraction purchaseInteraction; public CombatDirector combatDirector; public CombatSquad combatSquad; public Color shrineEffectColor; public Transform symbolTransform; public int baseWispCount = 4; public float baseCredit = 40f; public CharacterBody shrineOwner; public bool acceptNext = false; [SyncVar] public int tier = 1; [SyncVar] public int wispsSpawned; public List ghosts = new List(); public ItemDef wispItem; private static int kRpcRpcDisableDirector; private static int kRpcRpcAddShrineStackClient; private int wispCount { get { //IL_0006: Unknown result type (might be due to invalid IL or missing references) float scalingValue = DifficultyCatalog.GetDifficultyDef(Run.instance.selectedDifficulty).scalingValue; float difficultyCoefficient = Run.instance.difficultyCoefficient; int num = Math.Min((int)Math.Round((float)baseWispCount + (scalingValue - 1f)), 8); if (MoreShrines.wispShrineScaleDifficulty.Value) { num += (int)Math.Round((difficultyCoefficient - 1f) * 1.3f); } if (RunArtifactManager.instance.IsArtifactEnabled(Artifacts.Swarms)) { num *= 2; } return num; } } private float monsterCredit { get { //IL_0011: Unknown result type (might be due to invalid IL or missing references) float difficultyCoefficient = Run.instance.difficultyCoefficient; float num = DifficultyCatalog.GetDifficultyDef(Run.instance.selectedDifficulty).scalingValue - 1f; return baseCredit * (num + 1f) + (baseCredit + 30f) * (difficultyCoefficient - 1f); } } public int Networktier { get { return tier; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar(value, ref tier, 1u); } } public int NetworkwispsSpawned { get { return wispsSpawned; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar(value, ref wispsSpawned, 2u); } } public void Awake() { //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Expected O, but got Unknown //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) purchaseInteraction = ((Component)this).GetComponent(); combatDirector = ((Component)this).GetComponent(); combatSquad = ((Component)this).GetComponent(); purchaseInteraction.Networkcost = 1; purchaseInteraction.cost = 1; combatDirector.shouldSpawnOneWave = false; combatDirector.resetMonsterCardIfFailed = true; if (NetworkServer.active) { acceptNext = Random.Range(1, 100) > 40; if (!acceptNext) { combatDirector.teamIndex = (TeamIndex)2; } int num = Random.Range(1, 100); purchaseInteraction.costType = (CostTypeIndex)Array.IndexOf(CostTypeCatalog.costTypeDefs, MoreShrines.costTypeDefWispWhite); if (num <= 40) { purchaseInteraction.costType = (CostTypeIndex)Array.IndexOf(CostTypeCatalog.costTypeDefs, MoreShrines.costTypeDefWispGreen); Networktier = 2; } if (num <= 5) { purchaseInteraction.costType = (CostTypeIndex)Array.IndexOf(CostTypeCatalog.costTypeDefs, MoreShrines.costTypeDefWispRed); Networktier = 3; ParticleSystem component = ((Component)symbolTransform).GetComponent(); Gradient val = new Gradient(); val.SetKeys((GradientColorKey[])(object)new GradientColorKey[2] { new GradientColorKey(new Color(1f, 0.31f, 0f), 0f), new GradientColorKey(new Color(0.75f, 0f, 0.14f), 1f) }, (GradientAlphaKey[])(object)new GradientAlphaKey[2] { new GradientAlphaKey(1f, 0f), new GradientAlphaKey(1f, 1f) }); ColorOverLifetimeModule colorOverLifetime = component.colorOverLifetime; ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = MinMaxGradient.op_Implicit(val); EmissionModule emission = component.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(20f); MainModule main = component.main; ((MainModule)(ref main)).maxParticles = 80; } ((UnityEvent)(object)purchaseInteraction.onPurchase).AddListener((UnityAction)delegate(Interactor interactor) { AddShrineStack(interactor); }); ((UnityEvent)(object)combatDirector.onSpawnedServer).AddListener((UnityAction)delegate { OnSpawnedServer(((Component)this).gameObject); }); if (!acceptNext) { combatSquad.onMemberDefeatedServer += CombatSquad_onMemberDefeatedServer; } } } private void CombatSquad_onMemberDefeatedServer(CharacterMaster arg1, DamageReport damageReport) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: 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) if (Object.op_Implicit((Object)(object)damageReport.victimMaster) && (damageReport.attackerTeamIndex != damageReport.victimTeamIndex || !Object.op_Implicit((Object)(object)damageReport.victimMaster.minionOwnership.ownerMaster)) && Random.Range(1, 100) < 15) { PickupIndex val = PickupCatalog.itemIndexToPickupIndex[wispItem.itemIndex]; if (val != PickupIndex.none) { PickupDropletController.CreatePickupDroplet(val, damageReport.victimBody.corePosition, Vector3.up * 20f); } } } private void Update() { combatDirector.monsterSpawnTimer = 0f; combatDirector.currentMonsterCard = null; if (!NetworkServer.active) { return; } List list = new List(); foreach (CharacterMaster members in combatSquad.membersList) { list.Add(members); } foreach (CharacterMaster item in list) { if (Object.op_Implicit((Object)(object)item.GetBody()) && Object.op_Implicit((Object)(object)shrineOwner.master) && !ghosts.Contains(item.GetBody())) { MakeGhost(item.GetBody(), shrineOwner); ghosts.Add(item.GetBody()); } } } public void MakeGhost(CharacterBody body, CharacterBody owner) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) if (acceptNext) { body.teamComponent.teamIndex = TeamComponent.GetObjectTeam(((Component)owner).gameObject); if (!Object.op_Implicit((Object)(object)((Component)body.master).GetComponent())) { ((Component)body.master).gameObject.AddComponent(); } if (!Object.op_Implicit((Object)(object)((Component)body.master).GetComponent())) { ((Component)body.master).gameObject.AddComponent(); } AIOwnership component = ((Component)body.master).GetComponent(); component.ownerMaster = owner.master; BaseAI component2 = ((Component)body.master).GetComponent(); component2.leader.gameObject = ((Component)owner).gameObject; component2.leader.characterBody = owner; body.inventory.GiveItem(Items.Ghost, 1); } body.inventory.GiveItem(wispItem, wispCount); } private Component CopyComponent(Component original, GameObject destination) { Type type = ((object)original).GetType(); Component val = destination.AddComponent(type); FieldInfo[] fields = type.GetFields(); FieldInfo[] array = fields; foreach (FieldInfo fieldInfo in array) { fieldInfo.SetValue(val, fieldInfo.GetValue(original)); } return val; } private void OnSpawnedServer(GameObject gameObject) { NetworkwispsSpawned = wispsSpawned + 1; if (wispsSpawned >= wispCount) { ((Behaviour)combatDirector).enabled = false; CallRpcDisableDirector(); } } [ClientRpc] public void RpcDisableDirector() { ((Behaviour)combatDirector).enabled = false; } [ClientRpc] public void RpcAddShrineStackClient(NetworkInstanceId interactorId) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) ((Component)symbolTransform).gameObject.SetActive(false); if (NetworkServer.objects.ContainsKey(interactorId)) { Interactor component = ((Component)NetworkServer.objects[interactorId]).gameObject.GetComponent(); shrineOwner = ((Component)component).GetComponent(); } } public void AddShrineStack(Interactor interactor) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Expected O, but got Unknown CallRpcAddShrineStackClient(((NetworkBehaviour)((Component)interactor).GetComponent()).netId); if (!NetworkServer.active) { Debug.LogWarning((object)"[Server] function 'System.Void RoR2.ShrineCombatBehavior::AddShrineStack(RoR2.Interactor)' called on client"); return; } shrineOwner = ((Component)interactor).GetComponent(); wispShrineActivation(interactor, monsterCredit); EffectManager.SpawnEffect(Resources.Load("Prefabs/Effects/ShrineUseEffect"), new EffectData { origin = ((Component)this).transform.position, rotation = Quaternion.identity, scale = 1f, color = Color32.op_Implicit(shrineEffectColor) }, true); } public void wispShrineActivation(Interactor interactor, float monsterCredit) { //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Expected O, but got Unknown //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Expected O, but got Unknown ((Behaviour)combatDirector).enabled = true; CombatDirector obj = combatDirector; obj.monsterCredit += monsterCredit; combatDirector.maximumNumberToSpawnBeforeSkipping = wispCount; combatDirector.monsterSpawnTimer = 0f; if (Object.op_Implicit((Object)(object)wispItem)) { string colorHexString = ColorCatalog.GetColorHexString((ColorIndex)1); if (tier == 2) { colorHexString = ColorCatalog.GetColorHexString((ColorIndex)2); } if (tier == 3) { colorHexString = ColorCatalog.GetColorHexString((ColorIndex)3); } if (acceptNext) { SubjectFormatChatMessage val = new SubjectFormatChatMessage(); ((SubjectChatMessage)val).subjectAsCharacterBody = ((Component)interactor).GetComponent(); ((SubjectChatMessage)val).baseToken = "SHRINE_WISP_ACCEPT_MESSAGE"; val.paramTokens = new string[2] { colorHexString, wispItem.nameToken }; Chat.SendBroadcastChat((ChatMessageBase)(object)val); } else { SubjectFormatChatMessage val = new SubjectFormatChatMessage(); ((SubjectChatMessage)val).subjectAsCharacterBody = ((Component)interactor).GetComponent(); ((SubjectChatMessage)val).baseToken = "SHRINE_WISP_DENY_MESSAGE"; val.paramTokens = new string[2] { colorHexString, wispItem.nameToken }; Chat.SendBroadcastChat((ChatMessageBase)(object)val); } } } private void UNetVersion() { } protected static void InvokeRpcRpcDisableDirector(NetworkBehaviour obj, NetworkReader reader) { if (!NetworkClient.active) { Debug.LogError((object)"RPC RpcDisableDirector called on server."); } else { ((ShrineWispBehaviour)(object)obj).RpcDisableDirector(); } } protected static void InvokeRpcRpcAddShrineStackClient(NetworkBehaviour obj, NetworkReader reader) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) if (!NetworkClient.active) { Debug.LogError((object)"RPC RpcAddShrineStackClient called on server."); } else { ((ShrineWispBehaviour)(object)obj).RpcAddShrineStackClient(reader.ReadNetworkId()); } } public void CallRpcDisableDirector() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { Debug.LogError((object)"RPC Function RpcDisableDirector called on client."); return; } NetworkWriter val = new NetworkWriter(); val.Write((short)0); val.Write((short)2); val.WritePackedUInt32((uint)kRpcRpcDisableDirector); val.Write(((Component)this).GetComponent().netId); ((NetworkBehaviour)this).SendRPCInternal(val, 0, "RpcDisableDirector"); } public void CallRpcAddShrineStackClient(NetworkInstanceId interactorId) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { Debug.LogError((object)"RPC Function RpcAddShrineStackClient called on client."); return; } NetworkWriter val = new NetworkWriter(); val.Write((short)0); val.Write((short)2); val.WritePackedUInt32((uint)kRpcRpcAddShrineStackClient); val.Write(((Component)this).GetComponent().netId); val.Write(interactorId); ((NetworkBehaviour)this).SendRPCInternal(val, 0, "RpcAddShrineStackClient"); } static ShrineWispBehaviour() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown kRpcRpcDisableDirector = 163751635; NetworkBehaviour.RegisterRpcDelegate(typeof(ShrineWispBehaviour), kRpcRpcDisableDirector, new CmdDelegate(InvokeRpcRpcDisableDirector)); kRpcRpcAddShrineStackClient = -836188432; NetworkBehaviour.RegisterRpcDelegate(typeof(ShrineWispBehaviour), kRpcRpcAddShrineStackClient, new CmdDelegate(InvokeRpcRpcAddShrineStackClient)); NetworkCRC.RegisterBehaviour("ShrineWispBehaviour", 0); } public override bool OnSerialize(NetworkWriter writer, bool forceAll) { if (forceAll) { writer.WritePackedUInt32((uint)tier); writer.WritePackedUInt32((uint)wispsSpawned); return true; } bool flag = false; if ((((NetworkBehaviour)this).syncVarDirtyBits & (true ? 1u : 0u)) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.WritePackedUInt32((uint)tier); } if ((((NetworkBehaviour)this).syncVarDirtyBits & 2u) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.WritePackedUInt32((uint)wispsSpawned); } if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); } return flag; } public override void OnDeserialize(NetworkReader reader, bool initialState) { if (initialState) { tier = (int)reader.ReadPackedUInt32(); wispsSpawned = (int)reader.ReadPackedUInt32(); return; } int num = (int)reader.ReadPackedUInt32(); if (((uint)num & (true ? 1u : 0u)) != 0) { tier = (int)reader.ReadPackedUInt32(); } if (((uint)num & 2u) != 0) { wispsSpawned = (int)reader.ReadPackedUInt32(); } } } internal class TinyImp : MonoBehaviour { public bool hasMarker = false; } public static class WeightedRandomizer { public static WeightedRandomizer From(Dictionary spawnRate) { return new WeightedRandomizer(spawnRate); } } public class WeightedRandomizer { private static Random _random = new Random(); private Dictionary _weights; public WeightedRandomizer(Dictionary weights) { _weights = weights; } public T TakeOne() { List> list = Sort(_weights); int num = 0; foreach (KeyValuePair weight in _weights) { num += weight.Value; } int num2 = _random.Next(0, num); T key = list[list.Count - 1].Key; foreach (KeyValuePair item in list) { if (num2 < item.Value) { key = item.Key; break; } num2 -= item.Value; } return key; } private List> Sort(Dictionary weights) { List> list = new List>(weights); list.Sort((KeyValuePair firstPair, KeyValuePair nextPair) => firstPair.Value.CompareTo(nextPair.Value)); return list; } } }