Пример #1
0
    //remove given enemy from list, populate a new one of same difficulty
    public void UpdateEnemyList(Enemy e)
    {
        var index = enemyList.IndexOf(e);

        enemyList.Remove(e);

        switch (index)
        {
        case 0:         //easy
            enemyList.Insert(index, EnemyFactory.GenerateEnemy(player.Level, -.5f, this.assetData));
            break;

        case 1:
            enemyList.Insert(index, EnemyFactory.GenerateEnemy(player.Level, 0, this.assetData));
            break;

        case 2:
            enemyList.Insert(index, EnemyFactory.GenerateEnemy(player.Level, .5f, this.assetData));
            break;

        default:
            enemyList.Insert(index, EnemyFactory.GenerateEnemy(player.Level, 0, this.assetData));
            break;
        }
    }
    public void RestartGame()
    {
        ClearItemButtons();
        ClearTurnInfo();
        turnTimer      = 0;
        cooldownTimer  = 0;
        hasClicked     = false;
        hasClickedItem = false;
        ClickValue     = 0;
        isCooldown     = false;
        isPaused       = true;
        isStart        = false;
        startTimer     = 3;

        this.enemy = EnemyFactory.GenerateEnemy(gameData.player.Level, UnityEngine.Random.Range(-1f, 1f), gameData.assetData);
        this.enemy.AttachGameController(this);

        currentTurnData    = enemy.getNextTurnData();
        EnemyDmgText.text  = "";
        PlayerDmgText.text = "";
        roundCount         = 1;
        logText.text       = "";

        LoadPlayerItemButtons();

        UpdateStats();

        InitTurnInfoPanel();
        splashScreenScript.Show();
    }
    public void GenerateEnemy()
    {
        var enemy = EnemyFactory.GenerateEnemy(gameData.player.Level, UnityEngine.Random.Range(-1f, 1f), gameData.assetData);

        var enemyStr = enemy.ToString();

        testText.text = enemyStr;
    }
Пример #4
0
 private void PopulateEnemyList(int level)
 {
     enemyList.Add(EnemyFactory.GenerateEnemy(level, -.5f, this.assetData));
     enemyList.Add(EnemyFactory.GenerateEnemy(level, 0, this.assetData));
     enemyList.Add(EnemyFactory.GenerateEnemy(level, .5f, this.assetData));
 }