using UnityEngine;
using System.Collections;
using System.Linq;

public class BossTurret : EnemyController
{

    public override void UpdateMotion()
    {
        Vector3 towardsPlayer = playerScript.transform.position - transform.position;
        towardsPlayer.Normalize();
        transform.right = Vector3.Cross(towardsPlayer, new Vector3(0, 0, 1));
    }

    public override void StayVertical()
    {
       
    }

    public override void UpdateAttacks()
    {
        Vector3 towardsPlayer = playerScript.transform.position - transform.position;

        towardsPlayer.x += -0.2f + Random.value*0.4f;
        towardsPlayer.Normalize();

        for (int t = 0; t < Attacks.Count(); t++)
        {
            Attacks[t].Update();

            if (transform.position.x < 12.0f)
            {
                float fShotSpeed = 15.0f + (5.5f * mcs.GetEnemySpeedMultiplier());
                Attacks[t].TryFire(transform.position, towardsPlayer, fShotSpeed);
            }
        }
    }
}
