コード例 #1
0
ファイル: RARC_Planet_SO.cs プロジェクト: Cazac/TTGD-RoboARC
    /////////////////////////////////////////////////////////////////

    public RARC_Planet GenerateAnyPlanet()
    {
        RARC_Planet newPlanet        = null;
        int         planetTypeChoice = Random.Range(0, 5);

        switch (planetTypeChoice)
        {
        case 0:
            newPlanet = GeneratePlanet_Rocky();
            break;

        case 1:
            newPlanet = GeneratePlanet_Lava();
            break;

        case 2:
            newPlanet = GeneratePlanet_Icy();
            break;

        case 3:
            newPlanet = GeneratePlanet_Gassy();
            break;

        case 4:
            newPlanet = GeneratePlanet_Living();
            break;

        default:
            newPlanet = GeneratePlanet_Rocky();
            break;
        }

        return(newPlanet);
    }
コード例 #2
0
ファイル: RARC_Planet_SO.cs プロジェクト: Cazac/TTGD-RoboARC
    public RARC_Planet GetMoons(RARC_Planet newPlanet)
    {
        //Moon Generation
        newPlanet.planetMoonPlanet_List = new List <RARC_Planet>();
        int planetMoonCount = Random.Range(0, 3);

        for (int i = 0; i < planetMoonCount; i++)
        {
            newPlanet.planetMoonPlanet_List.Add(GenerateMoon());
        }

        return(newPlanet);
    }
コード例 #3
0
ファイル: RARC_Planet_SO.cs プロジェクト: Cazac/TTGD-RoboARC
    public RARC_Planet GenerateMoon()
    {
        //Create New Planet
        RARC_Planet newMoon = new RARC_Planet();

        newMoon.planetType = RARC_Planet.PlanetType.Moon;

        //Sprite
        newMoon.planetSprite_Main      = Random.Range(0, planetSpritesMain_Moon.Count);
        newMoon.planetSprite_Secondary = Random.Range(0, planetSpritesSecondary_Moon.Count);

        //Colors
        newMoon.primaryColor   = ColorUtility.ToHtmlStringRGB(colorPaletteMain_Moon[Random.Range(0, colorPaletteMain_Moon.Count)]);
        newMoon.secondaryColor = ColorUtility.ToHtmlStringRGB(colorPaletteSecondary_Moon[Random.Range(0, colorPaletteSecondary_Moon.Count)]);

        //Visual Rotation
        //newMoon.planetRotation = Random.Range(0, 360);

        return(newMoon);
    }
コード例 #4
0
ファイル: RARC_Planet_SO.cs プロジェクト: Cazac/TTGD-RoboARC
    /////////////////////////////////////////////////////////////////

    public RARC_Planet GetGenericInfo(RARC_Planet newPlanet)
    {
        //Name
        newPlanet.planetName = allPlanetNames_List[Random.Range(0, allPlanetNames_List.Count)];

        //Visual Rotation
        newPlanet.planetRotation = Random.Range(-90, 90);

        //Time to reach planet
        newPlanet.planetTravelTime = Random.Range(2, 5);

        //Risk
        newPlanet.planetRiskFactor = Random.Range(0, 10);

        //Get Moons
        newPlanet = GetMoons(newPlanet);

        //Get Events
        newPlanet.planetEvent = GenerateAvalibleEvent();

        return(newPlanet);
    }
コード例 #5
0
ファイル: RARC_Planet_SO.cs プロジェクト: Cazac/TTGD-RoboARC
    public RARC_Planet GeneratePlanet_Living()
    {
        //Create New Planet
        RARC_Planet newPlanet = new RARC_Planet();

        newPlanet.planetType = RARC_Planet.PlanetType.Living;

        //Sprite / Colors
        newPlanet.planetSprite_Main      = Random.Range(0, planetSpritesMain_Living.Count);
        newPlanet.planetSprite_Secondary = Random.Range(0, planetSpritesSecondary_Living.Count);
        newPlanet.primaryColor           = ColorUtility.ToHtmlStringRGB(colorPaletteMain_Living[Random.Range(0, colorPaletteMain_Living.Count)]);
        newPlanet.secondaryColor         = ColorUtility.ToHtmlStringRGB(colorPaletteSecondary_Living[Random.Range(0, colorPaletteSecondary_Living.Count)]);

        //Resources
        newPlanet.planetResources_List = GenerateResources(BasicResource_Living, minAmountOf_BasicResource_Living, maxAmountOf_BasicResource_Living, CommonResource_Living, chanceOf_CommonResource_Living, minAmountOf_CommonResource_Living, maxAmountOf_CommonResource_Living, RareResource_Living, chanceOf_RareResource_Living, minAmountOf_RareResource_Living, maxAmountOf_RareResource_Living);

        //Generic Info For All Planets
        newPlanet = GetGenericInfo(newPlanet);

        //Return New Planet
        return(newPlanet);
    }
