private IEnumerator SpawnLoop()
    {
        Spawner.SpawnSoldier();
        Spawner.SpawnWizard();
        yield return(new WaitForSeconds(4f));

        Spawner.SpawnWizard();
        Spawner.SpawnSoldier();
        yield return(new WaitForSeconds(3f));

        Spawner.SpawnArcher();
        yield return(new WaitForSeconds(3f));

        SpawnRoutine = StartCoroutine(SpawnLoop());
    }
Ejemplo n.º 2
0
    private IEnumerator SpawnLoop()
    {
        yield return(new WaitForSeconds(3f));

        Spawner.SpawnSoldier();
        yield return(new WaitForSeconds(3f));

        Spawner.SpawnWizard();
        yield return(new WaitForSeconds(3f));

        Spawner.SpawnArcher();
        yield return(new WaitForSeconds(1f));

        List <GameObject> Units = Spawner.GetAllSpawnedUnits();

        foreach (GameObject u in Units)
        {
            if (u != null)
            {
                if (u.transform.localScale.x < 2f)
                {
                    StartCoroutine(SpellEffectsService.GetInstance().EmbiggenEffect(u));
                }
            }
        }
        SpawnRoutine = StartCoroutine(SpawnLoop());
    }
    private IEnumerator SpawnLoop()
    {
        float relativeScore = 1f;

        relativeScore = GroundClaimsService.GetInstance().GetRightTeamCoverageScore() / 100;
        yield return(new WaitForSeconds(0.3f + ((15f * relativeScore) * 3f)));

        Spawner.SpawnSoldier();
        Spawner.SpawnArcher();
        Spawner.SpawnWizard();
        SpawnRoutine = StartCoroutine(SpawnLoop());
    }
Ejemplo n.º 4
0
    private IEnumerator SpawnLoop()
    {
        float relativeScore = 1f;

        if (Owner == Team.Left)
        {
            relativeScore = GroundClaimsService.GetInstance().GetLeftTeamCoverageScore() / 100;
        }
        else
        {
            relativeScore = GroundClaimsService.GetInstance().GetRightTeamCoverageScore() / 100;
        }
        Spawner.SpawnSoldier();
        yield return(new WaitForSeconds(10f * relativeScore + 1));

        Spawner.SpawnArcher();
        yield return(new WaitForSeconds(10f * relativeScore + 1));

        Spawner.SpawnWizard();
        yield return(new WaitForSeconds(10f * relativeScore + 1));

        SpawnRoutine = StartCoroutine(SpawnLoop());
    }
    private IEnumerator SpawnLoop()
    {
        float relativeScore = (360 - LevelManagerService.GetInstance().GetTimeRemaining()) / 360;

        if (LevelManagerService.GetInstance().GetTimeRemaining() < 300)
        {
            if (SpawnTime > 2f)
            {
                LevelManagerService.GetInstance().SplashLabel.text = "Speeding Up!";
                yield return(new WaitForSeconds(3));

                LevelManagerService.GetInstance().SplashLabel.text = "";
                SpawnTime = 2f;
            }
        }
        if (LevelManagerService.GetInstance().GetTimeRemaining() < 240)
        {
            if (SpawnTime > 1.5f)
            {
                LevelManagerService.GetInstance().SplashLabel.text = "Speeding Up!!";
                yield return(new WaitForSeconds(3));

                LevelManagerService.GetInstance().SplashLabel.text = "";
                SpawnTime = 1.5f;
            }
        }
        if (LevelManagerService.GetInstance().GetTimeRemaining() < 180)
        {
            if (SpawnTime > 1.5f)
            {
                LevelManagerService.GetInstance().SplashLabel.text = "Speeding Up!!!";
                yield return(new WaitForSeconds(3));

                LevelManagerService.GetInstance().SplashLabel.text = "";
                SpawnTime = 1.5f;
            }
        }
        if (LevelManagerService.GetInstance().GetTimeRemaining() < 60)
        {
            if (SpawnTime > 1f)
            {
                LevelManagerService.GetInstance().SplashLabel.text = "Speeding Up!!!!";
                yield return(new WaitForSeconds(3));

                LevelManagerService.GetInstance().SplashLabel.text = "";
                SpawnTime = 1f;
            }
        }
        if (LevelManagerService.GetInstance().GetTimeRemaining() < 60)
        {
            if (SpawnTime > 0.75f)
            {
                LevelManagerService.GetInstance().SplashLabel.text = "Speeding Up!!!!!";
                yield return(new WaitForSeconds(3));

                LevelManagerService.GetInstance().SplashLabel.text = "";
                SpawnTime = 0.75f;
            }
        }
        Spawner.SpawnSoldier();
        yield return(new WaitForSeconds(SpawnTime));

        Spawner.SpawnArcher();
        yield return(new WaitForSeconds(SpawnTime));

        Spawner.SpawnWizard();
        yield return(new WaitForSeconds(SpawnTime));

        SpawnRoutine = StartCoroutine(SpawnLoop());
    }
