public SpawnLanceAtEdgeOfBoundary(EncounterRules encounterRules, string lanceKey, string orientationTargetKey, bool clusterUnits = false) : base(encounterRules)
 {
     this.lanceKey             = lanceKey;
     this.useOrientationTarget = true;
     this.orientationTargetKey = orientationTargetKey;
     this.clusterUnits         = clusterUnits;
 }
示例#2
0
 public SpawnObjectsAroundTarget(EncounterRules encounterRules, LogicState state, LookDirection lookDirection, float minDistance, float maxDistance) : base(encounterRules)
 {
     this.state = state;
     this.minDistanceFromTarget = minDistance;
     this.maxDistanceFromTarget = maxDistance;
     this.lookDirection         = lookDirection;
 }
        public AddEmployerLanceBatch(EncounterRules encounterRules, string orientationTargetKey,
                                     SpawnLogic.LookDirection lookDirection, float minDistance, float maxDistance)
        {
            int           numberOfUnitsInLance = 4;
            string        lanceGuid            = Guid.NewGuid().ToString();
            List <string> unitGuids            = encounterRules.GenerateGuids(numberOfUnitsInLance);
            string        employerTeamGuid     = EncounterRules.EMPLOYER_TEAM_ID;
            string        spawnerName          = $"Lance_Ally_SupportingForce_{lanceGuid}";

            encounterRules.EncounterLogic.Add(new AddLanceToAllyTeam(lanceGuid, unitGuids));
            encounterRules.EncounterLogic.Add(new AddLanceSpawnChunk(employerTeamGuid, lanceGuid, unitGuids, spawnerName,
                                                                     "Spawns a non-objective related ally supporting lance"));
            encounterRules.EncounterLogic.Add(new SpawnLanceMembersAroundTarget(encounterRules, spawnerName, orientationTargetKey,
                                                                                lookDirection, minDistance, maxDistance));

            if (Main.Settings.AdditionalLanceSettings.UseDialogue && !MissionControl.Instance.ContractStats.ContainsKey(ContractStats.DIALOGUE_ADDITIONAL_LANCE_ALLY_START))
            {
                MissionControl.Instance.ContractStats.Add(ContractStats.DIALOGUE_ADDITIONAL_LANCE_ALLY_START, true);
                encounterRules.EncounterLogic.Add(new AddDialogueChunk(
                                                      ChunkLogic.DIALOGUE_ADDITIONAL_LANCE_ALLY_START_GUID,
                                                      "AdditionalLanceAllyStart",
                                                      "Start Conversation For Additional Lance Ally",
                                                      lanceGuid
                                                      // "DialogBucketDef_Universal_KillConfirmed"
                                                      ));
                encounterRules.EncounterLogic.Add(new DialogTrigger(MessageCenterMessageType.OnEncounterIntroComplete, ChunkLogic.DIALOGUE_ADDITIONAL_LANCE_ALLY_START_GUID));
            }

            encounterRules.ObjectReferenceQueue.Add(spawnerName);
        }
示例#4
0
 public AddExtraLanceSpawnsForExtendedLancesBatch(EncounterRules encounterRules)
 {
     encounterRules.EncounterLogic.Add(new AddExtraLanceMembers(state));
     encounterRules.EncounterLogic.Add(new AddExtraLanceMembersIndividualSecondPass(state));
     encounterRules.EncounterLogic.Add(new AddExtraLanceSpawnPoints(encounterRules, state));
     encounterRules.EncounterLogic.Add(new SpawnObjectsAroundTarget(encounterRules, state, SceneManipulationLogic.LookDirection.AWAY_FROM_TARGET));
 }