コード例 #6
0
    /////////////////////////////////////////////////////////////////

    public void SetPlanet(RARC_Planet planet, int refreshLeft)
    {
        //Planet
        planetSprite_Main.transform.rotation      = Quaternion.Euler(0, 0, planet.planetRotation);
        planetSprite_Secondary.transform.rotation = Quaternion.Euler(0, 0, planet.planetRotation);

        //Sprite
        planetSprite_Main.sprite      = GetPlanetSprite_Main(planet.planetSprite_Main, planet.planetType);
        planetSprite_Secondary.sprite = GetPlanetSprite_Secondary(planet.planetSprite_Secondary, planet.planetType);

        //Color
        planetSprite_Main.color      = GetPlanetColor(planet.primaryColor);
        planetSprite_Secondary.color = GetPlanetColor(planet.secondaryColor);

        //Name
        if (name_Text != null)
        {
            name_Text.text = planet.planetName;
        }

        //Resources
        if (travelTime_Text != null)
        {
            travelTime_Text.text = "Distance " + "<" + RARC_ButtonController_Game.Instance.colorValues_Yellow + "> " + planet.planetTravelTime + " Weeks" + "</color>";
        }

        //Button
        if (refreshButton_Text != null)
        {
            refreshButton_Text.text = "Reroll Planet: (" + refreshLeft + ")";
            if (refreshLeft <= 0)
            {
                refresh_Button.interactable = false;
            }
            else
            {
                refresh_Button.interactable = true;
            }
        }

        //Resources
        if (resources1_Tab != null)
        {
            if (planet.planetResources_List.Count >= 3)
            {
                resources1_Tab.gameObject.SetActive(true);
                resources2_Tab.gameObject.SetActive(true);
                resources3_Tab.gameObject.SetActive(true);

                resources1_Tab.SetResource_Navigating(planet.planetResources_List[0]);
                resources2_Tab.SetResource_Navigating(planet.planetResources_List[1]);
                resources3_Tab.SetResource_Navigating(planet.planetResources_List[2]);
            }
            else if (planet.planetResources_List.Count >= 2)
            {
                resources1_Tab.gameObject.SetActive(true);
                resources2_Tab.gameObject.SetActive(true);
                resources3_Tab.gameObject.SetActive(false);

                resources1_Tab.SetResource_Navigating(planet.planetResources_List[0]);
                resources2_Tab.SetResource_Navigating(planet.planetResources_List[1]);
            }
            else if (planet.planetResources_List.Count >= 1)
            {
                resources1_Tab.gameObject.SetActive(true);
                resources2_Tab.gameObject.SetActive(false);
                resources3_Tab.gameObject.SetActive(false);

                resources1_Tab.SetResource_Navigating(planet.planetResources_List[0]);
            }
            else
            {
                resources1_Tab.gameObject.SetActive(false);
                resources2_Tab.gameObject.SetActive(false);
                resources3_Tab.gameObject.SetActive(false);
            }
        }

        //Moon
        if (moonContainer1_GO != null)
        {
            if (planet.planetMoonPlanet_List.Count >= 1 && moonContainer1_GO != null)
            {
                RARC_Planet moon1 = planet.planetMoonPlanet_List[0];

                moonContainer1_GO.SetActive(true);

                moonSprite1_Main.transform.rotation      = Quaternion.Euler(0, 0, moon1.planetRotation);
                moonSprite1_Secondary.transform.rotation = Quaternion.Euler(0, 0, moon1.planetRotation);

                moonSprite1_Main.sprite      = GetPlanetSprite_Main(moon1.planetSprite_Main, moon1.planetType);
                moonSprite1_Secondary.sprite = GetPlanetSprite_Secondary(moon1.planetSprite_Secondary, moon1.planetType);

                moonSprite1_Main.color      = GetPlanetColor(moon1.primaryColor);
                moonSprite1_Secondary.color = GetPlanetColor(moon1.secondaryColor);
            }
            else
            {
                moonContainer1_GO.SetActive(false);
            }
        }

        //Moon
        if (moonContainer2_GO != null)
        {
            if (planet.planetMoonPlanet_List.Count >= 2 && moonContainer2_GO != null)
            {
                RARC_Planet moon2 = planet.planetMoonPlanet_List[1];

                moonContainer2_GO.SetActive(true);

                moonSprite2_Main.transform.rotation      = Quaternion.Euler(0, 0, moon2.planetRotation);
                moonSprite2_Secondary.transform.rotation = Quaternion.Euler(0, 0, moon2.planetRotation);

                moonSprite2_Main.sprite      = GetPlanetSprite_Main(moon2.planetSprite_Main, moon2.planetType);
                moonSprite2_Secondary.sprite = GetPlanetSprite_Secondary(moon2.planetSprite_Secondary, moon2.planetType);

                moonSprite2_Main.color      = GetPlanetColor(moon2.primaryColor);
                moonSprite2_Secondary.color = GetPlanetColor(moon2.secondaryColor);
            }
            else
            {
                moonContainer2_GO.SetActive(false);
            }
        }
    }
