Пример #1
0
        private GameObject BuildEmptyChunk()
        {
            Main.LogDebug($"[ChunkTypeBuilder.{contractTypeBuilder.ContractTypeKey}] Building 'BuildEmptyChunk' (Container) Chunk");
            EmptyCustomChunkGameLogic emptyChunk = ChunkFactory.CreateEmptyCustomChunk(this.name, contractTypeBuilder.EncounterLayerGo.transform);

            SetupChunk(emptyChunk);
            return(emptyChunk.gameObject);
        }
        public override void Run(RunPayload payload)
        {
            Main.Logger.Log($"[AddCustomPlayerLanceSpawnChunk] Adding encounter structure");
            EncounterLayerData        encounterLayerData = MissionControl.Instance.EncounterLayerData;
            EmptyCustomChunkGameLogic emptyCustomChunk   = ChunkFactory.CreateEmptyCustomChunk("Chunk_Lance");

            emptyCustomChunk.encounterObjectGuid = System.Guid.NewGuid().ToString();
            emptyCustomChunk.notes = debugDescription;

            // Auto select Player or Employer based on the lance configurator
            if (teamGuid == null)
            {
                SpawnableUnit[] lanceUnits = MissionControl.Instance.CurrentContract.Lances.GetLanceUnits(EncounterRules.PLAYER_TEAM_ID);
                if (lanceUnits.Length > 4)
                {
                    teamGuid = EncounterRules.PLAYER_TEAM_ID;
                }
                else
                {
                    teamGuid = EncounterRules.EMPLOYER_TEAM_ID;
                }
            }

            // Guard: Don't do anything if there are no employer units and employer mode is on
            SpawnableUnit[] employerLanceUnits = MissionControl.Instance.CurrentContract.Lances.GetLanceUnits(EncounterRules.EMPLOYER_TEAM_ID);
            Main.Logger.Log($"[AddCustomPlayerLanceExtraSpawnPoints] '{employerLanceUnits.Length}' employer lance units are being sent to Mission Control by Bigger Drops.");
            if (employerLanceUnits.Length <= 0)
            {
                return;
            }

            bool spawnOnActivation = true;
            CustomPlayerLanceSpawnerGameLogic lanceSpawner = LanceSpawnerFactory.CreateCustomPlayerLanceSpawner(
                emptyCustomChunk.gameObject,
                spawnerName,
                lanceGuid,
                teamGuid,
                spawnOnActivation,
                SpawnUnitMethodType.ViaLeopardDropship,
                unitGuids
                );

            lanceSpawner.transform.position = Vector3.zero;
        }
Пример #3
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.CreateRegion(escapeChunkGo, regionGameLogicGuid, objectiveGuid, "Region_Withdraw", "regionDef_EvacZone");

                bool useDropship = true;
                OccupyRegionObjective occupyRegionObjective = ObjectiveFactory.CreateOccupyRegionObjective(
                    objectiveGuid,
                    escapeChunkGo,
                    null,
                    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",
                    0,
                    0,
                    useDropship,
                    new string[] { MissionControl.Instance.IsCustomContractType ? "Player 1" : "player_unit" },
                    new string[] { "opposing_unit" }
                    );

                ObjectiveFactory.CreateContractObjective(occupyRegionObjective);
            }
            else
            {
                Main.Logger.Log($"[AddWithdrawChunk] 'Chunk_Withdraw' already exists in map. No need to recreate.");
            }
        }
Пример #4
0
        public override void Run(RunPayload payload)
        {
            Main.Logger.Log($"[AddLanceSpawnChunk] Adding encounter structure");
            EncounterLayerData        encounterLayerData = MissionControl.Instance.EncounterLayerData;
            EmptyCustomChunkGameLogic emptyCustomChunk   = ChunkFactory.CreateEmptyCustomChunk("Chunk_Lance");

            emptyCustomChunk.encounterObjectGuid = System.Guid.NewGuid().ToString();
            emptyCustomChunk.notes = debugDescription;

            bool spawnOnActivation             = true;
            LanceSpawnerGameLogic lanceSpawner = LanceSpawnerFactory.CreateLanceSpawner(
                emptyCustomChunk.gameObject,
                spawnerName,
                lanceGuid,
                teamGuid,
                spawnOnActivation,
                SpawnUnitMethodType.InstantlyAtSpawnPoint,
                unitGuids
                );

            lanceSpawner.transform.position = Vector3.zero;
        }