コード例 #1
0
 public void PrepareSettling()
 {
     if (settleQuest != null)
     {
         return;
     }
     settleQuest = new ConditionQuest(new SimpleCondition[3]
     {
         SimpleCondition.GetDummyCondition(null),
         SimpleCondition.GetDummyCondition(null),
         SimpleCondition.GetResourceCondition(ResourceType.Supplies, COLONISTS_SEND_COST)
     },
                                      colony, false, QuestIcon.PeopleIcon);
     settleQuest.steps[0] = localizer.colonistArrivedLabel;
     settleQuest.steps[1] = localizer.livingSpaceLabel;
     UIController.GetCurrent().updateEvent += CheckSettlingConditions;
     settleWindow = scenarioUI.ShowConditionPanel(1, settleQuest, this.SendColonists);
     settleWindow.SetMainIcon(UIController.iconsTexture, UIController.GetIconUVRect(Icons.Citizen));
     settleWindow.SetButtonText(localizer.sendColonistsLabel);
 }
コード例 #2
0
        protected void StartSectorBuildingQuest(byte ring, byte index, System.Action clickAction)
        {
            var conditions = new SimpleCondition[3];

            if (ring == 0) // INNER RING
            {
                switch (index)
                {
                case 0:
                    conditions[0] = SimpleCondition.GetResourceCondition(ResourceType.metal_K, 4100f);
                    conditions[1] = SimpleCondition.GetResourceCondition(ResourceType.metal_S, 1600f);
                    conditions[2] = SimpleCondition.GetMoneyCondition(2500f);
                    break;

                case 1:
                    conditions[0] = SimpleCondition.GetGearsCondition(4f);
                    conditions[1] = SimpleCondition.GetResourceCondition(ResourceType.metal_M, 2500f);
                    conditions[2] = SimpleCondition.GetResourceCondition(ResourceType.metal_E, 1200f);
                    break;

                case 2:
                    conditions[0] = SimpleCondition.GetMoneyCondition(2500f);
                    conditions[1] = SimpleCondition.GetResourceCondition(ResourceType.metal_P, 500f);
                    conditions[2] = SimpleCondition.GetResourceCondition(ResourceType.mineral_L, 2000f);
                    break;

                case 3:
                    conditions[0] = SimpleCondition.GetResourceCondition(ResourceType.metal_S, 1500f);
                    conditions[1] = SimpleCondition.GetResourceCondition(ResourceType.Concrete, 7530f);
                    conditions[2] = SimpleCondition.GetResourceCondition(ResourceType.Plastics, 7530f);
                    break;

                case 4:
                    conditions[0] = SimpleCondition.GetFreeWorkersCondition(500);
                    conditions[1] = SimpleCondition.GetMoneyCondition(1200f);
                    conditions[2] = SimpleCondition.GetResourceCondition(ResourceType.Food, 40000f);
                    break;

                case 5:
                    conditions[0] = SimpleCondition.GetFreeWorkersCondition(600);
                    conditions[1] = SimpleCondition.GetResourceCondition(ResourceType.metal_K, 1200f);
                    conditions[2] = SimpleCondition.GetMoneyCondition(1500f);
                    break;
                }
                conditionQuest = new ConditionQuest(conditions, colony, false, QuestIcon.FoundationRouteIcon);
            }
            else // OUTER RING
            {
                switch (index)
                {
                case 0:
                    conditions[0] = SimpleCondition.GetResourceCondition(ResourceType.Plastics, 6800f);
                    conditions[1] = SimpleCondition.GetResourceCondition(ResourceType.metal_K, 1200f);
                    conditions[2] = SimpleCondition.GetStoredEnergyCondition(6100f);
                    break;

                case 1:
                    conditions[0] = SimpleCondition.GetResourceCondition(ResourceType.Fuel, 250f);
                    conditions[1] = SimpleCondition.GetFreeWorkersCondition(700);
                    conditions[2] = SimpleCondition.GetMoneyCondition(1700f);
                    break;

                case 2:
                    conditions[0] = SimpleCondition.GetResourceCondition(ResourceType.Concrete, 8000f);
                    conditions[1] = SimpleCondition.GetResourceCondition(ResourceType.Plastics, 8000f);
                    conditions[2] = SimpleCondition.GetCrewsCondition(2, 3);
                    break;

                case 3:
                    conditions[0] = SimpleCondition.GetResourceCondition(ResourceType.metal_M, 5700f);
                    conditions[1] = SimpleCondition.GetShuttlesCondition(10);
                    conditions[2] = SimpleCondition.GetDummyCondition(true);
                    // 4 рейса с оборудованием
                    break;

                case 4:
                    conditions[0] = SimpleCondition.GetResourceCondition(ResourceType.Dirt, 12000f);
                    conditions[1] = SimpleCondition.GetResourceCondition(ResourceType.mineral_F, 2500f);
                    conditions[2] = SimpleCondition.GetResourceCondition(ResourceType.mineral_L, 1000f);
                    break;

                case 5:
                    conditions[0] = SimpleCondition.GetMoneyCondition(2000f);
                    conditions[1] = SimpleCondition.GetResourceCondition(ResourceType.Dirt, 1200f);
                    conditions[2] = SimpleCondition.GetGearsCondition(5f);
                    break;
                }
                //
                conditionQuest = new ConditionQuest(conditions, colony, false, QuestIcon.FoundationRouteIcon);
            }
            conditionQuest.CheckQuestConditions();
            conditionWindow = scenarioUI.ShowConditionPanel(0, conditionQuest, clickAction);
            conditionQuest.BindUIUpdateFunction(conditionWindow.Refresh);
            conditionQuest.SubscribeToUpdate(questUI);
        }