示例#5
0
        public AddTargetLanceWithDestroyObjectiveBatch(EncounterRules encounterRules, string orientationTargetKey,
                                                       SpawnLogic.LookDirection lookDirection, float minDistance, float maxDistance, string objectiveName, int priority, bool isPrimaryObjective)
        {
            int           numberOfUnitsInLance  = 4;
            string        lanceGuid             = Guid.NewGuid().ToString();
            string        contractObjectiveGuid = Guid.NewGuid().ToString();
            string        objectiveGuid         = Guid.NewGuid().ToString();
            List <string> unitGuids             = encounterRules.GenerateGuids(numberOfUnitsInLance);
            string        targetTeamGuid        = EncounterRules.TARGET_TEAM_ID;
            string        spawnerName           = $"Lance_Enemy_OpposingForce_{lanceGuid}";

            // AddPartialContractObjective addPartialContractObjective = new AddPartialContractObjective(contractObjectiveGuid, false, objectiveName, objectiveName);
            // addPartialContractObjective.ObjectiveGuids.Add(objectiveGuid);
            // AddContractObjectiveToEncounter addContractObjectiveToEncounter = new AddContractObjectiveToEncounter(contractObjectiveGuid);

            encounterRules.EncounterLogic.Add(new AddLanceToTargetTeam(lanceGuid, unitGuids));
            // encounterRules.EncounterLogic.Add(addPartialContractObjective);
            // encounterRules.EncounterLogic.Add(addContractObjectiveToEncounter);
            encounterRules.EncounterLogic.Add(new AddDestroyWholeUnitChunk(encounterRules, targetTeamGuid, lanceGuid, unitGuids,
                                                                           // spawnerName, objectiveGuid, objectiveName, priority, isPrimaryObjective, contractObjectiveGuid));
                                                                           spawnerName, objectiveGuid, objectiveName, priority, isPrimaryObjective));
            encounterRules.EncounterLogic.Add(new SpawnLanceMembersAroundTarget(encounterRules, spawnerName, orientationTargetKey,
                                                                                SpawnLogic.LookDirection.AWAY_FROM_TARGET, minDistance, maxDistance));

            encounterRules.ObjectReferenceQueue.Add(spawnerName);
        }
示例#6
0
        public AddCustomPlayerMechsBatch(EncounterRules encounterRules)
        {
            int           numberOfUnitsInLance = 4;
            string        lanceGuid            = Guid.NewGuid().ToString();
            string        employerGuid         = EncounterRules.EMPLOYER_TEAM_ID;
            List <string> unitGuids            = encounterRules.GenerateGuids(numberOfUnitsInLance);
            string        spawnerName          = $"Lance_Custom_PlayerLance_{lanceGuid}";

            encounterRules.EncounterLogic.Add(new AddCustomPlayerLanceExtraSpawnPoints());

            int playerAiUnitCount = MissionControl.Instance.CurrentContract.Lances.GetLanceUnits(EncounterRules.EMPLOYER_TEAM_ID).Length;

            if (playerAiUnitCount > 0)
            {
                Main.Logger.Log($"[AddCustomPlayerMechsBatch] Detected AI player controlled lance. Queuing up encounter logic to handle this.");

                encounterRules.EncounterLogic.Add(new AddCustomPlayerLanceSpawnChunk(employerGuid, lanceGuid, unitGuids, spawnerName,
                                                                                     "Spawns a custom (player or Ai) controlled player lance"));

                encounterRules.EncounterLogic.Add(new SpawnLanceAroundTarget(encounterRules, spawnerName, "SpawnerPlayerLance",
                                                                             SpawnLogic.LookDirection.AWAY_FROM_TARGET, 200f, 250f, true));
            }

            encounterRules.ObjectReferenceQueue.Add(spawnerName);
        }
        private void AddDialogueChunk(EncounterRules encounterRules)
        {
            DialogueOverride dialogueOverride = GetPresetDynamicWithdrawDialogue();

            if (dialogueOverride == null)
            {
                encounterRules.EncounterLogic.Add(new AddDialogueChunk(
                                                      ChunkLogic.DIALOGUE_DYNAMIC_WITHDRAW_ESCAPE_GUID,
                                                      "DynamicWithdrawEscape",
                                                      "Start Conversation For Dynamic Withdraw Escape",
                                                      ChunkLogic.DYNAMIC_WITHDRAW_REGION_GUID,
                                                      true,
                                                      "I'm coming in hot. Get to the EZ as soon as you can, Commander",
                                                      UnityGameInstance.BattleTechGame.DataManager.CastDefs.Get("castDef_SumireDefault")
                                                      ));
            }
            else
            {
                encounterRules.EncounterLogic.Add(new AddDialogueChunk(
                                                      ChunkLogic.DIALOGUE_DYNAMIC_WITHDRAW_ESCAPE_GUID,
                                                      "DynamicWithdrawEscape",
                                                      "Start Conversation For Dynamic Withdraw Escape",
                                                      dialogueOverride
                                                      ));
            }
        }
