From 1afbe22070fab2a944a7c25885c89f4a935b8033 Mon Sep 17 00:00:00 2001 From: Richard Griffiths Date: Sun, 2 Aug 2020 11:07:44 +0200 Subject: [PATCH 01/12] Per-ContractID overrides didn't work for disabling features Also, Hot Drop Protection Flashpoint specific control wasn't working --- src/Core/MissionControl.cs | 53 +++++++++++++++++++++++--------------- 1 file changed, 32 insertions(+), 21 deletions(-) diff --git a/src/Core/MissionControl.cs b/src/Core/MissionControl.cs index 9793d26a..0d92daf1 100644 --- a/src/Core/MissionControl.cs +++ b/src/Core/MissionControl.cs @@ -353,11 +353,12 @@ private EncounterLayerData GetActiveEncounter() { public bool AreAdditionalLancesAllowed(string teamType) { // Allow contract settings overrides to force their respective setting - bool areLancesAllowed = Main.Settings.ActiveContractSettings.Has(ContractSettingsOverrides.AdditionalLances_Enable) && Main.Settings.ActiveContractSettings.GetBool(ContractSettingsOverrides.AdditionalLances_Enable); - if (areLancesAllowed) return true; + if (Main.Settings.ActiveContractSettings.Has(ContractSettingsOverrides.AdditionalLances_Enable)) { + return Main.Settings.ActiveContractSettings.GetBool(ContractSettingsOverrides.AdditionalLances_Enable); + } if (Main.Settings.AdditionalLanceSettings.Enable) { - areLancesAllowed = !Main.Settings.AdditionalLanceSettings.IsTeamDisabled(teamType); + bool areLancesAllowed = !Main.Settings.AdditionalLanceSettings.IsTeamDisabled(teamType); if (areLancesAllowed) areLancesAllowed = !IsAnyFlashpointContract() || (IsAnyFlashpointContract() && Main.Settings.EnableFlashpointOverrides && Main.Settings.AdditionalLanceSettings.EnableForFlashpoints); if (areLancesAllowed) areLancesAllowed = Main.Settings.AdditionalLanceSettings.GetValidContractTypes().Contains(CurrentContractType); if (areLancesAllowed) areLancesAllowed = Main.Settings.AdditionalLanceSettings.DisableWhenMaxTonnage.AreLancesAllowed((int)this.CurrentContract.Override.lanceMaxTonnage); @@ -373,11 +374,12 @@ public bool AreAdditionalLancesAllowed(string teamType) { public bool IsExtendedBoundariesAllowed() { // Allow contract settings overrides to force their respective setting - bool isExtendedBoundariesAllowed = Main.Settings.ActiveContractSettings.Has(ContractSettingsOverrides.ExtendedBoundaries_Enable) && Main.Settings.ActiveContractSettings.GetBool(ContractSettingsOverrides.ExtendedBoundaries_Enable); - if (isExtendedBoundariesAllowed) return true; + if (Main.Settings.ActiveContractSettings.Has(ContractSettingsOverrides.ExtendedBoundaries_Enable)) { + return Main.Settings.ActiveContractSettings.GetBool(ContractSettingsOverrides.ExtendedBoundaries_Enable); + } if (Main.Settings.ExtendedBoundaries.Enable) { - isExtendedBoundariesAllowed = !IsAnyFlashpointContract() || (IsAnyFlashpointContract() && Main.Settings.EnableFlashpointOverrides && Main.Settings.ExtendedBoundaries.EnableForFlashpoints); + bool isExtendedBoundariesAllowed = !IsAnyFlashpointContract() || (IsAnyFlashpointContract() && Main.Settings.EnableFlashpointOverrides && Main.Settings.ExtendedBoundaries.EnableForFlashpoints); if (isExtendedBoundariesAllowed) isExtendedBoundariesAllowed = Main.Settings.ExtendedBoundaries.GetValidContractTypes().Contains(CurrentContractType); return isExtendedBoundariesAllowed; } @@ -386,11 +388,12 @@ public bool IsExtendedBoundariesAllowed() { public bool IsExtendedLancesAllowed() { // Allow contract settings overrides to force their respective setting - bool isExtendedLancesAllowed = Main.Settings.ActiveContractSettings.Has(ContractSettingsOverrides.ExtendedLances_Enable) && Main.Settings.ActiveContractSettings.GetBool(ContractSettingsOverrides.ExtendedLances_Enable); - if (isExtendedLancesAllowed) return true; + if (Main.Settings.ActiveContractSettings.Has(ContractSettingsOverrides.ExtendedLances_Enable)) { + return Main.Settings.ActiveContractSettings.GetBool(ContractSettingsOverrides.ExtendedLances_Enable); + } if (Main.Settings.ExtendedLances.Enable) { - isExtendedLancesAllowed = !IsAnyFlashpointContract() || (IsAnyFlashpointContract() && Main.Settings.EnableFlashpointOverrides && Main.Settings.ExtendedLances.EnableForFlashpoints); + bool isExtendedLancesAllowed = !IsAnyFlashpointContract() || (IsAnyFlashpointContract() && Main.Settings.EnableFlashpointOverrides && Main.Settings.ExtendedLances.EnableForFlashpoints); if (isExtendedLancesAllowed) isExtendedLancesAllowed = Main.Settings.ExtendedLances.GetValidContractTypes().Contains(CurrentContractType); return isExtendedLancesAllowed; } @@ -399,11 +402,12 @@ public bool IsExtendedLancesAllowed() { public bool IsRandomSpawnsAllowed() { // Allow contract settings overrides to force their respective setting - bool isRandomSpawnsAllowed = Main.Settings.ActiveContractSettings.Has(ContractSettingsOverrides.RandomSpawns_Enable) && Main.Settings.ActiveContractSettings.GetBool(ContractSettingsOverrides.RandomSpawns_Enable); - if (isRandomSpawnsAllowed) return true; + if (Main.Settings.ActiveContractSettings.Has(ContractSettingsOverrides.RandomSpawns_Enable)) { + return Main.Settings.ActiveContractSettings.GetBool(ContractSettingsOverrides.RandomSpawns_Enable); + } if (Main.Settings.RandomSpawns.Enable) { - isRandomSpawnsAllowed = !IsAnyFlashpointContract() || (IsAnyFlashpointContract() && Main.Settings.EnableFlashpointOverrides && Main.Settings.RandomSpawns.EnableForFlashpoints); + bool isRandomSpawnsAllowed = !IsAnyFlashpointContract() || (IsAnyFlashpointContract() && Main.Settings.EnableFlashpointOverrides && Main.Settings.RandomSpawns.EnableForFlashpoints); if (isRandomSpawnsAllowed) isRandomSpawnsAllowed = Main.Settings.RandomSpawns.GetValidContractTypes().Contains(CurrentContractType); return isRandomSpawnsAllowed; } @@ -412,11 +416,12 @@ public bool IsRandomSpawnsAllowed() { public bool IsDynamicWithdrawAllowed() { // Allow contract settings overrides to force their respective setting - bool isDynamicWithdrawAllowed = Main.Settings.ActiveContractSettings.Has(ContractSettingsOverrides.DynamicWithdraw_Enable) && Main.Settings.ActiveContractSettings.GetBool(ContractSettingsOverrides.DynamicWithdraw_Enable); - if (isDynamicWithdrawAllowed) return true; + if (Main.Settings.ActiveContractSettings.Has(ContractSettingsOverrides.DynamicWithdraw_Enable)) { + return Main.Settings.ActiveContractSettings.GetBool(ContractSettingsOverrides.DynamicWithdraw_Enable); + } if (Main.Settings.DynamicWithdraw.Enable) { - isDynamicWithdrawAllowed = !IsAnyFlashpointContract() || (IsAnyFlashpointContract() && Main.Settings.EnableFlashpointOverrides && Main.Settings.DynamicWithdraw.EnableForFlashpoints); + bool isDynamicWithdrawAllowed = !IsAnyFlashpointContract() || (IsAnyFlashpointContract() && Main.Settings.EnableFlashpointOverrides && Main.Settings.DynamicWithdraw.EnableForFlashpoints); if (isDynamicWithdrawAllowed) isDynamicWithdrawAllowed = !MissionControl.Instance.IsSkirmish(); return isDynamicWithdrawAllowed; } @@ -429,18 +434,24 @@ public bool IsSkirmish(Contract contract) { public bool IsHotDropProtectionAllowed() { // Allow contract settings overrides to force their respective setting - bool isHotDropProtectionAllowed = Main.Settings.ActiveContractSettings.Has(ContractSettingsOverrides.HotDropProtection_Enable) && Main.Settings.ActiveContractSettings.GetBool(ContractSettingsOverrides.HotDropProtection_Enable); - if (isHotDropProtectionAllowed) return true; + if (Main.Settings.ActiveContractSettings.Has(ContractSettingsOverrides.HotDropProtection_Enable)) { + return Main.Settings.ActiveContractSettings.GetBool(ContractSettingsOverrides.HotDropProtection_Enable); + } - return Main.Settings.HotDropProtection.Enable; + if (Main.Settings.HotDropProtection.Enable) { + bool isHotDropProtectionAllowed = !IsAnyFlashpointContract() || (IsAnyFlashpointContract() && Main.Settings.EnableFlashpointOverrides && Main.Settings.HotDropProtection.EnableForFlashpoints); + return isHotDropProtectionAllowed; + } + return false; } public bool AreAdditionalPlayerMechsAllowed() { // Allow contract settings overrides to force their respective setting - bool areAdditionalPlayerMechsAllowed = Main.Settings.ActiveContractSettings.Has(ContractSettingsOverrides.AdditionalPlayerMechs_Enable) && Main.Settings.ActiveContractSettings.GetBool(ContractSettingsOverrides.AdditionalPlayerMechs_Enable); - if (areAdditionalPlayerMechsAllowed) return true; + if (Main.Settings.ActiveContractSettings.Has(ContractSettingsOverrides.AdditionalPlayerMechs_Enable)) { + return Main.Settings.ActiveContractSettings.GetBool(ContractSettingsOverrides.AdditionalPlayerMechs_Enable); + } - areAdditionalPlayerMechsAllowed = !IsAnyFlashpointContract() || (IsAnyFlashpointContract() && Main.Settings.EnableAdditionalPlayerMechsForFlashpoints); + bool areAdditionalPlayerMechsAllowed = !IsAnyFlashpointContract() || (IsAnyFlashpointContract() && Main.Settings.EnableAdditionalPlayerMechsForFlashpoints); if (areAdditionalPlayerMechsAllowed) areAdditionalPlayerMechsAllowed = Main.Settings.AdditionalPlayerMechs; return areAdditionalPlayerMechsAllowed; From e5c60267411606218be09f0a4f4cd7a544a0cd2b Mon Sep 17 00:00:00 2001 From: Richard Griffiths Date: Sun, 2 Aug 2020 20:08:56 +0200 Subject: [PATCH 02/12] Remove old tasks and change logs to debug --- .vscode/tasks.json | 20 ------------------- .../SpawnLogic/SpawnObjectsAroundTarget.cs | 4 ++-- 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 3bfc4720..53f2a0af 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -8,26 +8,6 @@ "args": ["build", "D:/Modding/Battletech/MissionControl/src/MissionControl.csproj"], "problemMatcher": "$msCompile" }, - /* - { - "label": "copy", - "type": "shell", - "command": "cp", - "args": [ - "D:/Modding/Battletech/MissionControl/src/bin/Debug/net471/MissionControl.dll", - "'D:/Program Files (x86)/Steam/steamapps/common/BATTLETECH/Mods/MissionControl'" - ] - }, - { - "label": "copy (hbs)", - "type": "shell", - "command": "cp", - "args": [ - "D:/Modding/Battletech/MissionControl/src/bin/Debug/net471/MissionControl.dll", - "'C:/Users/Rich/Documents/my games/BattleTech/mods/HBS/MissionControl'" - ] - }, - */ { "label": "copy (assets)", "type": "shell", diff --git a/src/Core/EncounterLogic/SpawnLogic/SpawnObjectsAroundTarget.cs b/src/Core/EncounterLogic/SpawnLogic/SpawnObjectsAroundTarget.cs index 8826431d..b6448c73 100644 --- a/src/Core/EncounterLogic/SpawnLogic/SpawnObjectsAroundTarget.cs +++ b/src/Core/EncounterLogic/SpawnLogic/SpawnObjectsAroundTarget.cs @@ -80,9 +80,9 @@ public override void Run(RunPayload payload) { GameObject objectGo = objectGos[i]; string objectKey = objectKeys[i]; string orientationTargetKey = orientationTargetKeys[i]; - Main.Logger.Log($"[SpawnObjectsAroundTarget] Attemping for '{objectGo.name}' with key '{objectKey}'"); + Main.Logger.LogDebug($"[SpawnObjectsAroundTarget] Attempting for '{objectGo.name}' with key '{objectKey}'"); GameObject orientationTarget = orientationTargets[orientationTargetKey]; - Main.Logger.Log($"[SpawnObjectsAroundTarget] Using orientation target key '{orientationTargetKey}' and Go name '{orientationTarget.transform.name}'"); + Main.Logger.LogDebug($"[SpawnObjectsAroundTarget] Using orientation target key '{orientationTargetKey}' and Go name '{orientationTarget.transform.name}'"); SaveSpawnPosition(objectGo); From 48fa2597bc15a2f2b0691a8e67b433278f89eda9 Mon Sep 17 00:00:00 2001 From: Richard Griffiths Date: Sun, 2 Aug 2020 20:50:40 +0200 Subject: [PATCH 03/12] Add result --- .../ContractTypeBuilders/ResultsBuilder.cs | 17 ++++++++-- .../ModifyLanceEvasionTicksByTagResult.cs | 33 +++++++++++++++++++ 2 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 src/Core/EncounterResults/ModifyLanceEvasionTicksByTagResult.cs diff --git a/src/Core/ContractTypeBuilders/ResultsBuilder.cs b/src/Core/ContractTypeBuilders/ResultsBuilder.cs index 97b6619f..65ca868a 100644 --- a/src/Core/ContractTypeBuilders/ResultsBuilder.cs +++ b/src/Core/ContractTypeBuilders/ResultsBuilder.cs @@ -48,6 +48,7 @@ private void BuildResult(JObject result) { case "CompleteObjective": BuildCompleteObjectiveResult(result); break; case "SetTemporaryUnitPhaseInitiativeByTag": BuildSetTemporaryUnitPhaseInitiativeByTagResult(result); break; case "SetLanceEvasionTicksByTag": BuildSetLanceEvasionTicksByTagResult(result); break; + case "ModifyLanceEvasionTicksByTag": BuildModifyLanceEvasionTicksByTagResult(result); break; case "CameraFocus": BuildCameraFocusResult(result); break; case "DestroyBuildingsAtLanceSpawns": BuildDestroyBuildingsAtLanceSpawnsResult(result); break; case "Delay": BuildDelayResult(result); break; @@ -234,7 +235,7 @@ private void BuildCompleteObjectiveResult(JObject resultObject) { } private void BuildSetTemporaryUnitPhaseInitiativeByTagResult(JObject resultObject) { - Main.LogDebug("[BuildSetTemporaryUnitPhaseInitiativeByTagResult] Building 'SetTemporaryUnitPhaseInitiativeByTagResult' result"); + Main.LogDebug("[BuildSetTemporaryUnitPhaseInitiativeByTagResult] Building 'SetTemporaryUnitPhaseInitiativeByTag' result"); int initiative = (int)resultObject["Initiative"]; string[] tags = ((JArray)resultObject["Tags"]).ToObject(); @@ -246,7 +247,7 @@ private void BuildSetTemporaryUnitPhaseInitiativeByTagResult(JObject resultObjec } private void BuildSetLanceEvasionTicksByTagResult(JObject resultObject) { - Main.LogDebug("[BuildSetLanceEvasionTicksByTagResult] Building 'SetLanceEvasionTicksByTagResult' result"); + Main.LogDebug("[BuildSetLanceEvasionTicksByTagResult] Building 'SetLanceEvasionTicksByTag' result"); int amount = (int)resultObject["Amount"]; string[] tags = ((JArray)resultObject["Tags"]).ToObject(); @@ -257,6 +258,18 @@ private void BuildSetLanceEvasionTicksByTagResult(JObject resultObject) { results.Add(result); } + private void BuildModifyLanceEvasionTicksByTagResult(JObject resultObject) { + Main.LogDebug("[BuildModifyLanceEvasionTicksByTagResult] Building 'ModifyLanceEvasionTicksByTag' result"); + int amount = (int)resultObject["Amount"]; + string[] tags = ((JArray)resultObject["Tags"]).ToObject(); + + ModifyLanceEvasionTicksByTagResult result = ScriptableObject.CreateInstance(); + result.Amount = amount; + result.Tags = tags; + + results.Add(result); + } + private void BuildCameraFocusResult(JObject resultObject) { Main.LogDebug("[BuildCameraFocusResult] Building 'CameraFocus' result"); string guid = resultObject["EncounterGuid"].ToString(); diff --git a/src/Core/EncounterResults/ModifyLanceEvasionTicksByTagResult.cs b/src/Core/EncounterResults/ModifyLanceEvasionTicksByTagResult.cs new file mode 100644 index 00000000..3273bf62 --- /dev/null +++ b/src/Core/EncounterResults/ModifyLanceEvasionTicksByTagResult.cs @@ -0,0 +1,33 @@ +using BattleTech; +using BattleTech.Framework; + +using HBS.Collections; + +using Harmony; + +using System; +using System.Collections.Generic; + +namespace MissionControl.Result { + public class ModifyLanceEvasionTicksByTagResult : EncounterResult { + public string[] Tags { get; set; } + public int Amount { get; set; } + + public override void Trigger(MessageCenterMessage inMessage, string triggeringName) { + Main.LogDebug($"[ModifyLanceEvasionTicksByTagResult] Modifying evasion by '{Amount}' on combatants with tags '{String.Concat(Tags)}'"); + List combatants = ObjectiveGameLogic.GetTaggedCombatants(UnityGameInstance.BattleTechGame.Combat, new TagSet(Tags)); + + Main.LogDebug($"[ModifyLanceEvasionTicksByTagResult] Found'{combatants.Count}' combatants"); + + foreach (ICombatant combatant in combatants) { + if (combatant is AbstractActor) { + AbstractActor actor = combatant as AbstractActor; + + actor.EvasivePipsCurrent += Amount; + AccessTools.Property(typeof(AbstractActor), "EvasivePipsTotal").SetValue(actor, actor.EvasivePipsCurrent, null); + UnityGameInstance.BattleTechGame.Combat.MessageCenter.PublishMessage(new EvasiveChangedMessage(actor.GUID, actor.EvasivePipsCurrent)); + } + } + } + } +} From ec7c5cffd504aae87e5e3454c83374f1e55ebdd5 Mon Sep 17 00:00:00 2001 From: Richard Griffiths Date: Sun, 2 Aug 2020 20:51:23 +0200 Subject: [PATCH 04/12] Cover < 0 evasion --- src/Core/EncounterResults/ModifyLanceEvasionTicksByTagResult.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Core/EncounterResults/ModifyLanceEvasionTicksByTagResult.cs b/src/Core/EncounterResults/ModifyLanceEvasionTicksByTagResult.cs index 3273bf62..f8ce73ff 100644 --- a/src/Core/EncounterResults/ModifyLanceEvasionTicksByTagResult.cs +++ b/src/Core/EncounterResults/ModifyLanceEvasionTicksByTagResult.cs @@ -24,6 +24,8 @@ public override void Trigger(MessageCenterMessage inMessage, string triggeringNa AbstractActor actor = combatant as AbstractActor; actor.EvasivePipsCurrent += Amount; + if (actor.EvasivePipsCurrent < 0) actor.EvasivePipsCurrent = 0; + AccessTools.Property(typeof(AbstractActor), "EvasivePipsTotal").SetValue(actor, actor.EvasivePipsCurrent, null); UnityGameInstance.BattleTechGame.Combat.MessageCenter.PublishMessage(new EvasiveChangedMessage(actor.GUID, actor.EvasivePipsCurrent)); } From e61fa383f2d59e1842123a9a00e693aaff094736 Mon Sep 17 00:00:00 2001 From: Richard Griffiths Date: Sun, 2 Aug 2020 20:51:38 +0200 Subject: [PATCH 05/12] Set ModifyLanceEvasion instead of SetLanceEvasion --- contractTypeBuilds/Blackout/common.jsonc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contractTypeBuilds/Blackout/common.jsonc b/contractTypeBuilds/Blackout/common.jsonc index b83cee17..591cdd16 100644 --- a/contractTypeBuilds/Blackout/common.jsonc +++ b/contractTypeBuilds/Blackout/common.jsonc @@ -752,8 +752,8 @@ "Tags": ["turrets_1b"] }, { - "Type": "SetLanceEvasionTicksByTag", // Prevent evasion helping them in a trap - "Amount": 0, + "Type": "ModifyLanceEvasionTicksByTag", // Reduce evasion to indicate a trap + "Amount": -2, "Tags": ["Player 1"] } ] From 64dce4dce9cb88ef792a204899052ea43a1ed77e Mon Sep 17 00:00:00 2001 From: Richard Griffiths Date: Sun, 2 Aug 2020 22:18:41 +0200 Subject: [PATCH 06/12] Remove deprecated spawnPoints variable and and set default detection ran --- src/Core/ContractTypeBuilders/NodeBuilders/SpawnBuilder.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Core/ContractTypeBuilders/NodeBuilders/SpawnBuilder.cs b/src/Core/ContractTypeBuilders/NodeBuilders/SpawnBuilder.cs index e023bd15..354526a9 100644 --- a/src/Core/ContractTypeBuilders/NodeBuilders/SpawnBuilder.cs +++ b/src/Core/ContractTypeBuilders/NodeBuilders/SpawnBuilder.cs @@ -23,7 +23,6 @@ public class SpawnBuilder : NodeBuilder { private JObject rotation; private string team; private string guid; - private int spawnPoints; private List spawnPointGuids; private bool preciseSpawnPoints; private JObject mountOnTargets; @@ -43,7 +42,6 @@ public SpawnBuilder(ContractTypeBuilder contractTypeBuilder, GameObject parent, this.subType = spawner["SubType"].ToString(); this.team = spawner["Team"].ToString(); this.guid = spawner["Guid"].ToString(); - this.spawnPoints = (int)spawner["SpawnPoints"]; this.spawnPointGuids = spawner["SpawnPointGuids"].ToObject>(); this.preciseSpawnPoints = spawner.ContainsKey("PreciseSpawnPoints") ? (bool)spawner["PreciseSpawnPoints"] : false; this.mountOnTargets = spawner.ContainsKey("MountOn") ? (JObject)spawner["MountOn"] : null; @@ -54,7 +52,7 @@ public SpawnBuilder(ContractTypeBuilder contractTypeBuilder, GameObject parent, this.rotation = spawner.ContainsKey("Rotation") ? (JObject)spawner["Rotation"] : null; this.aiOrdersArray = spawner.ContainsKey("AI") ? (JArray)spawner["AI"] : null; this.alertLanceOnSpawn = spawner.ContainsKey("AlertLanceOnSpawn") ? (bool)spawner["AlertLanceOnSpawn"] : false; - this.defaultDetectionRange = spawner.ContainsKey("DefaultDetectionRange") ? (int)spawner["DefaultDetectionRange"] : 0; + this.defaultDetectionRange = spawner.ContainsKey("DefaultDetectionRange") ? (int)spawner["DefaultDetectionRange"] : 200; this.tags = spawner.ContainsKey("Tags") ? spawner["Tags"].ToObject>() : null; if (this.aiOrdersArray != null) { From a25dd2f5cea49831454f22249b1e9666bd064466 Mon Sep 17 00:00:00 2001 From: Richard Griffiths Date: Mon, 3 Aug 2020 13:19:47 +0200 Subject: [PATCH 07/12] Update blackout for evasion from -2 to -3 for phase 1 trap --- contractTypeBuilds/Blackout/common.jsonc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contractTypeBuilds/Blackout/common.jsonc b/contractTypeBuilds/Blackout/common.jsonc index 591cdd16..1b476014 100644 --- a/contractTypeBuilds/Blackout/common.jsonc +++ b/contractTypeBuilds/Blackout/common.jsonc @@ -753,7 +753,7 @@ }, { "Type": "ModifyLanceEvasionTicksByTag", // Reduce evasion to indicate a trap - "Amount": -2, + "Amount": -3, "Tags": ["Player 1"] } ] From 20aa00b6d70faa7aea3b97af79b17b1511ab6e17 Mon Sep 17 00:00:00 2001 From: Richard Griffiths Date: Tue, 4 Aug 2020 00:22:11 +0200 Subject: [PATCH 08/12] Initial work for disabling pilot death with a node --- contractTypeBuilds/SoloDuel/common.jsonc | 14 ++++++++ .../ContractTypeBuilder.cs | 1 + .../NodeBuilders/CombatStateBuilder.cs | 34 +++++++++++++++++++ .../NodeBuilders/ContractEditBuilder.cs | 2 +- 4 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 src/Core/ContractTypeBuilders/NodeBuilders/CombatStateBuilder.cs diff --git a/contractTypeBuilds/SoloDuel/common.jsonc b/contractTypeBuilds/SoloDuel/common.jsonc index f95bbc9c..8e4c24dc 100644 --- a/contractTypeBuilds/SoloDuel/common.jsonc +++ b/contractTypeBuilds/SoloDuel/common.jsonc @@ -149,6 +149,20 @@ "TargetGuid2": "f426f0dc-969d-477d-81a9-d02f9e1eff79" // Enemy spawner } ] + }, + { + "Name": "Chunk_DisablePilotDeath", + "Type": "Chunk", + "SubType": "Container", + "ControlledByContract": true, + "Guid": "953a5930-06d0-4a2d-9840-e9a70c2a63ea", + "Children": [ + { + "Name": "CombatState_DisablePilotDeath", + "Type": "CombatState", + "SubType": "DisablePilotDeath" + } + ] } ] } diff --git a/src/Core/ContractTypeBuilders/ContractTypeBuilder.cs b/src/Core/ContractTypeBuilders/ContractTypeBuilder.cs index 43d0a1e2..c8bc4f0c 100644 --- a/src/Core/ContractTypeBuilders/ContractTypeBuilder.cs +++ b/src/Core/ContractTypeBuilders/ContractTypeBuilder.cs @@ -189,6 +189,7 @@ private void BuildNode(GameObject parent, JObject child) { case "Dialogue": nodeBuilder = new DialogueBuilder(this, parent, child); break; case "SwapPlacement": nodeBuilder = new PlacementBuilder(this, parent, child); break; case "ContractEdit": nodeBuilder = new ContractEditBuilder(this, parent, child); break; + case "CombatState": nodeBuilder = new CombatStateBuilder(this, parent, child); break; default: break; } diff --git a/src/Core/ContractTypeBuilders/NodeBuilders/CombatStateBuilder.cs b/src/Core/ContractTypeBuilders/NodeBuilders/CombatStateBuilder.cs new file mode 100644 index 00000000..41a43ac2 --- /dev/null +++ b/src/Core/ContractTypeBuilders/NodeBuilders/CombatStateBuilder.cs @@ -0,0 +1,34 @@ +using UnityEngine; + +using Newtonsoft.Json.Linq; + +namespace MissionControl.ContractTypeBuilders { + public class CombatStateBuilder : NodeBuilder { + private ContractTypeBuilder contractTypeBuilder; + private JObject state; + + private GameObject parent; + private string name; + private string subType; + + public CombatStateBuilder(ContractTypeBuilder contractTypeBuilder, GameObject parent, JObject state) { + this.contractTypeBuilder = contractTypeBuilder; + this.state = state; + + this.parent = parent; + this.name = state["Name"].ToString(); + this.subType = state["SubType"].ToString(); + } + + public override void Build() { + switch (subType) { + case "DisablePilotDeath": BuildDisablePilotDeath(); break; + default: Main.LogDebug($"[CombatStateBuilder.{contractTypeBuilder.ContractTypeKey}] No support for sub-type '{subType}'. Check for spelling mistakes."); break; + } + } + + private void BuildDisablePilotDeath() { + //SwapTeamFactionGameLogic swapFactionGameLogic = ContractEditFactory.CreateSwapFaction(this.parent, this.name, Guid.NewGuid().ToString(), teamGuid1, teamGuid2); + } + } +} \ No newline at end of file diff --git a/src/Core/ContractTypeBuilders/NodeBuilders/ContractEditBuilder.cs b/src/Core/ContractTypeBuilders/NodeBuilders/ContractEditBuilder.cs index f5835d91..e0434a6b 100644 --- a/src/Core/ContractTypeBuilders/NodeBuilders/ContractEditBuilder.cs +++ b/src/Core/ContractTypeBuilders/NodeBuilders/ContractEditBuilder.cs @@ -28,7 +28,7 @@ public ContractEditBuilder(ContractTypeBuilder contractTypeBuilder, GameObject p public override void Build() { switch (subType) { case "SwapTeamFactions": BuildSwapFactions(); break; - default: Main.LogDebug($"[RegionBuilder.{contractTypeBuilder.ContractTypeKey}] No support for sub-type '{subType}'. Check for spelling mistakes."); break; + default: Main.LogDebug($"[ContractEditBuilder.{contractTypeBuilder.ContractTypeKey}] No support for sub-type '{subType}'. Check for spelling mistakes."); break; } } From a53b843fd9b8d87b569ea751ad2d7a0d6c6d03cb Mon Sep 17 00:00:00 2001 From: Richard Griffiths Date: Tue, 4 Aug 2020 19:41:12 +0200 Subject: [PATCH 09/12] Fixed spelling mistake breaking user/mod settings override for DebugMode --- src/Core/Settings/SettingsOverride.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Core/Settings/SettingsOverride.cs b/src/Core/Settings/SettingsOverride.cs index 8ab1bedc..348f1654 100644 --- a/src/Core/Settings/SettingsOverride.cs +++ b/src/Core/Settings/SettingsOverride.cs @@ -7,7 +7,7 @@ namespace MissionControl.Config { public class SettingsOverride { - public static string DebugMode = "DebudMode"; + public static string DebugMode = "DebugMode"; public static string VersionCheck = "VersionCheck"; public static string DebugSkirmishMode = "DebugSkirmishMode"; public static string EnableFlashpointOverrides = "EnableFlashpointOverrides"; From 2230803da5e71455e5b115dcc75c7d624f4bbead Mon Sep 17 00:00:00 2001 From: Richard Griffiths Date: Sun, 9 Aug 2020 17:48:56 +0200 Subject: [PATCH 10/12] Working version - needs a bit more testing --- .../NodeBuilders/CombatStateBuilder.cs | 9 +++- src/Core/Data/MCTaggedObjectType.cs | 1 + .../EncounterFactories/CombatStateFactory.cs | 25 +++++++++++ .../DisablePilotDeathGameLogic.cs | 42 +++++++++++++++++++ src/Core/MissionControl.cs | 18 ++++++++ ...ContractFinalizeKilledMechwarriorsPatch.cs | 34 +++++++++++++++ .../PilotInjurePilotPatch.cs | 22 ++++++++++ 7 files changed, 150 insertions(+), 1 deletion(-) create mode 100644 src/Core/EncounterFactories/CombatStateFactory.cs create mode 100644 src/Core/LogicComponents/CombatStates/DisablePilotDeathGameLogic.cs create mode 100644 src/Patches/CustomContractTypes/CustomGameLogic/DisablePilotDeathGameLogic/ContractFinalizeKilledMechwarriorsPatch.cs create mode 100644 src/Patches/CustomContractTypes/CustomGameLogic/DisablePilotDeathGameLogic/PilotInjurePilotPatch.cs diff --git a/src/Core/ContractTypeBuilders/NodeBuilders/CombatStateBuilder.cs b/src/Core/ContractTypeBuilders/NodeBuilders/CombatStateBuilder.cs index 41a43ac2..cf8460c4 100644 --- a/src/Core/ContractTypeBuilders/NodeBuilders/CombatStateBuilder.cs +++ b/src/Core/ContractTypeBuilders/NodeBuilders/CombatStateBuilder.cs @@ -2,6 +2,11 @@ using Newtonsoft.Json.Linq; +using System; + +using MissionControl.EncounterFactories; +using MissionControl.LogicComponents.CombatStates; + namespace MissionControl.ContractTypeBuilders { public class CombatStateBuilder : NodeBuilder { private ContractTypeBuilder contractTypeBuilder; @@ -28,7 +33,9 @@ public override void Build() { } private void BuildDisablePilotDeath() { - //SwapTeamFactionGameLogic swapFactionGameLogic = ContractEditFactory.CreateSwapFaction(this.parent, this.name, Guid.NewGuid().ToString(), teamGuid1, teamGuid2); + bool disableInjuries = state.ContainsKey("DisableInjuries") ? (bool)state["DisableInjuries"] : false; + + DisablePilotDeathGameLogic disablePilotDeathGameLogic = CombatStateFactory.CreateDisablePilotDeath(this.parent, this.name, Guid.NewGuid().ToString(), disableInjuries); } } } \ No newline at end of file diff --git a/src/Core/Data/MCTaggedObjectType.cs b/src/Core/Data/MCTaggedObjectType.cs index 74c5c2b3..2120558d 100644 --- a/src/Core/Data/MCTaggedObjectType.cs +++ b/src/Core/Data/MCTaggedObjectType.cs @@ -3,5 +3,6 @@ public enum MCTaggedObjectType { SwapPlacement = 100, SwapTeamFaction = 101, ActivateDialogue = 102, + DisablePilotDeath = 103, }; } \ No newline at end of file diff --git a/src/Core/EncounterFactories/CombatStateFactory.cs b/src/Core/EncounterFactories/CombatStateFactory.cs new file mode 100644 index 00000000..023ce6fc --- /dev/null +++ b/src/Core/EncounterFactories/CombatStateFactory.cs @@ -0,0 +1,25 @@ +using UnityEngine; + +using MissionControl.LogicComponents.CombatStates; + +namespace MissionControl.EncounterFactories { + public class CombatStateFactory { + private static GameObject CreateGameObject(GameObject parent, string name = null) { + GameObject go = new GameObject((name == null) ? "CombatState" : name); + go.transform.parent = parent.transform; + go.transform.localPosition = Vector3.zero; + + return go; + } + + public static DisablePilotDeathGameLogic CreateDisablePilotDeath(GameObject parent, string name, string guid, bool disableInjuries) { + GameObject disablePilotDeathGameObject = CreateGameObject(parent, name); + + DisablePilotDeathGameLogic disablePilotDeathGameLogic = disablePilotDeathGameObject.AddComponent(); + disablePilotDeathGameLogic.encounterObjectGuid = guid; + disablePilotDeathGameLogic.DisableInjuries = disableInjuries; + + return disablePilotDeathGameLogic; + } + } +} \ No newline at end of file diff --git a/src/Core/LogicComponents/CombatStates/DisablePilotDeathGameLogic.cs b/src/Core/LogicComponents/CombatStates/DisablePilotDeathGameLogic.cs new file mode 100644 index 00000000..5cb6110b --- /dev/null +++ b/src/Core/LogicComponents/CombatStates/DisablePilotDeathGameLogic.cs @@ -0,0 +1,42 @@ +using UnityEngine; + +using BattleTech; + +using HBS.Util; + +using MissionControl.Data; + +namespace MissionControl.LogicComponents.CombatStates { + public class DisablePilotDeathGameLogic : EncounterObjectGameLogic { + public static string DISABLE_PILOT_DEATH = "DISABLE_PILOT_DEATH"; + public static string DISABLE_PILOT_INJURY = "DISABLE_PILOT_INJURY"; + + [SerializeField] + public bool DisableInjuries { get; set; } = false; + + public override TaggedObjectType Type { + get { + return (TaggedObjectType)MCTaggedObjectType.DisablePilotDeath; + } + } + + public override void OnEnterActive() { + base.OnEnterActive(); + Main.LogDebug($"[DisablePilotDeathGameLogic.OnEnterActive] OnEnterActive"); + MissionControl.Instance.SetGameLogicData(DISABLE_PILOT_DEATH, "true"); + if (DisableInjuries) MissionControl.Instance.SetGameLogicData(DISABLE_PILOT_INJURY, "true"); + } + + public override void FromJSON(string json) { + JSONSerializationUtility.FromJSON(this, json); + } + + public override string GenerateJSONTemplate() { + return JSONSerializationUtility.ToJSON(new DisablePilotDeathGameLogic()); + } + + public override string ToJSON() { + return JSONSerializationUtility.ToJSON(this); + } + } +} diff --git a/src/Core/MissionControl.cs b/src/Core/MissionControl.cs index 0d92daf1..a7e106bd 100644 --- a/src/Core/MissionControl.cs +++ b/src/Core/MissionControl.cs @@ -50,6 +50,8 @@ public static MissionControl Instance { public bool IsCustomContractType { get; set; } = false; public List QueuedBuildingMounts { get; set; } = new List(); + private Dictionary CustomGameLogicData { get; set; } = new Dictionary(); + public HexGrid HexGrid { get; private set; } public bool IsContractValid { get; private set; } = false; @@ -222,6 +224,7 @@ private void ClearOldCaches() { Main.Logger.Log($"[MissionControl] Clearing old caches"); AssetBundleManagerGetAssetFromBundlePatch.ClearLookup(); + CustomGameLogicData.Clear(); // This might need to be moved up higher in the load order } public void SetActiveAdditionalLances(Contract contract) { @@ -508,5 +511,20 @@ public bool IsDroppingCustomControlledPlayerLance() { return false; } + + public string GetGameLogicData(string key) { + if (CustomGameLogicData.ContainsKey(key)) { + return CustomGameLogicData[key]; + } + return null; + } + + public void SetGameLogicData(string key, string value) { + CustomGameLogicData[key] = value; + } + + public void RemoveGameLogicData(string key) { + CustomGameLogicData.Remove(key); + } } } \ No newline at end of file diff --git a/src/Patches/CustomContractTypes/CustomGameLogic/DisablePilotDeathGameLogic/ContractFinalizeKilledMechwarriorsPatch.cs b/src/Patches/CustomContractTypes/CustomGameLogic/DisablePilotDeathGameLogic/ContractFinalizeKilledMechwarriorsPatch.cs new file mode 100644 index 00000000..ed1bc6cf --- /dev/null +++ b/src/Patches/CustomContractTypes/CustomGameLogic/DisablePilotDeathGameLogic/ContractFinalizeKilledMechwarriorsPatch.cs @@ -0,0 +1,34 @@ +using Harmony; + +using BattleTech; + +using MissionControl.LogicComponents.CombatStates; + +namespace MissionControl.Patches { + [HarmonyPatch(typeof(Contract), "FinalizeKilledMechWarriors")] + public class ContractFinalizeKilledMechwarriorsPatch { + static bool Prefix(Contract __instance) { + Main.LogDebug($"[ContractFinalizeKilledMechwarriorsPatch.Prefix] DisablePilotDeathGameLogic - Running"); + string shouldDisablePilotDeath = MissionControl.Instance.GetGameLogicData(DisablePilotDeathGameLogic.DISABLE_PILOT_DEATH); + if (UnityGameInstance.BattleTechGame.Combat != null) { + if (shouldDisablePilotDeath != null && shouldDisablePilotDeath == "true") { + Main.LogDebug($"[ContractFinalizeKilledMechwarriorsPatch.Prefix] DisablePilotDeathGameLogic - Preventing pilot death."); + + foreach (UnitResult playerUnitResult in __instance.PlayerUnitResults) { + Pilot pilot = playerUnitResult.pilot; + PilotDef pilotDef = pilot.pilotDef; + pilotDef?.SetRecentInjuryDamageType(DamageType.NOT_SET); + } + + return false; + } + } + return true; + } + + static void Postfix(Pilot __instance) { + MissionControl.Instance.RemoveGameLogicData(DisablePilotDeathGameLogic.DISABLE_PILOT_DEATH); + MissionControl.Instance.RemoveGameLogicData(DisablePilotDeathGameLogic.DISABLE_PILOT_INJURY); + } + } +} \ No newline at end of file diff --git a/src/Patches/CustomContractTypes/CustomGameLogic/DisablePilotDeathGameLogic/PilotInjurePilotPatch.cs b/src/Patches/CustomContractTypes/CustomGameLogic/DisablePilotDeathGameLogic/PilotInjurePilotPatch.cs new file mode 100644 index 00000000..b10dcd78 --- /dev/null +++ b/src/Patches/CustomContractTypes/CustomGameLogic/DisablePilotDeathGameLogic/PilotInjurePilotPatch.cs @@ -0,0 +1,22 @@ +using Harmony; + +using BattleTech; + +using MissionControl.LogicComponents.CombatStates; + +namespace MissionControl.Patches { + [HarmonyPatch(typeof(Pilot), "InjurePilot")] + public class PilotInjurePilotPatch { + static bool Prefix(Pilot __instance) { + Main.LogDebug($"[PilotInjurePilotPatch.Prefix] DisablePilotDeathGameLogic - Running for pilot '{__instance.Callsign}'"); + string shouldDisablePilotInjury = MissionControl.Instance.GetGameLogicData(DisablePilotDeathGameLogic.DISABLE_PILOT_INJURY); + if (UnityGameInstance.BattleTechGame.Combat != null) { + if (shouldDisablePilotInjury != null && shouldDisablePilotInjury == "true") { + Main.LogDebug($"[PilotInjurePilotPatch.Prefix] DisablePilotDeathGameLogic - Ignoring injury for pilot '{__instance.Callsign}'"); + return false; + } + } + return true; + } + } +} \ No newline at end of file From edab23c2b37c506df2cfddb078110d379c21604d Mon Sep 17 00:00:00 2001 From: Richard Griffiths Date: Sun, 9 Aug 2020 18:43:58 +0200 Subject: [PATCH 11/12] Confirmed testing and added some some solo and duo duels --- contractTypeBuilds/DuoDuel/common.jsonc | 15 +++++++++++++++ contractTypeBuilds/SoloDuel/common.jsonc | 3 ++- .../contracts/duoduel/DuoDuel_FestiveCouple.json | 15 +++++++++++++++ .../contracts/duoduel/DuoDuel_YearlyTussle.json | 15 +++++++++++++++ .../contracts/soloduel/SoloDuel_AllEyesOn.json | 7 +++++++ .../contracts/soloduel/SoloDuel_LifeLesson.json | 7 +++++++ .../CombatStates/DisablePilotDeathGameLogic.cs | 2 +- .../ContractFinalizeKilledMechwarriorsPatch.cs | 1 - .../PilotInjurePilotPatch.cs | 1 - 9 files changed, 62 insertions(+), 4 deletions(-) diff --git a/contractTypeBuilds/DuoDuel/common.jsonc b/contractTypeBuilds/DuoDuel/common.jsonc index 04e273d5..2b2a8493 100644 --- a/contractTypeBuilds/DuoDuel/common.jsonc +++ b/contractTypeBuilds/DuoDuel/common.jsonc @@ -151,6 +151,21 @@ "TargetGuid2": "f426f0dc-969d-477d-81a9-d02f9e1eff79" // Enemy spawner } ] + }, + { + "Name": "Chunk_DisablePilotDeath", + "Type": "Chunk", + "SubType": "Container", + "ControlledByContract": true, + "Guid": "953a5930-06d0-4a2d-9840-e9a70c2a63ea", + "Children": [ + { + "Name": "CombatState_DisablePilotDeath", + "Type": "CombatState", + "SubType": "DisablePilotDeath", + "DisableInjuries": false + } + ] } ] } diff --git a/contractTypeBuilds/SoloDuel/common.jsonc b/contractTypeBuilds/SoloDuel/common.jsonc index 8e4c24dc..d663f46e 100644 --- a/contractTypeBuilds/SoloDuel/common.jsonc +++ b/contractTypeBuilds/SoloDuel/common.jsonc @@ -160,7 +160,8 @@ { "Name": "CombatState_DisablePilotDeath", "Type": "CombatState", - "SubType": "DisablePilotDeath" + "SubType": "DisablePilotDeath", + "DisableInjuries": false } ] } diff --git a/overrides/contracts/duoduel/DuoDuel_FestiveCouple.json b/overrides/contracts/duoduel/DuoDuel_FestiveCouple.json index f7f4563d..c77dad34 100644 --- a/overrides/contracts/duoduel/DuoDuel_FestiveCouple.json +++ b/overrides/contracts/duoduel/DuoDuel_FestiveCouple.json @@ -55,6 +55,21 @@ "isPrimary": true, "forPlayer": "Player1", "objectiveGuids": ["a0b9c5b2-c594-4c5a-be1d-028a51c51519"] + }, + { + "Name": "Chunk_DisablePilotDeath", + "Type": "Chunk", + "SubType": "Container", + "ControlledByContract": true, + "Guid": "953a5930-06d0-4a2d-9840-e9a70c2a63ea", + "Children": [ + { + "Name": "CombatState_DisablePilotDeath", + "Type": "CombatState", + "SubType": "DisablePilotDeath", + "DisableInjuries": false + } + ] } ], "objectiveList": [ diff --git a/overrides/contracts/duoduel/DuoDuel_YearlyTussle.json b/overrides/contracts/duoduel/DuoDuel_YearlyTussle.json index fc79f220..3145e78f 100644 --- a/overrides/contracts/duoduel/DuoDuel_YearlyTussle.json +++ b/overrides/contracts/duoduel/DuoDuel_YearlyTussle.json @@ -80,6 +80,21 @@ "EncounterObjectGuid": "ed007c52-f4cb-4bfc-842a-a50454d8a82a" }, "enableChunkFromContract": true + }, + { + "Name": "Chunk_DisablePilotDeath", + "Type": "Chunk", + "SubType": "Container", + "ControlledByContract": true, + "Guid": "953a5930-06d0-4a2d-9840-e9a70c2a63ea", + "Children": [ + { + "Name": "CombatState_DisablePilotDeath", + "Type": "CombatState", + "SubType": "DisablePilotDeath", + "DisableInjuries": false + } + ] } ], "cameraFocusHelperList": [ diff --git a/overrides/contracts/soloduel/SoloDuel_AllEyesOn.json b/overrides/contracts/soloduel/SoloDuel_AllEyesOn.json index f6e62657..07865f1e 100644 --- a/overrides/contracts/soloduel/SoloDuel_AllEyesOn.json +++ b/overrides/contracts/soloduel/SoloDuel_AllEyesOn.json @@ -80,6 +80,13 @@ "EncounterObjectGuid": "ed007c52-f4cb-4bfc-842a-a50454d8a82a" }, "enableChunkFromContract": true + }, + { + "name": "Chunk_DisablePilotDeath", + "encounterChunk": { + "EncounterObjectGuid": "953a5930-06d0-4a2d-9840-e9a70c2a63ea" + }, + "enableChunkFromContract": true } ], "cameraFocusHelperList": [ diff --git a/overrides/contracts/soloduel/SoloDuel_LifeLesson.json b/overrides/contracts/soloduel/SoloDuel_LifeLesson.json index 0c9cd46f..8dad8305 100644 --- a/overrides/contracts/soloduel/SoloDuel_LifeLesson.json +++ b/overrides/contracts/soloduel/SoloDuel_LifeLesson.json @@ -55,6 +55,13 @@ "isPrimary": true, "forPlayer": "Player1", "objectiveGuids": ["a0b9c5b2-c594-4c5a-be1d-028a51c51519"] + }, + { + "name": "Chunk_DisablePilotDeath", + "encounterChunk": { + "EncounterObjectGuid": "953a5930-06d0-4a2d-9840-e9a70c2a63ea" + }, + "enableChunkFromContract": true } ], "objectiveList": [ diff --git a/src/Core/LogicComponents/CombatStates/DisablePilotDeathGameLogic.cs b/src/Core/LogicComponents/CombatStates/DisablePilotDeathGameLogic.cs index 5cb6110b..471b640e 100644 --- a/src/Core/LogicComponents/CombatStates/DisablePilotDeathGameLogic.cs +++ b/src/Core/LogicComponents/CombatStates/DisablePilotDeathGameLogic.cs @@ -22,7 +22,7 @@ public override TaggedObjectType Type { public override void OnEnterActive() { base.OnEnterActive(); - Main.LogDebug($"[DisablePilotDeathGameLogic.OnEnterActive] OnEnterActive"); + Main.LogDebug($"[DisablePilotDeathGameLogic.OnEnterActive] Activating"); MissionControl.Instance.SetGameLogicData(DISABLE_PILOT_DEATH, "true"); if (DisableInjuries) MissionControl.Instance.SetGameLogicData(DISABLE_PILOT_INJURY, "true"); } diff --git a/src/Patches/CustomContractTypes/CustomGameLogic/DisablePilotDeathGameLogic/ContractFinalizeKilledMechwarriorsPatch.cs b/src/Patches/CustomContractTypes/CustomGameLogic/DisablePilotDeathGameLogic/ContractFinalizeKilledMechwarriorsPatch.cs index ed1bc6cf..4b8a7794 100644 --- a/src/Patches/CustomContractTypes/CustomGameLogic/DisablePilotDeathGameLogic/ContractFinalizeKilledMechwarriorsPatch.cs +++ b/src/Patches/CustomContractTypes/CustomGameLogic/DisablePilotDeathGameLogic/ContractFinalizeKilledMechwarriorsPatch.cs @@ -8,7 +8,6 @@ namespace MissionControl.Patches { [HarmonyPatch(typeof(Contract), "FinalizeKilledMechWarriors")] public class ContractFinalizeKilledMechwarriorsPatch { static bool Prefix(Contract __instance) { - Main.LogDebug($"[ContractFinalizeKilledMechwarriorsPatch.Prefix] DisablePilotDeathGameLogic - Running"); string shouldDisablePilotDeath = MissionControl.Instance.GetGameLogicData(DisablePilotDeathGameLogic.DISABLE_PILOT_DEATH); if (UnityGameInstance.BattleTechGame.Combat != null) { if (shouldDisablePilotDeath != null && shouldDisablePilotDeath == "true") { diff --git a/src/Patches/CustomContractTypes/CustomGameLogic/DisablePilotDeathGameLogic/PilotInjurePilotPatch.cs b/src/Patches/CustomContractTypes/CustomGameLogic/DisablePilotDeathGameLogic/PilotInjurePilotPatch.cs index b10dcd78..212cc1a9 100644 --- a/src/Patches/CustomContractTypes/CustomGameLogic/DisablePilotDeathGameLogic/PilotInjurePilotPatch.cs +++ b/src/Patches/CustomContractTypes/CustomGameLogic/DisablePilotDeathGameLogic/PilotInjurePilotPatch.cs @@ -8,7 +8,6 @@ namespace MissionControl.Patches { [HarmonyPatch(typeof(Pilot), "InjurePilot")] public class PilotInjurePilotPatch { static bool Prefix(Pilot __instance) { - Main.LogDebug($"[PilotInjurePilotPatch.Prefix] DisablePilotDeathGameLogic - Running for pilot '{__instance.Callsign}'"); string shouldDisablePilotInjury = MissionControl.Instance.GetGameLogicData(DisablePilotDeathGameLogic.DISABLE_PILOT_INJURY); if (UnityGameInstance.BattleTechGame.Combat != null) { if (shouldDisablePilotInjury != null && shouldDisablePilotInjury == "true") { From 38914d03e1324705698568cbcc208ae9e23f0f87 Mon Sep 17 00:00:00 2001 From: Richard Griffiths Date: Tue, 1 Sep 2020 20:47:28 +0200 Subject: [PATCH 12/12] version bump for 1.1.3 --- mod.json | 2 +- src/MissionControl.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mod.json b/mod.json index 8ed72f90..95ddd086 100644 --- a/mod.json +++ b/mod.json @@ -1,7 +1,7 @@ { "Name": "Mission Control", "Enabled": true, - "Version": "1.1.2", + "Version": "1.1.3", "Description": "A HBS BattleTech mod that adds custom contract types and varies the encounter specifics such as encounter boundary size, spawn locations, lance numbers and objectives", "Author": "CWolf", "Contact": "cwolfs@gmail.com", diff --git a/src/MissionControl.csproj b/src/MissionControl.csproj index ca4c5e66..37410090 100644 --- a/src/MissionControl.csproj +++ b/src/MissionControl.csproj @@ -1,6 +1,6 @@ - 1.1.2 + 1.1.3 Library net471