[CR] Replace environmental protection with seal integrity #74872
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
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.env_resist >= 15
on the legs and feet.env_resist < 10
then resistances to acid and fire are multiplied byenv_resist / 10
.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, likebreathability
on materials, and on bionics and body parts it is changed toinnate_seal
. All hardcoded values will be changed to use the enum. Flags likeWATERPROOF
andGAS_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.