Exemple #1
0
    protected override void LabourResult(int iterations)
    {
        if (iterations < 1)
        {
            return;
        }
        workflow -= iterations;
        int memCount = (int)((workersCount / (float)maxWorkers) * Crew.MAX_MEMBER_COUNT);

        if (workersCount < memCount)
        {
            memCount = workersCount;
        }
        if (memCount > 0)
        {
            Crew c = Crew.CreateNewCrew(colony, memCount);
            workersCount -= memCount;
            workflow      = 0;
            finding       = false;
            AnnouncementCanvasController.MakeAnnouncement(Localization.GetCrewAction(LocalizedCrewAction.Ready, c));
            hireCost = hireCost * (1 + GameConstants.HIRE_COST_INCREASE);
            hireCost = ((int)(hireCost * 100)) / 100f;
            if (showOnGUI)
            {
                rcenterObserver.SelectCrew(c);
            }
        }
    }
Exemple #2
0
 override public void LabourUpdate()
 {
     if (!isActive | !isEnergySupplied)
     {
         return;
     }
     if (workersCount > 0)
     {
         if (finding)
         {
             workSpeed = (FIND_SPEED * 0.8f * colony.workspeed + 0.2f * Random.value) * GameMaster.LABOUR_TICK / workflowToProcess;
             workflow += workSpeed;
             if (workflow >= workflowToProcess)
             {
                 int memCount = (int)((workersCount / (float)maxWorkers) * Crew.MAX_MEMBER_COUNT);
                 if (workersCount < memCount)
                 {
                     memCount = workersCount;
                 }
                 if (memCount > 0)
                 {
                     Crew c = Crew.CreateNewCrew(colony, memCount);
                     workersCount -= memCount;
                     workflow      = 0;
                     finding       = false;
                     GameLogUI.MakeAnnouncement(Localization.GetCrewAction(LocalizedCrewAction.Ready, c));
                     hireCost = hireCost * (1 + GameConstants.HIRE_COST_INCREASE);
                     hireCost = ((int)(hireCost * 100)) / 100f;
                     if (showOnGUI)
                     {
                         rcenterObserver.SelectCrew(c);
                     }
                 }
             }
         }
     }
     else
     {
         if (workflow > 0)
         {
             workflow -= backupSpeed * GameMaster.LABOUR_TICK;
             if (workflow < 0)
             {
                 workflow = 0;
             }
         }
     }
 }
