//-----------------------------------------
 //This is called when the shield generator is destroyed. Starts the second phase of the boss fight
 public void StartSecondPhase()
 {
     //We activate the hitbox on the jumpdrive and start the timer while also disabling the ships shields.
     messageTxt.DisplayMessage("Their shields are down, and they're trying to escape! Find and destroy the jump drive!");
     jumpDriveAnim.enabled  = true;
     myInfo.MaxShields      = 0;
     myInfo.ShieldRegenRate = 0f;
     GetComponent <Health> ().AddShields(-500);
     StartCoroutine(SecondPhaseTimer());
 }
Exemple #2
0
    public void DisplayMessage(string message)
    {
        if (!hasInitialized)
        {
            Initialize();
        }

        if (messageTextController != null)
        {
            messageTextController.DisplayMessage(message);
        }
    }
    float maxTargetLength = 10.0f; // Maximum amount of time to have a target before searching for a new one

    void Start()
    {
        myInfo            = GetComponent <UnitInfo>();
        weaponsController = GetComponent <WeaponsController>();
        myRigidbody       = GetComponent <Rigidbody>();
        target            = GetEasiestTarget();
        myHealth          = GetComponent <Health> ();

        phase     = 1;
        shieldsOn = true;
        boosted   = false;

        if (!UnitTracker.GetActiveUnits().Contains(this.gameObject))
        {
            UnitTracker.AddUnit(this.gameObject);
        }
        // set target on spawn
        messageTxt = GameObject.Find("MessageText").GetComponent <MessageTextController>();
        messageTxt.DisplayMessage("Their shields are too strong for our weapons. Try to find a weak point.");
    }