Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check effect damage is non-zero before applying rupture to the damage preview #1445

Merged
merged 2 commits into from
Jan 6, 2025

Conversation

BlackDog86
Copy link
Contributor

Fixes #1394

@BlackDog86 BlackDog86 requested a review from Iridar January 4, 2025 21:04
@BlackDog86 BlackDog86 self-assigned this Jan 4, 2025
@BlackDog86 BlackDog86 added this to the 1.30.0 milestone Jan 4, 2025
@BlackDog86
Copy link
Contributor Author

BlackDog86 commented Jan 4, 2025

Needs further testing but seems to work well in preliminary - one potential issue would be with abilities which deal 0 damage but are somehow 'intended' to cause the rupture damage to trigger. I can't think of anything off the top of my head which does this but it ought to be considered & obviously more than willing to accept revisions to the methodology to check other things as well.

@faanlez
Copy link

faanlez commented Jan 4, 2025

Rupture isn't applied anyway if there is no damage being dealt.

//	Start Issue #1299
/// HL-Docs: ref:Bugfixes; issue:1299
/// Remove the cap from the amount of bonus damage that can be added to an attack by rupture, and do not add rupture added by this attack to the attack's damage.
//RuptureAmount = min(kTarget.GetRupturedValue() + NewRupture, RuptureCap);
RuptureAmount = kTarget.GetRupturedValue();

// While Rupture Cap is removed, we still want to add bonus damage from rupture only if the attack deals damage,
// as that was part of of the original functionality of the Rupture Cap.
if (WeaponDamage > 0)
{
	if (RuptureAmount != 0)
	{
		WeaponDamage += RuptureAmount;
		`log("Target is ruptured, increases damage by" @ RuptureAmount $", new damage:" @ WeaponDamage, true, 'XCom_HitRolls');
	}
}
// End Issue #1299

But, it would be more correct to check both min and max separately instead of adding them together for the check. So it would need to be each one checked and displayed separately because that would be how it actually works as well, if it is possible to roll zero damage then there is zero rupture applied.

@BlackDog86 BlackDog86 force-pushed the 1394-Rupture-Preview-Fix branch from 4e0adc6 to 9da8748 Compare January 5, 2025 15:59
Move issue tags, correct bracket indendation.
@Iridar
Copy link
Contributor

Iridar commented Jan 6, 2025

Please put the Begin Issue tag before the HL-Docs entry in the future, as such is the convention. Good work otherwise.

@Iridar Iridar merged commit 7bdf62b into X2CommunityCore:master Jan 6, 2025
4 checks passed
@Iridar Iridar added the ready-for-merge the pull request was reviewed and is ready to be merged. label Jan 6, 2025
BlackDog86 added a commit to BlackDog86/X2WOTCCommunityHighlander that referenced this pull request Jan 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-basegame ready-for-merge the pull request was reviewed and is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Damage preview shows rupture damage on all abilities
3 participants