Exemple #3
0
    private void TestMethod()
    {
        mainChunk.RenderDataFullRecalculation();

        return;

        Vector3Int ecpos = Vector3Int.zero;
        byte       ir    = PlaneExtension.INNER_RESOLUTION;
        var        slist = mainChunk.surfaces;

        if (mainChunk.TryGetPlace(ref ecpos, ir))
        {
            Structure s = Structure.GetStructureByID(Structure.MINI_GRPH_REACTOR_3_ID);
            s.SetBasement(slist[ecpos.z], PixelPosByte.zero);
        }
        if (mainChunk.TryGetPlace(ref ecpos, ir))
        {
            Structure s = Structure.GetStructureByID(Structure.MINI_GRPH_REACTOR_3_ID);
            s.SetBasement(slist[ecpos.z], PixelPosByte.zero);
        }
        if (mainChunk.TryGetPlace(ref ecpos, ir))
        {
            Structure s = Structure.GetStructureByID(Structure.MINI_GRPH_REACTOR_3_ID);
            s.SetBasement(slist[ecpos.z], PixelPosByte.zero);
        }

        if (mainChunk.TryGetPlace(ref ecpos, ir))
        {
            Structure s = Structure.GetStructureByID(Structure.OBSERVATORY_ID);
            s.SetBasement(slist[ecpos.z], PixelPosByte.zero);
            (s as WorkBuilding).AddWorkers(50);
        }

        if (mainChunk.TryGetPlace(ref ecpos, ir))
        {
            Structure s = Structure.GetStructureByID(Structure.QUANTUM_TRANSMITTER_4_ID);
            s.SetBasement(slist[ecpos.z], PixelPosByte.zero);
        }

        if (mainChunk.TryGetPlace(ref ecpos, ir))
        {
            Structure s = Structure.GetStructureByID(Structure.SCIENCE_LAB_ID);
            s.SetBasement(slist[ecpos.z], PixelPosByte.zero);
        }

        if (mainChunk.TryGetPlace(ref ecpos, ir))
        {
            Structure s = Structure.GetStructureByID(Structure.EXPEDITION_CORPUS_4_ID);
            s.SetBasement(slist[ecpos.z], PixelPosByte.zero);
        }
        if (mainChunk.TryGetPlace(ref ecpos, ir))
        {
            Structure s = Structure.GetStructureByID(Structure.RECRUITING_CENTER_4_ID);
            s.SetBasement(slist[ecpos.z], PixelPosByte.zero);
        }
        if (mainChunk.TryGetPlace(ref ecpos, ir))
        {
            Structure s = Structure.GetStructureByID(Structure.SHUTTLE_HANGAR_4_ID);
            s.SetBasement(slist[ecpos.z], PixelPosByte.zero);
            (s as Hangar).FORCED_MakeShuttle();
        }

        Crew c = Crew.CreateNewCrew(colonyController, Crew.MAX_MEMBER_COUNT);

        colonyController.storage.AddResources(new ResourceContainer[] {
            new ResourceContainer(ResourceType.Fuel, 500f),
            new ResourceContainer(ResourceType.Supplies, 500f)
        });
        colonyController.AddEnergyCrystals(1000f);

        globalMap.FORCED_CreatePointOfInterest();
    }
    public static void PrepareForExpeditions()
    {
        var rm = GameMaster.realMaster;
        var colonyController = rm.colonyController;
        var mainChunk        = rm.mainChunk;

        if (colonyController == null)
        {
            return;
        }
        var planes = mainChunk.GetUnoccupiedSurfaces(8);

        planes[0]?.CreateStructure(Structure.RECRUITING_CENTER_4_ID);
        var c = Crew.CreateNewCrew(colonyController, Crew.MAX_CREWS_COUNT); c.Rename("Mony Mony");

        c = Crew.CreateNewCrew(colonyController, Crew.MAX_CREWS_COUNT); c.Rename("Black Rabbit");
        c = Crew.CreateNewCrew(colonyController, Crew.MAX_CREWS_COUNT); c.Rename("Bonemaker");
        c = Crew.CreateNewCrew(colonyController, Crew.MAX_CREWS_COUNT); c.Rename("Eiffiel Dungeon");
        planes[1]?.CreateStructure(Structure.QUANTUM_TRANSMITTER_4_ID);
        planes[2]?.CreateStructure(Structure.QUANTUM_TRANSMITTER_4_ID);
        planes[3]?.CreateStructure(Structure.QUANTUM_TRANSMITTER_4_ID);
        planes[4]?.CreateStructure(Structure.QUANTUM_TRANSMITTER_4_ID);
        planes[5]?.CreateStructure(Structure.EXPEDITION_CORPUS_4_ID);
        planes[6]?.CreateStructure(Structure.MINI_GRPH_REACTOR_3_ID);
        planes[7]?.CreateStructure(Structure.STORAGE_BLOCK_ID);
        colonyController.storage.AddResource(ResourceType.Fuel, 25000);
        colonyController.storage.AddResource(ResourceType.Supplies, 2000);

        var       pf = mainChunk.GetUnoccupiedEdgePosition(false, false);
        var       p  = pf.plane;
        Structure s;

        if (p != null)
        {
            s = p.CreateStructure(Structure.SHUTTLE_HANGAR_4_ID);
            if (s != null)
            {
                s.SetModelRotation(pf.faceIndex * 2);
                (s as Hangar).FORCED_MakeShuttle();
            }
        }
        pf = mainChunk.GetUnoccupiedEdgePosition(false, false);
        p  = pf.plane;
        if (p != null)
        {
            s = p.CreateStructure(Structure.SHUTTLE_HANGAR_4_ID);
            if (s != null)
            {
                s.SetModelRotation(pf.faceIndex * 2);
                (s as Hangar).FORCED_MakeShuttle();
            }
        }
        pf = mainChunk.GetUnoccupiedEdgePosition(false, false);
        p  = pf.plane;
        if (p != null)
        {
            s = p.CreateStructure(Structure.SHUTTLE_HANGAR_4_ID);
            if (s != null)
            {
                s.SetModelRotation(pf.faceIndex * 2);
                (s as Hangar).FORCED_MakeShuttle();
            }
        }
        pf = mainChunk.GetUnoccupiedEdgePosition(false, false);
        p  = pf.plane;
        if (p != null)
        {
            s = p.CreateStructure(Structure.SHUTTLE_HANGAR_4_ID);
            if (s != null)
            {
                s.SetModelRotation(pf.faceIndex * 2);
                (s as Hangar).FORCED_MakeShuttle();
            }
        }
        var globalMap = rm.globalMap;

        globalMap.FORCED_CreatePointOfInterest();
        globalMap.FORCED_CreatePointOfInterest();
        globalMap.FORCED_CreatePointOfInterest();
        globalMap.FORCED_CreatePointOfInterest();
        globalMap.FORCED_CreatePointOfInterest();
        globalMap.FORCED_CreatePointOfInterest();
        globalMap.FORCED_CreatePointOfInterest();
        globalMap.FORCED_CreatePointOfInterest();
        globalMap.FORCED_CreatePointOfInterest();
        globalMap.FORCED_CreatePointOfInterest();
    }