示例#8
0
        public AddPlayer2LanceWithDestroyObjectiveBatch(EncounterRules encounterRules, string orientationTargetKey,
                                                        SpawnLogic.LookDirection lookDirection, float minDistance, float maxDistance, string objectiveName, int priority,
                                                        bool isPrimaryObjective, bool displayToUser, bool showObjectiveOnLanceDetected, bool excludeFromAutocomplete)
        {
            int           numberOfUnitsInLance = 4;
            string        lanceGuid            = Guid.NewGuid().ToString();
            string        objectiveGuid        = Guid.NewGuid().ToString();
            List <string> unitGuids            = encounterRules.GenerateGuids(numberOfUnitsInLance);
            string        targetTeamGuid       = EncounterRules.PLAYER_2_TEAM_ID;
            string        spawnerName          = $"Lance_Enemy_OpposingForce_{lanceGuid}";

            encounterRules.EncounterLogic.Add(new AddLanceToPlayer2Team(lanceGuid, unitGuids));
            encounterRules.EncounterLogic.Add(new AddDestroyWholeUnitChunk(encounterRules, targetTeamGuid, lanceGuid, unitGuids,
                                                                           spawnerName, objectiveGuid, objectiveName, priority, isPrimaryObjective, displayToUser));
            if (!excludeFromAutocomplete)
            {
                encounterRules.EncounterLogic.Add(new AddObjectiveToAutocompleteTrigger(objectiveGuid));
            }
            encounterRules.EncounterLogic.Add(new SpawnLanceMembersAroundTarget(encounterRules, spawnerName, orientationTargetKey,
                                                                                SpawnLogic.LookDirection.AWAY_FROM_TARGET, minDistance, maxDistance));

            if (showObjectiveOnLanceDetected)
            {
                encounterRules.EncounterLogic.Add(new ShowObjectiveTrigger(MessageCenterMessageType.OnLanceDetected, lanceGuid, objectiveGuid, false));
            }

            encounterRules.ObjectReferenceQueue.Add(spawnerName);
        }
示例#9
0
        public void RunEncounterRules(LogicBlock.LogicType type, RunPayload payload = null)
        {
            if (EncounterRules != null)
            {
                switch (type)
                {
                case LogicBlock.LogicType.RESOURCE_REQUEST: {
                    EncounterRules.Run(LogicBlock.LogicType.RESOURCE_REQUEST, payload);
                    break;
                }

                case LogicBlock.LogicType.CONTRACT_OVERRIDE_MANIPULATION: {
                    EncounterRules.Run(LogicBlock.LogicType.CONTRACT_OVERRIDE_MANIPULATION, payload);
                    break;
                }

                case LogicBlock.LogicType.ENCOUNTER_MANIPULATION: {
                    EncounterRules.Run(LogicBlock.LogicType.ENCOUNTER_MANIPULATION, payload);
                    break;
                }

                case LogicBlock.LogicType.SCENE_MANIPULATION: {
                    EncounterRules.Run(LogicBlock.LogicType.SCENE_MANIPULATION, payload);
                    break;
                }

                default: {
                    Main.Logger.LogError($"[RunEncounterRules] Unknown type of '{type.ToString()}'");
                    break;
                }
                }
            }
        }
 public SpawnObjectAnywhere(EncounterRules encounterRules, string objectKey, string orientationTargetKey, float mustBeBeyondDistance) : base(encounterRules)
 {
     this.objectKey            = objectKey;
     this.useOrientationTarget = true;
     this.orientationTargetKey = orientationTargetKey;
     this.distanceCheckType    = WithinOrBeyondDistanceType.MUST_BE_BEYOND;
     this.distanceCheck        = mustBeBeyondDistance;
 }
