private GameObject BuildDestroyWholeLanceChunk()
        {
            Main.LogDebug($"[ChunkTypeBuilder.{contractTypeBuilder.ContractTypeKey}] Building 'DestroyWholeLance' Chunk");
            DestroyWholeLanceChunk destroyWholeLanceChunkGameLogic = ChunkFactory.CreateDestroyWholeLanceChunk(this.name, contractTypeBuilder.EncounterLayerGo.transform);

            SetupChunk(destroyWholeLanceChunkGameLogic);
            return(destroyWholeLanceChunkGameLogic.gameObject);
        }
        public override void Run(RunPayload payload)
        {
            Main.Logger.Log($"[AddDestroyWholeUnitChunk] Adding encounter structure");
            EncounterLayerData     encounterLayerData = MissionControl.Instance.EncounterLayerData;
            DestroyWholeLanceChunk destroyWholeChunk  = ChunkFactory.CreateDestroyWholeLanceChunk();

            destroyWholeChunk.encounterObjectGuid = System.Guid.NewGuid().ToString();

            this.objectiveLabel = MissionControl.Instance.CurrentContract.Interpolate(this.objectiveLabel).ToString();

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

            bool showProgress = true;
            DestroyLanceObjective objective = ObjectiveFactory.CreateDestroyLanceObjective(
                objectiveGuid,
                destroyWholeChunk.gameObject,
                lanceSpawnerRef,
                lanceGuid,
                objectiveLabel,
                showProgress,
                ProgressFormat.PERCENTAGE_COMPLETE,
                "The primary objective to destroy the enemy lance",
                priority,
                displayToUser,
                ObjectiveMark.AttackTarget,
                contractObjectiveGameLogicGuid,
                Main.Settings.ActiveAdditionalLances.GetRewards()
                );

            if (isPrimary)
            {
                AccessTools.Field(typeof(ObjectiveGameLogic), "primary").SetValue(objective, true);
            }
            else
            {
                AccessTools.Field(typeof(ObjectiveGameLogic), "primary").SetValue(objective, false);
            }

            DestroyLanceObjectiveRef destroyLanceObjectiveRef = new DestroyLanceObjectiveRef();

            destroyLanceObjectiveRef.encounterObject = objective;

            destroyWholeChunk.lanceSpawner     = lanceSpawnerRef;
            destroyWholeChunk.destroyObjective = destroyLanceObjectiveRef;
        }
Beispiel #3
0
        private GameObject BuildDestroyWholeLanceChunk()
        {
            Main.LogDebug($"[ChunkTypeBuilder.{contractTypeBuilder.ContractTypeKey}] Building 'DestroyWholeLance' Chunk");
            DestroyWholeLanceChunk destroyWholeLanceChunkGameLogic = ChunkFactory.CreateDestroyWholeLanceChunk(this.name, contractTypeBuilder.EncounterLayerGo.transform);

            destroyWholeLanceChunkGameLogic.encounterObjectGuid = this.guid;
            if (controlledByContract)
            {
                destroyWholeLanceChunkGameLogic.startingStatus = EncounterObjectStatus.ControlledByContract;
            }
            return(destroyWholeLanceChunkGameLogic.gameObject);
        }