fa icon indicating copy to clipboard operation
fa copied to clipboard

Re-implement Chrono Dampener to properly use firing cycle + VFX fixes

Open lL1l1 opened this issue 1 year ago • 5 comments

Fixes #2410. To replicate the issue, start chrono with targeting of a land/sea surface unit, then walk underwater while staying within its 35 range. It will stay locked on and never check its own inability to fire underwater, so it'll keep firing underwater. This is caused by its custom firing cycle that never goes to the OnFire event except in the initial target acquisition. The cycle: idle -> FireReady -(FireReady.OnFire)-> FiringState (repeat forever) -(FiringState.OnLostTarget)-> Idle

Changes

  • RateOfFire actually determines the fire rate now.
  • It can no longer fire underwater.
  • Categories to stun are generated from the BP's stun buff definition instead of being coded in the weapon.
  • Chrono uses its own range instead of relying completely on the primary weapon. Now the range upgrades adjust the range of Chrono, like they do with overcharge.
  • The initial stun effects are fixed (target.InitialStunFxApplied was never reset) and the effect was changed to be a more noticeable flash, as if the enemy was suddenly hit by a burst of energy. The flash effect also reduces with distance since the stun is weaker far away.
  • If you zoomed out or looked away while Chrono was firing, the large ring particle wouldn't emit and you'd never see the effect if you looked back at it. This is changed to always emit because Chrono is rather important.
  • AIR*MOBILE is not a valid target restriction, so Chrono was uselessly firing at aircraft. The target priorities are fixed to only fire at t1-t3 mobile surface units.

lL1l1 avatar Feb 08 '24 07:02 lL1l1

The chrono dampener intentionally did not use the firing cycle. It was like this before I refactored it in https://github.com/FAForever/fa/pull/3918. I discussed this back then too and it would prevent multiple Aeon ACUs from permanently stunning enemy units because they have control over when the chrono dampener triggers.

Garanas avatar Feb 09 '24 06:02 Garanas

I prefer that it does use the fire cycle since tying it to the game tick has the potential to delay the activation for 4 seconds, making the weapon seem unresponsive and sluggish sometimes. I added stunlock prevention by preventing new chrono stuns applying before the initial stunning chrono has reloaded. This allows it to be responsive when you walk into range, but it also harms multi-chrono strategies since one chrono far away from a unit can steal the ability to stun that unit from a chrono much closer, if the timings line up. But to be fair, seeing more than one chrono in a single fight is very rare.

lL1l1 avatar Feb 11 '24 08:02 lL1l1

I'll look into it for you this weekend 👍

Garanas avatar Mar 21 '24 07:03 Garanas

@MrRowey It should be a very minor change in terms of balance, so I didn't add do not merge. Doesn't change how often Chrono fires or how long it can stun, just when it fires. https://github.com/FAForever/fa/blob/3096dffb7ecc2c5afaf14fbca6301360af669902/changelog/snippets/balance.5883.md?plain=1#L1-L5

If Aeon SACU get chrono with a longer cooldown, this PR would make creating that new Chrono weapon much easier.

lL1l1 avatar May 01 '24 01:05 lL1l1

thats fine, Can i get a ping when merged so I can add to patchnotes

MrRowey avatar May 01 '24 08:05 MrRowey