Beispiel #1
0
        public override void Success()
        {
            TargetCell.Explore();
            base.Success();

            var plan = new ReturnToNestPlan(Player, Ants);

            Player.Planer.TryToAddPlan(plan);
        }
Beispiel #2
0
        public override void Execute()
        {
            var cell = (TargetCell as EnviromentCellData);

            if (cell == null || cell.Source == null || cell.Source.IsDepleted)
            {
                Fail();
                return;
            }

            if (Ants.Position != TargetCell)
            {
                MoveToTarget();
                return;
            }

            TargetCell.Explore();

            if (!cell.IsGatherable)
            {
                if (isGathered)
                {
                    Success();
                }
                else
                {
                    Fail();
                }
                return;
            }
            isGathered = true;

            var source = cell.Source;

            var power  = Player.Anter.CalculateGatherPower(Ants);
            var amount = source.Gather(power);

            Player.Resourcer.Store(source.ResourceType, amount);

            if (source.IsDepleted)
            {
                Success();
            }
        }
Beispiel #3
0
        public override void Execute()
        {
            if (Ants.Position != TargetCell)
            {
                MoveToTarget();
                return;
            }

            var tg = (TargetCell as EnviromentCellData);

            if (tg != null)
            {
                TargetCell.Explore();
                Success();
                return;
            }

            Fail();
        }