Files
Bubberstation/code/modules/movespeed
Jacquerel f435207376 Replaces Netherworld mob health scaling component (#73629)
## About The Pull Request

The netherworld mob refactor PR added a component called `damage_buffs`
which... was both kind of a little bit pointless and also didn't do what
the name said it did.
This adds a new component which actually does what that component
promised to do, and does it more reliably.

The previous system had sort of odd behaviour where a Migo would start
moving faster as it took damage but _only_ if it took damage with an
identifiable mob, so damage from the environment or lava or an explosion
or anything else which doesn't come with someone to blame wouldn't
update the mob, and neither would its health going back _up_... until
someone punched it at which point anything it should have been doing
before then would suddenly update.

This adds a new component which simply listens to
`COMSIG_LIVING_HEALTH_UPDATE` instead of `COMSIG_ATOM_WAS_ATTACKED` and
then interpolates the provided maximum and minimum values smoothly based
on how close you are to a maximum or minimum health threshold.
This is slightly different from the original behaviour which didn't
necessarily have those things change linearly and only did it in
increments of 25%... but this is cleaner.

## Why It's Good For The Game

Fixes some odd behaviour with these mobs.
Hopefully makes the code both cleaner and more reusable in the future.

## Changelog

🆑
refactor: Migos, Creatures, and Blank Bodies use a new shared component
to update their stats which scales smoothly as they take damage rather
than in stages.
fix: Migos, Creatures and Blank Bodies will all update their stats when
taking or losing damage regardless of it was from an identifiable enemy.
/🆑
2023-02-27 16:27:50 -07:00
..