Ejemplo n.º 1
0
        public Area(Shape2 inShape, AreaBehavior inBehavior)
        {
            _shape = inShape;
            _type  = (inShape is Circle) ? ShapeType.Circle : ((inShape is Polygon2) ? ShapeType.Polygon : ShapeType.Rectangle);

            AreaColor = Color.Yellow;

            _behavior = inBehavior;
        }
Ejemplo n.º 2
0
    public override void Do()
    {
        GameObject   area         = Instantiate(Prefabs.Instance.area, owner.transform.position, Quaternion.identity, owner.transform);
        AreaBehavior areaBehavior = area.GetComponent <AreaBehavior>();

        areaBehavior.radius = radius;
        areaBehavior.damage = damage;
        areaBehavior.owner  = owner;
        areaBehavior.delay  = delay;
        areaBehavior.buff   = gainBuff;
        areaBehavior.Init();
    }
Ejemplo n.º 3
0
        public static bool DoExploreZone()
        {
            bool isInMap = !WillBot.Plugin.Cache.InHideout && !WillBot.Plugin.Cache.InTown;

            // If no nearby monsters and no nearby objects to interact with
            if (WillBot.Me.ClosestItemToLoot == null && AreaBehavior.AreThereAreaActionsToPerform() == false && WillBot.Me.enemies.ClosestMonsterEntity == null)
            {
                return(true);
            }
            return(false);
            //   if (!DoCombat() && !DoMoveToMonster() && !DoLooting() && !DoMoveToNonKillableUniqueMonster()  && !)
        }
Ejemplo n.º 4
0
    void Shoot(Vector2 pos)
    {
        GameObject   area         = Instantiate(Prefabs.Instance.area, targetPos, Quaternion.identity, null);
        AreaBehavior areaBehavior = area.GetComponent <AreaBehavior>();

        areaBehavior.radius = radius;
        areaBehavior.damage = damage;
        areaBehavior.owner  = owner;
        areaBehavior.delay  = delay;
        areaBehavior.buff   = gainBuff;
        areaBehavior.Init();
    }