コード例 #7
0
    /////////////////////////////////////////////////////////////////

    public void SetPlanet(RARC_Planet planet)
    {
        //Planet
        planetSprite_Main.transform.rotation      = Quaternion.Euler(0, 0, planet.planetRotation);
        planetSprite_Secondary.transform.rotation = Quaternion.Euler(0, 0, planet.planetRotation);

        //Sprite
        planetSprite_Main.sprite      = GetPlanetSprite_Main(planet.planetSprite_Main, planet.planetType);
        planetSprite_Secondary.sprite = GetPlanetSprite_Secondary(planet.planetSprite_Secondary, planet.planetType);

        //Color
        planetSprite_Main.color      = GetPlanetColor(planet.primaryColor);
        planetSprite_Secondary.color = GetPlanetColor(planet.secondaryColor);

        //Name
        if (name_Text != null)
        {
            name_Text.text = planet.planetName;
        }

        //Resources
        if (travelTime_Text != null)
        {
            travelTime_Text.text = "Travel Time " + planet.planetTravelTime + " Weeks.";

            resources1_Text.text = "- Iron (0% - 20%)";
            resources2_Text.text = "- Silicone (50% - 100%)";
            resources3_Text.text = "- Gems (0% - 20%)";
        }


        //Moon
        if (planet.planetMoonPlanet_List.Count >= 1 && moonContainer1_GO != null)
        {
            RARC_Planet moon1 = planet.planetMoonPlanet_List[0];

            moonContainer1_GO.SetActive(true);

            moonSprite1_Main.transform.rotation      = Quaternion.Euler(0, 0, moon1.planetRotation);
            moonSprite1_Secondary.transform.rotation = Quaternion.Euler(0, 0, moon1.planetRotation);

            moonSprite1_Main.sprite      = GetPlanetSprite_Main(moon1.planetSprite_Main, moon1.planetType);
            moonSprite1_Secondary.sprite = GetPlanetSprite_Secondary(moon1.planetSprite_Secondary, moon1.planetType);

            moonSprite1_Main.color      = GetPlanetColor(moon1.primaryColor);
            moonSprite1_Secondary.color = GetPlanetColor(moon1.secondaryColor);
        }
        else
        {
            moonContainer1_GO.SetActive(false);
        }

        //Moon
        if (planet.planetMoonPlanet_List.Count >= 2 && moonContainer2_GO != null)
        {
            RARC_Planet moon2 = planet.planetMoonPlanet_List[1];

            moonContainer2_GO.SetActive(true);

            moonSprite2_Main.transform.rotation      = Quaternion.Euler(0, 0, moon2.planetRotation);
            moonSprite2_Secondary.transform.rotation = Quaternion.Euler(0, 0, moon2.planetRotation);

            moonSprite2_Main.sprite      = GetPlanetSprite_Main(moon2.planetSprite_Main, moon2.planetType);
            moonSprite2_Secondary.sprite = GetPlanetSprite_Secondary(moon2.planetSprite_Secondary, moon2.planetType);

            moonSprite2_Main.color      = GetPlanetColor(moon2.primaryColor);
            moonSprite2_Secondary.color = GetPlanetColor(moon2.secondaryColor);
        }
        else
        {
            moonContainer2_GO.SetActive(false);
        }
    }