示例#11
0
 public SpawnObjectsAroundTarget(EncounterRules encounterRules, string objectKey, string orientationTargetKey, LookDirection lookDirection) : base(encounterRules)
 {
     this.objectKeys = new List <string> {
         objectKey
     };
     this.defaultOrientationTargetKey = orientationTargetKey;
     this.lookDirection = lookDirection;
 }
示例#12
0
        public GameObject GetPlayerSpawn()
        {
            GameObject encounterLayerGo     = MissionControl.Instance.EncounterLayerGameObject;
            GameObject chunkPlayerLanceGo   = encounterLayerGo.transform.Find(EncounterRules.GetPlayerLanceChunkName()).gameObject;
            GameObject spawnerPlayerLanceGo = chunkPlayerLanceGo.transform.Find(EncounterRules.GetPlayerLanceSpawnerName()).gameObject;

            return(spawnerPlayerLanceGo);
        }
示例#13
0
 public SpawnObjectsAroundTarget(EncounterRules encounterRules, List <string> objectKeys, string orientationTargetKey, LookDirection lookDirection, float minDistance, float maxDistance) : base(encounterRules)
 {
     this.objectKeys = objectKeys;
     this.defaultOrientationTargetKey = orientationTargetKey;
     this.minDistanceFromTarget       = minDistance;
     this.maxDistanceFromTarget       = maxDistance;
     this.lookDirection = lookDirection;
 }
示例#14
0
        public GameObject GetPlayerSpawn()
        {
            GameObject encounterLayerGo     = MissionControl.Instance.EncounterLayerGameObject;
            GameObject chunkPlayerLanceGo   = EncounterRules.GetPlayerLanceChunkGameObject(encounterLayerGo);
            GameObject spawnerPlayerLanceGo = EncounterRules.GetPlayerSpawnerGameObject(chunkPlayerLanceGo);

            return(spawnerPlayerLanceGo);
        }
示例#15
0
 public SpawnLanceMembersAroundTarget(EncounterRules encounterRules, string lanceKey, string orientationTargetKey, string lookTargetKey, LookDirection lookDirection, float mustBeBeyondDistance, float mustBeWithinDistance) : base(encounterRules)
 {
     this.lanceKey             = lanceKey;
     this.orientationTargetKey = orientationTargetKey;
     this.lookTargetKey        = lookTargetKey;
     this.lookDirection        = lookDirection;
     this.mustBeBeyondDistance = mustBeBeyondDistance;
     this.mustBeWithinDistance = mustBeWithinDistance;
 }
示例#16
0
 public SpawnLanceAnywhere(EncounterRules encounterRules, string lanceKey, string orientationTargetKey, float mustBeBeyondDistance, bool clusterUnits = false) : base(encounterRules)
 {
     this.lanceKey             = lanceKey;
     this.useOrientationTarget = true;
     this.orientationTargetKey = orientationTargetKey;
     this.distanceCheckType    = WithinOrBeyondDistanceType.MUST_BE_BEYOND;
     this.distanceCheck        = mustBeBeyondDistance;
     this.clusterUnits         = clusterUnits;
 }
 public SpawnLanceAtEdgeOfBoundary(EncounterRules encounterRules, string lanceKey, string orientationTargetKey, WithinOrBeyondDistanceType distanceCheckType, float checkDistance, bool clusterUnits = false) : base(encounterRules)
 {
     this.lanceKey             = lanceKey;
     this.useOrientationTarget = true;
     this.orientationTargetKey = orientationTargetKey;
     this.distanceCheckType    = distanceCheckType;
     this.distanceCheck        = checkDistance;
     this.clusterUnits         = clusterUnits;
 }