Ejemplo n.º 6
0
    void Update()
    {
        if (FreezeUpdateLoop)
        {
            return;
        }
        if (Input.GetKey(KeyCode.Space))
        {
            UnitSpawner.SpawnSoldier();
        }
        List <Tile> tilesToRemove = GetRemovableTiles();
        Dictionary <string, int> removedTileCounts = new Dictionary <string, int>();

        if (tilesToRemove.Count > 0)
        {
            foreach (Tile ttr in tilesToRemove)
            {
                if (!removedTileCounts.ContainsKey(ttr.Name))
                {
                    removedTileCounts[ttr.Name] = 0;
                }
                removedTileCounts[ttr.Name]++;
                Vector2 ttrc = GetTileCoordinates(ttr);
                TileMap[(int)ttrc.y][(int)ttrc.x].Tile.Remove();
                TileMap[(int)ttrc.y][(int)ttrc.x].Tile = null;
            }
            if (removedTileCounts.ContainsKey("Sword") ||
                removedTileCounts.ContainsKey("Arrow") ||
                removedTileCounts.ContainsKey("Thunder") ||
                removedTileCounts.ContainsKey("Shield") ||
                removedTileCounts.ContainsKey("Void")
                )
            {
                SfxManagerService.GetInstance().PlayTilePop();
            }
            if (removedTileCounts.ContainsKey("Skull"))
            {
                SfxManagerService.GetInstance().PlaySkullPop();
            }
            if (removedTileCounts.ContainsKey("Sword"))
            {
                while (removedTileCounts["Sword"] >= 3)
                {
                    UnitSpawner.SpawnSoldier();
                    removedTileCounts["Sword"] -= 3;
                }
            }
            if (removedTileCounts.ContainsKey("Arrow"))
            {
                while (removedTileCounts["Arrow"] >= 3)
                {
                    UnitSpawner.SpawnArcher();
                    removedTileCounts["Arrow"] -= 3;
                }
            }
            if (removedTileCounts.ContainsKey("Thunder"))
            {
                while (removedTileCounts["Thunder"] >= 3)
                {
                    UnitSpawner.SpawnWizard();
                    removedTileCounts["Thunder"] -= 3;
                }
            }
            if (removedTileCounts.ContainsKey("Void"))
            {
                while (removedTileCounts["Void"] >= 3)
                {
                    if (LevelManagerService.GetInstance().CurrentPlayerMana < 3)
                    {
                        StartCoroutine(IncreaseManaByXOverT(1, 0.5f));
                    }
                    removedTileCounts["Void"] -= 3;
                }
            }
            if (removedTileCounts.ContainsKey("Skull"))
            {
                float skullDamage = Mathf.Min(removedTileCounts["Skull"] / 2);
                while (removedTileCounts["Skull"] >= 3)
                {
                    removedTileCounts["Skull"] -= 3;
                    List <GameObject> PlayerSpawnedUnits = UnitSpawner.GetAllSpawnedUnits();
                    foreach (GameObject u in PlayerSpawnedUnits)
                    {
                        if (u != null)
                        {
                            DamagableUnit d = u.GetComponent <DamagableUnit>();
                            if (d != null)
                            {
                                d.TakeDamage(skullDamage);
                            }
                        }
                    }
                }
            }
            StartCoroutine(PushTiles());
        }
    }