Пример #1
0
        protected bool PreRebirth()
        {
            if (Main.Settings.ManageYggdrasil && YggdrasilManager.AnyHarvestable())
            {
                if (Main.Settings.SwapYggdrasilLoadouts && Main.Settings.YggdrasilLoadout.Length > 0)
                {
                    if (!LoadoutManager.TryYggdrasilSwap() || !DiggerManager.TryYggSwap())
                    {
                        Main.Log("Delaying rebirth to wait for ygg loadout/diggers");
                        return(true);
                    }

                    YggdrasilManager.HarvestAll();
                    Main.Log("Delaying rebirth 1 loop to allow fruit effects");
                    return(true);
                }

                YggdrasilManager.HarvestAll();
                Main.Log("Delaying rebirth 1 loop to allow fruit effects");
                return(true);
            }

            DiggerManager.UpgradeCheapestDigger();

            CastBloodSpells(true);
            return(false);
        }
Пример #2
0
        public void DoRebirth()
        {
            if (_wrapper == null)
            {
                return;
            }

            if (_wrapper.Breakpoints.RebirthTime < 0)
            {
                return;
            }

            if (_character.rebirthTime.totalseconds < _wrapper.Breakpoints.RebirthTime)
            {
                return;
            }

            if (Main.Settings.SwapYggdrasilLoadouts && Main.Settings.YggdrasilLoadout.Length > 0)
            {
                if (!LoadoutManager.TryYggdrasilSwap() || !DiggerManager.TryYggSwap())
                {
                    Main.Log("Delaying rebirth to wait for ygg loadout/diggers");
                    return;
                }

                YggdrasilManager.HarvestAll();
                LoadoutManager.RestoreGear();
                LoadoutManager.ReleaseLock();
                DiggerManager.RestoreDiggers();
                DiggerManager.ReleaseLock();
            }

            _currentDiggerBreakpoint  = null;
            _currentEnergyBreakpoint  = null;
            _currentGearBreakpoint    = null;
            _currentWandoosBreakpoint = null;
            _currentMagicBreakpoint   = null;
            _currentR3Breakpoint      = null;

            Main.Log("Rebirth time hit, performing rebirth");
            var controller = Main.Character.rebirth;

            typeof(Rebirth).GetMethods(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance)
            .Single(x => x.Name == "engage" && x.GetParameters().Length == 0).Invoke(controller, null);
        }