示例#18
0
 public SpawnLanceMembersAroundTarget(EncounterRules encounterRules, string lanceKey, string orientationTargetKey, string lookTargetKey, LookDirection lookDirection, float minDistance, float maxDistance) : base(encounterRules)
 {
     this.lanceKey             = lanceKey;
     this.orientationTargetKey = orientationTargetKey;
     this.lookTargetKey        = lookTargetKey;
     this.lookDirection        = lookDirection;
     minDistanceFromTarget     = minDistance;
     maxDistanceFromTarget     = maxDistance;
 }
 public SpawnLanceAnywhere(EncounterRules encounterRules, string lanceKey, string orientationTargetKey, float minimumDistance, bool clusterUnits = false) : base(encounterRules)
 {
     this.lanceKey             = lanceKey;
     this.useOrientationTarget = true;
     this.orientationTargetKey = orientationTargetKey;
     this.useMiniumDistance    = true;
     this.minimumDistance      = minimumDistance;
     this.clusterUnits         = clusterUnits;
 }
        public AddDynamicWithdrawBatch(EncounterRules encounterRules)
        {
            Main.Logger.Log($"[{this.GetType().Name}] Building Dynamic Withdraw");

            encounterRules.EncounterLogic.Add(new DoesChunkExist(state, "Chunk_Withdraw"));
            encounterRules.EncounterLogic.Add(new AddWithdrawChunk(state, ChunkLogic.DYNAMIC_WITHDRAW_CHUNK_GUID, ChunkLogic.DYNAMIC_WITHDRAW_OBJECTIVE_GUID, ChunkLogic.DYNAMIC_WITHDRAW_REGION_GUID));
            encounterRules.EncounterLogic.Add(new WithdrawChunkTrigger((MessageCenterMessageType)MessageTypes.ON_CHUNK_ACTIVATED, ChunkLogic.DYNAMIC_WITHDRAW_CHUNK_GUID));
            encounterRules.EncounterLogic.Add(new EndCombatTrigger(MessageCenterMessageType.OnObjectiveSucceeded, ChunkLogic.DYNAMIC_WITHDRAW_OBJECTIVE_GUID, EndCombatTrigger.EndCombatType.RETREAT));
            AddDialogueChunk(encounterRules);

            encounterRules.EncounterLogic.Add(new DialogTrigger((MessageCenterMessageType)MessageTypes.ON_CHUNK_ACTIVATED, ChunkLogic.DIALOGUE_DYNAMIC_WITHDRAW_ESCAPE_GUID));
        }
示例#21
0
 public AddDestroyWholeUnitChunk(EncounterRules encounterRules, string teamGuid, string lanceGuid, List <string> unitGuids,
                                 string spawnerName, string objectiveGuid, string objectiveLabel, int priority, bool isPrimary, string contractObjectiveGameLogicGuid = null)
 {
     this.encounterRules = encounterRules;
     this.teamGuid       = teamGuid;
     this.lanceGuid      = lanceGuid;
     this.unitGuids      = unitGuids;
     this.spawnerName    = spawnerName;
     this.objectiveGuid  = objectiveGuid;
     this.objectiveLabel = objectiveLabel;
     this.priority       = priority;
     this.isPrimary      = isPrimary;
     this.contractObjectiveGameLogicGuid = contractObjectiveGameLogicGuid;
 }
示例#22
0
 private void SetEncounterRule(Type encounterRules)
 {
     if (AllowMissionControl())
     {
         EncounterRules     = (EncounterRules)Activator.CreateInstance(encounterRules);
         EncounterRulesName = encounterRules.Name.Replace("EncounterRules", "");
         EncounterRules.Build();
         EncounterRules.ActivatePostFeatures();
     }
     else
     {
         EncounterRules     = null;
         EncounterRulesName = null;
     }
 }
示例#23
0
 private void SetEncounterRule(Type encounterRules)
 {
     if (AllowMissionControl())
     {
         EncounterRules     = (EncounterRules)Activator.CreateInstance(encounterRules);
         EncounterRulesName = encounterRules.Name.Replace("EncounterRules", "");
         EncounterRules.Build();
         EncounterRules.ActivatePostFeatures();
     }
     else
     {
         Main.Logger.Log($"[MissionControl] Mission Control is not allowed to run. Possibly a story mission or flashpoint contract.");
         EncounterRules     = null;
         EncounterRulesName = null;
     }
 }
