Beispiel #1
0
    public override void DestroyTerrain()
    {
        foreach (Point item in map.GetUnits())
        {
            if (map.Get(item).GetUnitType() == Type.Player)
            {
                map.Get(item).Health.IncreaseHealth(HealAmount);
            }
        }

        base.DestroyTerrain();
    }
        public override void Select(Point point)
        {
            Unit selectedUnit = unitsMap.Get(point);

            if (selectedUnit != null && selectedUnit.GetUnitType() == RoboRapture.Units.Type.Enemy)
            {
                selectedUnit?.VoFx?.Play(selectedUnit.transform.position);
            }
        }
Beispiel #3
0
        protected override void AttackPositions(Point point)
        {
            base.AttackPositions(point);
            if (!UnitsMap.Contains(point))
            {
                return;
            }

            SkillActionFX?.Play(UnitsMap.Get(point).gameObject.transform.position);
        }
        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);
        }
        private void SetSkillAction(SkillAction action, Point target)
        {
            ActionPerformed = action;

            SelectedUnit = action.Unit;

            SelectedAction = action.ActionType;

            Instigator = action.Unit;

            if (map.Contains(target))
            {
                HasTarget = true;
                Target    = map.Get(target);
            }

            EvaluateCameraMovement();
        }
Beispiel #6
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);
    }
        //
        //      Summary:
        //
        //          Called to Cause lightning to apply damage to units.
        //
        public IEnumerator CastLightning()
        {
            if (LoadedLightningPoints.Count > 0)
            {
                foreach (Point item in LoadedLightningPoints)
                {
                    yield return(new WaitForSeconds(LightningIntervalDelay));

                    EffectsPostProcessingController.Instance.ApplyEffect(EffectType.ExposureFlash, ExposureDuration, ExposureSpeed, ExposureStrength);

                    OnLightningHit?.Invoke();

                    LightningStrikeFX.Play(new Vector3(item.x, 1, item.z));

                    if (units.Contains(item))
                    {
                        units.Get(item).Health.ReduceHealth(LightningDamage);
                    }

                    Destroy(SpawnedIndicators[item].gameObject);

                    foreach (Tile tile in controller.GetAllTilesFromVisibleBoard())
                    {
                        if (tile.EntityPosition == item)
                        {
                            tile.SwitchDescription(TileAuxillary.DescriptionTypes.NORMAL);
                        }
                    }
                }
                LoadedLightningPoints.Clear();
                SpawnedIndicators.Clear();
            }
            else
            {
                LoadLightning();
            }
        }
Beispiel #8
0
 public void PrintAllUnitPositions()
 {
     Logcat.W(this, "========== Printing All Unit's Positions ==========");
     this.map.GetUnits().ForEach(u => Logcat.W(this, $"Unit {map.Get(u).GetUnitType()} {map.Get(u).name} at {u}, status {map.Get(u).gameObject.active}"));
 }
Beispiel #9
0
        public void ItemSelected(RefPoint point)
        {
            Unit unit = map.Get(point.Value);

            this.HighlightSelectedUnit(unit);
        }
    private bool AddUnitToMap(Point point, Unit unit)
    {
        if (Units.Contains(point))
        {
            Debug.LogError($"[EnvironmentManager] Units map already contains a unit in specified point {unit.name} {unit.GetPosition()}, Conflicting Unit: {Units.Get(point)} {Units.Get(point).GetPosition()}", Units.Get(point));
            return(false);
        }

        Units.Add(point, unit);
        return(true);
    }