Exemplo n.º 1
0
        private IEnumerator SpawnNeoSatan()
        {
            BossFightController.SetActive(true);

            if (DisableHUD)
            {
                MainHUD.SetActive(false);
            }

            // APPLY KNOCKBACK TO NEOSATAN SPAWN AREA
            foreach (Point item in LoadSpawnArea())
            {
                handler.Execute(controller, NeoSatanSpawnPosition, item, 1);
            }

            handler.Execute(controller, new Point(this.NeoSatanSpawnPosition.x - 1, this.NeoSatanSpawnPosition.y, this.NeoSatanSpawnPosition.z), NeoSatanSpawnPosition, 1);

            do
            {
                yield return(null);
            } while (map.Contains(NeoSatanSpawnPosition));
            ActivateSoulSphere();
            // SPAWN NEO-SATAN
            NeoSatanReference = AIPlacementHelper.AddUnit(null, NeoSatanSpawnPosition, NeoSatan);
            BossFightController.GetComponent <BossFightController>().SetNeoSatanRef(NeoSatanReference);
            OnNeoSatanSpawn?.Invoke();
        }
Exemplo n.º 2
0
        private IEnumerator Attack(CardinalDirections direction, Vector3 point)
        {
            yield return(new WaitForSeconds(delay));

            Logcat.I(this, $"Shooting with direction {direction} vector {point}");
            this.transform.localPosition += point;
            GetPointsInLine(direction)?.ForEach(p => UnitsMap.Get(p)?.Health?.ReduceHealth(this.DeltaHealth));
            this.transform.localPosition -= point;
            KnockbackHandler handler = new KnockbackHandler(this.UnitsMap);

            handler.Execute(this.BoardController, Target, this.Unit.GetPosition(), this.Knockback);
        }
Exemplo n.º 3
0
        protected virtual void AttackPositions(Point point)
        {
            if (!UnitsMap.Contains(point))
            {
                return;
            }

            Unit             targetUnit = this.UnitsMap.Get(point);
            KnockbackHandler handler    = new KnockbackHandler(this.UnitsMap);

            handler.Execute(this.BoardController, this.Unit.GetPosition(), targetUnit.GetPosition(), this.Knockback);
            targetUnit?.Health.ReduceHealth(this.DeltaHealth);
        }
Exemplo n.º 4
0
        public override void Execute()
        {
            if (this.UnitsMap.Contains(this.Target))
            {
                Unit             targetUnit = this.UnitsMap.Get(this.Target);
                KnockbackHandler handler    = new KnockbackHandler(this.UnitsMap);
                handler.Execute(this.BoardController, this.Unit.GetPosition(), targetUnit.GetPosition(), this.Knockback);
                targetUnit.Health.ReduceHealth(this.DeltaHealth);
            }

            this.IsActive(false);

            Logcat.I(this, "Whelp attack action executed");
        }
Exemplo n.º 5
0
        public override void Execute()
        {
            Logcat.I(this, $"Nanobots called");

            Unit targetUnit = this.UnitsMap.Get(this.Target);

            SimulateAttack(false, this.Target, this.DeltaHealth, this.Knockback, false);
            KnockbackHandler handler = new KnockbackHandler(this.UnitsMap);

            handler.Execute(this.BoardController, this.Unit.GetPosition(), targetUnit.GetPosition(), this.Knockback);
            targetUnit.Health.IncreaseHealth(this.DeltaHealth);
            Logcat.I(this, $"Nanobots unit healed");

            this.IsActive(false);
        }
Exemplo n.º 6
0
        private void AttackTarget()
        {
            Unit targetUnit = this.UnitsMap.Get(this.Target);

            if (targetUnit != null)
            {
                SimulateAttack(false, this.Target, this.DeltaHealth, this.Knockback, true);
                KnockbackHandler handler = new KnockbackHandler(this.UnitsMap);
                handler.Execute(this.BoardController, this.Unit.GetPosition(), targetUnit.GetPosition(), this.Knockback);
                targetUnit?.Health.ReduceHealth(this.DeltaHealth);
            }

            this.IsActive(false);
            Logcat.I(this, "Telekinesis blast executed");
        }
Exemplo n.º 7
0
        private void AttackPosition(Point target)
        {
            Unit targetUnit = this.Unit.UnitsMap.Get(target);

            if (targetUnit == null)
            {
                return;
            }

            if ((targetUnit is EnemyUnit) && ((EnemyUnit)targetUnit).GetSpawnedUnitType() == UnitType.NEOSATAN_LEG)
            {
                return;
            }

            KnockbackHandler handler = new KnockbackHandler(this.UnitsMap);

            handler.Execute(this.BoardController, this.Unit.GetPosition(), targetUnit.GetPosition(), this.Knockback);
            targetUnit?.Health.ReduceHealth(this.DeltaHealth);
            //// Logcat.I($"attacking position {target}, is a unit in the position? {targetUnit != null}");
        }
Exemplo n.º 8
0
        public override void Execute()
        {
            if (!this.ValidateAction(this.Target))
            {
                return;
            }

            Unit targetUnit = this.UnitsMap.Get(this.Target);

            if (targetUnit != null)
            {
                SimulateAttack(false, this.Target, this.DeltaHealth, this.Knockback, true);
                KnockbackHandler handler = new KnockbackHandler(this.UnitsMap);
                handler.Execute(this.BoardController, this.Unit.GetPosition(), targetUnit.GetPosition(), this.Knockback);
                targetUnit?.Health.ReduceHealth(this.DeltaHealth);
            }

            this.IsActive(false);
            Logcat.I(this, "Crush Action executed");
        }
Exemplo n.º 9
0
    private IEnumerator ApplyExplosion(Point[] targets, Point[] attackArea)
    {
        yield return(new WaitForSeconds(HighlightWaitTime));

        foreach (Point item in targets)
        {
            if (UnitsMap.Contains(item))
            {
                Unit targetUnit = UnitsMap.Get(item);
                targetUnit.Health.ReduceHealth(Damage);
                handler.Execute(controller, this.GetPosition(), targetUnit.GetPosition(), 1);
            }
        }

        controller.SwitchTilesFromActiveBoards(new HashSet <Point>(attackArea), Edu.Vfs.RoboRapture.TileAuxillary.TileStates.NORMAL);

        EnvironmentManager.EnvironmentCollection.Remove(WorldPosition);
        UnitsMap.Remove(this.GetPosition());
        gameObject.SetActive(false);
    }