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

Warhead activation target health thresholds #1398

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

Metadorius
Copy link
Member

Customizable Warhead trigger conditions

  • It is now possible to make warheads only trigger when target's HP is above and/or below certain percentage.
    • Both conditions need to evaluate to true in order for the warhead to trigger.

In rulesmd.ini:

[SOMEWARHEAD]               ; WarheadType
AffectsAbovePercent=0.0     ; floating point value, percents or absolute
AffectsBelowPercent=1.0     ; floating point value, percents or absolute

@Metadorius
Copy link
Member Author

This PR is supposed to be a reimpl. of #627. @FS-21 please verify that it can achieve the same functionality, keeping in mind what we commented earlier.

Copy link

Nightly build for this pull request:

This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build.

@FS-21
Copy link
Contributor

FS-21 commented Oct 1, 2024

So basically we have to set multiple warheads in the same weapon and depending the threshold of the damage produced by the warhead it does any damage (or not)? Is for preparing the tests

@Metadorius
Copy link
Member Author

depending the threshold of the damage produced

No, depending on the target health at the moment of hit.

@Metadorius
Copy link
Member Author

Otherwise you're correct.

@FS-21
Copy link
Contributor

FS-21 commented Oct 1, 2024

So you said:

1º) The weapon hits the target.
2º) Checks the target health
3º) checks if there are the 2 new tags
4º) if meets the criteria the weapon works or does nothing if doesn't meet the criteria of the new 2 tags.

I tried With a Yuri mind control weapon (as the ones used in #627 ):

[EMindControl]
Damage=1 ;Number of mind control links
ROF=20
Range=7
Projectile=PsychicControl
Speed=100
Warhead=PsyController
Anim=YURICNTL
FireOnce=yes
CanTargetHouses=enemies

[PsyController] ;Mind control warhead. Will skip normal damage like EMP did
Verses=100%,100%,100%,100%,0%,100%,0%,0%,0%,100%,100%
MindControl=yes
AnimList=YURICNTL
; ...
PenetratesBunker=no
AffectsAbovePercent=0.0 ; floating point value, percents or absolute
AffectsBelowPercent=0.5 ; floating point value, percents or absolute

It ignores this new logic and mind controls the target. Same with ExtraWarheads logic.

Anotehr test in a Chrono legionnaire temporal weapon
[ChronoBeam]
Verses=100%,100%,100%,100%,100%,100%,100%,100%,100%,100%,0%
Temporal=yes
Versus.ImmuneToTemporal_concrete_armor=0%
Versus.defender_armor=0%
Versus.defender_armor.ForceFire=no
Versus.defender_armor.Retaliate=no
Versus.defender_armor.PassiveAcquire=no
AffectsAbovePercent=0.0 ; floating point value, percents or absolute
AffectsBelowPercent=0.5 ; floating point value, percents or absolute

These tags are ignored and attacks & erase the target.
I also tried the Ares KillDriver=yes logic in WH and the same, these tags doesn't work

@FS-21
Copy link
Contributor

FS-21 commented Oct 1, 2024

Wait, I checked in the code that exists a EffectsRequireVerses=false, I want re-test these cases sicne they should be considered effects.
EDIT: nah, it still doesn't works

@Metadorius
Copy link
Member Author

Meh I know what's the issue, currently it only applies to Phobos warhead effects... will see later if it's possible to fix this

@FS-21
Copy link
Contributor

FS-21 commented Oct 1, 2024

If helps : 0x4690B0 -> void __thiscall BulletClass::Logics(BulletClass *this, CoordStruct *coords) <- controls some WH effects (or all, I don't remember. Is what I was using in #627 for replacing the original warhead by another one if the threshold was reached)

@Metadorius
Copy link
Member Author

If helps : 0x4690B0 -> void __thiscall BulletClass::Logics(BulletClass *this, CoordStruct *coords) <- controls some WH effects (or all, I don't remember. Is what I was using in #627 for replacing the original warhead by another one if the threshold was reached)

Yeah I am looking at this one too. I figured I'll ask other devs since for some reason it isn't hooked in order to be able to control all effects, might be cause of Ares. I might just move that check in the beginning of the function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants