mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-15 18:06:48 +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" />
15 lines
736 B
Plaintext
15 lines
736 B
Plaintext
// 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_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_STAMINA_BONUS "stamina_bonus"
|
|
#define TRAIT_ORIGIN_PAIN_RESISTANCE "pain_resistance"
|
|
|
|
//Vaurca-specific traits
|
|
#define TRAIT_ORIGIN_ELECTRONIC_WARFARE "electronic_warfare"
|