mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-31 00:49:06 +01:00
Light Sensitivity Refactor (#22386)
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" />
This commit is contained in:
@@ -57,3 +57,6 @@
|
||||
|
||||
/// Signal raised at the end of a mob's vision update to check if signals wish to supplement their own huds.
|
||||
#define COMSIG_MOB_UPDATE_VISION "mob_update_vision"
|
||||
|
||||
/// Signal raised when a mob checks for their flash protection.
|
||||
#define COMSIG_GET_FLASH_PROTECTION_MODIFIERS "get_flash_protection_modifiers"
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
// A set of traits used to determine which origin quirks to apply to characters.
|
||||
// These should all eventually be fully replaced with ECS methods.
|
||||
#define TRAIT_ORIGIN_IGNORE_CAPSAICIN "ignore_capsaicin"
|
||||
#define TRAIT_ORIGIN_ALCOHOL_RESISTANCE "alcohol_resistance"
|
||||
#define TRAIT_ORIGIN_DRUG_RESISTANCE "drug_resistance"
|
||||
#define TRAIT_ORIGIN_DARK_AFRAID "dark_sensitivity"
|
||||
#define TRAIT_ORIGIN_TOX_RESISTANCE "toxin_resistance"
|
||||
#define TRAIT_ORIGIN_COLD_RESISTANCE "cold_resistance"
|
||||
#define TRAIT_ORIGIN_HOT_RESISTANCE "hot_resistance"
|
||||
#define TRAIT_ORIGIN_NO_ANIMAL_PROTEIN "no_animal_protein"
|
||||
#define TRAIT_ORIGIN_LIGHT_SENSITIVE "light_sensitive"
|
||||
#define TRAIT_ORIGIN_STAMINA_BONUS "stamina_bonus"
|
||||
#define TRAIT_ORIGIN_PAIN_RESISTANCE "pain_resistance"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user