Beispiel #1
0
 public virtual void DestroyTerrain()
 {
     crackedMesh?.SplitMesh();
     OnDeathSound?.PlayAudio();
     UnitsMap.Remove(this.GetPosition());
     EnvironmentManager.EnvironmentCollection.Remove(WorldPosition);
     gameObject.SetActive(false);
 }
Beispiel #2
0
 public override void DestroyTerrain()
 {
     if (Health.IsDead())
     {
         UnitsMap.Remove(GetPosition());
         Spawner.SpawnUnit(SpawnedUnit, this.WorldPosition);
         EnvironmentManager.EnvironmentCollection.Remove(WorldPosition);
         gameObject.SetActive(false);
     }
 }
Beispiel #3
0
        public override void Execute()
        {
            Logcat.I(this, $"Incarnate IncarnateRebirthAttackAction execute");
            base.Execute();
            if (IsAnExcludedEnemy())
            {
                return;
            }

            UnitsMap.Remove(this.Unit.GetPosition());
            StartCoroutine(Rebirth());
        }
Beispiel #4
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);
    }