Esempio n. 1
0
        private void SpawnRequestedReinforcements()
        {
            Building_OrbitalRelay orbitalRelay = OG_Util.FindOrbitalRelay(this.Faction);

            if (orbitalRelay != null)
            {
                for (int pawnIndex = 0; pawnIndex < orbitalRelay.requestedOfficersNumber; pawnIndex++)
                {
                    Pawn pawn = OG_Inhabitants.GeneratePawn(OG_Util.OutpostOfficerDef);
                    GenSpawn.Spawn(pawn, this.Position);
                }
                for (int pawnIndex = 0; pawnIndex < orbitalRelay.requestedHeavyGuardsNumber; pawnIndex++)
                {
                    Pawn pawn = OG_Inhabitants.GeneratePawn(OG_Util.OutpostHeavyGuardDef);
                    GenSpawn.Spawn(pawn, this.Position);
                }
                for (int pawnIndex = 0; pawnIndex < orbitalRelay.requestedGuardsNumber; pawnIndex++)
                {
                    Pawn pawn = OG_Inhabitants.GeneratePawn(OG_Util.OutpostGuardDef);
                    GenSpawn.Spawn(pawn, this.Position);
                }
                for (int pawnIndex = 0; pawnIndex < orbitalRelay.requestedScoutsNumber; pawnIndex++)
                {
                    Pawn pawn = OG_Inhabitants.GeneratePawn(OG_Util.OutpostScoutDef);
                    GenSpawn.Spawn(pawn, this.Position);
                }
                for (int pawnIndex = 0; pawnIndex < orbitalRelay.requestedTechniciansNumber; pawnIndex++)
                {
                    Pawn pawn = OG_Inhabitants.GeneratePawn(OG_Util.OutpostTechnicianDef);
                    GenSpawn.Spawn(pawn, this.Position + Vector3Utility.RandomHorizontalOffset(4f).ToIntVec3());
                }
            }
        }
Esempio n. 2
0
 private void SpawnRequestedReinforcements()
 {
     for (int pawnIndex = 0; pawnIndex < this.requestedOfficersNumber; pawnIndex++)
     {
         Pawn pawn = OG_Inhabitants.GeneratePawn(OG_Util.OutpostOfficerDef);
         GenSpawn.Spawn(pawn, CellFinder.RandomClosewalkCellNear(this.Position, 4));
     }
     for (int pawnIndex = 0; pawnIndex < this.requestedHeavyGuardsNumber; pawnIndex++)
     {
         Pawn pawn = OG_Inhabitants.GeneratePawn(OG_Util.OutpostHeavyGuardDef);
         GenSpawn.Spawn(pawn, CellFinder.RandomClosewalkCellNear(this.Position, 4));
     }
     for (int pawnIndex = 0; pawnIndex < this.requestedGuardsNumber; pawnIndex++)
     {
         Pawn pawn = OG_Inhabitants.GeneratePawn(OG_Util.OutpostGuardDef);
         GenSpawn.Spawn(pawn, CellFinder.RandomClosewalkCellNear(this.Position, 4));
     }
     for (int pawnIndex = 0; pawnIndex < this.requestedScoutsNumber; pawnIndex++)
     {
         Pawn pawn = OG_Inhabitants.GeneratePawn(OG_Util.OutpostScoutDef);
         GenSpawn.Spawn(pawn, CellFinder.RandomClosewalkCellNear(this.Position, 4));
     }
     for (int pawnIndex = 0; pawnIndex < this.requestedTechniciansNumber; pawnIndex++)
     {
         Pawn pawn = OG_Inhabitants.GeneratePawn(OG_Util.OutpostTechnicianDef);
         GenSpawn.Spawn(pawn, CellFinder.RandomClosewalkCellNear(this.Position, 4));
     }
 }
Esempio n. 3
0
        void LaunchSecurityDropPods(int dropPodsNumber, PawnKindDef securityForcesDef, bool assaultColony)
        {
            IntVec3     dropPodSpot;
            List <Pawn> securityForcesList = new List <Pawn>();

            if ((dropPodsNumber == 0) || (securityForcesDef == null))
            {
                return;
            }
            OG_Inhabitants.InitializeUniformColorAccordingToBiome(); // Necessary in case of small outpost (no inhabitants were generated).
            for (int soldierIndex = 0; soldierIndex < dropPodsNumber; soldierIndex++)
            {
                bool validDropPodCellIsFound = DropCellFinder.TryFindDropSpotNear(this.dropZoneCenter, out dropPodSpot, true, false);
                if (validDropPodCellIsFound)
                {
                    Pawn soldier = OG_Inhabitants.GeneratePawn(securityForcesDef);
                    securityForcesList.Add(soldier);
                    DropPodUtility.MakeDropPodAt(dropPodSpot, new DropPodInfo
                    {
                        SingleContainedThing = soldier,
                        openDelay            = 240,
                        leaveSlag            = false
                    });
                }
            }

            LordJob lordJob;

            if (assaultColony)
            {
                lordJob = new LordJob_AssaultColony(OG_Util.FactionOfMAndCo, true, true, false);
            }
            else
            {
                lordJob = new LordJob_DefendPoint(this.dropZoneCenter);
            }
            Lord lord = LordMaker.MakeNewLord(OG_Util.FactionOfMAndCo, lordJob, securityForcesList);
        }