コード例 #8
0
    /////////////////////////////////////////////////////////////////

    public void CreateNewSave()
    {
        //Set Weeks
        shipInfo_WeeksSurvived = 0;

        //Ship Rooms
        shipData_Rooms_Arr     = new RARC_Room.RoomType[16];
        shipData_Rooms_Arr[0]  = RARC_Room.RoomType.EMPTY;
        shipData_Rooms_Arr[1]  = RARC_Room.RoomType.EMPTY;
        shipData_Rooms_Arr[2]  = RARC_Room.RoomType.EMPTY;
        shipData_Rooms_Arr[3]  = RARC_Room.RoomType.EMPTY;
        shipData_Rooms_Arr[4]  = RARC_Room.RoomType.EMPTY;
        shipData_Rooms_Arr[5]  = RARC_Room.RoomType.EMPTY;
        shipData_Rooms_Arr[6]  = RARC_Room.RoomType.EMPTY;
        shipData_Rooms_Arr[7]  = RARC_Room.RoomType.EMPTY;
        shipData_Rooms_Arr[8]  = RARC_Room.RoomType.EMPTY;
        shipData_Rooms_Arr[9]  = RARC_Room.RoomType.EMPTY;
        shipData_Rooms_Arr[10] = RARC_Room.RoomType.EMPTY;
        shipData_Rooms_Arr[11] = RARC_Room.RoomType.EMPTY;
        shipData_Rooms_Arr[12] = RARC_Room.RoomType.EMPTY;
        shipData_Rooms_Arr[13] = RARC_Room.RoomType.EMPTY;
        shipData_Rooms_Arr[14] = RARC_Room.RoomType.EMPTY;
        shipData_Rooms_Arr[15] = RARC_Room.RoomType.EMPTY;

        //SET FIRST LOCATION AS EASTH????
        shipData_currentLocation        = null;
        shipData_NavigationDestination  = null;
        shipData_NavigationTripProgress = 0;

        //Events
        shipCurrentTravelEvents_List   = new List <RARC_Event>();
        shipAvalibleTravelEvents_List  = new List <RARC_Event>();
        shipBlacklistTravelEvents_List = new List <RARC_Event>();
        shipCurrentPlanetEvents_List   = new List <RARC_Event>();
        shipAvaliblePlanetEvents_List  = new List <RARC_Event>();
        shipBlacklistPlanetEvents_List = new List <RARC_Event>();

        //Intro Event
        shipCurrentTravelEvents_List.Add(new RARC_Event(RARC_DatabaseController.Instance.events_DB.event_ANewHope));

        //Travel Events
        shipAvalibleTravelEvents_List.Add(new RARC_Event(RARC_DatabaseController.Instance.events_DB.event_AbandonedShip));
        shipAvalibleTravelEvents_List.Add(new RARC_Event(RARC_DatabaseController.Instance.events_DB.event_Aliens));
        shipAvalibleTravelEvents_List.Add(new RARC_Event(RARC_DatabaseController.Instance.events_DB.event_Bedtime));

        shipAvalibleTravelEvents_List.Add(new RARC_Event(RARC_DatabaseController.Instance.events_DB.event_BigRock));
        shipAvalibleTravelEvents_List.Add(new RARC_Event(RARC_DatabaseController.Instance.events_DB.event_Freedom));
        shipAvalibleTravelEvents_List.Add(new RARC_Event(RARC_DatabaseController.Instance.events_DB.event_FriendlyGreeting));
        shipAvalibleTravelEvents_List.Add(new RARC_Event(RARC_DatabaseController.Instance.events_DB.event_PartyTime));
        shipAvalibleTravelEvents_List.Add(new RARC_Event(RARC_DatabaseController.Instance.events_DB.event_RottenFood));
        shipAvalibleTravelEvents_List.Add(new RARC_Event(RARC_DatabaseController.Instance.events_DB.event_UnknownSignalClose));
        shipAvalibleTravelEvents_List.Add(new RARC_Event(RARC_DatabaseController.Instance.events_DB.event_UnknownSignalFar));
        shipAvalibleTravelEvents_List.Add(new RARC_Event(RARC_DatabaseController.Instance.events_DB.event_Zoom));


        //Planet Events
        shipAvaliblePlanetEvents_List.Add(new RARC_Event(RARC_DatabaseController.Instance.events_DB.event_AncientRuins));
        shipAvaliblePlanetEvents_List.Add(new RARC_Event(RARC_DatabaseController.Instance.events_DB.event_CrackInTheSurface));
        shipAvaliblePlanetEvents_List.Add(new RARC_Event(RARC_DatabaseController.Instance.events_DB.event_CreaturesOnTheGround));



        //Event Missfires
        travelEventsMissed = 1;
        planetEventsMissed = 1;

        //Set New Resource Bases and Storage
        shipHullHealth     = 100;
        shipResource_Scrap = new RARC_Resource("Scrap", 30, RARC_Resource.ResourceType.Scrap);
        shipResource_Fuel  = new RARC_Resource("Fuel", 100, RARC_Resource.ResourceType.Fuel);
        shipResource_Food  = new RARC_Resource("Food", 100, RARC_Resource.ResourceType.Food);

        shipStorage_List = new List <RARC_Resource>();

        //shipStorage_List.Add(new RARC_Resource("Titanium", 10, RARC_Resource.ResourceType.Titanium));
        //shipStorage_List.Add(new RARC_Resource("Carbon", 15, RARC_Resource.ResourceType.Carbon));
        //shipStorage_List.Add(new RARC_Resource("Silicon", 5, RARC_Resource.ResourceType.Silicon));
        shipStorage_List.Add(new RARC_Resource("Organics", 30, RARC_Resource.ResourceType.Organics));
        shipStorage_List.Add(new RARC_Resource("Hydrogen", 30, RARC_Resource.ResourceType.Hydrogen));
        shipStorage_List.Add(new RARC_Resource("Nitrogen", 30, RARC_Resource.ResourceType.Nitrogen));



        //Create new Lists
        shipData_Crew_List = new List <RARC_Crew>();
        shipData_Bots_List = new List <RARC_Crew>();

        //Loop Spawning New Crew
        int startingCrewCount = 12;

        for (int i = 0; i < startingCrewCount; i++)
        {
            //Add New Crew to List
            shipData_Crew_List.Add(new RARC_Crew());
        }

        //Loop Spawning New Bots
        int startingBotCount = 2;

        for (int i = 0; i < startingBotCount; i++)
        {
            //Add New Crew to List
            shipData_Bots_List.Add(new RARC_Crew());
        }



        if (false)
        {
            //Debug Items
            shipResource_Scrap = new RARC_Resource("Scrap", 999, RARC_Resource.ResourceType.Scrap);
            shipResource_Fuel  = new RARC_Resource("Fuel", 999, RARC_Resource.ResourceType.Fuel);
            shipResource_Food  = new RARC_Resource("Food", 999, RARC_Resource.ResourceType.Food);
            shipStorage_List.Add(new RARC_Resource("Titanium", 999, RARC_Resource.ResourceType.Titanium));
            shipStorage_List.Add(new RARC_Resource("Carbon", 999, RARC_Resource.ResourceType.Carbon));
            shipStorage_List.Add(new RARC_Resource("Silicon", 999, RARC_Resource.ResourceType.Silicon));
            shipStorage_List.Add(new RARC_Resource("Organics", 999, RARC_Resource.ResourceType.Organics));
            shipStorage_List.Add(new RARC_Resource("Hydrogen", 999, RARC_Resource.ResourceType.Hydrogen));
            shipStorage_List.Add(new RARC_Resource("Nitrogen", 999, RARC_Resource.ResourceType.Nitrogen));
        }
    }