mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-10 23:47:08 +01:00
3b6d0f20ec
The last time the Light Sensitivity code was changed, I remarked in a review that "This should probably be a component so that its code isn't being run on every mob forever". Well I've gotten around to doing that myself, except I figured out it's even better off as an Element in this situation rather than a Component. So this is now my first time adding Elements to the repo. It turns out they're really awesome when paired with signals. This PR removes the hardcoded check for the light senstivity and dark phobia traits from the Life() path, replacing them instead with two Elements which hook into the pre-existing signal used to handle vision updates for human mobs. I've mainly done this to help cut down on the overwhelmingly high cost of the Life() codepath, which is currently one of the most expensive paths we have. While I was at it with refactoring these two, I noticed that there wasn't a trait selection for either of them, so I added selections for both traits to the disabilities tab so that players can opt-in to being light sensitive or afraid of the dark! <img width="318" height="336" alt="image" src="https://github.com/user-attachments/assets/a1e60e83-d899-44df-8ea3-0cd5a87c231c" />