示例#1
0
    public void newGameVoid()
    {
        counter = 0;
        //clear all unlocks
        while (counter <= 36)
        {
            ObserverScript.Instance.unlocks[counter] = false;
            counter++;
        }
        //unlock0 should allways be unlocked
        ObserverScript.Instance.unlocks[0] = true;
        //get player name
        ObserverScript.Instance.playerName = nameBox.GetComponent <Text>().text;

        //if NG+ selected
        if (diffaculty[0].isOn == true)
        {
            //set difficulty tracker to lowest position
            ObserverScript.Instance.diff = 0;
            //reset counter
            counter = 0;
            //loop to unlock all the things
            while (counter <= 33)
            {
                ObserverScript.Instance.unlocks[counter] = true;
                counter++;
            }
            ObserverScript.Instance.shipswap          = 20;
            ObserverScript.Instance.factionRangeSwap += Random.Range(20, 50);
        }
        //if easy selected
        else if (diffaculty[1].isOn == true)
        {
            //set difficulty tracker
            ObserverScript.Instance.diff = 1;
            //unlock easy specific items
            ObserverScript.Instance.unlocks[28]       = true;
            ObserverScript.Instance.unlocks[29]       = true;
            ObserverScript.Instance.unlocks[30]       = true;
            ObserverScript.Instance.unlocks[31]       = true;
            ObserverScript.Instance.unlocks[32]       = true;
            ObserverScript.Instance.unlocks[33]       = true;
            ObserverScript.Instance.unlocks[4]        = true;
            ObserverScript.Instance.unlocks[1]        = true;
            ObserverScript.Instance.shipswap          = 5;
            ObserverScript.Instance.factionRangeSwap += Random.Range(10, 20);
        }
        //if medium selected
        else if (diffaculty[2].isOn == true)
        {
            //set difficulty tracker
            ObserverScript.Instance.diff = 2;
            //unlock medium specific items
            ObserverScript.Instance.unlocks[28]       = true;
            ObserverScript.Instance.unlocks[29]       = true;
            ObserverScript.Instance.unlocks[30]       = true;
            ObserverScript.Instance.unlocks[31]       = true;
            ObserverScript.Instance.shipswap          = Random.Range(5, 10);
            ObserverScript.Instance.factionRangeSwap += Random.Range(20, 35);
        }
        //if hard selected
        else if (diffaculty[3].isOn == true)
        {
            //set difficulty tracker to highest position
            ObserverScript.Instance.diff = 3;
            //unlock hard specific items
            ObserverScript.Instance.unlocks[28]       = true;
            ObserverScript.Instance.unlocks[29]       = true;
            ObserverScript.Instance.shipswap          = Random.Range(10, 15);
            ObserverScript.Instance.factionRangeSwap += Random.Range(30, 50);
        }
        sceneManager.briefing();
    }
示例#2
0
    public void winState()
    {
        //count level cleared
        ObserverScript.Instance.levelsCleared++;
        //reset bookmarks
        ObserverScript.Instance.bookmark0 = false;
        ObserverScript.Instance.bookmark1 = false;
        ObserverScript.Instance.bookmark2 = false;
        ObserverScript.Instance.bookmark3 = false;
        //misson progress check
        if (ObserverScript.Instance.mProgressMissile == 1)
        {
            int i = Random.Range(1, 100);
            if (i < 30)
            {
                //success unlock missile
                ObserverScript.Instance.unlocks[25] = true;
                //incromint mission progress tracker
                ObserverScript.Instance.mProgressMissile = 3;
            }
            else if (i >= 30)
            {
                //set eswap to 'm1 failed
                ObserverScript.Instance.esSwap = 2;
                //incromint mission progress tracker
                ObserverScript.Instance.mProgressMissile = 2;
                //start event
                sm.hangar();
            }
        }//misson progress check (M1)
        if (ObserverScript.Instance.mProgressMissile == 3)
        {
            ObserverScript.Instance.unlocks[26] = true;
            //incromint mission progress tracker
            ObserverScript.Instance.mProgressMissile++;
        }//misson progress check (M2)
        if (ObserverScript.Instance.mProgressMissile == 5)
        {
            ObserverScript.Instance.unlocks[27] = true;
            //incromint mission progress tracker
            ObserverScript.Instance.mProgressMissile++;
        }//misson progress check (M3)

        if (ObserverScript.Instance.mProgressShip == 1 && ObserverScript.Instance.missionType == 1)
        {
            ObserverScript.Instance.mProgressShip++;
        }
        if (ObserverScript.Instance.mProgressShip == 3 && scoreholder > 1000)
        {
            ObserverScript.Instance.mProgressShip++;
            ObserverScript.Instance.unlocks[34] = true;
        }//incroment ship mission and unlock first hidden ship

        if (ObserverScript.Instance.mProgressShip == 5 && ObserverScript.Instance.missionType == 1)
        {
            ObserverScript.Instance.mProgressShip++;
        }
        if (ObserverScript.Instance.mProgressShip == 7 && scoreholder > 5000 + ObserverScript.Instance.levelsCleared * 4)
        {
            ObserverScript.Instance.mProgressShip++;
        }
        if (ObserverScript.Instance.mProgressShip == 9 && ObserverScript.Instance.missionType == 2)
        {
            ObserverScript.Instance.mProgressShip++;
        }
        if (ObserverScript.Instance.mProgressShip == 11 && scoreholder > 7000 && ObserverScript.Instance.missionType == 0)
        {
            ObserverScript.Instance.unlocks[35] = true;
            ObserverScript.Instance.mProgressShip++;
        }//incroment ship mission and unlock second hidden ship
         //change scene
        sm.briefing();
    }