Cataclysm-DDA
Cataclysm-DDA copied to clipboard
[CR] Replace environmental protection with seal integrity
Summary
Infrastructure "Replace environmental protection with seal integrity"
Purpose of change
Environmental protection is currently essentially a magic number. All values involving it are hardcoded with no explanation as to how those values were chosen. When picking the value for armor or clothing, you have zero clue what the number you're setting even does.
A few examples:
- In
iexamine::flower_poppy
, you can only smell the flower if yourenv_resist
is less than 10, and if it's less than 5 then you have a chance of falling asleep. - Footwear only gives acid immunity if it has
env_resist >= 15
on the legs and feet. - If
env_resist < 10
then resistances to acid and fire are multiplied byenv_resist / 10
. - A few effects like flashbangs, boomer barf, and goo traps are rolled against
env_resist
throughadd_env_effect
despite there being no relevance. Swim goggles do not have integrated windshield wipers.
Describe the solution
On armor or clothing the name is changed to seal_integrity
with an enum type, like breathability
on materials, and on bionics and body parts it is changed to innate_seal
. All hardcoded values will be changed to use the enum. Flags like WATERPROOF
and GAS_PROOF
will become unnecessary.
Describe alternatives you've considered
Some complicated means of automatically determining a rough environmental protection value based on things like materials, thickness, other resistances, etc.
Testing
WIP.
Additional context
Relevant PRs and issues I found include #72010, #66297, #72271, #71964, and #74680.