示例#24
0
 private void SetEncounterRule(Type encounterRules)
 {
     if (AllowMissionControl())
     {
         EncounterRules     = (EncounterRules)Activator.CreateInstance(encounterRules);
         EncounterRulesName = encounterRules.Name.Replace("EncounterRules", "");
         EncounterRules.Build();
         EncounterRules.ActivatePostFeatures();
     }
     else
     {
         Main.Logger.Log($"[MissionControl] Mission Control is NOT allowed to run.");
         EncounterRules      = null;
         EncounterRulesName  = null;
         IsMCLoadingFinished = true;
     }
 }
示例#25
0
        public AddCustomPlayerMechsBatch(EncounterRules encounterRules)
        {
            int           numberOfUnitsInLance = 4;
            string        lanceGuid            = Guid.NewGuid().ToString();
            string        employerGuid         = EncounterRules.EMPLOYER_TEAM_ID;
            List <string> unitGuids            = encounterRules.GenerateGuids(numberOfUnitsInLance);
            string        spawnerName          = $"Lance_Custom_PlayerLance_{lanceGuid}";

            encounterRules.EncounterLogic.Add(new AddCustomPlayerLanceExtraSpawnPoints());

            encounterRules.EncounterLogic.Add(new AddCustomPlayerLanceSpawnChunk(employerGuid, lanceGuid, unitGuids, spawnerName,
                                                                                 "Spawns a custom (player or Ai) controlled player lance"));

            encounterRules.EncounterLogic.Add(new SpawnLanceAroundTarget(encounterRules, spawnerName, "SpawnerPlayerLance",
                                                                         SpawnLogic.LookDirection.AWAY_FROM_TARGET, 200f, 250f, true));

            encounterRules.ObjectReferenceQueue.Add(spawnerName);
        }
示例#26
0
        public AddPlayer2LanceWithDestroyObjectiveBatch(EncounterRules encounterRules, string orientationTargetKey,
                                                        SpawnLogic.LookDirection lookDirection, float minDistance, float maxDistance, string objectiveName, int priority, bool isPrimaryObjective)
        {
            int           numberOfUnitsInLance = 4;
            string        lanceGuid            = Guid.NewGuid().ToString();
            string        objectiveGuid        = Guid.NewGuid().ToString();
            List <string> unitGuids            = encounterRules.GenerateGuids(numberOfUnitsInLance);
            string        targetTeamGuid       = EncounterRules.PLAYER_2_TEAM_ID;
            string        spawnerName          = $"Lance_Enemy_OpposingForce_{lanceGuid}";

            encounterRules.EncounterLogic.Add(new AddLanceToPlayer2Team(lanceGuid, unitGuids));
            encounterRules.EncounterLogic.Add(new AddDestroyWholeUnitChunk(encounterRules, targetTeamGuid, lanceGuid, unitGuids,
                                                                           spawnerName, objectiveGuid, objectiveName, priority, isPrimaryObjective));
            encounterRules.EncounterLogic.Add(new SpawnLanceMembersAroundTarget(encounterRules, spawnerName, orientationTargetKey,
                                                                                SpawnLogic.LookDirection.AWAY_FROM_TARGET, minDistance, maxDistance));

            encounterRules.ObjectReferenceQueue.Add(spawnerName);
        }
示例#27
0
 public SpawnObjectsAroundTarget(EncounterRules encounterRules, LogicState state, LookDirection lookDirection) : base(encounterRules)
 {
     this.state         = state;
     this.lookDirection = lookDirection;
 }
 public SpawnObjectAnywhere(EncounterRules encounterRules, string objectKey, string orientationTargetKey) : base(encounterRules)
 {
     this.objectKey            = objectKey;
     this.orientationTargetKey = orientationTargetKey;
 }
示例#29
0
 public SpawnLanceLogic(EncounterRules encounterRules) : base(encounterRules)
 {
 }
 public SpawnLanceAnywhere(EncounterRules encounterRules, string lanceKey, string orientationTargetKey, bool clusterUnits = false) : base(encounterRules)
 {
     this.lanceKey             = lanceKey;
     this.orientationTargetKey = orientationTargetKey;
     this.clusterUnits         = clusterUnits;
 }