Exemple #1
0
        private void SpawnMegaBoss()
        {
            GameObject megaBoss = RandomSpawner().SpawnBoss(_megaBoss);

            megaBoss.GetComponent <Boss>().Type = EnemyType.MegaBoss;

            foreach (BossColour colour in _megaBossColours)
            {
                BossReward bossReward = null;

                try
                {
                    bossReward = ShrineManager.Boss(colour).GetComponent <BossReward>();
                }
                catch (Exception)
                {
                    Debug.Log("no boss reward found");
                }

                try
                {
                    AoeBuff bossBuff = ShrineManager.Boss(colour).GetComponent <AoeBuff>();

                    AoeBuff newBuff = megaBoss.AddComponent <AoeBuff>();

                    newBuff.Tag      = bossBuff.Tag;
                    newBuff.Direct   = bossBuff.Direct;
                    newBuff.Target   = bossBuff.Target;
                    newBuff.Modifier = bossReward != null ? bossReward.Modifiers[ShrineManager.ShrineLevels[colour]] : bossBuff.Modifier;
                    Debug.Log(newBuff.Modifier);
                }
                catch (NullReferenceException)
                {
                    Debug.Log("no AOEBuff found on boss");
                }

                try
                {
                    FollowerBuff followerBuff = _prefabManager.Get("follower_" + colour).GetComponent <FollowerBuff>();

                    if (followerBuff == null)
                    {
                        break;
                    }

                    FollowerBuff newBuff = megaBoss.AddComponent <FollowerBuff>();

                    newBuff.Direct   = followerBuff.Direct;
                    newBuff.Target   = followerBuff.Target;
                    newBuff.Modifier = bossReward != null ? bossReward.Modifiers[ShrineManager.ShrineLevels[colour]] : followerBuff.Modifier;
                }
                catch (Exception)
                {
                    Debug.Log("no followerbuff for boss colour");
                }
            }

            _megaBossColours.Clear();
        }
Exemple #2
0
        // Use this for initialization
        void Start()
        {
            GameObject[] spawnZones = GameObject.FindGameObjectsWithTag("SpawnZone");

            _shrineManager = GameObject.Find("ShrineManager").GetComponent <ShrineManager>();
            _prefabManager = GameObject.Find("PrefabManager").GetComponent <PrefabManager>();
            _player        = GameObject.Find("player").GetComponent <Player.Player>();

            _spawners = new AreaSpawner[spawnZones.Length];

            for (int i = 0; i < spawnZones.Length; i++)
            {
                _spawners[i] = spawnZones[i].GetComponent <AreaSpawner>();
            }

            _normalBoss = _prefabManager.Get("Normal Boss");

            _megaBoss = _prefabManager.Get("Mega Boss");
        }