Ejemplo n.º 5
0
        private Composite CreateTree()
        {
            return(new PrioritySelector(

                       new Decorator(x => GameController.Game.IsPreGame == true, LoginBehavior.TryEnterGameFromLoginScreen(x => 3)),
                       new Decorator(x => TreeHelper.CanTickTown(), CommonBehavior.TownToHideout()),

                       new Decorator(x => TreeHelper.CanTickHideout(), new PrioritySelector(
                                         new Decorator(x => (DateTime.Now.Subtract(previousBreakTime) > breakInterval), new Action(delegate
            {
                previousBreakTime = DateTime.Now;
                var breakLength = new TimeSpan(hours: 0, minutes: MathHepler.Randomizer.Next(8, 15), seconds: 0);
                Thread.Sleep(breakLength);
                return RunStatus.Failure;
            }
                                                                                                                                   )),
                                         //new Inverter(CommonBehavior.CloseOpenPanels()),
                                         CommonBehavior.HandleDestroyItemPopup(),
                                         CharacterAbilityTrees.ActivateNecroAuras(),
                                         new Action(delegate
            {
                CommonBehavior.CouldNotFindValidPositionToExplore = false;
                WillBot.Me.enemies.LastKilledMonsterTime = DateTime.Now;
                return RunStatus.Failure;
            }),
                                         SellBehavior.SellItems(sellUnidCrItems: true),
                                         TownBehavior.IdentifyUniquesInPlayerInventory(),
                                         TownBehavior.Stashie(),
                                         //ChaosRecipeBehavior.ChaosRecipeHandler(),



                                         // TownBehavior.EnterBloodAquaducts())),
                                         MapPrepBehavior.GetOpenAndEnterMap())),
                       new Decorator(x => TreeHelper.CanTickDead(),
                                     AreaBehavior.DiedBehavior()),
                       new Decorator(x => TreeHelper.CanTickMap(),// !PlayerHelper.isPlayerDead(),
                                     new PrioritySelector(

                                         //new Inverter(CommonBehavior.CloseOpenPanels()),
                                         new Inverter(CommonBehavior.CloseOpenPanelsIfOpenPanels()),
                                         new Decorator(delegate
            {
                // if not killed a monster in the last x seconds -> exit map
                if (DateTime.Now.Subtract(WillBot.Me.enemies.LastKilledMonsterTime).TotalSeconds > 60)
                {
                    return true;
                }
                return false;
            },
                                                       CommonBehavior.OpenAndEnterTownPortal()
                                                       ),
                                         CharacterAbilityTrees.CreateNecroBuffTree(),
                                         new Decorator(ret => CommonBehavior.DoCombat(), NecroCombat.NecroCombatComposite()),
                                         LevelGemsBehavior.LevelGems(),
                                         LootBehavior.BuildLootComposite(),
                                         ChestBehavior.DoOpenNearbyChest(),
                                         AreaBehavior.InteractWithLabelOnGroundOpenable(() => WillBot.Me.TimelessMonolith),
                                         AreaBehavior.InteractWithLabelOnGroundOpenable(() => WillBot.Me.EssenceMonsterMonolith),
                                         AreaBehavior.InteractWithLabelOnGroundOpenable(() => WillBot.Me.HarvestChest),
                                         AreaBehavior.InteractWithLabelOnGroundOpenable(() => WillBot.Me.StrongBox),
                                         AreaBehavior.InteractWithLabelOnGroundOpenable(() => WillBot.Me.BlightPumpInMap),
                                         //AreaBehavior.DefendBlightPumpMap(),

                                         AreaBehavior.OpenDeliriumMirror(),
                                         CommonBehavior.MoveToUnkillableUniqueMonster(),
                                         //CommonBehavior.MoveToDeliriumPause(),
                                         new Decorator(x => CommonBehavior.DoMoveToMonster(),
                                                       CommonBehavior.MoveTo(ret => WillBot.Me.enemies.ClosestMonsterEntity?.GridPos, x => WillBot.Me.enemies.ClosestMonsterEntity?.Pos,
                                                                             CommonBehavior.DefaultMovementSpec)),
                                         new Action(delegate
            {
                AreaBehavior.UpdateAreaTransitions();
                return RunStatus.Failure;
            }),

                                         new Decorator(delegate
            {
                if (CommonBehavior.DoMoveToMonster() == false && CommonBehavior.DoCombat() == false && CommonBehavior.DoMoveToNonKillableUniqueMonster() == false)
                {
                    WillBot.LogMessageCombo($"Checking for exit/area transitions");
                    return true;
                }
                return false;
            },
                                                       new PrioritySelector(
                                                           CommonBehavior.HandleDestroyItemPopup(),
                                                           AreaBehavior.TryDoAreaTransition(),
                                                           new Decorator(delegate
            {
                if (CommonBehavior.MapComplete())
                {
                    WillBot.LogMessageCombo($"Exiting map due to map complete criterias fulfilled, explored more than {WillBot.Settings.MapAreaExploration}");
                    return true;
                }
                return false;
            },
                                                                         CommonBehavior.OpenAndEnterTownPortal()
                                                                         ),
                                                           new Decorator(delegate
            {
                if (CommonBehavior.CouldNotFindValidPositionToExplore == true)
                {
                    WillBot.LogMessageCombo("Exiting map due to not finding a valid position to explore");
                    return true;
                }
                return false;
            },
                                                                         CommonBehavior.OpenAndEnterTownPortal()
                                                                         ),
                                                           new Decorator(
                                                               delegate
            {
                if (WillBot.Me.IsPlayerInventoryFull == true)
                {
                    WillBot.LogMessageCombo("Exiting map due to inventory full.");
                    return true;
                }
                return false;
            },
                                                               CommonBehavior.OpenAndEnterTownPortal())
                                                           )),
                                         CommonBehavior.DoExploringComposite()
                                         ))));
        }