Пример #1
0
        // Spawns the party into battle.
        private void SpawnParty()
        {
            PlayerInventory playerInventory = GameManager.Instance.PlayerReference.GetComponent <PlayerInventory>();

            listOfAllParty = new List <BattleStats>();

            int currLocationIndex = 0;

            for (int currIndex = 0; currIndex < playerInventory.GetPartyInvetorySize(); ++currIndex)
            {
                BattleStats partyMember = Instantiate(characterPrefab, partySpawnLocations[currLocationIndex].position, Quaternion.identity).GetComponent <BattleStats>();
                partyMember.battleData = playerInventory.GetInventoryCharacterAtIndex(currIndex).SpecifiedCharacter;
                partyMember.InitalizeEntity(playerInventory.GetInventoryCharacterAtIndex(currIndex));

                listOfAllParty.Add(partyMember);
                currLocationIndex++;
            }
        }
Пример #2
0
        // Spawns in enemies from the event
        private void SpawnEnemies()
        {
            listOfAllEnemies = new List <BattleStats>();

            int currSpawnIndex = 0;

            foreach (EnemyData currentData in currentBattleEvent.listOfEnemiesInFight)
            {
                BattleStats newEnemy = Instantiate(characterPrefab, enemySpawnLocations[currSpawnIndex].position, Quaternion.identity).GetComponent <BattleStats>();
                newEnemy.battleData = currentData;
                newEnemy.InitalizeEntity(currentData.maxHealthPoints, currentData.maxSkillPoints);

                // We level up the enemy in here based on their current level
                for (int iterator = currentData.currentLevel; iterator > 0; iterator--)
                {
                    newEnemy.LevelUpStats();
                }

                listOfAllEnemies.Add(newEnemy);
                currSpawnIndex++;
            }
        }