Exemplo n.º 1
0
    private void onTimerTick()
    {
//        Debug.Log("Boss Using Boss Move");

        // TODO: add a smarter way of choosing spells
        int       spellUsedIndex = Random.Range(0, spells.Count);
        BossSpell usedSpell      = spells[spellUsedIndex];

        if (usedSpell.Type == BossSpell.TargetType.Party)
        {
            foreach (Wizard wizard in allWizards)
            {
                wizard.healthScript.TakeDamage(usedSpell.Damage);
            }
        }
        else if (usedSpell.Type == BossSpell.TargetType.Single)
        {
            int    targetWizardId = Random.Range(0, allWizards.Count);
            Wizard targetWizard   = allWizards[targetWizardId];
            targetWizard.healthScript.TakeDamage(usedSpell.Damage);
        }
        else if (usedSpell.Type == BossSpell.TargetType.Self)
        {
            healthScript.TakeDamage(usedSpell.Damage);
        }
    }
Exemplo n.º 2
0
 private void Shoot()
 {
     if (!isSpawned)
     {
         GameObject projectileObject = Instantiate(PrefabProjectile, transform.position, Quaternion.identity) as GameObject;
         BossSpell  projectile       = projectileObject.GetComponent <BossSpell>();
         projectile.SetDirection(GetFacingDirection());
         projectileSound.Play();
         Destroy(projectileObject, projectileDuration);
     }
 }