Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of Wisplings v1.0.0
Wisplings.dll
Decompiled a day 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.Globalization; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Text; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Jotunn.Configs; using Jotunn.Entities; using Jotunn.Managers; using Jotunn.Utils; using Microsoft.CodeAnalysis; using UnityEngine; using UnityEngine.Rendering; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("Wisplings")] [assembly: AssemblyCompany("2711 Studios")] [assembly: AssemblyProduct("Wisplings")] [assembly: AssemblyFileVersion("1.0.0")] [assembly: AssemblyVersion("1.0.0.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace Wisplings { public class SE_BastionWisp : SE_Demister { } [BepInPlugin("com.studio2711.wisplings", "Wisplings", "1.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] public class WisplingsPlugin : BaseUnityPlugin { internal static readonly Color Indigo = new Color(0.294f, 0.169f, 0.839f, 1f); internal static ConfigEntry<string> AnchorCost; internal static ConfigEntry<float> AnchorHoverHeight; internal static ConfigEntry<float> AnchorChestRange; internal static ConfigEntry<float> AnchorScale; internal static ConfigEntry<Color> AnchorEmptyColour; internal static readonly ConfigEntry<float>[] BastionRadius = new ConfigEntry<float>[4]; internal static ConfigEntry<string> BastionFuelItem; internal static ConfigEntry<float> BastionFuelPerHour; internal static ConfigEntry<int> BastionMaxFuel; internal static ConfigEntry<int> BastionFuelPerUse; internal static ConfigEntry<bool> BastionRaidShrink; internal static ConfigEntry<float> BastionMinSpacing; internal static ConfigEntry<bool> BastionAffectsBosses; internal static ConfigEntry<bool> BastionShowEdge; internal static ConfigEntry<bool> BastionLetTameablesGraze; internal static WispCosts BastionCosts; internal static readonly Color Green = new Color(0.302f, 1f, 0.42f, 1f); internal static readonly Color Gold = new Color(1f, 0.89f, 0.302f, 1f); internal static readonly Color Ember = new Color(1f, 0.29f, 0.11f, 1f); internal static readonly Color Bronze = new Color(0.753f, 0.502f, 0.251f, 1f); internal static readonly Color Lime = new Color(0.784f, 1f, 0.18f, 1f); internal static readonly ConfigEntry<float>[] HarvestRange = new ConfigEntry<float>[4]; internal static readonly ConfigEntry<int>[] HarvestPicksPerTrip = new ConfigEntry<int>[4]; internal static ConfigEntry<float> HarvestScanInterval; internal static ConfigEntry<string> HarvestIgnore; internal static ConfigEntry<bool> HarvestRespectWards; internal static ConfigEntry<bool> HarvestReplant; internal static WispCosts HarvestCosts; internal static readonly ConfigEntry<float>[] GleanRange = new ConfigEntry<float>[4]; internal static readonly ConfigEntry<int>[] GleanStacksPerTrip = new ConfigEntry<int>[4]; internal static ConfigEntry<bool> GleanFromWater; internal static ConfigEntry<float> GleanMinAge; internal static ConfigEntry<float> GleanMaxAge; internal static ConfigEntry<float> GleanCombatCooldown; internal static ConfigEntry<bool> GleanRespectWards; internal static ConfigEntry<bool> GleanIgnoreTrophies; internal static ConfigEntry<float> GleanChainRadius; internal static WispCosts GleanCosts; internal static readonly ConfigEntry<float>[] StokerRange = new ConfigEntry<float>[4]; internal static readonly ConfigEntry<int>[] StokerPerTrip = new ConfigEntry<int>[4]; internal static ConfigEntry<float> StokerScanInterval; internal static ConfigEntry<float> StokerRefuelBelow; internal static ConfigEntry<bool> StokerOnlyInBase; internal static ConfigEntry<bool> StokerRespectWards; internal static ConfigEntry<bool> StokerIncludeTorches; internal static ConfigEntry<bool> StokerLoadOre; internal static ConfigEntry<string> StokerKilnInputs; internal static WispCosts StokerCosts; internal static readonly ConfigEntry<float>[] StashRange = new ConfigEntry<float>[4]; internal static readonly ConfigEntry<int>[] StashPerTrip = new ConfigEntry<int>[4]; internal static ConfigEntry<float> StashScanInterval; internal static ConfigEntry<string> StashSignText; internal static ConfigEntry<float> StashSignDistance; internal static ConfigEntry<float> StashFindRange; internal static ConfigEntry<bool> StashOnlyInBase; internal static ConfigEntry<bool> StashRespectWards; internal static ConfigEntry<bool> StashNewHomes; internal static WispCosts StashCosts; internal static readonly ConfigEntry<float>[] HerderRange = new ConfigEntry<float>[4]; internal static readonly ConfigEntry<int>[] HerderFoodPerTrip = new ConfigEntry<int>[4]; internal static ConfigEntry<float> HerderScanInterval; internal static ConfigEntry<bool> HerderOnlyInBase; internal static ConfigEntry<bool> HerderRespectWards; internal static ConfigEntry<bool> HerderLeadWanderers; internal static ConfigEntry<float> HerderLeadCooldown; internal static WispCosts HerderCosts; public const string PluginGuid = "com.studio2711.wisplings"; public const string PluginName = "Wisplings"; public const string PluginVersion = "1.0.0"; internal const string VanillaItem = "Demister"; internal static ManualLogSource Log; internal static WisplingsPlugin Instance; private Harmony _harmony; internal static readonly ConfigEntry<float>[] LevelRange = new ConfigEntry<float>[4]; internal static readonly ConfigEntry<float>[] LevelRepairPercent = new ConfigEntry<float>[4]; internal static readonly ConfigEntry<float>[] LevelWorkSeconds = new ConfigEntry<float>[4]; internal static ConfigEntry<float> Level3SpreadRadius; internal static ConfigEntry<int> UpgradeDragonEggs; internal static readonly ConfigEntry<int>[] UpgradeEitr = new ConfigEntry<int>[4]; internal static readonly ConfigEntry<int>[] UpgradeWisps = new ConfigEntry<int>[4]; internal static ConfigEntry<float> RepairScanInterval; internal static ConfigEntry<bool> RepairRespectWards; internal static ConfigEntry<float> RepairRaidSpeed; internal static ConfigEntry<float> RepairReturnMargin; internal static ConfigEntry<TargetPriority> RepairPriority; internal static ConfigEntry<RepairSoundMode> RepairSound; internal static ConfigEntry<float> RepairSoundVolume; internal static ConfigEntry<bool> RepairGlowEnabled; internal static ConfigEntry<Color> RepairGlowColour; internal static readonly Color Amber = new Color(1f, 0.62f, 0.18f, 1f); internal static readonly Color Magenta = new Color(1f, 0.17f, 0.84f, 1f); internal static readonly Color Cobalt = new Color(0.18f, 0.42f, 1f, 1f); internal static readonly Color Pearl = new Color(0.949f, 0.957f, 1f, 1f); internal static readonly Color PaleGold = new Color(1f, 0.88f, 0.55f, 1f); internal static readonly Color Crimson = new Color(0.816f, 0.063f, 0.165f, 1f); internal static readonly Color Rose = new Color(1f, 0.561f, 0.722f, 1f); internal static readonly Color SpiritGrey = new Color(0.624f, 0.706f, 0.784f, 1f); internal static readonly Color Teal = new Color(0.18f, 0.851f, 0.765f, 1f); internal static readonly Color Violet = new Color(0.478f, 0.169f, 1f, 1f); internal static ConfigEntry<float> WispSoundVolume; internal static readonly ConfigEntry<float>[] SentinelRange = new ConfigEntry<float>[4]; internal static ConfigEntry<float> SentinelScanInterval; internal static ConfigEntry<bool> SentinelIgnorePassive; internal static ConfigEntry<bool> SentinelWarnDuringRaids; internal static ConfigEntry<bool> SentinelChimeForEveryone; internal static ConfigEntry<bool> SentinelBehindWarning; internal static ConfigEntry<float> SentinelBehindAngle; internal static ConfigEntry<bool> SentinelDirectionText; internal static WispCosts SentinelCosts; internal static readonly ConfigEntry<float>[] WardenAbsorb = new ConfigEntry<float>[4]; internal static readonly ConfigEntry<float>[] WardenRecharge = new ConfigEntry<float>[4]; internal static ConfigEntry<bool> WardenOnlyOutOfCombat; internal static ConfigEntry<float> WardenCombatCooldown; internal static ConfigEntry<bool> WardenOverflow; internal static ConfigEntry<float> WardenPulseRadius; internal static ConfigEntry<float> WardenPulseForce; internal static WispCosts WardenCosts; internal static readonly ConfigEntry<float>[] ScoutRange = new ConfigEntry<float>[4]; internal static ConfigEntry<float> ScoutScanInterval; internal static ConfigEntry<float> ScoutMarkerSeconds; internal static ConfigEntry<int> ScoutMaxMarksPerScan; internal static ConfigEntry<string> ScoutIgnore; internal static ConfigEntry<bool> ScoutIgnoreInsideBase; internal static ConfigEntry<bool> ScoutFindChests; internal static ConfigEntry<bool> ScoutFindEntrances; internal static ConfigEntry<float> ScoutGuideSeconds; internal static ConfigEntry<Color> ScoutMarkerColour; internal static ConfigEntry<Color> ScoutChestColour; internal static ConfigEntry<bool> ScoutEntranceText; internal static WispCosts ScoutCosts; internal static readonly ConfigEntry<float>[] PhoenixFloorPercent = new ConfigEntry<float>[4]; internal static readonly ConfigEntry<float>[] PhoenixInvulnSeconds = new ConfigEntry<float>[4]; internal static readonly ConfigEntry<bool>[] PhoenixCleanse = new ConfigEntry<bool>[4]; internal static ConfigEntry<float> PhoenixCooldown; internal static ConfigEntry<string> PhoenixNeverSaveFrom; internal static ConfigEntry<float> PhoenixFlareRadius; internal static ConfigEntry<float> PhoenixFlareForce; internal static ConfigEntry<float> PhoenixFlareFire; internal static WispCosts PhoenixCosts; internal static readonly ConfigEntry<float>[] BalmHealAmount = new ConfigEntry<float>[4]; internal static readonly ConfigEntry<float>[] BalmRange = new ConfigEntry<float>[4]; internal static ConfigEntry<float> BalmHealInterval; internal static ConfigEntry<float> BalmCombatCooldown; internal static ConfigEntry<bool> BalmHealTames; internal static ConfigEntry<bool> BalmHealPlayers; internal static ConfigEntry<bool> BalmHealNumbers; internal static WispCosts BalmCosts; internal static readonly ConfigEntry<float>[] WayfinderMinutes = new ConfigEntry<float>[4]; internal static ConfigEntry<float> WayfinderLeadDistance; internal static ConfigEntry<float> WayfinderFadeDistance; internal static ConfigEntry<float> WayfinderTrailSpacing; internal static ConfigEntry<float> WayfinderTrailSeconds; internal static ConfigEntry<float> WayfinderLanternRange; internal static ConfigEntry<float> WayfinderBeaconRange; internal static WispCosts WayfinderCosts; internal static readonly ConfigEntry<float>[] MarinerWarnRange = new ConfigEntry<float>[4]; internal static readonly ConfigEntry<float>[] MarinerLampRange = new ConfigEntry<float>[4]; internal static readonly ConfigEntry<float>[] MarinerLampIntensity = new ConfigEntry<float>[4]; internal static ConfigEntry<float> MarinerScanInterval; internal static ConfigEntry<string> MarinerSeaCreatures; internal static ConfigEntry<bool> MarinerWarnSwimmers; internal static ConfigEntry<bool> MarinerDaylightLamp; internal static ConfigEntry<float> MarinerMastHeight; internal static ConfigEntry<bool> MarinerChimeForEveryone; internal static ConfigEntry<bool> MarinerDirectionText; internal static ConfigEntry<bool> MarinerLeviathanWarning; internal static ConfigEntry<float> MarinerLeviathanRadius; internal static WispCosts MarinerCosts; internal static readonly ConfigEntry<float>[] StormDamage = new ConfigEntry<float>[4]; internal static readonly ConfigEntry<float>[] StormCooldown = new ConfigEntry<float>[4]; internal static ConfigEntry<float> StormRange; internal static ConfigEntry<bool> StormOnlyEnemiesInCombat; internal static ConfigEntry<float> StormChargeSeconds; internal static ConfigEntry<float> StormChainRange; internal static ConfigEntry<float> StormChainFraction; internal static ConfigEntry<string> StormHitEffect; internal static ConfigEntry<string> StormHitSound; internal static ConfigEntry<string> StormChainSound; internal static WispCosts StormCosts; internal static ConfigEntry<bool> DebugLogging; internal static ConfigEntry<bool> TestCommands; private static string _seaRaw; private static HashSet<string> _seaSet = new HashSet<string>(); private void BindAnchor(Func<string, AcceptableValueBase, ConfigDescription> admin) { //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Expected O, but got Unknown //IL_00b1: Unknown result type (might be due to invalid IL or missing references) AnchorCost = ((BaseUnityPlugin)this).Config.Bind<string>("Wisp Anchor", "BuildCost", "YggdrasilWood:9, BlackMarble:9, Eitr:4, Wisp:4", admin("What the Wisp Anchor costs to build with the hammer (near a Galdr table), as Item:amount pairs. Applies after a restart.", null)); AnchorHoverHeight = ((BaseUnityPlugin)this).Config.Bind<float>("Wisp Anchor", "HoverHeight", 1.8f, admin("How high above the Anchor (metres) its wisp rests.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.5f, 6f))); AnchorScale = ((BaseUnityPlugin)this).Config.Bind<float>("Wisp Anchor", "Scale", 0.75f, new ConfigDescription("Size of the Anchor model (1 = the Wisp Lure's size). Client-side, applies after a restart.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.3f, 1.5f), Array.Empty<object>())); AnchorEmptyColour = ((BaseUnityPlugin)this).Config.Bind<Color>("Wisp Anchor", "EmptyColour", SpiritGrey, "Colour of the Anchor's glow while it holds no wisp (RRGGBBAA hex). With a wisp slotted it glows in that wisp's colour. Client-side."); AnchorChestRange = ((BaseUnityPlugin)this).Config.Bind<float>("Wisp Anchor", "DeliveryChestRange", 4f, admin("An anchored Harvest Wisp puts what it picks into the nearest chest within this many metres of the Anchor (otherwise in a pile beside it).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 20f))); float[] array = new float[4] { 0f, 8f, 12f, 16f }; string[] array2 = new string[4] { "", "Garðr", "Miðgarðr", "Ásgarðr: + holds its size during raids" }; for (int i = 1; i <= 3; i++) { BastionRadius[i] = ((BaseUnityPlugin)this).Config.Bind<float>("Bastion Wisp Level " + i, "Radius", array[i], admin($"Level {i} ({array2[i]}): half the width (metres) of the square area around the Anchor that monsters won't come into.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(2f, 40f))); } BastionFuelItem = ((BaseUnityPlugin)this).Config.Bind<string>("Bastion Wisp", "FuelItem", "Eitr", admin("The item (prefab name) that fuels a Bastion. Eitr = Refined Eitr.", null)); BastionFuelPerHour = ((BaseUnityPlugin)this).Config.Bind<float>("Bastion Wisp", "FuelPerHour", 1f, admin("Fuel used per in-game hour (an in-game day is about 30 minutes, so 1 per hour is 24 a day). Only burns while the area is loaded.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 20f))); BastionMaxFuel = ((BaseUnityPlugin)this).Config.Bind<int>("Bastion Wisp", "MaxFuel", 50, admin("Most fuel an Anchor holds.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 1000))); BastionFuelPerUse = ((BaseUnityPlugin)this).Config.Bind<int>("Bastion Wisp", "FuelPerUse", 10, admin("How many fuel items one use adds (Shift + use, or using the fuel on the Anchor from your hotbar).", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 100))); BastionRaidShrink = ((BaseUnityPlugin)this).Config.Bind<bool>("Bastion Wisp", "RaidShrink", true, admin("If true, during a raid nearby the area shrinks to half size at levels 1 and 2 (level 3 holds), so raids still matter.", null)); BastionMinSpacing = ((BaseUnityPlugin)this).Config.Bind<float>("Bastion Wisp", "MinSpacing", 50f, admin("Only one Bastion per base: a Bastion within this many metres of an older active one stays dark. 0 = no limit.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 200f))); BastionAffectsBosses = ((BaseUnityPlugin)this).Config.Bind<bool>("Bastion Wisp", "AffectsBosses", false, admin("If false, bosses ignore Bastion areas.", null)); BastionLetTameablesGraze = ((BaseUnityPlugin)this).Config.Bind<bool>("Bastion Wisp", "LetTameablesGraze", true, admin("If true, animals that can be tamed (boars, wolves, lox...) aren't chased off by the area while they have no target, so a pen inside it still works and they can be tamed. Once one hunts you, it still won't follow you inside.", null)); BastionShowEdge = ((BaseUnityPlugin)this).Config.Bind<bool>("Bastion Wisp", "ShowEdge", true, "Show faint sparks along the edge of an active Bastion area when you're near. Client-side."); BastionCosts = new WispCosts(((BaseUnityPlugin)this).Config, "Bastion Wisp Costs", "BastionWisp", "Wisp:27, FlametalNew:9, BlackCore:4, Eitr:36", "Wisp:18, Eitr:72, FlametalNew:9", "Wisp:45, Eitr:135, TrophyFader:1", admin); } private static Dictionary<string, string> AnchorTranslations() { return new Dictionary<string, string> { { "piece_wispanchor", "Wisp Anchor" }, { "piece_wispanchor_desc", "Holds one wisp. A Repair, Harvest, Stoker, Stash or Herder wisp works around the Anchor instead of around you; a Bastion Wisp guards the area. Use to slot the wisp you're wearing, use again to take it back." }, { "anchor_empty", "Empty" }, { "anchor_put", "Slot the wisp you're wearing" }, { "anchor_put_hotbar", "Or use a wisp on it from your hotbar" }, { "anchor_take", "Take the wisp back" }, { "anchor_level", "level" }, { "anchor_fuel", "Fuel" }, { "anchor_addfuel", "Add fuel" }, { "anchor_need_wisp", "Wear a Repair, Harvest, Stoker, Stash, Herder or Bastion wisp first" }, { "anchor_not_this", "That wisp doesn't work from an Anchor" }, { "anchor_full", "The Anchor already holds a wisp" }, { "anchor_slotted", "The wisp settles into the Anchor" }, { "anchor_try_again", "The Anchor is busy, try again" }, { "anchor_fuel_full", "The Bastion is full" }, { "anchor_fuel_added", "The Bastion glows brighter" }, { "anchor_no_fuel", "You have no $1" }, { "anchor_bastion_off", "<color=#9FB4C8>Dark</color>" }, { "anchor_bastion_on", "<color=#8F7BFF>Monsters keep away</color>" }, { "anchor_bastion_nofuel", "<color=#FF8F8F>Out of fuel</color>" }, { "anchor_bastion_blocked", "<color=#FFB86B>Dark: another Bastion already guards this base</color>" }, { "anchor_bastion_raidshrunk", "<color=#FFB86B>Raid: holding a smaller area</color>" }, { "item_bastionwisp", "Bastion Wisp" }, { "item_bastionwisp_desc", "Does nothing worn. Slotted into a Wisp Anchor and fed Refined Eitr, it keeps monsters out of a small area: hunters won't follow you in, wanderers keep their distance. One per base.\n\n<color=#4B2BD6>Level 1</color> Garðr, the yard: 16 m across\n<color=#4B2BD6>Level 2</color> Miðgarðr, the walled world of men: 24 m across\n<color=#4B2BD6>Level 3</color> Ásgarðr, the home of the gods: 32 m across, and it holds its size during raids" }, { "se_bastionwisp", "Bastion Wisp" }, { "se_bastionwisp_tooltip", "Waiting for a Wisp Anchor." }, { "se_bastionwisp_start", "Your bastion wisp waits for an anchor" } }; } private void RegisterAnchorItems() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) Make<SE_BastionWisp>("BastionWisp", Indigo, BastionCosts); RegisterAnchorPiece(); } private void RegisterAnchorPiece() { //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Expected O, but got Unknown //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Expected O, but got Unknown //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Expected O, but got Unknown try { GameObject val = PrefabManager.Instance.CreateClonedPrefab("piece_wispanchor", "piece_wisplure"); if ((Object)(object)val == (Object)null) { WLog.Error("anchor_register_failed", "reason", "piece_wisplure_missing"); return; } int num = 0; WispSpawner[] componentsInChildren = val.GetComponentsInChildren<WispSpawner>(true); for (int i = 0; i < componentsInChildren.Length; i++) { Object.DestroyImmediate((Object)(object)componentsInChildren[i]); num++; } GuidePoint[] componentsInChildren2 = val.GetComponentsInChildren<GuidePoint>(true); for (int i = 0; i < componentsInChildren2.Length; i++) { Object.DestroyImmediate((Object)(object)((Component)componentsInChildren2[i]).gameObject); num++; } val.transform.localScale = Vector3.one * AnchorScale.Value; int num2 = WispAnchor.TintGlow(val, AnchorEmptyColour.Value, null); val.AddComponent<WispAnchor>(); List<RequirementConfig> list = new List<RequirementConfig>(); string[] array = (AnchorCost.Value ?? "").Split(','); for (int i = 0; i < array.Length; i++) { string text = array[i].Trim(); int num3 = text.IndexOf(':'); if (num3 > 0 && int.TryParse(text.Substring(num3 + 1).Trim(), NumberStyles.Integer, CultureInfo.InvariantCulture, out var result)) { list.Add(new RequirementConfig(text.Substring(0, num3).Trim(), result, 0, true)); } } CustomPiece val2 = new CustomPiece(val, true, new PieceConfig { Name = "$piece_wispanchor", Description = "$piece_wispanchor_desc", PieceTable = PieceTables.Hammer, Category = PieceCategories.Misc, CraftingStation = CraftingStations.GaldrTable, Requirements = list.ToArray() }); PieceManager.Instance.AddPiece(val2); List<string> list2 = new List<string>(); foreach (RequirementConfig item in list) { list2.Add(item.Item); } WispFactory.CheckItems("piece_wispanchor", list2); WLog.Event("anchor_registered", "partsRemoved", num, "tintedParts", num2, "scale", AnchorScale.Value, "requirements", list.Count); if (DebugLogging.Value) { WispDiagnostics.DumpPrefab("piece_wispanchor", val); } } catch (Exception ex) { WLog.Error("anchor_register_failed", "type", ex.GetType().Name, "message", ex.Message); Log.LogError((object)ex); } } private void BindHearth(Func<string, AcceptableValueBase, ConfigDescription> admin) { float[] array = new float[4] { 0f, 12f, 16f, 20f }; int[] array2 = new int[4] { 0, 1, 4, 6 }; string[] array3 = new string[4] { "", "Akr", "Sif: carries several pickings a trip", "Freyr: + replants the crops it picks" }; for (int i = 1; i <= 3; i++) { string text = "Harvest Wisp Level " + i; HarvestRange[i] = ((BaseUnityPlugin)this).Config.Bind<float>(text, "Range", array[i], admin($"Level {i} ({array3[i]}): how far from you (metres) it picks.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(3f, 60f))); HarvestPicksPerTrip[i] = ((BaseUnityPlugin)this).Config.Bind<int>(text, "PicksPerTrip", array2[i], admin($"Level {i}: how many plants it picks before bringing the load back to you.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 20))); } HarvestScanInterval = ((BaseUnityPlugin)this).Config.Bind<float>("Harvest Wisp", "ScanInterval", 1.5f, admin("How often an idle wisp looks for something to pick (seconds).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.25f, 10f))); HarvestIgnore = ((BaseUnityPlugin)this).Config.Bind<string>("Harvest Wisp", "IgnorePickables", "Pickable_Stone, Pickable_StoneRock, Pickable_Branch, Pickable_Branch_Snow, Pickable_Flint, Pickable_Snowball", admin("Pickables it never picks (prefab names, comma separated). It only ever picks crops and wild plants that grow back, never treasure.", null)); HarvestRespectWards = ((BaseUnityPlugin)this).Config.Bind<bool>("Harvest Wisp", "RespectWards", true, admin("If true, it leaves plants inside wards you don't have access to alone.", null)); HarvestReplant = ((BaseUnityPlugin)this).Config.Bind<bool>("Harvest Wisp Level 3", "Replant", true, admin("Level 3: replant each crop it picks, using the seeds (or carrots, turnips...) from your inventory. Without them it just picks.", null)); HarvestCosts = new WispCosts(((BaseUnityPlugin)this).Config, "Harvest Wisp Costs", "HarvestWisp", "Wisp:9, Eitr:7, Barley:9, Flax:9", "Wisp:7, Eitr:14, MushroomJotunPuffs:5", "Wisp:18, Eitr:36, MushroomMagecap:9", admin); float[] array4 = new float[4] { 0f, 12f, 18f, 25f }; int[] array5 = new int[4] { 0, 1, 3, 3 }; string[] array6 = new string[4] { "", "Nisse", "Andvari: three stacks a trip", "Fáfnir: + fishes items out of water" }; for (int j = 1; j <= 3; j++) { string text2 = "Gleaner Wisp Level " + j; GleanRange[j] = ((BaseUnityPlugin)this).Config.Bind<float>(text2, "Range", array4[j], admin($"Level {j} ({array6[j]}): how far from you (metres) it gathers loot.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(3f, 60f))); GleanStacksPerTrip[j] = ((BaseUnityPlugin)this).Config.Bind<int>(text2, "StacksPerTrip", array5[j], admin($"Level {j}: how many stacks it carries back at once.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 10))); } GleanFromWater = ((BaseUnityPlugin)this).Config.Bind<bool>("Gleaner Wisp Level 3", "FromWater", true, admin("Level 3: also fetch items floating in water.", null)); GleanMinAge = ((BaseUnityPlugin)this).Config.Bind<float>("Gleaner Wisp", "MinItemAge", 2f, admin("Seconds an item must have been on the ground before it's gathered.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 60f))); GleanMaxAge = ((BaseUnityPlugin)this).Config.Bind<float>("Gleaner Wisp", "MaxItemAge", 600f, admin("Items on the ground longer than this (seconds) are left alone, so it doesn't sweep up things lying in your base.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(30f, 86400f))); GleanCombatCooldown = ((BaseUnityPlugin)this).Config.Bind<float>("Gleaner Wisp", "CombatCooldown", 6f, admin("Seconds since you were last hit or hit something before it starts gathering.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 120f))); GleanRespectWards = ((BaseUnityPlugin)this).Config.Bind<bool>("Gleaner Wisp", "RespectWards", true, admin("If true, it leaves items inside wards you don't have access to alone.", null)); GleanIgnoreTrophies = ((BaseUnityPlugin)this).Config.Bind<bool>("Gleaner Wisp", "IgnoreTrophies", false, admin("If true, it leaves trophies for you to pick up yourself.", null)); GleanChainRadius = ((BaseUnityPlugin)this).Config.Bind<float>("Gleaner Wisp", "ChainRadius", 6f, admin("On a multi-stack trip, how far (metres) it looks from the last item for the next one.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 30f))); GleanCosts = new WispCosts(((BaseUnityPlugin)this).Config, "Gleaner Wisp Costs", "GleanerWisp", "Wisp:7, Feathers:9, Silver:4, Eitr:5", "Wisp:5, Eitr:14, ScaleHide:4", "Wisp:14, Eitr:36, Bilebag:2", admin); float[] array7 = new float[4] { 0f, 15f, 20f, 25f }; int[] array8 = new int[4] { 0, 1, 3, 5 }; string[] array9 = new string[4] { "", "Eldr: fires and torches", "Logi: + smelters, furnaces and kilns", "Surtr: + loads ore" }; for (int k = 1; k <= 3; k++) { string text3 = "Stoker Wisp Level " + k; StokerRange[k] = ((BaseUnityPlugin)this).Config.Bind<float>(text3, "Range", array7[k], admin($"Level {k} ({array9[k]}): how far from you (metres) it tends fires and uses chests.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(3f, 60f))); StokerPerTrip[k] = ((BaseUnityPlugin)this).Config.Bind<int>(text3, "PerTrip", array8[k], admin($"Level {k}: how many fuel (or ore) items it carries per trip.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 50))); } StokerScanInterval = ((BaseUnityPlugin)this).Config.Bind<float>("Stoker Wisp", "ScanInterval", 2f, admin("How often an idle wisp checks the fires (seconds).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.5f, 30f))); StokerRefuelBelow = ((BaseUnityPlugin)this).Config.Bind<float>("Stoker Wisp", "RefuelBelow", 0.5f, admin("It tops something up once its fuel (or ore queue) is below this fraction of full.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.05f, 1f))); StokerOnlyInBase = ((BaseUnityPlugin)this).Config.Bind<bool>("Stoker Wisp", "OnlyInBase", true, admin("If true, it only uses chests and fires inside a base (near a workbench or fire you built), never out in the wild.", null)); StokerRespectWards = ((BaseUnityPlugin)this).Config.Bind<bool>("Stoker Wisp", "RespectWards", true, admin("If true, it leaves chests and fires inside wards you don't have access to alone.", null)); StokerIncludeTorches = ((BaseUnityPlugin)this).Config.Bind<bool>("Stoker Wisp", "IncludeTorches", true, admin("If true, it also keeps torches and sconces lit.", null)); StokerLoadOre = ((BaseUnityPlugin)this).Config.Bind<bool>("Stoker Wisp Level 3", "LoadOre", true, admin("Level 3: also loads ore (and other inputs: flax, barley, sap...) from chests into smelters, furnaces, spinning wheels and the like in the same base.", null)); StokerKilnInputs = ((BaseUnityPlugin)this).Config.Bind<string>("Stoker Wisp", "KilnInputs", "Wood, FineWood, RoundLog, YggdrasilWood, Blackwood", admin("A building with no fuel slot whose inputs are all in this list counts as a kiln: from level 2 the Stoker fills it like a fire.", null)); StokerCosts = new WispCosts(((BaseUnityPlugin)this).Config, "Stoker Wisp Costs", "StokerWisp", "Wisp:11, SurtlingCore:5, BlackMetal:4, Eitr:9", "Wisp:9, Eitr:18, SurtlingCore:9", "Wisp:22, Eitr:45, BlackCore:1", admin); float[] array10 = new float[4] { 0f, 10f, 15f, 20f }; int[] array11 = new int[4] { 0, 1, 3, 5 }; string[] array12 = new string[4] { "", "Tomte", "Bryti: tops up part-filled stacks first", "Fulla: + finds an empty chest for items with no home" }; for (int l = 1; l <= 3; l++) { string text4 = "Stash Wisp Level " + l; StashRange[l] = ((BaseUnityPlugin)this).Config.Bind<float>(text4, "Range", array10[l], admin($"Level {l} ({array12[l]}): how far from the stash chest (metres) it looks for the chests items belong in.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(3f, 60f))); StashPerTrip[l] = ((BaseUnityPlugin)this).Config.Bind<int>(text4, "StacksPerTrip", array11[l], admin($"Level {l}: how many stacks it carries per trip.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 20))); } StashScanInterval = ((BaseUnityPlugin)this).Config.Bind<float>("Stash Wisp", "ScanInterval", 2f, admin("How often an idle wisp checks the stash chest (seconds).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.5f, 30f))); StashSignText = ((BaseUnityPlugin)this).Config.Bind<string>("Stash Wisp", "SignText", "Stash", admin("A chest with a sign reading this (any capitals) next to it is the stash chest the wisp empties.", null)); StashSignDistance = ((BaseUnityPlugin)this).Config.Bind<float>("Stash Wisp", "SignDistance", 2.5f, admin("How close (metres) the sign must be to the chest (measured from the chest's base to the sign).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.5f, 6f))); StashFindRange = ((BaseUnityPlugin)this).Config.Bind<float>("Stash Wisp", "StashChestRange", 25f, admin("How far from you (metres) a stash chest can be.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(3f, 80f))); StashOnlyInBase = ((BaseUnityPlugin)this).Config.Bind<bool>("Stash Wisp", "OnlyInBase", true, admin("If true, it only uses chests inside a base.", null)); StashRespectWards = ((BaseUnityPlugin)this).Config.Bind<bool>("Stash Wisp", "RespectWards", true, admin("If true, it leaves chests inside wards you don't have access to alone.", null)); StashNewHomes = ((BaseUnityPlugin)this).Config.Bind<bool>("Stash Wisp Level 3", "NewHomes", true, admin("Level 3: an item with no home goes to the nearest empty chest, which then becomes its home.", null)); StashCosts = new WispCosts(((BaseUnityPlugin)this).Config, "Stash Wisp Costs", "StashWisp", "Wisp:9, YggdrasilWood:9, Iron:4, Eitr:7", "Wisp:7, Eitr:14, FineWood:9", "Wisp:18, Eitr:36, BlackCore:2", admin); float[] array13 = new float[4] { 0f, 15f, 20f, 25f }; int[] array14 = new int[4] { 0, 2, 5, 5 }; string[] array15 = new string[4] { "", "Hirðir", "Smali: uses the food you have most of", "Gefjun: + leads tames that wander out of the base back in" }; for (int m = 1; m <= 3; m++) { string text5 = "Herder Wisp Level " + m; HerderRange[m] = ((BaseUnityPlugin)this).Config.Bind<float>(text5, "Range", array13[m], admin($"Level {m} ({array15[m]}): how far from you (metres) it tends animals and uses chests.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(3f, 60f))); HerderFoodPerTrip[m] = ((BaseUnityPlugin)this).Config.Bind<int>(text5, "FoodPerTrip", array14[m], admin($"Level {m}: most food it carries per trip (one per hungry animal in the group).", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 20))); } HerderScanInterval = ((BaseUnityPlugin)this).Config.Bind<float>("Herder Wisp", "ScanInterval", 2f, admin("How often an idle wisp checks the animals (seconds).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.5f, 30f))); HerderOnlyInBase = ((BaseUnityPlugin)this).Config.Bind<bool>("Herder Wisp", "OnlyInBase", true, admin("If true, it only feeds animals inside a base, from chests inside a base.", null)); HerderRespectWards = ((BaseUnityPlugin)this).Config.Bind<bool>("Herder Wisp", "RespectWards", true, admin("If true, it leaves chests and animals inside wards you don't have access to alone.", null)); HerderLeadWanderers = ((BaseUnityPlugin)this).Config.Bind<bool>("Herder Wisp Level 3", "LeadWanderers", true, admin("Level 3: a tame that has wandered out of the base (not following anyone, not told to stay elsewhere) gets a 'stay here' point at the nearest fire or workbench, so it walks back in.", null)); HerderLeadCooldown = ((BaseUnityPlugin)this).Config.Bind<float>("Herder Wisp Level 3", "LeadCooldown", 60f, admin("Level 3: seconds before it tries to lead the same animal again.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(5f, 600f))); HerderCosts = new WispCosts(((BaseUnityPlugin)this).Config, "Herder Wisp Costs", "HerderWisp", "Wisp:9, LoxPelt:4, Barley:9, Eitr:7", "Wisp:7, Eitr:14, WolfFang:4", "Wisp:18, Eitr:36, TrophyLox:1", admin); } private static Dictionary<string, string> HearthTranslations() { return new Dictionary<string, string> { { "item_harvestwisp", "Harvest Wisp" }, { "item_harvestwisp_desc", "Picks ripe crops and wild plants that grow back and brings them to your feet. Never treasure.\n\n<color=#4DFF6B>Level 1</color> Akr, the field: one picking a trip, 12 m\n<color=#4DFF6B>Level 2</color> Sif, the golden-haired: four a trip, 16 m\n<color=#4DFF6B>Level 3</color> Freyr, the god of the harvest: six a trip, 20 m, and it replants crops with seeds from your pack" }, { "se_harvestwisp", "Harvest Wisp" }, { "se_harvestwisp_tooltip", "Picks crops and wild plants nearby and brings them to your feet." }, { "se_harvestwisp_start", "Your harvest wisp eyes the fields" }, { "item_gleanerwisp", "Gleaner Wisp" }, { "item_gleanerwisp_desc", "After a fight, gathers the loot lying around and drops it at your feet. Never what you dropped yourself.\n\n<color=#FFE34D>Level 1</color> Nisse, the house-sprite: one stack a trip, 12 m\n<color=#FFE34D>Level 2</color> Andvari, the dwarf who kept the gold: three a trip, 18 m\n<color=#FFE34D>Level 3</color> Fáfnir, the hoard-dragon: 25 m, and it fishes items out of water" }, { "se_gleanerwisp", "Gleaner Wisp" }, { "se_gleanerwisp_tooltip", "Gathers loot after a fight and drops it at your feet." }, { "se_gleanerwisp_start", "Your gleaner wisp glints" }, { "item_stokerwisp", "Stoker Wisp" }, { "item_stokerwisp_desc", "In your base, carries fuel from your chests to fires running low.\n\n<color=#FF4A1C>Level 1</color> Eldr, the fire: fires and torches, one a trip\n<color=#FF4A1C>Level 2</color> Logi, fire itself: smelters, furnaces and kilns too, three a trip\n<color=#FF4A1C>Level 3</color> Surtr, the fire giant: five a trip, and it loads ore" }, { "se_stokerwisp", "Stoker Wisp" }, { "se_stokerwisp_tooltip", "Feeds your fires and furnaces from your chests." }, { "se_stokerwisp_start", "Your stoker wisp crackles warmly" }, { "item_stashwisp", "Stash Wisp" }, { "item_stashwisp_desc", "Put a sign reading \"Stash\" beside a chest and fill it: each stack goes to the chest where that item already lives. Items with no home stay put.\n\n<color=#C08040>Level 1</color> Tomte, the farm sprite: one stack a trip, chests within 10 m\n<color=#C08040>Level 2</color> Bryti, the steward: three a trip, 15 m, tops up part stacks first\n<color=#C08040>Level 3</color> Fulla, keeper of Frigg's casket: five a trip, 20 m, and items with no home get an empty chest" }, { "se_stashwisp", "Stash Wisp" }, { "se_stashwisp_tooltip", "Sorts the chest with the \"Stash\" sign into your other chests." }, { "se_stashwisp_start", "Your stash wisp eyes the clutter" }, { "item_herderwisp", "Herder Wisp" }, { "item_herderwisp_desc", "Brings food from your chests to hungry tames in your base and drops it beside them.\n\n<color=#C8FF2E>Level 1</color> Hirðir, the herdsman: food for two a trip\n<color=#C8FF2E>Level 2</color> Smali, the shepherd: food for five, the kind you have most of\n<color=#C8FF2E>Level 3</color> Gefjun, who ploughed with her oxen: and tames that wander out of the base are led back in" }, { "se_herderwisp", "Herder Wisp" }, { "se_herderwisp_tooltip", "Feeds hungry tames in your base from your chests." }, { "se_herderwisp_start", "Your herder wisp counts the herd" } }; } private void RegisterHearthItems() { //IL_0005: 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_002d: 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_0055: Unknown result type (might be due to invalid IL or missing references) Make<SE_HarvestWisp>("HarvestWisp", Green, HarvestCosts); Make<SE_GleanerWisp>("GleanerWisp", Gold, GleanCosts); Make<SE_StokerWisp>("StokerWisp", Ember, StokerCosts); Make<SE_StashWisp>("StashWisp", Bronze, StashCosts); Make<SE_HerderWisp>("HerderWisp", Lime, HerderCosts); } private static void Make<T>(string item, Color colour, WispCosts costs) where T : SE_Demister { //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) string text = item.ToLowerInvariant(); WispFactory.CheckItems(item, costs.Items); WispFactory.Create<T>(new WispDefinition { ItemName = item, StatusEffectName = "SE_" + item, BallName = item + "_ball", NameToken = "$item_" + text, DescriptionToken = "$item_" + text + "_desc", SeNameToken = "$se_" + text, SeStartToken = "$se_" + text + "_start", SeTooltipToken = "$se_" + text + "_tooltip", Colour = colour, IconDumpName = item + "_icon", CraftingStation = CraftingStations.GaldrTable, MaxQuality = 3, Requirements = costs.Requirements() }); } private static void AddHearthCommands() { CommandManager.Instance.AddConsoleCommand((ConsoleCommand)(object)new ScatterCommand()); CommandManager.Instance.AddConsoleCommand((ConsoleCommand)(object)new RipenCommand()); CommandManager.Instance.AddConsoleCommand((ConsoleCommand)(object)new DrainFuelCommand()); CommandManager.Instance.AddConsoleCommand((ConsoleCommand)(object)new FillChestCommand()); CommandManager.Instance.AddConsoleCommand((ConsoleCommand)(object)new StarveCommand()); CommandManager.Instance.AddConsoleCommand((ConsoleCommand)(object)new WanderCommand()); CommandManager.Instance.AddConsoleCommand((ConsoleCommand)(object)new AnchorInfoCommand()); } private void Awake() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown Log = ((BaseUnityPlugin)this).Logger; Instance = this; WLog.Event("plugin_awake", "version", "1.0.0"); BindConfig(); AddLocalization(); _harmony = new Harmony("com.studio2711.wisplings"); _harmony.PatchAll(typeof(WisplingsPlugin).Assembly); if (TestCommands.Value) { CommandManager.Instance.AddConsoleCommand((ConsoleCommand)(object)new DamagePiecesCommand()); CommandManager.Instance.AddConsoleCommand((ConsoleCommand)(object)new HurtCommand()); CommandManager.Instance.AddConsoleCommand((ConsoleCommand)(object)new SpawnHostileCommand()); CommandManager.Instance.AddConsoleCommand((ConsoleCommand)(object)new WardenReadyCommand()); CommandManager.Instance.AddConsoleCommand((ConsoleCommand)(object)new PhoenixReadyCommand()); CommandManager.Instance.AddConsoleCommand((ConsoleCommand)(object)new ScoutForgetCommand()); CommandManager.Instance.AddConsoleCommand((ConsoleCommand)(object)new DieCommand()); CommandManager.Instance.AddConsoleCommand((ConsoleCommand)(object)new WayfinderCommand()); CommandManager.Instance.AddConsoleCommand((ConsoleCommand)(object)new HurtTamesCommand()); CommandManager.Instance.AddConsoleCommand((ConsoleCommand)(object)new SerpentCommand()); CommandManager.Instance.AddConsoleCommand((ConsoleCommand)(object)new LeviathanDiveCommand()); AddHearthCommands(); } ((Component)this).gameObject.AddComponent<WayfinderGuide>(); RegisterRepairCosts(); UpgradeCosts.Hook(); ItemManager.OnItemsRegistered += delegate { SE_WardenShield.CopyVisuals(SE_WardenWisp.ShieldTemplate); }; PrefabManager.OnVanillaPrefabsAvailable += RegisterItems; } private void BindConfig() { //IL_03d1: Unknown result type (might be due to invalid IL or missing references) //IL_03db: Expected O, but got Unknown //IL_0410: Unknown result type (might be due to invalid IL or missing references) //IL_05c4: Unknown result type (might be due to invalid IL or missing references) //IL_05ce: Expected O, but got Unknown float[] array = new float[4] { 0f, 10f, 15f, 20f }; float[] array2 = new float[4] { 0f, 25f, 100f, 100f }; float[] array3 = new float[4] { 0f, 2f, 1.5f, 1.5f }; string[] array4 = new string[4] { "", "Dvergr", "Brokkr", "Eitri" }; for (int i = 1; i <= 3; i++) { string text = "Repair Wisp Level " + i; LevelRange[i] = ((BaseUnityPlugin)this).Config.Bind<float>(text, "Range", array[i], Admin($"Level {i} ({array4[i]}): how far from you (metres) it looks for damaged pieces.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(2f, 60f))); LevelRepairPercent[i] = ((BaseUnityPlugin)this).Config.Bind<float>(text, "RepairPercent", array2[i], Admin($"Level {i}: health restored per visit, as a percent of the piece's maximum. 100 = full repair in one visit.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 100f))); LevelWorkSeconds[i] = ((BaseUnityPlugin)this).Config.Bind<float>(text, "WorkSeconds", array3[i], Admin($"Level {i}: how long it hovers at a piece before the repair lands (seconds).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.2f, 30f))); } Level3SpreadRadius = ((BaseUnityPlugin)this).Config.Bind<float>("Repair Wisp Level 3", "SpreadRadius", 4f, Admin("Level 3: when a piece is repaired, a ripple fully repairs every damaged piece within this many metres of it. 0 turns the ripple off.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 15f))); UpgradeDragonEggs = ((BaseUnityPlugin)this).Config.Bind<int>("Repair Wisp Upgrades", "DragonEggs", 1, Admin("Dragon Eggs needed for each upgrade (level 2 and level 3).", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 10))); int[] array5 = new int[4] { 0, 0, 18, 54 }; int[] array6 = new int[4] { 0, 0, 7, 27 }; for (int j = 2; j <= 3; j++) { UpgradeEitr[j] = ((BaseUnityPlugin)this).Config.Bind<int>("Repair Wisp Upgrades", $"Level{j}Eitr", array5[j], Admin($"Refined Eitr needed to upgrade to level {j}.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 500))); UpgradeWisps[j] = ((BaseUnityPlugin)this).Config.Bind<int>("Repair Wisp Upgrades", $"Level{j}Wisps", array6[j], Admin($"Wisps needed to upgrade to level {j}.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 500))); } RepairScanInterval = ((BaseUnityPlugin)this).Config.Bind<float>("Repair Wisp", "ScanInterval", 1f, Admin("How often an idle wisp looks for work (seconds).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.25f, 10f))); RepairRespectWards = ((BaseUnityPlugin)this).Config.Bind<bool>("Repair Wisp", "RespectWards", true, Admin("If true, the wisp skips pieces inside wards you don't have access to.")); RepairRaidSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("Repair Wisp", "RaidSpeedMultiplier", 0.5f, Admin("Work speed during a raid. 0.5 = half speed, 1 = full speed, 0 = stop during raids.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f))); RepairReturnMargin = ((BaseUnityPlugin)this).Config.Bind<float>("Repair Wisp", "ReturnMargin", 8f, Admin("The wisp gives up and comes back if you get further from it than its range plus this many metres.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(2f, 40f))); RepairPriority = ((BaseUnityPlugin)this).Config.Bind<TargetPriority>("Repair Wisp", "Priority", TargetPriority.Auto, Admin("Which piece to fix next. Auto = nearest to the wisp normally, most damaged first during a raid.")); RepairSound = ((BaseUnityPlugin)this).Config.Bind<RepairSoundMode>("Repair Wisp", "Sound", RepairSoundMode.Chime, "Sound when the wisp repairs: Chime, Hammer (the game's build sound), Both or Off. Client-side."); RepairSoundVolume = ((BaseUnityPlugin)this).Config.Bind<float>("Repair Wisp", "SoundVolume", 0.8f, new ConfigDescription("Volume of the repair sound (0-1), on top of the game's SFX volume. Client-side.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>())); RepairGlowEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Repair Wisp", "Glow", true, "Show a glow and sparkles on a piece each time it's repaired. Client-side."); RepairGlowColour = ((BaseUnityPlugin)this).Config.Bind<Color>("Repair Wisp", "GlowColour", Amber, "Colour of the repair glow (RRGGBBAA hex). Amber by default; 4DFF6BFF gives a classic green 'heal' look. Client-side, applies after a restart."); BindSentinel((string t, AcceptableValueBase r) => Admin(t, r)); BindWarden((string t, AcceptableValueBase r) => Admin(t, r)); BindScout((string t, AcceptableValueBase r) => Admin(t, r)); BindPhoenix((string t, AcceptableValueBase r) => Admin(t, r)); BindBalm((string t, AcceptableValueBase r) => Admin(t, r)); BindWayfinder((string t, AcceptableValueBase r) => Admin(t, r)); BindMariner((string t, AcceptableValueBase r) => Admin(t, r)); BindStorm((string t, AcceptableValueBase r) => Admin(t, r)); BindHearth((string t, AcceptableValueBase r) => Admin(t, r)); BindAnchor((string t, AcceptableValueBase r) => Admin(t, r)); WispSoundVolume = ((BaseUnityPlugin)this).Config.Bind<float>("Wisps", "SoundVolume", 0.8f, new ConfigDescription("Volume of every wisp's sounds except the Repair Wisp's (0-1), on top of the game's SFX volume. Client-side.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>())); DebugLogging = ((BaseUnityPlugin)this).Config.Bind<bool>("Debug", "VerboseLogging", false, "Write detailed WISPLINGS| lines to the BepInEx log (every repair, heal, zap, pick and state change), and save the recoloured icons as PNGs under BepInEx/config/Wisplings. Off by default: the log then only shows loading, equipping and anything unusual."); TestCommands = ((BaseUnityPlugin)this).Config.Bind<bool>("Debug", "TestCommands", false, "Adds the wisplings_* console commands used to test the wisps (they also need devcommands). Applies after a restart."); static ConfigDescription Admin(string text2, AcceptableValueBase range = null) { //IL_000a: 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_0017: Expected O, but got Unknown //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown return new ConfigDescription(text2, range, new object[1] { (object)new ConfigurationManagerAttributes { IsAdminOnly = true } }); } } private void BindSentinel(Func<string, AcceptableValueBase, ConfigDescription> admin) { float[] array = new float[4] { 0f, 30f, 40f, 50f }; string[] array2 = new string[4] { "", "Vörðr", "Gjallarhorn", "Heimdallr" }; for (int i = 1; i <= 3; i++) { SentinelRange[i] = ((BaseUnityPlugin)this).Config.Bind<float>("Sentinel Wisp Level " + i, "Range", array[i], admin($"Level {i} ({array2[i]}): how far from you (metres) it watches for hostile creatures.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(5f, 80f))); } SentinelScanInterval = ((BaseUnityPlugin)this).Config.Bind<float>("Sentinel Wisp", "ScanInterval", 0.5f, admin("How often it looks around (seconds).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.2f, 5f))); SentinelIgnorePassive = ((BaseUnityPlugin)this).Config.Bind<bool>("Sentinel Wisp", "IgnorePassive", true, admin("If true, passive animals (deer, hares, chickens and the like) never trigger a warning.", null)); SentinelWarnDuringRaids = ((BaseUnityPlugin)this).Config.Bind<bool>("Sentinel Wisp", "WarnDuringRaids", true, admin("If false, it stays quiet during raids (it still pulses).", null)); SentinelChimeForEveryone = ((BaseUnityPlugin)this).Config.Bind<bool>("Sentinel Wisp", "ChimeForEveryone", false, admin("If true, other players near you hear its warning chime too. Off by default so a busy server doesn't get noisy. Everyone always sees the pulse.", null)); SentinelBehindWarning = ((BaseUnityPlugin)this).Config.Bind<bool>("Sentinel Wisp Level 3", "BehindWarning", true, admin("Level 3: a sharp flash and chime when a hostile fires a projectile at you from outside your view.", null)); SentinelBehindAngle = ((BaseUnityPlugin)this).Config.Bind<float>("Sentinel Wisp Level 3", "BehindAngle", 100f, admin("Level 3: how far from where the camera faces (degrees) the shooter must be to count as 'behind'.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(45f, 180f))); SentinelDirectionText = ((BaseUnityPlugin)this).Config.Bind<bool>("Sentinel Wisp Level 3", "ShowDirectionText", true, "Level 3: show a short line top left naming the threat and its compass direction (never distance or count). Client-side."); SentinelCosts = new WispCosts(((BaseUnityPlugin)this).Config, "Sentinel Wisp Costs", "SentinelWisp", "Wisp:18, Eitr:27, Carapace:9, BlackCore:4", "Wisp:22, Eitr:54, TrophySeekerBrute:2", "Wisp:40, Eitr:108, FlametalNew:9, TrophySeekerQueen:1", admin); } private void BindWarden(Func<string, AcceptableValueBase, ConfigDescription> admin) { float[] array = new float[4] { 0f, 75f, 120f, 175f }; float[] array2 = new float[4] { 0f, 120f, 100f, 80f }; string[] array3 = new string[4] { "", "Skjöldr", "Svalinn", "Ægishjálmr" }; for (int i = 1; i <= 3; i++) { string text = "Warden Wisp Level " + i; WardenAbsorb[i] = ((BaseUnityPlugin)this).Config.Bind<float>(text, "Absorb", array[i], admin($"Level {i} ({array3[i]}): how much damage the shield soaks up before it breaks.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(5f, 2000f))); WardenRecharge[i] = ((BaseUnityPlugin)this).Config.Bind<float>(text, "RechargeSeconds", array2[i], admin($"Level {i}: seconds out of combat it takes the wisp to bring the shield back after it breaks.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(5f, 1800f))); } WardenOnlyOutOfCombat = ((BaseUnityPlugin)this).Config.Bind<bool>("Warden Wisp", "RechargeOnlyOutOfCombat", true, admin("If true, the shield only recharges while you're out of combat.", null)); WardenCombatCooldown = ((BaseUnityPlugin)this).Config.Bind<float>("Warden Wisp", "CombatCooldown", 10f, admin("Seconds since you last attacked or were hit before you count as out of combat.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 120f))); WardenOverflow = ((BaseUnityPlugin)this).Config.Bind<bool>("Warden Wisp", "OverflowPassesThrough", true, admin("If true, a hit bigger than what's left of the shield breaks it and the rest of the damage reaches you. If false, the breaking hit is fully absorbed, like the Staff of Protection.", null)); WardenPulseRadius = ((BaseUnityPlugin)this).Config.Bind<float>("Warden Wisp Level 3", "PulseRadius", 6f, admin("Level 3: when the shield breaks, enemies within this many metres are staggered and pushed away. Bosses ignore it. 0 turns it off.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 20f))); WardenPulseForce = ((BaseUnityPlugin)this).Config.Bind<float>("Warden Wisp Level 3", "PulseForce", 80f, admin("Level 3: how hard the break pulse pushes.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 400f))); WardenCosts = new WispCosts(((BaseUnityPlugin)this).Config, "Warden Wisp Costs", "WardenWisp", "Wisp:27, Eitr:36, FlametalNew:14, BlackCore:5", "Wisp:32, Eitr:81, MoltenCore:3", "Wisp:63, Eitr:144, FlametalNew:27, TrophyFader:1", admin); } private void BindScout(Func<string, AcceptableValueBase, ConfigDescription> admin) { //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) float[] array = new float[4] { 0f, 20f, 30f, 40f }; string[] array2 = new string[4] { "", "Ratatoskr: pickables", "Huginn: + chests you haven't opened", "Muninn: + dungeon entrances" }; for (int i = 1; i <= 3; i++) { ScoutRange[i] = ((BaseUnityPlugin)this).Config.Bind<float>("Scout Wisp Level " + i, "Range", array[i], admin($"Level {i} ({array2[i]}): how far from you (metres) it looks.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(5f, 80f))); } ScoutScanInterval = ((BaseUnityPlugin)this).Config.Bind<float>("Scout Wisp", "ScanInterval", 2f, admin("How often it looks around (seconds).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.5f, 10f))); ScoutMarkerSeconds = ((BaseUnityPlugin)this).Config.Bind<float>("Scout Wisp", "MarkerSeconds", 6f, admin("How long a marker glows over a find (seconds). Chests and entrances glow half as long again.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 30f))); ScoutMaxMarksPerScan = ((BaseUnityPlugin)this).Config.Bind<int>("Scout Wisp", "MaxMarksPerScan", 6, admin("Most new finds marked in one scan, nearest first. The rest are marked on the next scans.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 30))); ScoutIgnore = ((BaseUnityPlugin)this).Config.Bind<string>("Scout Wisp", "IgnorePickables", "Pickable_Stone, Pickable_StoneRock, Pickable_Branch, Pickable_Branch_Snow, Pickable_Flint, Pickable_Snowball", admin("Pickables it never marks (prefab names, comma separated). Stones, branches and flint by default, since they're everywhere.", null)); ScoutIgnoreInsideBase = ((BaseUnityPlugin)this).Config.Bind<bool>("Scout Wisp", "IgnoreInsideBase", true, admin("If true, it doesn't mark pickables inside a base (near a workbench or fire), so your own crop fields don't light up.", null)); ScoutFindChests = ((BaseUnityPlugin)this).Config.Bind<bool>("Scout Wisp Level 2", "FindChests", true, admin("Level 2+: mark chests in the world that you haven't opened yet (never player-built chests).", null)); ScoutFindEntrances = ((BaseUnityPlugin)this).Config.Bind<bool>("Scout Wisp Level 3", "FindEntrances", true, admin("Level 3: mark dungeon entrances, and fly out to hover over a newly found one.", null)); ScoutGuideSeconds = ((BaseUnityPlugin)this).Config.Bind<float>("Scout Wisp Level 3", "GuideSeconds", 3f, admin("Level 3: how long it hovers over an entrance before coming back (seconds).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 15f))); ScoutMarkerColour = ((BaseUnityPlugin)this).Config.Bind<Color>("Scout Wisp", "MarkerColour", Pearl, "Colour of the markers over pickables and entrances (RRGGBBAA hex). Client-side."); ScoutChestColour = ((BaseUnityPlugin)this).Config.Bind<Color>("Scout Wisp", "ChestMarkerColour", PaleGold, "Colour of the markers over chests (RRGGBBAA hex). Client-side."); ScoutEntranceText = ((BaseUnityPlugin)this).Config.Bind<bool>("Scout Wisp Level 3", "ShowEntranceText", true, "Level 3: a short line top left when it finds an entrance, with the compass direction. Client-side."); ScoutCosts = new WispCosts(((BaseUnityPlugin)this).Config, "Scout Wisp Costs", "ScoutWisp", "Wisp:7, MushroomJotunPuffs:4, Eitr:5", "Wisp:5, Eitr:9, MushroomMagecap:4", "Wisp:11, Eitr:27, Wishbone:1", admin); } private void BindPhoenix(Func<string, AcceptableValueBase, ConfigDescription> admin) { float[] array = new float[4] { 0f, 0f, 10f, 25f }; float[] array2 = new float[4] { 0f, 0f, 2f, 3f }; bool[] array3 = new bool[4] { false, false, true, true }; string[] array4 = new string[4] { "", "Glóð", "Bál", "Líf" }; for (int i = 1; i <= 3; i++) { string text = "Phoenix Wisp Level " + i; PhoenixFloorPercent[i] = ((BaseUnityPlugin)this).Config.Bind<float>(text, "HealthFloorPercent", array[i], admin($"Level {i} ({array4[i]}): health you're left with after a save, as a percent of your maximum. 0 = 1 HP.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 100f))); PhoenixInvulnSeconds[i] = ((BaseUnityPlugin)this).Config.Bind<float>(text, "InvulnerableSeconds", array2[i], admin($"Level {i}: seconds after a save during which no damage lands, so you can get away. 0 = none.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 10f))); PhoenixCleanse[i] = ((BaseUnityPlugin)this).Config.Bind<bool>(text, "BurnAwayAilments", array3[i], admin($"Level {i}: if true, the flare burns away burning, poison, frost and smoke, so they can't finish you off.", null)); } PhoenixCooldown = ((BaseUnityPlugin)this).Config.Bind<float>("Phoenix Wisp", "CooldownSeconds", 0f, admin("Seconds of world time before it can save you again. 0 = one in-game day (about 30 minutes).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 86400f))); PhoenixNeverSaveFrom = ((BaseUnityPlugin)this).Config.Bind<string>("Phoenix Wisp", "NeverSaveFrom", "EdgeOfWorld, Drowning, Incinerator", admin("Kinds of death it never prevents (the game's hit types, comma separated). Others: Fall, Burning, Freezing, Poisoned, Smoke, AshlandsLava, AshlandsOcean.", null)); PhoenixFlareRadius = ((BaseUnityPlugin)this).Config.Bind<float>("Phoenix Wisp Level 3", "FlareRadius", 6f, admin("Level 3: enemies within this many metres are staggered, pushed away and set alight by the flare. Bosses ignore it. 0 turns it off.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 20f))); PhoenixFlareForce = ((BaseUnityPlugin)this).Config.Bind<float>("Phoenix Wisp Level 3", "FlareForce", 100f, admin("Level 3: how hard the flare pushes.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 400f))); PhoenixFlareFire = ((BaseUnityPlugin)this).Config.Bind<float>("Phoenix Wisp Level 3", "FlareFireDamage", 30f, admin("Level 3: fire damage the flare deals to each enemy it hits (it also sets them burning). 0 = push only.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 500f))); PhoenixCosts = new WispCosts(((BaseUnityPlugin)this).Config, "Phoenix Wisp Costs", "PhoenixWisp", "Wisp:22, Eitr:36, CelestialFeather:3, MoltenCore:2", "Wisp:27, Eitr:72, CelestialFeather:4, TrophyFallenValkyrie:1", "Wisp:54, Eitr:144, CelestialFeather:4, TrophyFader:1", admin); } private void BindBalm(Func<string, AcceptableValueBase, ConfigDescription> admin) { float[] array = new float[4] { 0f, 1f, 2f, 3f }; float[] array2 = new float[4] { 0f, 10f, 10f, 10f }; string[] array3 = new string[4] { "", "Lyf: you", "Hlíf: you and your tames", "Eir: you, your tames and other players" }; for (int i = 1; i <= 3; i++) { string text = "Balm Wisp Level " + i; BalmHealAmount[i] = ((BaseUnityPlugin)this).Config.Bind<float>(text, "HealAmount", array[i], admin($"Level {i} ({array3[i]}): health restored to each target every heal.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 50f))); BalmRange[i] = ((BaseUnityPlugin)this).Config.Bind<float>(text, "Range", array2[i], admin($"Level {i}: how far from you (metres) tames and other players are healed. Level 1 only heals you, so it ignores this.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 40f))); } BalmHealInterval = ((BaseUnityPlugin)this).Config.Bind<float>("Balm Wisp", "HealInterval", 2f, admin("Seconds between heals.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.5f, 30f))); BalmCombatCooldown = ((BaseUnityPlugin)this).Config.Bind<float>("Balm Wisp", "CombatCooldown", 8f, admin("Seconds since you (or the tame) last attacked or were hit before healing starts again.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 120f))); BalmHealTames = ((BaseUnityPlugin)this).Config.Bind<bool>("Balm Wisp", "HealTames", true, admin("Level 2+: heal your tames nearby (never while they're fighting).", null)); BalmHealPlayers = ((BaseUnityPlugin)this).Config.Bind<bool>("Balm Wisp", "HealPlayers", true, admin("Level 3: heal other players nearby (never while they're fighting). Two Balm Wisps never double-heal anyone.", null)); BalmHealNumbers = ((BaseUnityPlugin)this).Config.Bind<bool>("Balm Wisp", "ShowHealNumbers", true, "Show the game's green heal numbers each time it heals. Client-side (the healer's setting)."); BalmCosts = new WispCosts(((BaseUnityPlugin)this).Config, "Balm Wisp Costs", "BalmWisp", "Wisp:9, RoyalJelly:4, Sap:9, Eitr:7", "Wisp:7, Eitr:18, RoyalJelly:9", "Wisp:18, Eitr:45, TrophySeekerQueen:1", admin); } private void BindWayfinder(Func<string, AcceptableValueBase, ConfigDescription> admin) { //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Expected O, but got Unknown float[] array = new float[4] { 0f, 10f, 20f, 30f }; string[] array2 = new string[4] { "", "Fylgja: trail", "Hamingja: + light at night", "Valkyrja: + a column of light over the tombstone" }; for (int i = 1; i <= 3; i++) { WayfinderMinutes[i] = ((BaseUnityPlugin)this).Config.Bind<float>("Wayfinder Wisp Level " + i, "DurationMinutes", array[i], admin($"Level {i} ({array2[i]}): minutes of guiding after you respawn (counts only while you're alive in the world).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 240f))); } WayfinderLeadDistance = ((BaseUnityPlugin)this).Config.Bind<float>("Wayfinder Wisp", "LeadDistance", 10f, admin("How far ahead of you (metres) the guide floats on the way to your tombstone.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(3f, 40f))); WayfinderFadeDistance = ((BaseUnityPlugin)this).Config.Bind<float>("Wayfinder Wisp", "FadeDistance", 15f, admin("The guide hovers over your tombstone and fades out once you're this close (metres).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(3f, 60f))); WayfinderTrailSpacing = ((BaseUnityPlugin)this).Config.Bind<float>("Wayfinder Wisp", "TrailSpacing", 2.5f, "How often (metres) the guide leaves a spark behind. Client-side."); WayfinderTrailSeconds = ((BaseUnityPlugin)this).Config.Bind<float>("Wayfinder Wisp", "TrailSeconds", 20f, new ConfigDescription("How long each trail spark lingers (seconds). Client-side.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(2f, 120f), Array.Empty<object>())); WayfinderLanternRange = ((BaseUnityPlugin)this).Config.Bind<float>("Wayfinder Wisp Level 2", "LanternRange", 16f, admin("Level 2+: how far the guide's light reaches at night (metres).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(4f, 40f))); WayfinderBeaconRange = ((BaseUnityPlugin)this).Config.Bind<float>("Wayfinder Wisp Level 3", "BeaconRange", 50f, admin("Level 3: a column of light rises from your tombstone once you're within this many metres.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(10f, 150f))); WayfinderCosts = new WispCosts(((BaseUnityPlugin)this).Config, "Wayfinder Wisp Costs", "WayfinderWisp", "Wisp:5, BoneFragments:9, WitheredBone:4, Eitr:5", "Wisp:5, Eitr:9, SurtlingCore:2", "Wisp:11, Eitr:27, TrophyDraugrElite:1", admin); } private void BindMariner(Func<string, AcceptableValueBase, ConfigDescription> admin) { float[] array = new float[4] { 0f, 40f, 60f, 80f }; float[] array2 = new float[4] { 0f, 30f, 40f, 50f }; float[] array3 = new float[4] { 0f, 1.3f, 1.7f, 2.1f }; string[] array4 = new string[4] { "", "Vágr", "Njörðr: + names the creature and its direction", "Ægir: + warns before a Leviathan you're standing on dives" }; for (int i = 1; i <= 3; i++) { string text = "Mariner Wisp Level " + i; MarinerWarnRange[i] = ((BaseUnityPlugin)this).Config.Bind<float>(text, "WarnRange", array[i], admin($"Level {i} ({array4[i]}): how far from your ship (metres) it warns of sea creatures.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(10f, 150f))); MarinerLampRange[i] = ((BaseUnityPlugin)this).Config.Bind<float>(text, "LampRange", array2[i], admin($"Level {i}: how far the light over the ship reaches (metres).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(5f, 80f))); MarinerLampIntensity[i] = ((BaseUnityPlugin)this).Config.Bind<float>(text, "LampIntensity", array3[i], admin($"Level {i}: how bright the light over the ship is.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.2f, 6f))); } MarinerScanInterval = ((BaseUnityPlugin)this).Config.Bind<float>("Mariner Wisp", "ScanInterval", 0.5f, admin("How often it looks around (seconds).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.2f, 5f))); MarinerSeaCreatures = ((BaseUnityPlugin)this).Config.Bind<string>("Mariner Wisp", "SeaCreatures", "Serpent, BonemawSerpent", admin("Creatures it always warns about while you sail (prefab names, comma separated).", null)); MarinerWarnSwimmers = ((BaseUnityPlugin)this).Config.Bind<bool>("Mariner Wisp", "WarnAnySwimmingHostile", true, admin("If true, it also warns about any other hostile creature swimming near the ship.", null)); MarinerDaylightLamp = ((BaseUnityPlugin)this).Config.Bind<bool>("Mariner Wisp", "LampInDaylight", false, admin("If true, the light over the ship is on in daytime too. Off by default: it's a night light.", null)); MarinerMastHeight = ((BaseUnityPlugin)this).Config.Bind<float>("Mariner Wisp", "MastHeight", 1.5f, admin("How far above the top of the mast it hovers while you're aboard (metres).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(-5f, 10f))); MarinerChimeForEveryone = ((BaseUnityPlugin)this).Config.Bind<bool>("Mariner Wisp", "ChimeForEveryone", false, admin("If true, everyone near the ship hears its warning chime. Off by default; everyone always sees the pulse and the light.", null)); MarinerDirectionText = ((BaseUnityPlugin)this).Config.Bind<bool>("Mariner Wisp Level 2", "ShowDirectionText", true, "Level 2+: show a short line top left naming the creature and its compass direction. Client-side."); MarinerLeviathanWarning = ((BaseUnityPlugin)this).Config.Bind<bool>("Mariner Wisp Level 3", "LeviathanWarning", true, admin("Level 3: warn and count down when a Leviathan you're standing on is about to dive.", null)); MarinerLeviathanRadius = ((BaseUnityPlugin)this).Config.Bind<float>("Mariner Wisp Level 3", "LeviathanRadius", 20f, admin("Level 3: how close (metres, ignoring height) you must be to a Leviathan to count as standing on it.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(5f, 60f))); MarinerCosts = new WispCosts(((BaseUnityPlugin)this).Config, "Mariner Wisp Costs", "MarinerWisp", "Wisp:7, Chitin:9, SerpentScale:4, Eitr:5", "Wisp:5, Eitr:14, Chitin:9", "Wisp:11, Eitr:27, TrophySerpent:1", admin); } internal static HashSet<string> MarinerSeaCreatureSet() { string text = MarinerSeaCreatures.Value ?? ""; if (text == _seaRaw) { return _seaSet; } _seaRaw = text; HashSet<string> hashSet = new HashSet<string>(); string[] array = text.Split(','); for (int i = 0; i < array.Length; i++) { string text2 = array[i].Trim(); if (text2.Length > 0) { hashSet.Add(text2); } } _seaSet = hashSet; return hashSet; } private void BindStorm(Func<string, AcceptableValueBase, ConfigDescription> admin) { float[] array = new float[4] { 0f, 10f, 20f, 25f }; float[] array2 = new float[4] { 0f, 4f, 3f, 3f }; string[] array3 = new string[4] { "", "Þruma", "Mjölnir", "Þórr: + arcs to one more enemy" }; for (int i = 1; i <= 3; i++) { string text = "Storm Wisp Level " + i; StormDamage[i] = ((BaseUnityPlugin)this).Config.Bind<float>(text, "Damage", array[i], admin($"Level {i} ({array3[i]}): lightning damage per zap (before the target's resistances).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 500f))); StormCooldown[i] = ((BaseUnityPlugin)this).Config.Bind<float>(text, "CooldownSeconds", array2[i], admin($"Level {i}: seconds between zaps.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.5f, 60f))); } StormRange = ((BaseUnityPlugin)this).Config.Bind<float>("Storm Wisp", "Range", 15f, admin("How far from you (metres) it goes after enemies.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(4f, 40f))); StormOnlyEnemiesInCombat = ((BaseUnityPlugin)this).Config.Bind<bool>("Storm Wisp", "OnlyEnemiesInCombat", true, admin("If true, it only zaps enemies already fighting you, another player or a tame, so it never starts a fight or wakes something you're sneaking past.", null)); StormChargeSeconds = ((BaseUnityPlugin)this).Config.Bind<float>("Storm Wisp", "ChargeSeconds", 0.45f, admin("How long it crackles over an enemy before each zap (seconds).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 3f))); StormChainRange = ((BaseUnityPlugin)this).Config.Bind<float>("Storm Wisp Level 3", "ChainRange", 4f, admin("Level 3: each zap arcs to the nearest other enemy within this many metres of the first. 0 turns it off.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 15f))); StormChainFraction = ((BaseUnityPlugin)this).Config.Bind<float>("Storm Wisp Level 3", "ChainFraction", 0.5f, admin("Level 3: the arc's damage as a fraction of the zap's. 0 turns the arc off.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f))); StormHitEffect = ((BaseUnityPlugin)this).Config.Bind<string>("Storm Wisp", "HitEffect", "fx_lightningweapon_hit", "The game's own effect played where a zap lands (prefab name; empty = none). Client-side, applies after a restart."); StormHitSound = ((BaseUnityPlugin)this).Config.Bind<string>("Storm Wisp", "HitSound", "sfx_weapons_lightning_impact", "The game's own sound played where a zap lands (prefab name; empty = the wisp chime). Client-side, applies after a restart."); StormChainSound = ((BaseUnityPlugin)this).Config.Bind<string>("Storm Wisp", "ChainSound", "sfx_weapons_lightning_chain", "Sound for the level 3 arc (prefab name; empty = the hit sound). Client-side, applies after a restart."); StormCosts = new WispCosts(((BaseUnityPlugin)this).Config, "Storm Wisp Costs", "StormWisp", "Wisp:18, Thunderstone:4, FlametalNew:9, Eitr:18", "Wisp:14, Eitr:36, Thunderstone:4", "Wisp:36, Eitr:90, TrophyFader:1", admin); } private static void RegisterRepairCosts() { UpgradeCosts.Register("RepairWisp", "BlackMetal", (int q) => (q <= 1) ? 4 : 0); UpgradeCosts.Register("RepairWisp", "Iron", (int q) => (q <= 1) ? 4 : 0); UpgradeCosts.Register("RepairWisp", "Eitr", (int q) => (q > 1) ? ((q != 2) ? UpgradeEitr[3].Value : UpgradeEitr[2].Value) : 11); UpgradeCosts.Register("RepairWisp", "Wisp", (int q) => (q > 1) ? ((q != 2) ? UpgradeWisps[3].Value : UpgradeWisps[2].Value) : 11); UpgradeCosts.Register("RepairWisp", "DragonEgg", (int q) => (q > 1) ? UpgradeDragonEggs.Value : 0); } private void AddLocalization() { CustomLocalization localization = LocalizationManager.Instance.GetLocalization(); string text = "English"; localization.AddTranslation(ref text, HearthTranslations()); CustomLocalization localization2 = LocalizationManager.Instance.GetLocalization(); text = "English"; localization2.AddTranslation(ref text, AnchorTranslations()); CustomLocalization localization3 = LocalizationManager.Instance.GetLocalization(); text = "English"; localization3.AddTranslation(ref text, new Dictionary<string, string> { { "item_repairwisp", "Repair Wisp" }, { "item_repairwisp_desc", "Mends your damaged buildings nearby, piece by piece. Slower during a raid.\n\n<color=orange>Level 1</color> Dvergr, the dwarf: 25% per visit, 10 m\n<color=orange>Level 2</color> Brokkr, the dwarf-smith: full repair, 15 m\n<color=orange>Level 3</color> Eitri, the master smith: full repair that ripples to pieces nearby, 20 m" }, { "se_repairwisp", "Repair Wisp" }, { "se_repairwisp_tooltip", "Mends your buildings, piece by piece." }, { "se_repairwisp_start", "Your repair wisp looks for work" }, { "item_sentinelwisp", "Sentinel Wisp" }, { "item_sentinelwisp_desc", "Pulses and chimes when something hostile comes near, faster as it closes in. Warns; never protects.\n\n<color=#FF2BD6>Level 1</color> Vörðr, the watching spirit: 30 m\n<color=#FF2BD6>Level 2</color> Gjallarhorn, the horn that wakes the gods: 40 m, a deeper chime for bosses and starred creatures\n<color=#FF2BD6>Level 3</color> Heimdallr, the watchman of the gods: 50 m, names the threat and its direction, warns of shots from behind" }, { "se_sentinelwisp", "Sentinel Wisp" }, { "se_sentinelwisp_tooltip", "Pulses when something hostile comes near, faster the closer it gets." }, { "se_sentinelwisp_start", "Your sentinel wisp keeps watch" }, { "item_wardenwisp", "Warden Wisp" }, { "item_wardenwisp_desc", "A shield that soaks up damage until it breaks, then recharges while you're out of combat.\n\n<color=#2F6BFF>Level 1</color> Skjöldr, the shield: absorbs 75, recharges in 120 s\n<color=#2F6BFF>Level 2</color> Svalinn, the shield before the sun: absorbs 120, 100 s\n<color=#2F6BFF>Level 3</color> Ægishjálmr, the helm of awe: absorbs 175, 80 s, and the breaking shield throws enemies back" }, { "se_wardenwisp", "Warden Wisp" }, { "se_wardenwisp_tooltip", "A shield around you while it glows. Once broken, it recharges out of combat." }, { "se_wardenwisp_start", "Your warden wisp stands guard" }, { "se_wardenshield", "Warden's Shield" }, { "se_wardenshield_tooltip", "Soaks up damage until it breaks. Your Warden Wisp brings it back once you're out of combat." }, { "item_scoutwisp", "Scout Wisp" }, { "item_scoutwisp_desc", "Marks things worth picking up with a glow only you see. Never touches your map.\n\n<color=#F2F4FF>Level 1</color> Ratatoskr, the running messenger: pickables within 20 m\n<color=#F2F4FF>Level 2</color> Huginn, thought: 30 m, and chests you haven't opened\n<color=#F2F4FF>Level 3</color> Muninn, memory: 40 m, and dungeon entrances; it flies out to show the way in" }, { "se_scoutwisp", "Scout Wisp" }, { "se_scoutwisp_tooltip", "Marks things worth picking up with a brief glow." }, { "se_scoutwisp_start", "Your scout wisp looks around" }, { "item_phoenixwisp", "Phoenix Wisp" }, { "item_phoenixwisp_desc", "Once a day, a blow that would kill you leaves you alive instead. Then it goes dark until it recharges.\n\n<color=#D0102A>Level 1</color> Glóð, the ember: leaves you at 1 health\n<color=#D0102A>Level 2</color> Bál, the pyre: 10%, 2 s untouchable, burns away poison, fire and frost\n<color=#D0102A>Level 3</color> Líf, who outlives Ragnarök: 25%, 3 s untouchable, and the flare throws enemies back in flames" }, { "se_phoenixwisp", "Phoenix Wisp" }, { "se_phoenixwisp_tooltip", "Saves you from one killing blow a day. The number is the time until it burns again." }, { "se_phoenixwisp_start", "Your phoenix wisp burns bright" }, { "se_phoenixwisp_saved", "Your Phoenix Wisp bursts into flame. You live!" }, { "se_phoenixwisp_ready", "Your phoenix wisp burns bright again" }, { "item_balmwisp", "Balm Wisp" }, { "item_balmwisp_desc", "Heals slowly between fights, never during them.\n\n<color=#FF8FB8>Level 1</color> Lyf, the healing herb: 1 health every 2 s\n<color=#FF8FB8>Level 2</color> Hlíf, the sheltering maiden: 2 every 2 s, and your tames within 10 m\n<color=#FF8FB8>Level 3</color> Eir, the goddess of healing: 3 every 2 s, your tames and other players within 10 m" }, { "se_balmwisp", "Balm Wisp" }, { "se_balmwisp_tooltip", "Slow healing out of combat. After a fight, the number counts down to when it starts again." }, { "se_balmwisp_start", "Your balm wisp hums softly" }, { "item_wayfinderwisp", "Wayfinder Wisp" }, { "item_wayfinderwisp_desc", "Die wearing it and a guide waits for you when you wake, drifting ahead toward your tombstone.\n\n<color=#9FB4C8>Level 1</color> Fylgja, the follower spirit: a trail for 10 minutes\n<color=#9FB4C8>Level 2</color> Hamingja, the luck that walks with you: 20 minutes, and it lights the way at night\n<color=#9FB4C8>Level 3</color> Valkyrja, the chooser of the slain: 30 minutes, and a column of light over the tombstone within 50 m" }, { "se_wayfinderwisp", "Wayfinder Wisp" }, { "se_wayfinderwisp_tooltip", "If you die wearing it, a guide leads you back to your tombstone." }, { "se_wayfinderwisp_start", "Your wayfinder wisp keeps watch" }, { "wayfinder_waits", "Your Wayfinder Wisp waits to lead you back" }, { "wayfinder_arrived", "Your tombstone is near. The Wayfinder fades" }, { "wayfinder_timeout", "Your Wayfinder Wisp fades away" }, { "wayfinder_gone", "Your tombstone is gone. The Wayfinder fades" }, { "item_marinerwisp", "Mariner Wisp" }, { "item_marinerwisp_desc", "Aboard a ship it climbs to the masthead, lights the water at night and warns of serpents and other swimmers. Ashore, a plain light.\n\n<color=#2ED9C3>Level 1</color> Vágr, the wave: warns within 40 m\n<color=#2ED9C3>Level 2</color> Njörðr, the god of seafarers: 60 m, a brighter light, names the creature and its direction\n<color=#2ED9C3>Level 3</color> Ægir, the sea itself: 80 m, the widest light, and a warning before a Leviathan you stand on dives" }, { "se_marinerwisp", "Mariner Wisp" }, { "se_marinerwisp_tooltip", "Lights the water and warns of what circles below. The number is how far away the nearest one is." }, { "se_marinerwisp_start", "Your mariner wisp tastes the salt air" }, { "mariner_dive", "The Leviathan is diving!" }, { "item_stormwisp", "Storm Wisp" }, { "item_stormwisp_desc", "Zaps enemies already fighting you or your companions with small lightning hits. Never starts a fight, never touches animals, tames or players.\n\n<color=#7A2BFF>Level 1</color> Þruma, the thunder: 10 lightning every 4 s\n<color=#7A2BFF>Level 2</color> Mjölnir, the hammer: 20 every 3 s\n<color=#7A2BFF>Level 3</color> Þórr, the thunder god: 25 every 3 s, arcing to one more enemy nearby" }, { "se_stormwisp", "Storm Wisp" }, { "se_stormwisp_tooltip", "Zaps enemies that are already fighting you." }, { "se_stormwisp_start", "Your storm wisp crackles" } }); } private void RegisterItems() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Expected O, but got Unknown //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Expected O, but got Unknown //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Expected O, but got Unknown //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Expected O, but got Unknown //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Expected O, but got Unknown //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Expected O, but got Unknown //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_033f: Unknown result type (might be due to invalid IL or missing references) //IL_0344: Unknown result type (might be due to invalid IL or missing references) //IL_03ef: Unknown result type (might be due to invalid IL or missing references) //IL_03f4: Unknown result type (might be due to invalid IL or missing references) //IL_049f: Unknown result type (might be due to invalid IL or missing references) //IL_04a4: Unknown result type (might be due to invalid IL or missing references) //IL_054f: Unknown result type (might be due to invalid IL or missing references) //IL_0554: Unknown result type (might be due to invalid IL or missing references) //IL_05ff: Unknown result type (might be due to invalid IL or missing references) //IL_0604: Unknown result type (might be due to invalid IL or missing references) //IL_06af: Unknown result type (might be due to invalid IL or missing references) //IL_06b4: Unknown result type (might be due to invalid IL or missing references) PrefabManager.OnVanillaPrefabsAvailable -= RegisterItems; GameObject prefab = PrefabManager.Instance.GetPrefab("demister_ball"); RepairFx.Init(prefab); RepairGlow.Init(prefab, RepairGlowColour.Value); WispMarker.Init(prefab); StormBolt.Init(prefab); WispDefinition wispDefinition = new WispDefinition(); wispDefinition.ItemName = "RepairWisp"; wispDefinition.StatusEffectName = "SE_RepairWisp"; wispDefinition.BallName = "RepairWisp_ball"; wispDefinition.NameToken = "$item_repairwisp"; wispDefinition.DescriptionToken = "$item_repairwisp_desc"; wispDefinition.SeNameToken = "$se_repairwisp"; wispDefinition.SeStartToken = "$se_repairwisp_start"; wispDefinition.SeTooltipToken = "$se_repairwisp_tooltip"; wispDefinition.Colour = Amber; wispDefinition.IconDumpName = "RepairWisp_icon"; wispDefinition.CraftingStation = CraftingStations.GaldrTable; wispDefinition.MaxQuality = 3; wispDefinition.Requirements = (RequirementConfig[])(object)new RequirementConfig[5] { new RequirementConfig("BlackMetal", 4, 0, true), new RequirementConfig("Eitr", 11, 18, true), new RequirementConfig("Iron", 4, 0, true), new RequirementConfig("Wisp", 11, 7, true), new RequirementConfig("DragonEgg", 0, 1, true) }; WispFactory.Create<SE_RepairWisp>(wispDefinition); WispFactory.CheckItems("SentinelWisp", SentinelCosts.Items); WispFactory.Create<SE_SentinelWisp>(new WispDefinition { ItemName = "SentinelWisp", StatusEffectName = "SE_SentinelWisp", BallName = "SentinelWisp_ball", NameToken = "$item_sentinelwisp", DescriptionToken = "$item_sentinelwisp_desc", SeNameToken = "$se_sentinelwisp", SeStartToken = "$se_sentinelwisp_start", SeTooltipToken = "$se_sentinelwisp_tooltip", Colour = Magenta, IconDumpName = "SentinelWisp_icon", CraftingStation = CraftingStations.GaldrTable, MaxQuality = 3, Requirements = SentinelCosts.Requirements() }); SE_WardenShield sE_WardenShield = ScriptableObject.CreateInstance<SE_WardenShield>(); ((Object)sE_WardenShield).name = "SE_WardenShield"; ((StatusEffect)sE_WardenShield).m_name = "$se_wardenshield"; ((StatusEffect)sE_WardenShield).m_tooltip = "$se_wardenshield_tooltip"; ItemManager.Instance.AddStatusEffect(new CustomStatusEffect((StatusEffect)(object)sE_WardenShield, false)); SE_WardenWisp.ShieldTemplate = sE_WardenShield; WispFactory.CheckItems("WardenWisp", WardenCosts.Items); WispFactory.Create<SE_WardenWisp>(new WispDefinition { ItemName = "WardenWisp", StatusEffectName = "SE_WardenWisp", BallName = "WardenWisp_ball", NameToken = "$item_wardenwisp", DescriptionToken = "$item_wardenwisp_desc", SeNameToken = "$se_wardenwisp", SeStartToken = "$se_wardenwisp_start", SeTooltipToken = "$se_wardenwisp_tooltip", Colour = Cobalt, IconDumpName = "WardenWisp_icon", CraftingStation = CraftingStations.GaldrTable, MaxQuality = 3, Requirements = WardenCosts.Requirements() }); WispFactory.CheckItems("ScoutWisp", ScoutCosts.Items); WispFactory.Create<SE_ScoutWisp>(new WispDefinition { ItemName = "ScoutWisp", StatusEffectName = "SE_ScoutWisp", BallName = "ScoutWisp_ball", NameToken = "$item_scoutwisp", DescriptionToken = "$item_scoutwisp_desc", SeNameToken = "$se_scoutwisp", SeStartToken = "$se_scoutwisp_start", SeTooltipToken = "$se_scoutwisp_tooltip", Colour = Pearl, IconDumpName = "ScoutWisp_icon", CraftingStation = CraftingStations.GaldrTable, MaxQuality = 3, Requirements = ScoutCosts.Requirements() }); WispFactory.CheckItems("PhoenixWisp", PhoenixCosts.Items); WispFactory.Create<SE_PhoenixWisp>(new WispDefinition { ItemName = "PhoenixWisp", StatusEffectName = "SE_PhoenixWisp", BallName = "PhoenixWisp_ball", NameToken = "$item_phoenixwisp", DescriptionToken = "$item_phoenixwisp_desc", SeNameToken = "$se_phoenixwisp", SeStartToken = "$se_phoenixwisp_start", SeTooltipToken = "$se_phoenixwisp_tooltip", Colour = Crimson, IconDumpName = "PhoenixWisp_icon", CraftingStation = CraftingStations.GaldrTable, MaxQuality = 3, Requirements = PhoenixCosts.Requirements() }); WispFactory.CheckItems("BalmWisp", BalmCosts.Items); WispFactory.Create<SE_BalmWisp>(new WispDefinition { ItemName = "BalmWisp", StatusEffectName = "SE_BalmWisp", BallName = "BalmWisp_ball", NameToken = "$item_balmwisp", DescriptionToken = "$item_balmwisp_desc", SeNameToken = "$se_balmwisp", SeStartToken = "$se_balmwisp_start", SeTooltipToken = "$se_balmwisp_tooltip", Colour = Rose, IconDumpName = "BalmWisp_icon", CraftingStation = CraftingStations.GaldrTable, MaxQuality = 3, Requirements = BalmCosts.Requirements() }); WispFactory.CheckItems("WayfinderWisp", WayfinderCosts.Items); WispFactory.Create<SE_WayfinderWisp>(new WispDefinition { ItemName = "WayfinderWisp", StatusEffectName = "SE_WayfinderWisp", BallName = "WayfinderWisp_ball", NameToken = "$item_wayfinderwisp", DescriptionToken = "$item_wayfinderwisp_desc", SeNameToken = "$se_wayfinderwisp", SeStartToken = "$se_wayfinderwisp_start", SeTooltipToken = "$se_wayfinderwisp_tooltip", Colour = SpiritGrey, IconDumpName = "WayfinderWisp_icon", CraftingStation = CraftingStations.GaldrTable, MaxQuality = 3, Requirements = WayfinderCosts.Requirements() }); WispFactory.CheckItems("MarinerWisp", MarinerCosts.Items); WispFactory.Create<SE_MarinerWisp>(new WispDefinition { ItemName = "MarinerWisp", StatusEffectName = "SE_MarinerWisp", BallName = "MarinerWisp_ball", NameToken = "$item_marinerwisp", DescriptionToken = "$item_marinerwisp_desc", SeNameToken = "$se_marinerwisp", SeStartToken = "$se_marinerwisp_start", SeTooltipToken = "$se_marinerwisp_tooltip", Colour = Teal, IconDumpName = "MarinerWisp_icon", CraftingStation = CraftingStations.GaldrTable, MaxQuality = 3, Requirements = MarinerCosts.Requirements() }); WispFactory.CheckItems("StormWisp", StormCosts.Items); WispFactory.Create<SE_StormWisp>(new WispDefinition { ItemName = "StormWisp", StatusEffectName = "SE_StormWisp", BallName = "StormWisp_ball", NameToken = "$item_stormwisp", DescriptionToken = "$item_stormwisp_desc", SeNameToken = "$se_stormwisp", SeStartToken = "$se_stormwisp_start", SeTooltipToken = "$se_stormwisp_tooltip", Colour = Violet, IconDumpName = "StormWisp_icon", CraftingStation = CraftingStations.GaldrTable, MaxQuality = 3, Requirements = StormCosts.Requirements() }); RegisterHearthItems(); RegisterAnchorItems(); } } internal class DamagePiecesCommand : ConsoleCommand { public override string Name => "wisplings_damage"; public override string Help => "Wisplings test: damage your built pieces nearby. Usage: wisplings_damage [percent=50] [range=10]"; public override bool IsCheat => true; public override void Run(string[] args) { //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null) { Console.instance.Print("No local player."); return; } float num = ((args.Length != 0 && float.TryParse(args[0], NumberStyles.Float, CultureInfo.InvariantCulture, out var result)) ? result : 50f); float result2; float num2 = ((args.Length > 1 && float.TryParse(args[1], NumberStyles.Float, CultureInfo.InvariantCulture, out result2)) ? result2 : 10f); num = Mathf.Clamp(num, 1f, 99f); int num3 = 0; foreach (WearNTear allInstance in WearNTear.GetAllInstances()) { if (!((Object)(object)allInstance == (Object)null) && !(Vector3.Distance(((Component)allInstance).transform.position, ((Component)localPlayer).transform.position) > num2)) { Piece component = ((Component)allInstance).GetComponent<Piece>(); if (!((Object)(object)component == (Object)null) && component.IsPlacedByPlayer() && RepairRpc.Send(allInstance, (0f - allInstance.m_health) * num / 100f)) { num3++; } } } Console.instance.Print($"Wisplings: damaged {num3} pieces by {num}% within {num2} m."); WLog.Event("test_damage", "pieces", num3, "percent", num, "range", num2); } } internal class HurtCommand : ConsoleCommand { public override string Name => "wisplings_hurt"; public override string Help => "Wisplings test: hit yourself for some blunt damage, to test the Warden's shield. Usage: wisplings_hurt [amount=40]"; public override bool IsCheat => true; public override void Run(string[] args) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: 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_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Expected O, but got Unknown Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null) { Console.instance.Print("No local player."); return; } float result; float num = ((args.Length != 0 && float.TryParse(args[0], NumberStyles.Float, CultureInfo.InvariantCulture, out result)) ? result : 40f); HitData val = new HitData { m_point = ((Character)localPlayer).GetCenterPoint(), m_dir = -((Component)localPlayer).transform.forward, m_dodgeable = false, m_blockable = false }; val.m_damage.m_blunt = Mathf.Max(0f, num); float health = ((Character)localPlayer).GetHealth(); ((Character)localPlayer).Damage(val); Console.instance.Print($"Wisplings: hit yourself for {num} blunt damage."); WLog.Event("test_hurt", "amount", num, "healthBefore", health); } } internal class SpawnHostileCommand : ConsoleCommand { public override string Name => "wisplings_spawnhostile"; public override string Help => "Wisplings test: spawn a creature behind you, to test the Sentinel. Usage: wisplings_spawnhostile [prefab=Greydwarf] [distance=30] [stars=0]"; public override bool IsCheat => true; public override void Run(string[] args) { //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null || (Object)(object)ZNetScene.instance == (Object)null) { Console.instance.Print("No local player."); return; } string text = ((args.Length != 0) ? args[0] : "Greydwarf"); float result; float num = ((args.Length > 1 && float.TryParse(args[1], NumberStyles.Float, CultureInfo.InvariantCulture, out result)) ? result : 30f); int result2; int num2 = ((args.Length > 2 && int.TryParse(args[2], out result2)) ? Mathf.Clamp(result2, 0, 2) : 0); GameObject prefab = ZNetScene.instance.GetPrefab(text); if ((Object)(object)prefab == (Object)null || (Object)(object)prefab.GetComponent<Character>() == (Object)null) { Console.instance.Print("No creature called " + text + "."); return; } Vector3 val = -((Component)localPlayer).transform.forward; val.y = 0f; Vector3 val2 = ((Component)localPlayer).transform.position + ((Vector3)(ref val)).normalized * num; if ((Object)(object)ZoneSystem.instance != (Object)null) { val2.y = Mathf.Max(ZoneSystem.instance.GetGroundHeight(val2), val2.y - 20f) + 0.5f; } Character component = Object.Instantiate<GameObject>(prefab, val2, Quaternion.LookRotation(-val)).GetComponent<Character>(); if ((Object)(object)component != (Object)null && num2 > 0) { component.SetLevel(num2 + 1); } Console.instance.Print($"Wisplings: spawned {text} ({num2} stars) {num} m behind you."); WLog.Event("test_spawn", "prefab", text, "distance", num, "stars", num2, "dir", Compass.From(((Component)localPlayer).transform.position, val2)); } } internal class WardenReadyCommand : ConsoleCommand { public override string Name => "wisplings_wardenready"; public override string Help => "Wisplings test: recharge your Warden Wisp's shield now."; public override bool IsCheat => true; public override void Run(string[] args) { if ((Object)(object)SE_WardenWisp.ActiveLocal == (Object)null) { Console.instance.Print("Wisplings: no Warden Wisp equipped."); return; } SE_WardenWisp.ActiveLocal.ForceRecharge(); Console.instance.Print("Wisplings: Warden shield recharged."); } } internal class PhoenixReadyCommand : ConsoleCommand { public override string Name => "wisplings_phoenixready"; public override string Help => "Wisplings test: recharge your Phoenix Wisp now (it's ready again within half a second)."; public override bool IsCheat => true; public override void Run(string[] args) { if ((Object)(object)SE_PhoenixWisp.ActiveLocal == (Object)null) { Console.instance.Print("Wisplings: no Phoenix Wisp equipped."); return; } SE_PhoenixWisp.ActiveLocal.ForceReady(); Console.instance.Print("Wisplings: Phoenix Wisp recharged."); } } internal class ScoutForgetCommand : ConsoleCommand { public override string Name => "wisplings_scoutforget"; public override string Help => "Wisplings test: the Scout Wisp forgets what it has already marked, so the next scan marks everything again."; public override bool IsCheat => true; public override void Run(string[] args) { if ((Object)(object)SE_ScoutWisp.ActiveLocal == (Object)null) { Console.instance.Print("Wisplings: no Scout Wisp equipped (or it hasn't scanned yet)."); return; } int num = SE_ScoutWisp.ActiveLocal.ForgetAll(); Console.instance.Print($"Wisplings: Scout forgot {num} marks."); WLog.Event("test_scout_forget", "forgot", num); } } internal class DieCommand : ConsoleCommand { public override string Name => "wisplings_die"; public override string Help => "Wisplings test: die on the spot, to test the Wayfinder Wisp. A charged Phoenix Wisp still saves you."; public override bool IsCheat => true; public override void Run(string[] args) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Expected O, but got Unknown //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null || ((Character)localPlayer).IsDead()) { Console.instance.Print("No living local player."); return; } int num = WispLevel.