/// <summary>
    /// End battle and return to overworld once all enemies are defeated
    /// </summary>
    public void CheckVictory()
    {
        List <Entity> partyMembers = eParty.GetLivingParty();

        if (partyMembers.Count == 0)
        {
            //Revive overworld
            ow.activeEnemies.Remove(ea);
            Destroy(ea.gameObject);
            ow.Activate(true);
            SceneManager.LoadScene("overworld");
        }
    }
Example #2
0
    /// <summary>
    /// End battle and return to overworld once all enemies are defeated
    /// </summary>
    public void CheckVictory()
    {
        List <Entity> partyMembers = eParty.GetLivingParty();

        //All enemies dead
        if (partyMembers.Count == 0)
        {
            SetState("VICTORY");
        }

        //Check for level ups one more time
        foreach (Entity e in pParty.GetParty())
        {
            e.CheckLevel();
        }
    }