From 1b1c354dcb6bb973cc4cb1cbc4800d62713ef09b Mon Sep 17 00:00:00 2001 From: BlackDog86 <122568778+BlackDog86@users.noreply.github.com> Date: Fri, 27 Dec 2024 10:16:41 +0000 Subject: [PATCH 1/5] Fix PCS stacking behaviour --- .../Classes/XComGameState_HeadquartersXCom.uc | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_HeadquartersXCom.uc b/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_HeadquartersXCom.uc index 32c7fb58e..faecb68dd 100644 --- a/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_HeadquartersXCom.uc +++ b/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_HeadquartersXCom.uc @@ -4101,6 +4101,10 @@ function bool HasItemInInventoryOrLoadout(X2ItemTemplate ItemTemplate, optional function bool HasUnModifiedItem(XComGameState AddToGameState, X2ItemTemplate ItemTemplate, out XComGameState_Item ItemState, optional bool bLoot = false, optional XComGameState_Item CombatSimTest) { local int idx; + // Start Issue #1352 - New variables for combat sim stacking behavior + local int StatBoostidx; + local bool bhasIdenticalStatBoosts; + // End Issue #1352 if(bLoot) { @@ -4149,10 +4153,27 @@ function bool HasUnModifiedItem(XComGameState AddToGameState, X2ItemTemplate Ite { if(ItemState.GetMyTemplate().ItemCat == 'combatsim') { - if(ItemState.StatBoosts.Length > 0 && CombatSimTest.StatBoosts.Length > 0 && ItemState.StatBoosts[0].Boost == CombatSimTest.StatBoosts[0].Boost && ItemState.StatBoosts[0].StatType == CombatSimTest.StatBoosts[0].StatType) + // Begin Issue #1352 + /// HL-Docs: ref:Bugfixes; issue:1352 + /// Fixes a bug that caused PCS items which did not have exactly one stat boost, to not stack properly in the UI + /// by making HasUnModifiedItem() properly compare items with multiple stat boosts or no stat boosts at all. + bhasIdenticalStatBoosts = true; + if (CombatSimTest.StatBoosts.Length != 0) + { + for (StatBoostidx = 0; StatBoostidx < ItemState.StatBoosts.Length; StatBoostidx++) + { + if (ItemState.StatBoosts[StatBoostidx].Boost != CombatSimTest.StatBoosts[StatBoostidx].Boost || ItemState.StatBoosts[StatBoostidx].StatType != CombatSimTest.StatBoosts[StatBoostidx].StatType) + { + bhasIdenticalStatBoosts = false; + break; + } + } + } + if (bhasIdenticalStatBoosts) { return true; } + // End Issue #1352 } else { From b4bcf4812b6afd4e057bc56fd08a6814699f1d1d Mon Sep 17 00:00:00 2001 From: MattMc <122568778+BlackDog86@users.noreply.github.com> Date: Mon, 6 Jan 2025 07:54:23 +0000 Subject: [PATCH 2/5] Effects which can be removed by a medikit are no longer removed by revival protocol (#1438) --- .../Classes/X2Ability_SpecialistAbilitySet.uc | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/X2WOTCCommunityHighlander/Src/XComGame/Classes/X2Ability_SpecialistAbilitySet.uc b/X2WOTCCommunityHighlander/Src/XComGame/Classes/X2Ability_SpecialistAbilitySet.uc index d83cb7337..20e895b0d 100644 --- a/X2WOTCCommunityHighlander/Src/XComGame/Classes/X2Ability_SpecialistAbilitySet.uc +++ b/X2WOTCCommunityHighlander/Src/XComGame/Classes/X2Ability_SpecialistAbilitySet.uc @@ -748,7 +748,16 @@ static function X2AbilityTemplate RevivalProtocol() Template.AbilityTargetConditions.AddItem(new class'X2Condition_RevivalProtocol'); - Template.AddTargetEffect(RemoveAdditionalEffectsForRevivalProtocolAndRestorativeMist()); + // Start Issue #1435 + /// HL-Docs: ref:Bugfixes; issue:1435 + /// Fix bug that allows Revival Protocol to remove effects that are normally removed by a Medikit heal, + /// despite this functionality not being mentioned in the in-game localization, + /// and units with these effects not being valid targets for this ability, unless they are also mentally impaired. + /// The bug was caused by Firaxis reusing the `RemoveAdditionalEffectsForRevivalProtocolAndRestorativeMist()` function, + /// which makes sense for Restoration, as that ability also applies Medikit heal, + /// but not for Revival Protocol, which is only supposed to remove mental impairments. + Template.AddTargetEffect(RemoveImpairingEffectsByDamageTypeForRevivalProtocol_CH()); + // End Issue #1435 // Start Issue #1414 /// HL-Docs: ref:Bugfixes; issue:1414 @@ -2154,7 +2163,24 @@ static function X2Effect_RemoveEffects RemoveAdditionalEffectsForRevivalProtocol return RemoveEffects; } +// Start Issue #1435 - New function for Revival Protocol which no longer removes medikit-healable status effects. +static function X2Effect_RemoveEffects RemoveImpairingEffectsByDamageTypeForRevivalProtocol_CH() +{ + local X2Effect_RemoveEffectsByDamageType RemoveEffects; + RemoveEffects = new class'X2Effect_RemoveEffectsByDamageType'; + RemoveEffects.EffectNamesToRemove.AddItem(class'X2AbilityTemplateManager'.default.DisorientedName); + RemoveEffects.EffectNamesToRemove.AddItem(class'X2AbilityTemplateManager'.default.PanickedName); + RemoveEffects.EffectNamesToRemove.AddItem(class'X2StatusEffects'.default.UnconsciousName); + RemoveEffects.EffectNamesToRemove.AddItem(class'X2AbilityTemplateManager'.default.DazedName); + RemoveEffects.EffectNamesToRemove.AddItem(class'X2AbilityTemplateManager'.default.ObsessedName); + RemoveEffects.EffectNamesToRemove.AddItem(class'X2AbilityTemplateManager'.default.BerserkName); + RemoveEffects.EffectNamesToRemove.AddItem(class'X2AbilityTemplateManager'.default.ShatteredName); + RemoveEffects.EffectNamesToRemove.AddItem(class'X2AbilityTemplateManager'.default.StunnedName); + + return RemoveEffects; +} +// End Issue #1435 DefaultProperties { EverVigilantEffectName = "EverVigilantTriggered"; From 15975d866f62267fa30c1c7c3fbf58bc55ac37b1 Mon Sep 17 00:00:00 2001 From: furudee Date: Wed, 11 Dec 2024 02:54:24 +0200 Subject: [PATCH 3/5] Issue X2CommunityCore#1420 - Add validation of targets when making a right-click pathing attack using an ability that has X2TargetingMethod_ArcWave --- .../Src/XComGame/Classes/XComTacticalInput.uc | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComTacticalInput.uc b/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComTacticalInput.uc index 6d4f52605..04e700b51 100644 --- a/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComTacticalInput.uc +++ b/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComTacticalInput.uc @@ -3101,6 +3101,9 @@ function bool ClickToPath() local int ActionIndex; local int TargetIndex; local string ConfirmSound; + // Variables for Issue #1420 + local X2TargetingMethod_ArcWave ArcWaveTargetingMethod; + local AvailableTarget AdditionalTargets; if(`XCOMVISUALIZATIONMGR.VisualizerBlockingAbilityActivation()) { @@ -3125,6 +3128,34 @@ function bool ClickToPath() // and the targeted unit's location TargetIndex = UnitCache.AvailableActions[ActionIndex].AvailableTargets.Find('PrimaryTarget', PathingPawn.LastTargetObject.GetReference()); PathingPawn.GetWaypointTiles(WaypointTiles); + + // Start Issue #1420 + /// HL-Docs: ref:Bugfixes; issue:1420 + /// Abilities using X2TargetingMethod_ArcWave will now validate its additional targets when making a right-click pathing attack + ArcWaveTargetingMethod = X2TargetingMethod_ArcWave(new AbilityState.GetMyTemplate().TargetingMethod); + + if (ArcWaveTargetingMethod != None) + { + // Initialize the targetingmethod and set variables that were set incorrectly by parent class + ArcWaveTargetingMethod.Init(UnitCache.AvailableActions[ActionIndex], TargetIndex); + ArcWaveTargetingMethod.DirectSetTarget(TargetIndex); + ArcWaveTargetingMethod.LastDestination = PathingPawn.LastDestinationTile; + + AdditionalTargets = UnitCache.AvailableActions[ActionIndex].AvailableTargets[TargetIndex]; + + // Set the amount of additional targets + if (ArcWaveTargetingMethod.GetAdditionalTargets(AdditionalTargets)) + { + UnitCache.AvailableActions[ActionIndex].AvailableTargets[TargetIndex] = AdditionalTargets; + } + + // Cancel the side-effects caused by initialization of targeting method + `CAMERASTACK.RemoveCamera(ArcWaveTargetingMethod.LookAtCamera); + `PRES.GetTacticalHUD().CancelTargetingAction(); + ArcWaveTargetingMethod.Canceled(); + } + // End Issue #1420 + if(TargetIndex != INDEX_NONE && class'XComGameStateContext_Ability'.static.ActivateAbility(UnitCache.AvailableActions[ActionIndex], TargetIndex,,, PathingPawn.PathTiles, WaypointTiles)) { //If there is a ConfirmSound for the melee ability, play it From 337cc9fcd5afed5197e06aad9fb261468e29c767 Mon Sep 17 00:00:00 2001 From: BlackDog86 <122568778+BlackDog86@users.noreply.github.com> Date: Fri, 27 Dec 2024 10:16:41 +0000 Subject: [PATCH 4/5] Adjust XCGS_Item to ignore the number of upgrade slots in HasBeenModified --- .../Src/XComGame/Classes/XComGameState_Item.uc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_Item.uc b/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_Item.uc index cb5191a7f..3aab7ce0e 100644 --- a/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_Item.uc +++ b/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_Item.uc @@ -792,10 +792,14 @@ simulated function bool HasBeenModified() return true; //end issue #104 - WeaponTemplate = X2WeaponTemplate( m_ItemTemplate ); - - // Single line for Issues #93 and #306 - if ((WeaponTemplate != none) && (GetNumUpgradeSlots() > 0) && (GetMyWeaponUpgradeCount() > 0)) + WeaponTemplate = X2WeaponTemplate( m_ItemTemplate ); + /// HL-Docs: ref:Bugfixes; issue:1429 + /// Fix bug that caused weapons that have weapon upgrades installed, despite not having any weapon upgrade slots, + /// to stack in the HQ inventory, causing them to lose their installed upgrades when equipped. The fix removes the + /// check for the number of weapon upgrade slots on the weapon from the logic that determines whether the item has + /// been modified or not, and leaves just the check for number of installed weapon upgrades. + // Single line for Issues #93, #306 and #1429 + if ((WeaponTemplate != none) /* && (GetNumUpgradeSlots() > 0)*/ && (GetMyWeaponUpgradeCount() > 0)) return true; return false; From 7bdf62b41b3217b80f2dc5b2c9ec7c757636be17 Mon Sep 17 00:00:00 2001 From: MattMc <122568778+BlackDog86@users.noreply.github.com> Date: Mon, 6 Jan 2025 08:25:10 +0000 Subject: [PATCH 5/5] Check effect damage is non-zero before applying rupture to the damage preview (#1445) --- .../XComGame/Classes/XComGameState_Ability.uc | 27 +++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_Ability.uc b/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_Ability.uc index 922a55efa..4f93145fc 100644 --- a/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_Ability.uc +++ b/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_Ability.uc @@ -1230,15 +1230,32 @@ function NormalDamagePreview(StateObjectReference TargetRef, out WeaponDamageVal MaxDamagePreview.Shred += MaxDamagePreview.Shred * BurstFire.NumExtraShots; } } + + // Begin Issue #1394 + /// HL-Docs: ref:Bugfixes; issue:1394 + /// Abilities which do not specify a custom damage preview function will show rupture damage on the damage + /// preview, even if the ability is not capable of doing any damage (e.g. self target abilities like reload). + /// Checking that the previewed damage is non-zero before adding rupture damage to it mitigates this and improves + /// the display (mainly for modded gameplay, but it also occurs in niche base game circumstances e.g. if a ruptured + /// unit becomes mind controlled). if (Rupture > 0) { - MinDamagePreview.Damage += Rupture; - MaxDamagePreview.Damage += Rupture; DamageModInfo.bIsRupture = true; DamageModInfo.Value = Rupture; - MinDamagePreview.BonusDamageInfo.AddItem(DamageModInfo); - MaxDamagePreview.BonusDamageInfo.AddItem(DamageModInfo); - } + + if (MinDamagePreview.Damage > 0) + { + MinDamagePreview.Damage += Rupture; + MinDamagePreview.BonusDamageInfo.AddItem(DamageModInfo); + } + + if (MaxDamagePreview.Damage > 0) + { + MaxDamagePreview.Damage += Rupture; + MaxDamagePreview.BonusDamageInfo.AddItem(DamageModInfo); + } + } + // End Issue #1394 if (DestructibleState != none) {