예제 #1
0
        internal static void CheckMoneyPit()
        {
            if (Main.Character.pit.pitTime.totalseconds < Main.Character.pitController.currentPitTime())
            {
                return;
            }
            if (Main.Character.realGold < Main.Settings.MoneyPitThreshold)
            {
                return;
            }
            if (Main.Character.realGold < 1e5)
            {
                return;
            }

            if (Main.Settings.MoneyPitLoadout.Length > 0)
            {
                if (!LoadoutManager.TryMoneyPitSwap())
                {
                    return;
                }
            }
            if (Main.Character.realGold >= 1e50 && Main.Settings.ManageMagic && Main.Character.wishes.wishes[4].level > 0)
            {
                Main.Character.removeMostMagic();
                for (var i = Main.Character.bloodMagic.ritual.Count - 1; i >= 0; i--)
                {
                    Main.Character.bloodMagicController.bloodMagics[i].cap();
                }

                if (!DiggerManager.CanSwap())
                {
                    return;
                }
                DiggerManager.SaveDiggers();
                DiggerManager.EquipDiggers(new[] { 10 });
                DoMoneyPit();
                DiggerManager.RestoreDiggers();
            }
            else
            {
                DoMoneyPit();
            }

            if (Main.Settings.MoneyPitLoadout.Length > 0)
            {
                if (LoadoutManager.SwappedQuestToMoneyPit)
                {
                    LoadoutManager.RestoreQuestLayoutFromPit();
                }
                else
                {
                    LoadoutManager.RestoreGear();
                    LoadoutManager.ReleaseLock();
                }
            }
        }
예제 #2
0
        internal void ManageYggHarvest()
        {
            //We need to harvest but we dont have a loadout to manage OR we're not managing loadout
            if (!Settings.SwapYggdrasilLoadouts || Settings.YggdrasilLoadout.Length == 0)
            {
                //Not sure why this would be true, but safety first
                if (LoadoutManager.CurrentLock == LockType.Yggdrasil)
                {
                    LoadoutManager.RestoreGear();
                    LoadoutManager.ReleaseLock();
                }

                if (DiggerManager.CurrentLock == LockType.Yggdrasil)
                {
                    DiggerManager.RestoreDiggers();
                    DiggerManager.ReleaseLock();
                }
                ActuallyHarvest();
                return;
            }

            //We dont need to harvest anymore and we've already swapped, so swap back
            if (!NeedsHarvest() && LoadoutManager.CurrentLock == LockType.Yggdrasil)
            {
                LoadoutManager.RestoreGear();
                LoadoutManager.ReleaseLock();
            }

            if (!NeedsHarvest() && DiggerManager.CurrentLock == LockType.Yggdrasil)
            {
                DiggerManager.RestoreDiggers();
                DiggerManager.ReleaseLock();
            }

            //We're managing loadouts
            if (NeedsHarvest())
            {
                if (NeedsSwap())
                {
                    if (!LoadoutManager.TryYggdrasilSwap() || !DiggerManager.TryYggSwap())
                    {
                        return;
                    }

                    Log("Equipping Loadout for Yggdrasil and Harvesting");
                }
                else
                {
                    Log("Harvesting without swap because threshold not met");
                }

                //Harvest stuff
                ActuallyHarvest();
            }
        }