Exemplo n.º 1
0
    public void StartLevel(bool SetActive = true)
    {
        CurLevel++;
        LevelPointsAvailable   = CurLevel * 14;
        LevelSpawnTimer        = 1 / (Mathf.Log(CurLevel * 0.2f) + 2) + 0.4f;
        CurSpawnTimer          = LevelSpawnTimer;
        LevelTotalWeights      = 0;
        LargestPointsAvailable = LargestRatingInList;
        ThisLevelChoices       = new ChoiceStruct <SpawnableEnemy> [LargestRatingInList];
        for (int i = 0; i < ThisLevelChoices.Length; i++)
        {
            ThisLevelChoices[i] = new ChoiceStruct <SpawnableEnemy>();
        }

        foreach (var Enemy in EnemyChoices)
        {
            if (CurLevel >= Enemy.Value.Level)
            {
                ThisLevelChoices[Enemy.Value.Points - 1].Weight += Enemy.Value.Weight;
                ThisLevelChoices[Enemy.Value.Points - 1].ChoiceList.Add(Enemy.Value);
            }
        }
        Active = SetActive;
        Debug.Log("Level" + CurLevel + "(DifficultyOffset: " + (int)Mathf.Log(10 * CurLevel) + ", Total: " + LevelPointsAvailable + ")");
    }
Exemplo n.º 2
0
        public void Add(float weight, T item)
        {
            var choiceStruct = new ChoiceStruct();

            choiceStruct.Weight = weight;
            choiceStruct.Item   = item;
            _choiceStruct.Add(choiceStruct);
        }
Exemplo n.º 3
0
        public void Add(int weight, DungeonEnum.Tiles item)
        {
            var choiceStruct = new ChoiceStruct();

            choiceStruct.Weight = weight;
            choiceStruct.Item   = item;
            _choiceStruct.Add(choiceStruct);
        }