Esempio n. 1
0
        public static void StartNewGame(NewGameChoices choices)
        {
            if (!choices.IsTutorial)
            {
                choices.AddMinimumSupplies();
                choices.AddBackerSupplies();
            }

            UnityEngine.Debug.Log("Starting new game");
            Game.Current = new Game()
            {
                IsNewGame  = true,
                IsTutorial = choices.IsTutorial,
                Bases      = new Base[]
                {
                    new Base(true)
                    {
                        Name    = choices.HomesteadName,
                        Region  = choices.ChosenLocation.Region,
                        LatLong = choices.ChosenLocation.LatLong,
                        InitialMatterPurchase    = choices.BoughtMatter,
                        InitialCraftablePurchase = choices.BoughtCraftables,
                        Crates                      = new CrateData[] { },
                        Habitats                    = new HabitatExtraData[] { },
                        ConstructionZones           = new ConstructionData[] { },
                        ResourcelessData            = new ResourcelessModuleData[] { },
                        SingleResourceContainerData = new SingleResourceModuleData[] { },
                        MultiResourceContainerData  = new MultipleResourceModuleData[] { },
                    }
                },
                Environment = new EnvironmentData()
                {
                    CurrentHour   = 9,
                    CurrentMinute = 0,
                    CurrentSol    = 0
                },
                Player = new PlayerData(true)
                {
                    Name          = choices.PlayerName,
                    BankAccount   = choices.RemainingFunds,
                    Financing     = choices.ChosenFinancing,
                    PackData      = EVA.EVA.GetDefaultPackData(),
                    EnRouteOrders = new List <Order>(),
                    PerkProgress  = choices.GetPerkProgress(),
                    Loadout       = new Equipment.Equipment[]
                    {
                        Equipment.Equipment.Multimeter, //secondary gadget //no more ChemicalSniffer
                        Equipment.Equipment.Blueprints, //primary gadget
                        Equipment.Equipment.Locked,     //tertiary gadget
                        Equipment.Equipment.Locked,     //secondary tool
                        Equipment.Equipment.EmptyHand,  //unequipped
                        Equipment.Equipment.PowerDrill, //primary tool
                    }
                },
                Score   = new GameScore(),
                History = new Simulation.GlobalHistory()
            };
            Base.Current = Game.Current.Bases[0];
            Perks.PerkMultipliers.LoadFromPlayerPerkProgress();
        }
Esempio n. 2
0
    internal void UpdateChoices(NewGameChoices choices)
    {
        foreach (RectTransform entry in SuppliesParent)
        {
            if (entry.gameObject.activeInHierarchy)
            {
                choices.BoughtMatter[(Matter)int.Parse(entry.name)] = int.Parse(entry.GetChild(3).GetComponent <InputField>().text);
            }
        }
        foreach (RectTransform entry in CraftablesParent)
        {
            if (entry.gameObject.activeInHierarchy)
            {
                choices.BoughtCraftables[(Craftable)int.Parse(entry.name)] = int.Parse(entry.GetChild(3).GetComponent <InputField>().text);
            }
        }

        choices.RecalculateFunds();
        RefreshFunds(choices);

        LaunchButton.interactable = choices.RemainingFunds >= 0f;
    }
Esempio n. 3
0
 public void RefreshFunds(NewGameChoices choices)
 {
     StartingFunds.text  = String.Format("Starting Funds: ${0:#,##0}k", choices.StartingFunds / 1000);
     RemainingFunds.text = String.Format("Remaining Funds: ${0:#,##0}k", choices.RemainingFunds / 1000);
 }