コード例 #1
0
        public override void Run(RunPayload payload)
        {
            if (!state.GetBool("Chunk_Withdraw_Exists"))
            {
                Main.Logger.Log($"[AddWithdrawChunk] Adding encounter structure");

                string playerSpawnerGuid = GetPlayerSpawnGuid();

                EmptyCustomChunkGameLogic emptyCustomChunk = ChunkFactory.CreateEmptyCustomChunk("Chunk_Withdraw");
                GameObject escapeChunkGo = emptyCustomChunk.gameObject;
                emptyCustomChunk.encounterObjectGuid = chunkGuid;
                emptyCustomChunk.startingStatus      = EncounterObjectStatus.Inactive;
                emptyCustomChunk.notes = debugDescription;

                RegionFactory.CreateWithdrawRegion(escapeChunkGo, regionGameLogicGuid, objectiveGuid);

                bool useDropship = true;
                OccupyRegionObjective occupyRegionObjective = ObjectiveFactory.CreateOccupyRegionObjective(
                    objectiveGuid,
                    escapeChunkGo,
                    playerSpawnerGuid,
                    regionGameLogicGuid,
                    "Withdraw",
                    "Get to the Evac Zone",
                    $"with {ProgressFormat.UNITS_OCCUPYING_SO_FAR}/{ProgressFormat.NUMBER_OF_UNITS_TO_OCCUPY} unit(s)",
                    "The objective for the player to withdraw and complete, or withdraw, the mission",
                    useDropship
                    );

                ObjectiveFactory.CreateContractObjective(occupyRegionObjective);
            }
            else
            {
                Main.Logger.Log($"[AddWithdrawChunk] 'Chunk_Withdraw' already exists in map. No need to recreate.");
            }
        }