Phobos icon indicating copy to clipboard operation
Phobos copied to clipboard

Warhead activation target health thresholds

Open Metadorius opened this issue 1 year ago • 10 comments

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 avatar Sep 27 '24 20:09 Metadorius

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.

Metadorius avatar Sep 27 '24 20:09 Metadorius

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.

github-actions[bot] avatar Sep 27 '24 21:09 github-actions[bot]

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

FS-21 avatar Oct 01 '24 19:10 FS-21

depending the threshold of the damage produced

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

Metadorius avatar Oct 01 '24 19:10 Metadorius

Otherwise you're correct.

Metadorius avatar Oct 01 '24 19:10 Metadorius

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 avatar Oct 01 '24 20:10 FS-21

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

FS-21 avatar Oct 01 '24 21:10 FS-21

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

Metadorius avatar Oct 01 '24 21:10 Metadorius

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)

FS-21 avatar Oct 01 '24 21:10 FS-21

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.

Metadorius avatar Oct 01 '24 21:10 Metadorius

I updated the code with the suggested changes and I did basic tests and looks that it just works.

FS-21 avatar Feb 04 '25 22:02 FS-21

Applied feedback, pending that question between devs.

FS-21 avatar Feb 06 '25 07:02 FS-21

Finally I tested this online and no desyncs. Then should this be merged?

FS-21 avatar Feb 19 '25 18:02 FS-21

I just noticed EffectsRequireVerses is true by default and the documentation mentions it is false by default.

I'll change the docs later

FS-21 avatar Feb 21 '25 07:02 FS-21

tested, and it can do the effect we've expected: setting a series of ExtraWarheads with each of them having a warhead activation threshold, then it can detonate different warhead based on the target's strength

Coronia avatar Mar 28 '25 05:03 Coronia