public override void Run(RunPayload payload) { Main.Logger.Log($"[AddExtraLanceSpawnPoints] Adding lance spawn points to match contract override data"); Contract contract = MissionControl.Instance.CurrentContract; EncounterLayerData encounterLayerData = MissionControl.Instance.EncounterLayerData; ContractOverride contractOverride = contract.Override; lancesToSkip = (List <string>)state.GetObject("LancesToSkip"); lanceSpawners = new List <LanceSpawnerGameLogic>(encounterLayerData.gameObject.GetComponentsInChildren <LanceSpawnerGameLogic>()); // Backwards compatibility between EL v1 and v2 for renaming of key string targetKey = (Main.Settings.ActiveContractSettings.Has(ContractSettingsOverrides.ExtendedLances_TargetLanceSizeOverride)) ? ContractSettingsOverrides.ExtendedLances_TargetLanceSizeOverride : ContractSettingsOverrides.ExtendedLances_EnemyLanceSizeOverride; string employerKey = (Main.Settings.ActiveContractSettings.Has(ContractSettingsOverrides.ExtendedLances_EmployerLanceSizeOverride)) ? ContractSettingsOverrides.ExtendedLances_EmployerLanceSizeOverride : ContractSettingsOverrides.ExtendedLances_AllyLanceSizeOverride; PrepareIncreaseLanceMembers(contractOverride, contractOverride.targetTeam, targetKey, "Target"); PrepareIncreaseLanceMembers(contractOverride, contractOverride.employerTeam, employerKey, "Employer"); if (Main.Settings.ExtendedLances.EnableForTargetAlly) { PrepareIncreaseLanceMembers(contractOverride, contractOverride.targetsAllyTeam, ContractSettingsOverrides.ExtendedLances_TargetAllyLanceSizeOverride, "TargetAlly"); } else { Main.LogDebug($"[AddExtraLanceSpawnPoints] [{contractOverride.targetsAllyTeam}] TargetAlly is 'false' so will not increase lance members"); } if (Main.Settings.ExtendedLances.EnableForEmployerAlly) { PrepareIncreaseLanceMembers(contractOverride, contractOverride.employersAllyTeam, ContractSettingsOverrides.ExtendedLances_EmployerAllyLanceSizeOverride, "EmployerAlly"); } else { Main.LogDebug($"[AddExtraLanceSpawnPoints] [{contractOverride.employersAllyTeam}] EmployerAlly is 'false' so will not increase lance members"); } if (Main.Settings.ExtendedLances.EnableForHostileToAll) { PrepareIncreaseLanceMembers(contractOverride, contractOverride.hostileToAllTeam, ContractSettingsOverrides.ExtendedLances_HostileToAllLanceSizeOverride, "HostileToAll"); } else { Main.LogDebug($"[AddExtraLanceSpawnPoints] [{contractOverride.hostileToAllTeam}] HostileToAll is 'false' so will not increase lance members"); } if (Main.Settings.ExtendedLances.EnableForNeutralToAll) { PrepareIncreaseLanceMembers(contractOverride, contractOverride.neutralToAllTeam, ContractSettingsOverrides.ExtendedLances_NeutralToAllLanceSizeOverride, "NeutralToAll"); } else { Main.LogDebug($"[AddExtraLanceSpawnPoints] [{contractOverride.neutralToAllTeam}] NeutralToAll is 'false' so will not increase lance members"); } state.Set("ExtraLanceSpawnKeys", spawnKeys); }
public override void Run(RunPayload payload) { Main.Logger.Log($"[DoesChunkExist] Checking if '{this.chunkName}' exists"); GameObject encounterLayerGameObject = MissionControl.Instance.EncounterLayerGameObject; GameObject result = encounterLayerGameObject.FindRecursive(this.chunkName); if (result != null) { state.Set($"{chunkName}_Exists", true); } }
public override void Run(RunPayload payload) { Main.Logger.Log($"[AddExtraLanceSpawnPoints] Adding lance spawn points to match contract override data"); Contract contract = MissionControl.Instance.CurrentContract; EncounterLayerData encounterLayerData = MissionControl.Instance.EncounterLayerData; ContractOverride contractOverride = contract.Override; lanceSpawners = new List <LanceSpawnerGameLogic>(encounterLayerData.gameObject.GetComponentsInChildren <LanceSpawnerGameLogic>()); TeamOverride targetTeamOverride = contractOverride.targetTeam; TeamOverride employerTeamOverride = contractOverride.employerTeam; IncreaseLanceSpawnPoints(contractOverride, targetTeamOverride); IncreaseLanceSpawnPoints(contractOverride, employerTeamOverride); state.Set("ExtraLanceSpawnKeys", spawnKeys); }
public override void Run(RunPayload payload) { Main.Logger.Log($"[AddExtraLanceSpawnPoints] Adding lance spawn points to match contract override data"); Contract contract = MissionControl.Instance.CurrentContract; EncounterLayerData encounterLayerData = MissionControl.Instance.EncounterLayerData; ContractOverride contractOverride = contract.Override; lancesToSkip = (List <string>)state.GetObject("LancesToSkip"); lanceSpawners = new List <LanceSpawnerGameLogic>(encounterLayerData.gameObject.GetComponentsInChildren <LanceSpawnerGameLogic>()); TeamOverride targetTeamOverride = contractOverride.targetTeam; TeamOverride employerTeamOverride = contractOverride.employerTeam; if (Main.Settings.ActiveContractSettings.Has(ContractSettingsOverrides.ExtendedLances_EnemyLanceSizeOverride)) { int lanceSizeOverride = Main.Settings.ActiveContractSettings.GetInt(ContractSettingsOverrides.ExtendedLances_EnemyLanceSizeOverride); Main.Logger.Log($"[AddExtraLanceSpawnPoints] Using contract-specific settings override for contract '{MissionControl.Instance.CurrentContract.Name}'. Enemy lance size will be '{lanceSizeOverride}'."); IncreaseLanceSpawnPoints(contractOverride, targetTeamOverride, lanceSizeOverride); } else { IncreaseLanceSpawnPoints(contractOverride, targetTeamOverride); } if (Main.Settings.ActiveContractSettings.Has(ContractSettingsOverrides.ExtendedLances_AllyLanceSizeOverride)) { int lanceSizeOverride = Main.Settings.ActiveContractSettings.GetInt(ContractSettingsOverrides.ExtendedLances_AllyLanceSizeOverride); Main.Logger.Log($"[AddExtraLanceSpawnPoints] Using contract-specific settings override for contract '{MissionControl.Instance.CurrentContract.Name}'. Ally lance size will be '{lanceSizeOverride}'."); IncreaseLanceSpawnPoints(contractOverride, employerTeamOverride, lanceSizeOverride); } else { IncreaseLanceSpawnPoints(contractOverride, employerTeamOverride); } state.Set("ExtraLanceSpawnKeys", spawnKeys); }