Decompiled source of DeltaruneMod v1.7.8
DeltaruneMod.dll
Decompiled 2 hours ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using DeltaruneMod.Interactables; using DeltaruneMod.Items; using DeltaruneMod.Items.Lunar; using DeltaruneMod.Items.Tier2; using DeltaruneMod.Items.Yellow; using DeltaruneMod.Util; using Microsoft.CodeAnalysis; using Mono.Cecil; using Mono.Cecil.Cil; using MonoMod.Cil; using On.RoR2; using R2API; using RoR2; using RoR2.CharacterAI; using RoR2.Navigation; using RoR2.Projectile; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Events; using UnityEngine.Networking; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("DeltaruneMod")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+5065618488ee86a7e1b7ff0be8de731cfbb7111c")] [assembly: AssemblyProduct("DeltaruneMod")] [assembly: AssemblyTitle("DeltaruneMod")] [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; } } } public class MainClass : BaseUnityPlugin { public static PluginInfo PInfo { get; private set; } public void Awake() { PInfo = ((BaseUnityPlugin)this).Info; } } namespace DeltaruneMod { [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("AGU.DeltaruneMod", "DeltaruneMod", "1.7.7")] public class DeltarunePlugin : BaseUnityPlugin { [CompilerGenerated] private sealed class <LoadSoundBankWhenReady>d__12 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public DeltarunePlugin <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <LoadSoundBankWhenReady>d__12(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; goto IL_0051; case 1: <>1__state = -1; goto IL_0051; case 2: { <>1__state = -1; SoundBank.Init(); return false; } IL_0051: if (!AkSoundEngine.IsInitialized()) { Debug.Log((object)"Waiting for sound engine"); <>2__current = null; <>1__state = 1; return true; } <>2__current = (object)new WaitForSeconds(0.5f); <>1__state = 2; return true; } } 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 const string PluginGUID = "AGU.DeltaruneMod"; public const string PluginAuthor = "AGU"; public const string PluginName = "DeltaruneMod"; public const string PluginVersion = "1.7.7"; public static DeltarunePlugin Instance; public static CharacterMaster characterMaster; public static CharacterBody characterBody; public static AssetBundle MainAssets; public List<ItemBase> Items = new List<ItemBase>(); public List<InteractableBase> Interactables = new List<InteractableBase>(); public static HashSet<ItemDef> BlacklistedFromPrinter = new HashSet<ItemDef>(); public void Awake() { Instance = this; Log.Init(((BaseUnityPlugin)this).Logger); Debug.Log((object)"Starting Model Intialization for DeltaruneMod"); using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("DeltaruneMod.AssetBundle.deltarune_mod")) { MainAssets = AssetBundle.LoadFromStream(stream); } Debug.Log((object)"Model Intialization for DeltaruneMod successful!"); Debug.Log((object)"Starting Item Intialization for DeltaruneMod"); IEnumerable<Type> enumerable = from type in Assembly.GetExecutingAssembly().GetTypes() where !type.IsAbstract && type.IsSubclassOf(typeof(ItemBase)) select type; foreach (Type item in enumerable) { ItemBase itemBase = (ItemBase)Activator.CreateInstance(item); if (ValidateItem(itemBase, Items)) { itemBase.Init(); Debug.Log((object)("Item: " + itemBase.ItemName + " Initialized!")); } } Debug.Log((object)"Item Intialization for DeltaruneMod successful!"); Log.Debug("Trashcan empty... loading!"); IEnumerable<Type> enumerable2 = from type in Assembly.GetExecutingAssembly().GetTypes() where !type.IsAbstract && type.IsSubclassOf(typeof(InteractableBase)) select type; foreach (Type item2 in enumerable2) { InteractableBase interactableBase = (InteractableBase)Activator.CreateInstance(item2); if (ValidateInteractable(interactableBase, Interactables)) { interactableBase.Init(); Debug.Log((object)("Interactable: " + interactableBase.InteractableName + " Initialized!")); } } Log.Debug("Trashcan full!"); Events.Init(); ((MonoBehaviour)this).StartCoroutine(LoadSoundBankWhenReady()); Log.Debug("DeltaruneMod loaded successfully!"); } [IteratorStateMachine(typeof(<LoadSoundBankWhenReady>d__12))] private IEnumerator LoadSoundBankWhenReady() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <LoadSoundBankWhenReady>d__12(0) { <>4__this = this }; } public bool ValidateItem(ItemBase item, List<ItemBase> itemList) { itemList.Add(item); return true; } public bool ValidateInteractable(InteractableBase interactable, List<InteractableBase> interactableList) { interactableList.Add(interactable); return true; } private void Update() { } } } namespace DeltaruneMod.Util { public static class Events { public static void Init() { Run.onRunStartGlobal += delegate { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown GameObject val = new GameObject("TimerHost"); Object.DontDestroyOnLoad((Object)(object)val); val.AddComponent<Timers>(); }; } } public class Helpers { public static List<ItemDef> GetItems(int tierIndex) { //IL_0008: 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: Invalid comparison between Unknown and I4 //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: 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_0048: Invalid comparison between Unknown and I4 //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Invalid comparison between Unknown and I4 //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Invalid comparison between Unknown and I4 //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Invalid comparison between Unknown and I4 //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Invalid comparison between Unknown and I4 //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Invalid comparison between Unknown and I4 //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Invalid comparison between Unknown and I4 //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Invalid comparison between Unknown and I4 //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Invalid comparison between Unknown and I4 //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Invalid comparison between Unknown and I4 List<ItemDef> list = new List<ItemDef>(); for (ItemIndex val = (ItemIndex)0; (int)val < ItemCatalog.itemCount; val = (ItemIndex)(val + 1)) { ItemDef itemDef = ItemCatalog.GetItemDef(val); if ((Object)(object)itemDef == (Object)null) { continue; } switch (tierIndex) { case 99: list.Add(itemDef); continue; case 0: if ((int)itemDef.tier == 0) { list.Add(itemDef); continue; } break; } if (tierIndex == 1 && (int)itemDef.tier == 1) { list.Add(itemDef); } else if (tierIndex == 2 && (int)itemDef.tier == 2) { list.Add(itemDef); } else if (tierIndex == 3 && (int)itemDef.tier == 3) { list.Add(itemDef); } else if (tierIndex == 4 && (int)itemDef.tier == 4) { list.Add(itemDef); } else if (tierIndex == 5 && (int)itemDef.tier == 5) { list.Add(itemDef); } else if (tierIndex == 6 && (int)itemDef.tier == 6) { list.Add(itemDef); } else if (tierIndex == 7 && (int)itemDef.tier == 7) { list.Add(itemDef); } else if (tierIndex == 8 && (int)itemDef.tier == 8) { list.Add(itemDef); } else if (tierIndex == 9 && (int)itemDef.tier == 9) { list.Add(itemDef); } else if (tierIndex == 10 && (int)itemDef.tier == 10) { list.Add(itemDef); } } return list; } public static List<ItemDef> GetAllItemsFromInventory(Inventory inv) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Invalid comparison between Unknown and I4 //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003b: 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) List<ItemDef> list = new List<ItemDef>(); for (ItemIndex val = (ItemIndex)0; (int)val < ItemCatalog.itemCount; val = (ItemIndex)(val + 1)) { ItemDef itemDef = ItemCatalog.GetItemDef(val); if (!((Object)(object)itemDef == (Object)null) && inv.GetItemCount(val) > 0) { list.Add(itemDef); } } return list; } public static List<BuffDef> GetBuffs(int type) { List<BuffDef> list = new List<BuffDef>(); FieldInfo[] fields = typeof(Buffs).GetFields(BindingFlags.Static | BindingFlags.Public); FieldInfo[] array = fields; foreach (FieldInfo fieldInfo in array) { object? value = fieldInfo.GetValue(null); BuffDef val = (BuffDef)((value is BuffDef) ? value : null); if (val == null) { continue; } switch (type) { case 0: list.Add(val); continue; case 1: if (val.isDebuff) { list.Add(val); continue; } break; } if (type == 2 && val.isElite) { list.Add(val); } } fields = typeof(Buffs).GetFields(BindingFlags.Static | BindingFlags.Public); FieldInfo[] array2 = fields; foreach (FieldInfo fieldInfo2 in array2) { object? value2 = fieldInfo2.GetValue(null); BuffDef val2 = (BuffDef)((value2 is BuffDef) ? value2 : null); if (val2 == null) { continue; } switch (type) { case 0: list.Add(val2); continue; case 1: if (val2.isDebuff) { list.Add(val2); continue; } break; } if (type == 2 && val2.isElite) { list.Add(val2); } } fields = typeof(Buffs).GetFields(BindingFlags.Static | BindingFlags.Public); FieldInfo[] array3 = fields; foreach (FieldInfo fieldInfo3 in array3) { object? value3 = fieldInfo3.GetValue(null); BuffDef val3 = (BuffDef)((value3 is BuffDef) ? value3 : null); if (val3 == null) { continue; } switch (type) { case 0: list.Add(val3); continue; case 1: if (val3.isDebuff) { list.Add(val3); continue; } break; } if (type == 2 && val3.isElite) { list.Add(val3); } } return list; } public static void CreateNetworkedEffectPrefab(GameObject obj) { if (!Object.op_Implicit((Object)(object)obj.GetComponent<NetworkIdentity>())) { obj.AddComponent<NetworkIdentity>(); } if (!Object.op_Implicit((Object)(object)obj.GetComponent<EffectComponent>())) { obj.AddComponent<EffectComponent>(); } PrefabAPI.RegisterNetworkPrefab(obj); ContentAddition.AddEffect(obj); } public static void CreateNetworkedProjectilePrefab(GameObject obj) { if (!Object.op_Implicit((Object)(object)obj.GetComponent<ProjectileController>())) { obj.AddComponent<ProjectileController>(); } if (!Object.op_Implicit((Object)(object)obj.GetComponent<ProjectileSimple>())) { obj.AddComponent<ProjectileSimple>(); } if (!Object.op_Implicit((Object)(object)obj.GetComponent<NetworkIdentity>())) { obj.AddComponent<NetworkIdentity>(); } PrefabAPI.RegisterNetworkPrefab(obj); ContentAddition.AddProjectile(obj); } public static void CreateSoundPrefab(string name, string event_name) { NetworkSoundEventDef val = ScriptableObject.CreateInstance<NetworkSoundEventDef>(); val.eventName = event_name; ((Object)val).name = name; ContentAddition.AddNetworkSoundEventDef(val); } } internal static class Log { private static ManualLogSource _logSource; internal static void Init(ManualLogSource logSource) { _logSource = logSource; } internal static void Debug(object data) { _logSource.LogDebug(data); } internal static void Error(object data) { _logSource.LogError(data); } internal static void Fatal(object data) { _logSource.LogFatal(data); } internal static void Info(object data) { _logSource.LogInfo(data); } internal static void Message(object data) { _logSource.LogMessage(data); } internal static void Warning(object data) { _logSource.LogWarning(data); } } public static class SoundBank { public static uint _soundBankId; public const string soundBankFileName = "DeltaruneSoundBank.bnk"; public const string soundBankName = "DeltaruneSoundBank"; public static string SoundBankDirectory => Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)DeltarunePlugin.Instance).Info.Location)); public static void Init() { //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_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) Debug.Log((object)SoundBankDirectory); try { string text = Path.Combine(SoundBankDirectory, "DeltaruneSoundBank.bnk"); Debug.Log((object)$"SoundBank size: {new FileInfo(text).Length} bytes"); Debug.Log((object)"Attempting to load sound bank..."); if (!File.Exists(text)) { Log.Error("Sound bank path does not exist!!"); return; } AKRESULT val = AkSoundEngine.LoadBank(text, ref _soundBankId); if ((int)val == 1) { Log.Info("SoundBank loaded successfully!"); } else { Log.Error($"SoundBank failed to load. {val}"); } SoundBanks.Add(text); } catch (Exception ex) { Debug.Log((object)ex); } } } public class Timers : MonoBehaviour { [CompilerGenerated] private sealed class <BigShotTimer>d__1 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Timers <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <BigShotTimer>d__1(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; break; case 1: <>1__state = -1; break; } ItemBase<DevilsKnife>.instance.DevilsKnifeEffect(); <>2__current = (object)new WaitForSeconds(10.5f); <>1__state = 1; return true; } 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 void Start() { Log.Debug("Timers started."); ((MonoBehaviour)this).StartCoroutine(BigShotTimer()); } [IteratorStateMachine(typeof(<BigShotTimer>d__1))] private IEnumerator BigShotTimer() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <BigShotTimer>d__1(0) { <>4__this = this }; } } } namespace DeltaruneMod.Items { public abstract class ItemBase<T> : ItemBase where T : ItemBase<T> { public static T instance { get; private set; } public ItemBase() { if (instance != null) { throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting ItemBase was instantiated twice"); } instance = this as T; } } public abstract class ItemBase { public ItemDef ItemDef; public abstract string ItemName { get; } public abstract string ItemLangTokenName { get; } public abstract string ItemPickupDesc { get; } public abstract string ItemFullDescription { get; } public abstract string ItemLore { get; } public abstract ItemTier Tier { get; } public virtual ItemTag[] ItemTags { get; set; } = (ItemTag[])(object)new ItemTag[0]; public abstract GameObject ItemModel { get; } public abstract Sprite ItemIcon { get; } public virtual string CorruptsItem { get; set; } = null; public virtual UnlockableDef ItemUnlockableDef { get; set; } = null; public virtual bool CanRemove { get; } = true; public virtual bool AIBlacklisted { get; set; } = false; public virtual bool PrinterBlacklisted { get; set; } = false; public virtual bool RequireUnlock { get; set; } = true; public abstract void Init(); protected void CreateLang() { LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_NAME", ItemName); LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_PICKUP", ItemPickupDesc); LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_DESCRIPTION", ItemFullDescription); LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_LORE", ItemLore); } public abstract ItemDisplayRuleDict CreateItemDisplayRules(); protected void CreateItem() { //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_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Expected O, but got Unknown if (AIBlacklisted) { ItemTags = new List<ItemTag>(ItemTags) { (ItemTag)4 }.ToArray(); } ItemDef = ScriptableObject.CreateInstance<ItemDef>(); ((Object)ItemDef).name = "ITEM_" + ItemLangTokenName; ItemDef.nameToken = "ITEM_" + ItemLangTokenName + "_NAME"; ItemDef.pickupToken = "ITEM_" + ItemLangTokenName + "_PICKUP"; ItemDef.descriptionToken = "ITEM_" + ItemLangTokenName + "_DESCRIPTION"; ItemDef.loreToken = "ITEM_" + ItemLangTokenName + "_LORE"; ItemDef.pickupModelPrefab = ItemModel; ItemDef.pickupIconSprite = ItemIcon; ItemDef.hidden = false; ItemDef.canRemove = CanRemove; ItemDef.deprecatedTier = Tier; if (ItemTags.Length != 0) { ItemDef.tags = ItemTags; } if (PrinterBlacklisted) { DeltarunePlugin.BlacklistedFromPrinter.Add(ItemDef); } if (Object.op_Implicit((Object)(object)ItemUnlockableDef)) { ItemDef.unlockableDef = ItemUnlockableDef; } ItemAPI.Add(new CustomItem(ItemDef, CreateItemDisplayRules())); } public abstract void Hooks(); public int GetCount(CharacterBody body) { if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.inventory)) { return 0; } return body.inventory.GetItemCount(ItemDef); } public int GetCount(CharacterMaster master) { if (!Object.op_Implicit((Object)(object)master) || !Object.op_Implicit((Object)(object)master.inventory)) { return 0; } return master.inventory.GetItemCount(ItemDef); } public static void BlacklistFromPrinter(ILContext il) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_00be: 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) ILCursor val = new ILCursor(il); int listIndex = -1; int thisIndex = -1; ILLabel[] array = default(ILLabel[]); val.GotoNext(new Func<Instruction, bool>[1] { (Instruction x) => ILPatternMatchingExt.MatchSwitch(x, ref array) }); bool flag = val.TryGotoNext(new Func<Instruction, bool>[1] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, ref thisIndex) }); bool flag2 = val.TryGotoNext(new Func<Instruction, bool>[1] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref listIndex) }); MethodReference val2 = default(MethodReference); val.GotoNext((MoveType)0, new Func<Instruction, bool>[1] { (Instruction x) => ILPatternMatchingExt.MatchCall(x, ref val2) }); if (!(flag && flag2)) { return; } val.Emit(OpCodes.Ldarg, thisIndex); val.Emit(OpCodes.Ldloc, listIndex); val.EmitDelegate<Action<ShopTerminalBehavior, List<PickupIndex>>>((Action<ShopTerminalBehavior, List<PickupIndex>>)delegate(ShopTerminalBehavior shopTerminalBehavior, List<PickupIndex> list) { if (Object.op_Implicit((Object)(object)shopTerminalBehavior) && ((Object)((Component)shopTerminalBehavior).gameObject).name.Contains("Duplicator")) { list.RemoveAll((PickupIndex x) => DeltarunePlugin.BlacklistedFromPrinter.Contains(ItemCatalog.GetItemDef(PickupCatalog.GetPickupDef(x).itemIndex))); } }); } } public class Kromer : ItemBase<Pipis> { public override string ItemName => "1 [KROMER]"; public override string ItemLangTokenName => "KROMER"; public override string ItemPickupDesc => "DON'T WORRY! FOR OUR <style=cShrine>[No Money Back Guaranttee]</style>"; public override string ItemFullDescription => "Does nothing...\n\n\nWhy are you still reading??"; public override string ItemLore => "Smells like <style=cKeywordName>KROMER</style>."; public override ItemTier Tier => (ItemTier)5; public override GameObject ItemModel => DeltarunePlugin.MainAssets.LoadAsset<GameObject>("kromer.prefab"); public override Sprite ItemIcon => DeltarunePlugin.MainAssets.LoadAsset<Sprite>("kromer.png"); public override void Init() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) ItemModel.transform.localScale = new Vector3(2f, 2f, 2f); CreateLang(); CreateItem(); Hooks(); } public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(KromerEffect); } private void KromerEffect(CharacterBody sender, StatHookEventArgs args) { KromerEffectComponenent component = ((Component)sender).GetComponent<KromerEffectComponenent>(); if (Object.op_Implicit((Object)(object)sender.inventory) && ((GetCount(sender) > 50) & !Object.op_Implicit((Object)(object)component))) { component = ((Component)sender).gameObject.AddComponent<KromerEffectComponenent>(); component.body = sender; ((Behaviour)component).enabled = true; } } } public class KromerEffectComponenent : ItemBehavior { public CharacterBody body; private void Start() { CharacterMaster master = body.master; master.luck -= 1f; Debug.Log((object)"Thats too much Kromer... (-1 Luck)"); } } public class DroneHealingBoost : ItemBase<DroneHealingBoost> { public class DroneHealingBehavior : ItemBehavior { private float healTimer = 0f; private const float healInterval = 10f; private const float healFraction = 0.025f; public void FixedUpdate() { healTimer -= Time.fixedDeltaTime; if (healTimer <= 0f) { FindAndHeal(base.body); healTimer = 10f; } } public void FindAndHeal(CharacterBody drone) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: 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_0018: 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_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0027: 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_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003e: 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_0062: 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_0071: 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_007b: 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_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: 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_008f: 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_0097: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Expected O, but got Unknown //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010c: 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_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0129: 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_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Expected O, but got Unknown //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) TeamIndex teamIndex = drone.teamComponent.teamIndex; Ray aimRay = ((Component)drone).GetComponent<InputBankTest>().GetAimRay(); TeamMask none = TeamMask.none; ((TeamMask)(ref none)).AddTeam(drone.master.teamIndex); BullseyeSearch val = new BullseyeSearch { viewer = drone, filterByDistinctEntity = true, filterByLoS = false, minDistanceFilter = 0f, maxDistanceFilter = 100f, maxAngleFilter = 360f, searchDirection = ((Ray)(ref aimRay)).direction, searchOrigin = ((Ray)(ref aimRay)).origin, sortMode = (SortMode)1, queryTriggerInteraction = (QueryTriggerInteraction)0, teamMaskFilter = none }; val.RefreshCandidates(); val.FilterOutGameObject(((Component)drone).gameObject); foreach (HurtBox result in val.GetResults()) { CharacterBody val2 = result.healthComponent?.body; if (Object.op_Implicit((Object)(object)val2) && (Object)(object)val2 != (Object)(object)drone) { EffectManager.SpawnEffect(HealEffectPrefab, new EffectData { rootObject = ((Component)val2).gameObject, origin = val2.footPosition, rotation = Quaternion.LookRotation(Vector3.up), scale = 1f }, true); float num = val2.healthComponent.fullCombinedHealth * 0.025f; val2.healthComponent.Heal(num, default(ProcChainMask), true); Debug.Log((object)("Healed " + ((object)val2)?.ToString() + " for " + num + ".")); } } } } public class DroneHealingEffectController : MonoBehaviour { public CharacterBody targetBody; private void Start() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate<GameObject>(HealEffectPrefab, ((Component)this).transform.Find("Base")); val.transform.localPosition = Vector3.zero; val.transform.localRotation = Quaternion.LookRotation(Vector3.up); Object.Destroy((Object)(object)((Component)this).gameObject, 1f); } } public static GameObject HealEffectPrefab; public static GameObject HealEffectHolder; public override string ItemName => "DroneHealingBoost"; public override string ItemLangTokenName => "DRONE_HEAL_BOOST"; public override string ItemPickupDesc => ""; public override string ItemFullDescription => ""; public override string ItemLore => ""; public override ItemTier Tier => (ItemTier)5; public override GameObject ItemModel => DeltarunePlugin.MainAssets.LoadAsset<GameObject>("guide_book.prefab"); public override Sprite ItemIcon => DeltarunePlugin.MainAssets.LoadAsset<Sprite>("guide_book_icon.png"); public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients); } private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args) { if (!NetworkServer.active || sender.isPlayerControlled) { return; } int count = GetCount(sender); if (Object.op_Implicit((Object)(object)sender.inventory) && count > 0) { DroneHealingBehavior component = ((Component)sender).gameObject.GetComponent<DroneHealingBehavior>(); if (!Object.op_Implicit((Object)(object)component)) { component = ((Component)sender).gameObject.AddComponent<DroneHealingBehavior>(); ((ItemBehavior)component).body = sender; Debug.Log((object)("Gave " + ((object)sender)?.ToString() + " " + ItemName + ".")); } } } private static void CreateEffect() { //IL_0039: Unknown result type (might be due to invalid IL or missing references) HealEffectPrefab = PrefabAPI.InstantiateClone(DeltarunePlugin.MainAssets.LoadAsset<GameObject>("guide_book_heal.prefab"), "guidebook_heal", true); HealEffectPrefab.transform.localScale = new Vector3(0.3f, 0.3f, 0.3f); HealEffectPrefab.AddComponent<NetworkIdentity>(); HealEffectPrefab.AddComponent<EffectComponent>(); PrefabAPI.RegisterNetworkPrefab(HealEffectPrefab); ContentAddition.AddEffect(HealEffectPrefab); } public override void Init() { } } } namespace DeltaruneMod.Items.Yellow { public class MrPipis : ItemBase<Pipis> { public class MrPipisTracker : ItemBehavior { private List<BuffDef> allAffixes = Helpers.GetBuffs(2); private void FixedUpdate() { foreach (BuffDef allAffix in allAffixes) { if (!base.body.HasBuff(allAffix) && (Object)(object)allAffix != (Object)(object)Buffs.AurelioniteBlessing) { base.body.AddBuff(allAffix); } } } private void OnDisable() { foreach (BuffDef allAffix in allAffixes) { if (base.body.HasBuff(allAffix)) { base.body.RemoveBuff(allAffix); } } } } public override string ItemName => "Mr. Pipis"; public override string ItemLangTokenName => "MR_PIPIS"; public override string ItemPickupDesc => "Gain [ALL] elite buffs!"; public override string ItemFullDescription => "Provides <style=cIsUtility>all elite buffs</style> <style=cStack>(excluding Aurelionite's blessing)</style>."; public override string ItemLore => "WOWZAS! You can't get THIS from an egg!"; public override ItemTier Tier => (ItemTier)4; public override GameObject ItemModel => DeltarunePlugin.MainAssets.LoadAsset<GameObject>("mr_pipis.prefab"); public override Sprite ItemIcon => DeltarunePlugin.MainAssets.LoadAsset<Sprite>("mr_pipis_icon.png"); public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)3 }; public override bool PrinterBlacklisted { get { return base.PrinterBlacklisted; } set { base.PrinterBlacklisted = true; } } public override void Init() { CreateLang(); CreateItem(); Hooks(); } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: 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_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: 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_00b0: 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_00e8: 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_0103: 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_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0129: 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) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0197: 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_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_02bf: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_02df: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_0300: Unknown result type (might be due to invalid IL or missing references) //IL_0309: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_033d: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_036e: Unknown result type (might be due to invalid IL or missing references) //IL_0373: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_0379: Unknown result type (might be due to invalid IL or missing references) //IL_0394: Unknown result type (might be due to invalid IL or missing references) //IL_039d: Unknown result type (might be due to invalid IL or missing references) //IL_03cc: Unknown result type (might be due to invalid IL or missing references) //IL_03d1: Unknown result type (might be due to invalid IL or missing references) //IL_03e7: Unknown result type (might be due to invalid IL or missing references) //IL_03ec: Unknown result type (might be due to invalid IL or missing references) //IL_0402: Unknown result type (might be due to invalid IL or missing references) //IL_0407: Unknown result type (might be due to invalid IL or missing references) //IL_040c: Unknown result type (might be due to invalid IL or missing references) //IL_040d: Unknown result type (might be due to invalid IL or missing references) //IL_0428: Unknown result type (might be due to invalid IL or missing references) //IL_0431: Unknown result type (might be due to invalid IL or missing references) //IL_0460: Unknown result type (might be due to invalid IL or missing references) //IL_0465: Unknown result type (might be due to invalid IL or missing references) //IL_047b: Unknown result type (might be due to invalid IL or missing references) //IL_0480: Unknown result type (might be due to invalid IL or missing references) //IL_0496: Unknown result type (might be due to invalid IL or missing references) //IL_049b: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04a1: Unknown result type (might be due to invalid IL or missing references) //IL_04bc: Unknown result type (might be due to invalid IL or missing references) //IL_04c5: Unknown result type (might be due to invalid IL or missing references) //IL_04f4: Unknown result type (might be due to invalid IL or missing references) //IL_04f9: Unknown result type (might be due to invalid IL or missing references) //IL_050f: Unknown result type (might be due to invalid IL or missing references) //IL_0514: Unknown result type (might be due to invalid IL or missing references) //IL_052a: Unknown result type (might be due to invalid IL or missing references) //IL_052f: Unknown result type (might be due to invalid IL or missing references) //IL_0534: Unknown result type (might be due to invalid IL or missing references) //IL_0535: Unknown result type (might be due to invalid IL or missing references) //IL_0550: Unknown result type (might be due to invalid IL or missing references) //IL_0559: Unknown result type (might be due to invalid IL or missing references) //IL_0588: Unknown result type (might be due to invalid IL or missing references) //IL_058d: Unknown result type (might be due to invalid IL or missing references) //IL_05a3: Unknown result type (might be due to invalid IL or missing references) //IL_05a8: Unknown result type (might be due to invalid IL or missing references) //IL_05be: Unknown result type (might be due to invalid IL or missing references) //IL_05c3: Unknown result type (might be due to invalid IL or missing references) //IL_05c8: Unknown result type (might be due to invalid IL or missing references) //IL_05c9: Unknown result type (might be due to invalid IL or missing references) //IL_05e4: Unknown result type (might be due to invalid IL or missing references) //IL_05ed: Unknown result type (might be due to invalid IL or missing references) //IL_061c: Unknown result type (might be due to invalid IL or missing references) //IL_0621: Unknown result type (might be due to invalid IL or missing references) //IL_0637: Unknown result type (might be due to invalid IL or missing references) //IL_063c: Unknown result type (might be due to invalid IL or missing references) //IL_0652: Unknown result type (might be due to invalid IL or missing references) //IL_0657: Unknown result type (might be due to invalid IL or missing references) //IL_065c: Unknown result type (might be due to invalid IL or missing references) //IL_065d: Unknown result type (might be due to invalid IL or missing references) //IL_0678: Unknown result type (might be due to invalid IL or missing references) //IL_0681: Unknown result type (might be due to invalid IL or missing references) //IL_06b0: Unknown result type (might be due to invalid IL or missing references) //IL_06b5: Unknown result type (might be due to invalid IL or missing references) //IL_06cb: Unknown result type (might be due to invalid IL or missing references) //IL_06d0: Unknown result type (might be due to invalid IL or missing references) //IL_06e6: Unknown result type (might be due to invalid IL or missing references) //IL_06eb: Unknown result type (might be due to invalid IL or missing references) //IL_06f0: Unknown result type (might be due to invalid IL or missing references) //IL_06f1: Unknown result type (might be due to invalid IL or missing references) //IL_070c: Unknown result type (might be due to invalid IL or missing references) //IL_0715: Unknown result type (might be due to invalid IL or missing references) //IL_0744: Unknown result type (might be due to invalid IL or missing references) //IL_0749: Unknown result type (might be due to invalid IL or missing references) //IL_075f: Unknown result type (might be due to invalid IL or missing references) //IL_0764: Unknown result type (might be due to invalid IL or missing references) //IL_077a: Unknown result type (might be due to invalid IL or missing references) //IL_077f: Unknown result type (might be due to invalid IL or missing references) //IL_0784: Unknown result type (might be due to invalid IL or missing references) //IL_0785: Unknown result type (might be due to invalid IL or missing references) //IL_07a0: Unknown result type (might be due to invalid IL or missing references) //IL_07a9: Unknown result type (might be due to invalid IL or missing references) //IL_07d8: Unknown result type (might be due to invalid IL or missing references) //IL_07dd: Unknown result type (might be due to invalid IL or missing references) //IL_07f3: Unknown result type (might be due to invalid IL or missing references) //IL_07f8: Unknown result type (might be due to invalid IL or missing references) //IL_080e: Unknown result type (might be due to invalid IL or missing references) //IL_0813: Unknown result type (might be due to invalid IL or missing references) //IL_0818: Unknown result type (might be due to invalid IL or missing references) //IL_0819: Unknown result type (might be due to invalid IL or missing references) //IL_0834: Unknown result type (might be due to invalid IL or missing references) //IL_083d: Unknown result type (might be due to invalid IL or missing references) //IL_086c: Unknown result type (might be due to invalid IL or missing references) //IL_0871: Unknown result type (might be due to invalid IL or missing references) //IL_0887: Unknown result type (might be due to invalid IL or missing references) //IL_088c: Unknown result type (might be due to invalid IL or missing references) //IL_08a2: Unknown result type (might be due to invalid IL or missing references) //IL_08a7: Unknown result type (might be due to invalid IL or missing references) //IL_08ac: Unknown result type (might be due to invalid IL or missing references) //IL_08ad: Unknown result type (might be due to invalid IL or missing references) //IL_08c8: Unknown result type (might be due to invalid IL or missing references) //IL_08d1: Unknown result type (might be due to invalid IL or missing references) //IL_0900: Unknown result type (might be due to invalid IL or missing references) //IL_0905: Unknown result type (might be due to invalid IL or missing references) //IL_091b: Unknown result type (might be due to invalid IL or missing references) //IL_0920: Unknown result type (might be due to invalid IL or missing references) //IL_0936: Unknown result type (might be due to invalid IL or missing references) //IL_093b: Unknown result type (might be due to invalid IL or missing references) //IL_0940: Unknown result type (might be due to invalid IL or missing references) //IL_0941: Unknown result type (might be due to invalid IL or missing references) //IL_095c: Unknown result type (might be due to invalid IL or missing references) //IL_0965: Unknown result type (might be due to invalid IL or missing references) //IL_0994: Unknown result type (might be due to invalid IL or missing references) //IL_0999: Unknown result type (might be due to invalid IL or missing references) //IL_09af: Unknown result type (might be due to invalid IL or missing references) //IL_09b4: Unknown result type (might be due to invalid IL or missing references) //IL_09ca: Unknown result type (might be due to invalid IL or missing references) //IL_09cf: Unknown result type (might be due to invalid IL or missing references) //IL_09d4: Unknown result type (might be due to invalid IL or missing references) //IL_09d5: Unknown result type (might be due to invalid IL or missing references) ItemDisplayRuleDict val = new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>()); val.Add("mdlCommandoDualies", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = ItemModel, childName = "Head", localPos = new Vector3(-0.00426f, 0.28094f, -0.00592f), localAngles = new Vector3(353.7496f, 353.853f, 354.2567f), localScale = new Vector3(12.76023f, 16.23372f, 12.76023f) } }); val.Add("mdlHuntress", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = ItemModel, childName = "Head", localPos = new Vector3(0.00228f, 0.0628f, 0.03952f), localAngles = new Vector3(331.6837f, 17.06083f, 354.8333f), localScale = new Vector3(9.05695f, 12.89827f, 9.89628f) } }); val.Add("mdlBandit2", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = ItemModel, childName = "Head", localPos = new Vector3(0.00012f, 0.14728f, -0.00827f), localAngles = new Vector3(4.90821f, 83.88029f, 318.1501f), localScale = new Vector3(8.60173f, 10.61426f, 7.68438f) } }); val.Add("mdlToolbot", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = ItemModel, childName = "Head", localPos = new Vector3(-0.25753f, 2.58962f, 1.20786f), localAngles = new Vector3(303.5001f, 137.2872f, 340.3238f), localScale = new Vector3(71.05827f, 91.78291f, 71.05827f) } }); val.Add("mdlEngi", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = ItemModel, childName = "HeadCenter", localPos = new Vector3(-0.00976f, -0.16622f, 0.02857f), localAngles = new Vector3(339.7454f, 0.5669f, 354.8185f), localScale = new Vector3(12.66013f, 12.66013f, 15.70925f) } }); val.Add("mdlMage", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = ItemModel, childName = "Head", localPos = new Vector3(-0.00013f, 0.14606f, -0.09325f), localAngles = new Vector3(2.27543f, 348.6211f, 345.7619f), localScale = new Vector3(6.82893f, 7.70643f, 6.74123f) } }); val.Add("mdlMerc", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = ItemModel, childName = "Head", localPos = new Vector3(-0.00885f, 0.20796f, 0.01862f), localAngles = new Vector3(359.5584f, 1.03469f, 353.8554f), localScale = new Vector3(8.35088f, 8.35088f, 8.35088f) } }); val.Add("mdlTreebot", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = ItemModel, childName = "FlowerBase", localPos = new Vector3(-0.3344f, -0.04913f, 0.41831f), localAngles = new Vector3(13.48484f, 348.6151f, 346.5744f), localScale = new Vector3(8.67167f, 7.96958f, 6.45425f) } }); val.Add("mdlLoader", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = ItemModel, childName = "Head", localPos = new Vector3(-0.00889f, 0.18897f, 0.0452f), localAngles = new Vector3(21.75747f, 6.04681f, 9.19641f), localScale = new Vector3(8.36439f, 8.36439f, 8.15949f) } }); val.Add("mdlCroco", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = ItemModel, childName = "Head", localPos = new Vector3(-151f / (180f * MathF.E), 0.19218f, 0.66591f), localAngles = new Vector3(295.8134f, 350.4054f, 174.2124f), localScale = new Vector3(87.16365f, 99.29857f, 103.8343f) } }); val.Add("mdlCaptain", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = ItemModel, childName = "Head", localPos = new Vector3(0.03626f, 0.17108f, -0.01637f), localAngles = new Vector3(336.6772f, 351.1885f, 337.5962f), localScale = new Vector3(9.64486f, 9.54612f, 9.64486f) } }); val.Add("mdlRailGunner", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = ItemModel, childName = "GunStock", localPos = new Vector3(0.01195f, -0.32039f, 0.02558f), localAngles = new Vector3(76.31502f, 226.8212f, 213.0602f), localScale = new Vector3(6.96663f, 6.19495f, 6.19495f) } }); val.Add("mdlVoidSurvivor", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = ItemModel, childName = "Head", localPos = new Vector3(-0.02832f, 0.07043f, 0.06621f), localAngles = new Vector3(328.4013f, 84.34533f, 35.42325f), localScale = new Vector3(8.81553f, 9.3033f, 7.34627f) } }); val.Add("mdlChef", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = ItemModel, childName = "Head", localPos = new Vector3(-0.71728f, -73f / (102f * MathF.PI), -0.04492f), localAngles = new Vector3(288.7068f, 247.8444f, 183.6162f), localScale = new Vector3(13.41672f, 12.80579f, 12.2074f) } }); val.Add("mdlSeeker", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = ItemModel, childName = "Pack", localPos = new Vector3(-0.20928f, 0.1406f, -0.22238f), localAngles = new Vector3(335.5866f, 33.30312f, 20.72316f), localScale = new Vector3(9.48945f, 9.31357f, 8.43507f) } }); val.Add("mdlFalseSon", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = ItemModel, childName = "Chest", localPos = new Vector3(0.05703f, 0.27612f, 0.11341f), localAngles = new Vector3(293.5728f, 356.797f, 23.95159f), localScale = new Vector3(12.79138f, 17.81891f, 15.91274f) } }); val.Add("mdlRalsei", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = ItemModel, childName = "Head", localPos = new Vector3(-0.00018f, -0.00465f, 0.00218f), localAngles = new Vector3(318.1143f, 9.05731f, 355.9294f), localScale = new Vector3(0.45699f, 0.45699f, 0.45699f) } }); return val; } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(MrPipisEffect); } private void MrPipisEffect(CharacterBody sender, StatHookEventArgs args) { if (NetworkServer.active && Object.op_Implicit((Object)(object)sender)) { MrPipisTracker component = ((Component)sender).GetComponent<MrPipisTracker>(); if (Object.op_Implicit((Object)(object)sender.inventory) && GetCount(sender) > 0 && !Object.op_Implicit((Object)(object)component)) { component = ((Component)sender).gameObject.AddComponent<MrPipisTracker>(); ((ItemBehavior)component).body = sender; ((Behaviour)component).enabled = true; } else if (Object.op_Implicit((Object)(object)sender.inventory) && GetCount(sender) <= 0 && Object.op_Implicit((Object)(object)component)) { ((Behaviour)component).enabled = false; } else if (Object.op_Implicit((Object)(object)sender.inventory) && GetCount(sender) > 0 && !((Behaviour)component).enabled) { ((Behaviour)component).enabled = true; } } } } public class Pipis : ItemBase<Pipis> { public override string ItemName => "Pipis"; public override string ItemLangTokenName => "PIPIS"; public override string ItemPickupDesc => "Increases ALL of your stats."; public override string ItemFullDescription => "Increases <style=cIsUtility>ALL stats</style> by <style=cIsUtility>5%</style>.\nPearl be damned my boy ballin'."; public override string ItemLore => "You can't get this from an egg!"; public override ItemTier Tier => (ItemTier)4; public override GameObject ItemModel => DeltarunePlugin.MainAssets.LoadAsset<GameObject>("pipis.prefab"); public override Sprite ItemIcon => DeltarunePlugin.MainAssets.LoadAsset<Sprite>("pipis_icon.png"); public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[2] { (ItemTag)3, (ItemTag)1 }; public override bool PrinterBlacklisted { get { return base.PrinterBlacklisted; } set { base.PrinterBlacklisted = true; } } public override void Init() { CreateLang(); CreateItem(); Hooks(); } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: 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_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: 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_00b0: 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_00e8: 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_0103: 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_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0129: 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) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0197: 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_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_02bf: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_02df: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_0300: Unknown result type (might be due to invalid IL or missing references) //IL_0309: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_033d: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_036e: Unknown result type (might be due to invalid IL or missing references) //IL_0373: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_0379: Unknown result type (might be due to invalid IL or missing references) //IL_0394: Unknown result type (might be due to invalid IL or missing references) //IL_039d: Unknown result type (might be due to invalid IL or missing references) //IL_03cc: Unknown result type (might be due to invalid IL or missing references) //IL_03d1: Unknown result type (might be due to invalid IL or missing references) //IL_03e7: Unknown result type (might be due to invalid IL or missing references) //IL_03ec: Unknown result type (might be due to invalid IL or missing references) //IL_0402: Unknown result type (might be due to invalid IL or missing references) //IL_0407: Unknown result type (might be due to invalid IL or missing references) //IL_040c: Unknown result type (might be due to invalid IL or missing references) //IL_040d: Unknown result type (might be due to invalid IL or missing references) //IL_0428: Unknown result type (might be due to invalid IL or missing references) //IL_0431: Unknown result type (might be due to invalid IL or missing references) //IL_0460: Unknown result type (might be due to invalid IL or missing references) //IL_0465: Unknown result type (might be due to invalid IL or missing references) //IL_047b: Unknown result type (might be due to invalid IL or missing references) //IL_0480: Unknown result type (might be due to invalid IL or missing references) //IL_0496: Unknown result type (might be due to invalid IL or missing references) //IL_049b: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04a1: Unknown result type (might be due to invalid IL or missing references) //IL_04bc: Unknown result type (might be due to invalid IL or missing references) //IL_04c5: Unknown result type (might be due to invalid IL or missing references) //IL_04f4: Unknown result type (might be due to invalid IL or missing references) //IL_04f9: Unknown result type (might be due to invalid IL or missing references) //IL_050f: Unknown result type (might be due to invalid IL or missing references) //IL_0514: Unknown result type (might be due to invalid IL or missing references) //IL_052a: Unknown result type (might be due to invalid IL or missing references) //IL_052f: Unknown result type (might be due to invalid IL or missing references) //IL_0534: Unknown result type (might be due to invalid IL or missing references) //IL_0535: Unknown result type (might be due to invalid IL or missing references) //IL_0550: Unknown result type (might be due to invalid IL or missing references) //IL_0559: Unknown result type (might be due to invalid IL or missing references) //IL_0588: Unknown result type (might be due to invalid IL or missing references) //IL_058d: Unknown result type (might be due to invalid IL or missing references) //IL_05a3: Unknown result type (might be due to invalid IL or missing references) //IL_05a8: Unknown result type (might be due to invalid IL or missing references) //IL_05be: Unknown result type (might be due to invalid IL or missing references) //IL_05c3: Unknown result type (might be due to invalid IL or missing references) //IL_05c8: Unknown result type (might be due to invalid IL or missing references) //IL_05c9: Unknown result type (might be due to invalid IL or missing references) //IL_05e4: Unknown result type (might be due to invalid IL or missing references) //IL_05ed: Unknown result type (might be due to invalid IL or missing references) //IL_061c: Unknown result type (might be due to invalid IL or missing references) //IL_0621: Unknown result type (might be due to invalid IL or missing references) //IL_0637: Unknown result type (might be due to invalid IL or missing references) //IL_063c: Unknown result type (might be due to invalid IL or missing references) //IL_0652: Unknown result type (might be due to invalid IL or missing references) //IL_0657: Unknown result type (might be due to invalid IL or missing references) //IL_065c: Unknown result type (might be due to invalid IL or missing references) //IL_065d: Unknown result type (might be due to invalid IL or missing references) //IL_0678: Unknown result type (might be due to invalid IL or missing references) //IL_0681: Unknown result type (might be due to invalid IL or missing references) //IL_06b0: Unknown result type (might be due to invalid IL or missing references) //IL_06b5: Unknown result type (might be due to invalid IL or missing references) //IL_06cb: Unknown result type (might be due to invalid IL or missing references) //IL_06d0: Unknown result type (might be due to invalid IL or missing references) //IL_06e6: Unknown result type (might be due to invalid IL or missing references) //IL_06eb: Unknown result type (might be due to invalid IL or missing references) //IL_06f0: Unknown result type (might be due to invalid IL or missing references) //IL_06f1: Unknown result type (might be due to invalid IL or missing references) //IL_070c: Unknown result type (might be due to invalid IL or missing references) //IL_0715: Unknown result type (might be due to invalid IL or missing references) //IL_0744: Unknown result type (might be due to invalid IL or missing references) //IL_0749: Unknown result type (might be due to invalid IL or missing references) //IL_075f: Unknown result type (might be due to invalid IL or missing references) //IL_0764: Unknown result type (might be due to invalid IL or missing references) //IL_077a: Unknown result type (might be due to invalid IL or missing references) //IL_077f: Unknown result type (might be due to invalid IL or missing references) //IL_0784: Unknown result type (might be due to invalid IL or missing references) //IL_0785: Unknown result type (might be due to invalid IL or missing references) //IL_07a0: Unknown result type (might be due to invalid IL or missing references) //IL_07a9: Unknown result type (might be due to invalid IL or missing references) //IL_07d8: Unknown result type (might be due to invalid IL or missing references) //IL_07dd: Unknown result type (might be due to invalid IL or missing references) //IL_07f3: Unknown result type (might be due to invalid IL or missing references) //IL_07f8: Unknown result type (might be due to invalid IL or missing references) //IL_080e: Unknown result type (might be due to invalid IL or missing references) //IL_0813: Unknown result type (might be due to invalid IL or missing references) //IL_0818: Unknown result type (might be due to invalid IL or missing references) //IL_0819: Unknown result type (might be due to invalid IL or missing references) //IL_0834: Unknown result type (might be due to invalid IL or missing references) //IL_083d: Unknown result type (might be due to invalid IL or missing references) //IL_086c: Unknown result type (might be due to invalid IL or missing references) //IL_0871: Unknown result type (might be due to invalid IL or missing references) //IL_0887: Unknown result type (might be due to invalid IL or missing references) //IL_088c: Unknown result type (might be due to invalid IL or missing references) //IL_08a2: Unknown result type (might be due to invalid IL or missing references) //IL_08a7: Unknown result type (might be due to invalid IL or missing references) //IL_08ac: Unknown result type (might be due to invalid IL or missing references) //IL_08ad: Unknown result type (might be due to invalid IL or missing references) //IL_08c8: Unknown result type (might be due to invalid IL or missing references) //IL_08d1: Unknown result type (might be due to invalid IL or missing references) //IL_0900: Unknown result type (might be due to invalid IL or missing references) //IL_0905: Unknown result type (might be due to invalid IL or missing references) //IL_091b: Unknown result type (might be due to invalid IL or missing references) //IL_0920: Unknown result type (might be due to invalid IL or missing references) //IL_0936: Unknown result type (might be due to invalid IL or missing references) //IL_093b: Unknown result type (might be due to invalid IL or missing references) //IL_0940: Unknown result type (might be due to invalid IL or missing references) //IL_0941: Unknown result type (might be due to invalid IL or missing references) //IL_095c: Unknown result type (might be due to invalid IL or missing references) //IL_0965: Unknown result type (might be due to invalid IL or missing references) //IL_0994: Unknown result type (might be due to invalid IL or missing references) //IL_0999: Unknown result type (might be due to invalid IL or missing references) //IL_09af: Unknown result type (might be due to invalid IL or missing references) //IL_09b4: Unknown result type (might be due to invalid IL or missing references) //IL_09ca: Unknown result type (might be due to invalid IL or missing references) //IL_09cf: Unknown result type (might be due to invalid IL or missing references) //IL_09d4: Unknown result type (might be due to invalid IL or missing references) //IL_09d5: Unknown result type (might be due to invalid IL or missing references) ItemDisplayRuleDict val = new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>()); val.Add("mdlCommandoDualies", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = ItemModel, childName = "LeftJet", localPos = new Vector3(0.00013f, 0.01343f, 0.00686f), localAngles = new Vector3(22.89687f, 268.0432f, 258.2714f), localScale = new Vector3(6.9072f, 6.9072f, 6.9072f) } }); val.Add("mdlHuntress", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = ItemModel, childName = "Chest", localPos = new Vector3(-0.00725f, 0.12978f, 0.13905f), localAngles = new Vector3(357.6052f, 89.41378f, 342.1603f), localScale = new Vector3(9.75112f, 11.98992f, 9.75112f) } }); val.Add("mdlBandit2", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = ItemModel, childName = "MuzzleShotgun", localPos = new Vector3(-0.02101f, -0.00477f, 0.01479f), localAngles = new Vector3(283.734f, 62.9136f, 28.78585f), localScale = new Vector3(5.99235f, 4.61689f, 3.53847f) } }); val.Add("mdlToolbot", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = ItemModel, childName = "Head", localPos = new Vector3(0.3794f, 2.70397f, -0.97458f), localAngles = new Vector3(307.1695f, 173.5109f, 2.96273f), localScale = new Vector3(43.89983f, 71.05827f, 71.05827f) } }); val.Add("mdlEngi", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = ItemModel, childName = "MuzzleRight", localPos = new Vector3(0.00286f, 0.01333f, -0.1631f), localAngles = new Vector3(1.78108f, 89.37039f, 87.38036f), localScale = new Vector3(12.83591f, 15.81911f, 13.84606f) } }); val.Add("mdlMage", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = ItemModel, childName = "ClavicleL", localPos = new Vector3(-0.16533f, 0.09445f, -0.10163f), localAngles = new Vector3(349.5243f, 83.51843f, 56.10131f), localScale = new Vector3(6.82893f, 6.82893f, 6.82893f) } }); val.Add("mdlMerc", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = ItemModel, childName = "Head", localPos = new Vector3(0.01925f, 0.19819f, -0.09577f), localAngles = new Vector3(286.5604f, 24.27891f, 103.4976f), localScale = new Vector3(6.88069f, 11.03788f, 5.78616f) } }); val.Add("mdlTreebot", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = ItemModel, childName = "Eye", localPos = new Vector3(-0.00365f, 0.80307f, 0.01732f), localAngles = new Vector3(1.07244f, 104.6857f, 9.88337f), localScale = new Vector3(20.04582f, 23.37344f, 17.21499f) } }); val.Add("mdlLoader", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = ItemModel, childName = "MechHandRight", localPos = new Vector3(-0.04124f, 0.32469f, 0.04654f), localAngles = new Vector3(15.33141f, 189.3875f, 78.24608f), localScale = new Vector3(7.36798f, 13.29883f, 7.36798f) } }); val.Add("mdlCroco", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = ItemModel, childName = "Head", localPos = new Vector3(1.08672f, 1.76753f, 0.084f), localAngles = new Vector3(0.90842f, 268.449f, 232.6822f), localScale = new Vector3(64.47551f, 95.74067f, 64.47551f) } }); val.Add("mdlCaptain", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = ItemModel, childName = "HandR", localPos = new Vector3(-0.03565f, 0.07075f, 0.01312f), localAngles = new Vector3(9.92061f, 146.7857f, 17.66426f), localScale = new Vector3(4.8577f, 7.78581f, 4.07227f) } }); val.Add("mdlRailGunner", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = ItemModel, childName = "GunBarrel", localPos = new Vector3(-0.00422f, 0.63713f, -0.00013f), localAngles = new Vector3(2.21753f, 266.1243f, 174.4695f), localScale = new Vector3(6.33012f, 9.30456f, 5.06844f) } }); val.Add("mdlVoidSurvivor", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = ItemModel, childName = "CannonEnd", localPos = new Vector3(0.10334f, 0.00193f, 0.0155f), localAngles = new Vector3(23.73183f, 114.4923f, 301.8614f), localScale = new Vector3(11.51731f, 13.92004f, 13.6393f) } }); val.Add("mdlChef", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = ItemModel, childName = "Head", localPos = new Vector3(-0.24121f, 0.03468f, -0.05723f), localAngles = new Vector3(1.51737f, 351.2228f, 259.804f), localScale = new Vector3(13.09572f, 17.80788f, 9.28489f) } }); val.Add("mdlSeeker", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = ItemModel, childName = "Pack", localPos = new Vector3(0.18237f, -0.31841f, -0.16186f), localAngles = new Vector3(321.2907f, 71.28646f, 1.76035f), localScale = new Vector3(8.24892f, 7.33238f, 7.33238f) } }); val.Add("mdlFalseSon", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = ItemModel, childName = "Head", localPos = new Vector3(0.00591f, 0.21158f, 0.12662f), localAngles = new Vector3(7.60785f, 236.6935f, 268.9621f), localScale = new Vector3(17.39792f, 13.6196f, 9.26764f) } }); val.Add("mdlRalsei", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = ItemModel, childName = "Head", localPos = new Vector3(-0.01144f, 0.01106f, 0.00398f), localAngles = new Vector3(14.68918f, 284.3936f, 34.94466f), localScale = new Vector3(0.12866f, 0.12866f, 0.12866f) } }); return val; } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(PipisEffect); } private void PipisEffect(CharacterBody sender, StatHookEventArgs args) { if (!NetworkServer.active || !Object.op_Implicit((Object)(object)sender)) { return; } PipisTracker pipisTracker = ((Component)sender).GetComponent<PipisTracker>(); if (Object.op_Implicit((Object)(object)sender.inventory) && GetCount(sender) > 0) { if (!Object.op_Implicit((Object)(object)pipisTracker)) { pipisTracker = ((Component)sender).gameObject.AddComponent<PipisTracker>(); pipisTracker.body = sender; pipisTracker.currNumOfPipis = GetCount(sender); } else if (Object.op_Implicit((Object)(object)pipisTracker) && GetCount(sender) <= 0) { ((Behaviour)pipisTracker).enabled = false; } else if (Object.op_Implicit((Object)(object)pipisTracker) && GetCount(sender) > 0 && !((Behaviour)pipisTracker).enabled) { ((Behaviour)pipisTracker).enabled = true; } if (Object.op_Implicit((Object)(object)pipisTracker)) { pipisTracker.currNumOfPipis = GetCount(sender); } } } } public class PipisTracker : ItemBehavior { public int prevNumOfPipis = 0; public int currNumOfPipis = 0; public CharacterBody body; private float pipisMult = 1.05f; private void FixedUpdate() { if (currNumOfPipis > prevNumOfPipis) { CharacterBody obj = body; obj.baseArmor *= pipisMult; CharacterBody obj2 = body; obj2.baseMaxHealth *= pipisMult; CharacterBody obj3 = body; obj3.baseMoveSpeed *= pipisMult; CharacterBody obj4 = body; obj4.baseRegen *= pipisMult; CharacterBody obj5 = body; obj5.baseAttackSpeed *= pipisMult; CharacterBody obj6 = body; obj6.baseDamage *= pipisMult; CharacterBody obj7 = body; obj7.baseCrit *= pipisMult; prevNumOfPipis = currNumOfPipis; } } } } namespace DeltaruneMod.Items.Tier3 { internal class GuideBook : ItemBase<GuideBook> { public override string ItemName => "Guiding Manual"; public override string ItemLangTokenName => "GUIDE_BOOK"; public override string ItemPickupDesc => "All allied drones learn how to heal."; public override string ItemFullDescription => "All allied drones learn to heal,\nhealing for <style=cIsHealing>2.5%</style> hp every <style=cIsUtility>10</style> seconds <style=cStack>(+1% hp per stack)</style>."; public override string ItemLore => "You tried to read the manual, but it was so dense it made your head spin...\nPerhaps just the chapter on healing will be good for now..."; public override ItemTier Tier => (ItemTier)1; public override GameObject ItemModel => DeltarunePlugin.MainAssets.LoadAsset<GameObject>("guide_book.prefab"); public override Sprite ItemIcon => DeltarunePlugin.MainAssets.LoadAsset<Sprite>("guide_book_icon.png"); public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients); } private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args) { if (!NetworkServer.active) { return; } int count = GetCount(sender); if (Object.op_Implicit((Object)(object)sender.inventory) && count > 0) { GuideBookBehavior guideBookBehavior = ((Component)sender).GetComponent<GuideBookBehavior>(); if (!Object.op_Implicit((Object)(object)guideBookBehavior) && Object.op_Implicit((Object)(object)sender.inventory) && count > 0) { guideBookBehavior = ((Component)sender).gameObject.AddComponent<GuideBookBehavior>(); ((ItemBehavior)guideBookBehavior).body = sender; ((ItemBehavior)guideBookBehavior).stack = count; } else if (Object.op_Implicit((Object)(object)guideBookBehavior) && count <= 0) { ((Behaviour)guideBookBehavior).enabled = false; } else if (Object.op_Implicit((Object)(object)guideBookBehavior) && count > 0 && !((Behaviour)guideBookBehavior).enabled) { ((Behaviour)guideBookBehavior).enabled = true; } if (Object.op_Implicit((Object)(object)guideBookBehavior)) { ((ItemBehavior)guideBookBehavior).stack = count; } } } public override void Init() { } } public class GuideBookBehavior : ItemBehavior { private int previousStack; private void OnEnable() { ulong num = Run.instance.seed ^ (ulong)Run.instance.stageClearCount; UpdateAllMinions(base.stack); MasterSummon.onServerMasterSummonGlobal += OnServerMasterSummonGlobal; } private void OnDisable() { MasterSummon.onServerMasterSummonGlobal -= OnServerMasterSummonGlobal; UpdateAllMinions(0); } private void FixedUpdate() { if (previousStack != base.stack) { UpdateAllMinions(base.stack); } } private void OnServerMasterSummonGlobal(MasterSummonReport summonReport) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_003e: 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) if (!Object.op_Implicit((Object)(object)base.body) || !Object.op_Implicit((Object)(object)base.body.master) || !((Object)(object)base.body.master == (Object)(object)summonReport.leaderMasterInstance)) { return; } CharacterMaster summonMasterInstance = summonReport.summonMasterInstance; if (Object.op_Implicit((Object)(object)summonMasterInstance)) { CharacterBody body = summonMasterInstance.GetBody(); if (Object.op_Implicit((Object)(object)body)) { UpdateMinionInventory(summonMasterInstance.inventory, body.bodyFlags, base.stack); } } } private void UpdateAllMinions(int newStack) { //IL_0044: 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) if (!Object.op_Implicit((Object)(object)base.body)) { return; } CharacterBody body = base.body; if (!Object.op_Implicit((Object)(object)(((Object)(object)body != (Object)null) ? body.master : null))) { return; } MinionGroup val = MinionGroup.FindGroup(((NetworkBehaviour)body.master).netId); if (val == null) { return; } MinionOwnership[] members = val.members; foreach (MinionOwnership val2 in members) { if (!Object.op_Implicit((Object)(object)val2)) { continue; } CharacterMaster component = ((Component)val2).GetComponent<CharacterMaster>(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.inventory)) { CharacterBody body2 = component.GetBody(); if (Object.op_Implicit((Object)(object)body2)) { UpdateMinionInventory(component.inventory, body2.bodyFlags, newStack); } } } previousStack = newStack; } private void UpdateMinionInventory(Inventory inventory, BodyFlags bodyFlags, int newStack) { //IL_0013: 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_001b: Invalid comparison between Unknown and I4 //IL_000d: 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_0011: Invalid comparison between Unknown and I4 if ((Object.op_Implicit((Object)(object)inventory) && newStack > 0 && (bodyFlags & 2) > 0) || (bodyFlags & 0x2000) > 0) { int itemCount = inventory.GetItemCount(ItemBase<DroneHealingBoost>.instance.ItemDef); if (itemCount < base.stack) { inventory.GiveItem(ItemBase<DroneHealingBoost>.instance.ItemDef, base.stack - itemCount); } else if (itemCount > base.stack) { inventory.RemoveItem(ItemBase<DroneHealingBoost>.instance.ItemDef, itemCount - base.stack); } } else { inventory.ResetItem(ItemBase<DroneHealingBoost>.instance.ItemDef); } } } public class BigShot : ItemBase<BigShot> { [RequireComponent(typeof(TeamFilter))] public class BigShotBehavior : ItemBehavior { public BuffDef BigShotBuff; public float reloadTimer; public SkillLocator skillLocator; public InputBankTest inputBank; public int BigShotThreshold = 10; public float DmgMult = 77.7f; public float StackDmgMult = 22.2f; public uint MaxBigShotStacks = 30u; public float TotalDamageCalc; public uint TotalGoldGained = 0u; public uint GoldThreshold = 50u; private bool TimeForABigShot; public GameObject projectilePrefab; private void Awake() { ((Behaviour)this).enabled = false; } private void Start() { projectilePrefab = BigShot.projectilePrefab; } private void OnEnable() { if (Object.op_Implicit((Object)(object)base.body)) { base.body.onSkillActivatedServer += OnSkillActivated; skillLocator = ((Component)base.body).GetComponent<SkillLocator>(); inputBank = ((Component)base.body).GetComponent<InputBankTest>(); } } private void OnDisable() { if (Object.op_Implicit((Object)(object)base.body)) { base.body.onSkillActivatedServer -= OnSkillActivated; if (NetworkServer.active) { int num = 10000; while (base.body.HasBuff(BigShotBuff) && num > 0) { num--; base.body.RemoveBuff(BigShotBuff); } } } inputBank = null; skillLocator = null; } private void FixedUpdate() { if (NetworkServer.active) { TotalDamageCalc = base.body.damage * (DmgMult + StackDmgMult * (float)(base.stack - 1)); if (base.body.GetBuffCount(BigShotBuff) >= MaxBigShotStacks + 1) { base.body.RemoveBuff(BigShotBuff); } if (TotalGoldGained >= GoldThreshold * MaxBigShotStacks) { TotalGoldGained = GoldThreshold * MaxBigShotStacks; } if (TotalGoldGained >= GoldThreshold) { base.body.AddBuff(BigShotBuff); TotalGoldGained -= GoldThreshold; } if (base.body.GetBuffCount(BigShotBuff) >= BigShotThreshold && !TimeForABigShot) { TimeForABigShot = true; } } } private void OnSkillActivated(GenericSkill skill) { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Expected O, but got Unknown if (!NetworkServer.active) { return; } SkillLocator val = skillLocator; if ((Object)(object)(((Object)(object)val != (Object)null) ? val.primary : null) == (Object)(object)skill && TimeForABigShot) { ShootBigShot(); EffectManager.SpawnEffect(BigShotEffectPrefab, new EffectData { origin = ((Component)this).transform.position, scale = 1f }, true); for (int i = 0; i < BigShotThreshold; i++) { base.body.RemoveBuff(BigShotBuff); } TimeForABigShot = false; } } private void ShootBigShot() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: 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_00a0: Unknown result type (might be due to invalid IL or missing references) if (NetworkServer.active) { Ray aimRay = GetAimRay(); ProjectileManager.instance.FireProjectile(new FireProjectileInfo { projectilePrefab = projectilePrefab, position = ((Ray)(ref aimRay)).origin, rotation = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), owner = ((Component)this).gameObject, damage = TotalDamageCalc, force = 4f, crit = Util.CheckRoll(base.body.crit, base.body.master), damageColorIndex = (DamageColorIndex)0 }); } } private Ray GetAimRay() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: 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_0029: Unknown result type (might be due to invalid IL or missing references) return new Ray(base.body.inputBank.aimOrigin, base.body.inputBank.aimDirection); } } public Sprite BuffIcon = DeltarunePlugin.MainAssets.LoadAsset<Sprite>("big_shot_effect_icon.png"); public BuffDef BigShotBuff; public uint TotalStages = 0u; public uint GoldIncreasePerStage = 25u; public static GameObject projectilePrefab; public static GameObject BigShotEffectPrefab; public override string ItemName => "Dealmaker"; public override string ItemLangTokenName => "BIGSHOT"; public override string ItemPickupDesc => "Gain stacks of <style=cDeath>[Big Shot]</style> on gold gain."; public override string ItemFullDescription => "<style=cShrine>+30%</style> gold gain.\nOn gold gain <style=cStack>($50 per stage)</style>, gain <style=cStack>1</style> stack of <style=cDeath>[Big Shot]</style>.\nOn <style=cIsUtility>10</style> stacks, shoot a projectile on primary skill dealing <style=cIsDamage>777%</style> dmg <style=cStack>(+222% per stack)</style>."; public override string ItemLore => "As the days became more dull, and bussiness started to dry, a call came in.\nIt's your chance... a once in a lifetime chance... to become a <style=cDeath>[Big Shot]</style>."; public override ItemTier Tier => (ItemTier)2; public override GameObject ItemModel => DeltarunePlugin.MainAssets.LoadAsset<GameObject>("big_shot.prefab"); public override Sprite ItemIcon => DeltarunePlugin.MainAssets.LoadAsset<Sprite>("big_shot_icon.png"); public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)1 }; public override void Init() { CreateLang(); CreateItem(); CreateBuff(); CreateEffect(); CreateProjectile(); Hooks(); } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(BigShotEffect); CharacterMaster.GiveMoney += new hook_GiveMoney(BigShotMoneyEffect); Stage.onStageStartGlobal += Stage_onStageStartGlobal; } private void Stage_onStageStartGlobal(Stage obj) { if (NetworkServer.active && obj.sceneDef.cachedName != "bazaar") { TotalStages++; Debug.Log((object)("Total Stages: " + TotalStages)); } } public void BigShotMoneyEffect(orig_GiveMoney orig, CharacterMaster self, uint amount) { if (!NetworkServer.active || !Object.op_Implicit((Object)(object)self.GetBody())) { return; } CharacterBody body = self.GetBody(); int count = GetCount(body); BigShotBehavior component = ((Component)body).GetComponent<BigShotBehavior>(); if (Object.op_Implicit((Object)(object)body.inventory) && count > 0) { Debug.Log((object)("Amount | " + amount)); uint num = (uint)Mathf.CeilToInt((float)amount * 0.3f); amount += num; Debug.Log((object)("Adjusted Dealmaker Amount | " + amount)); if (Object.op_Implicit((Object)(object)component)) { component.TotalGoldGained += amount; } } orig.Invoke(self, amount); } public void BigShotEffect(CharacterBody sender, StatHookEventArgs args) { if (NetworkServer.active && Object.op_Implicit((Object)(object)sender)) { int count = GetCount(sender); BigShotBehavior bigShotBehavior = ((Component)sender).GetComponent<BigShotBehavior>(); if (Object.op_Implicit((Object)(object)sender.inventory) && count > 0 && !Object.op_Implicit((Object)(object)bigShotBehavior)) { bigShotBehavior = ((Component)sender).gameObject.AddComponent<BigShotBehavior>(); ((ItemBehavior)bigShotBehavior).body = sender; ((ItemBehavior)bigShotBehavior).stack = count; bigShotBehavior.BigShotBuff = BigShotBuff; } else if (Object.op_Implicit((Object)(object)bigShotBehavior) && count <= 0) { ((Behaviour)bigShotBehavior).enabled = false; } else if (Object.op_Implicit((Object)(object)bigShotBehavior) && count > 0 && !((Behaviour)bigShotBehavior).enabled) { ((Behaviour)bigShotBehavior).enabled = true; } if (Object.op_Implicit((Object)(object)bigShotBehavior)) { ((ItemBehavior)bigShotBehavior).stack = count; bigShotBehavior.GoldThreshold = 50 + TotalStages * GoldIncreasePerStage; } } } public void CreateBuff() { BigShotBuff = ScriptableObject.CreateInstance<BuffDef>(); ((Object)BigShotBuff).name = "BigShotBuff"; BigShotBuff.iconSprite = BuffIcon; BigShotBuff.canStack = true; BigShotBuff.isDebuff = false; ContentAddition.AddBuffDef(BigShotBuff); } public void CreateEffect() { BigShotEffectPrefab = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("Prefabs/Projectiles/ShurikenProjectile"), "BigShotSoundEffect", true); Helpers.CreateSoundPrefab("bigshot_sfx", "Play_BIGSHOT"); EffectComponent val = BigShotEffectPrefab.GetComponent<EffectComponent>() ?? BigShotEffectPrefab.AddComponent<EffectComponent>(); val.soundName = "Play_BIGSHOT"; Helpers.CreateNetworkedEffectPrefab(BigShotEffectPrefab); } public void CreateProjectile() { //IL_0059: Unknown result type (might be due to invalid IL or missing references) projectilePrefab = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("Prefabs/Projectiles/ShurikenProjectile"), "BigShotProjectile", true); GameObject val = PrefabAPI.InstantiateClone(DeltarunePlugin.MainAssets.LoadAsset<GameObject>("big_shot_projectile.prefab"), "big_shot", true); val.AddComponent<ProjectileGhostController>(); val.AddComponent<NetworkIdentity>(); val.transform.localScale = new Vector3(180f, 180f, 180f); ProjectileController component = projectilePrefab.GetComponent<ProjectileController>(); component.startSound = ""; component.shouldPlaySounds = false; component.ghostPrefab = val; ProjectileSimple component2 = projectilePrefab.GetComponent<ProjectileSimple>(); component2.desiredForwardSpeed *= 1f; ((Component)component2).GetComponent<Rigidbody>().useGravity = false; Object.Destroy((Object)(object)projectilePrefab.GetComponent<ProjectileSteerTowardTarget>()); Object.Destroy((Object)(object)projectilePrefab.GetComponent<ProjectileTargetComponent>()); Helpers.CreateNetworkedProjectilePrefab(projectilePref