New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create atom/item specific procs to handle most in-combat material procs and make most of these material procs compatible with atoms #15057
Merged
ZeWaka
merged 20 commits into
goonstation:master
from
M-Earthfire:matsci_tool_parts_matter
Aug 5, 2023
Merged
Create atom/item specific procs to handle most in-combat material procs and make most of these material procs compatible with atoms #15057
ZeWaka
merged 20 commits into
goonstation:master
from
M-Earthfire:matsci_tool_parts_matter
Aug 5, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…rties affect mobs out of the material now.
…rried with a chance
…nto matsci_tool_parts_matter
github-actions
bot
added
the
size/L
Denotes a PR that changes 100-499 lines, ignoring generated files.
label
Jul 23, 2023
…nto matsci_tool_parts_matter
ZeWaka
added
C-Code-Quality
Cleans up code, refactors things to be more readable or intuitive
A-Materials
Deals with our materials system in some way
labels
Jul 26, 2023
ZeWaka
requested changes
Aug 1, 2023
…nto matsci_tool_parts_matter
ZeWaka
approved these changes
Aug 3, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ideally this would be done using signals but this is fine for now i think
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-Materials
Deals with our materials system in some way
C-Bug
A bug that impacts usage of a feature
C-Code-Quality
Cleans up code, refactors things to be more readable or intuitive
size/L
Denotes a PR that changes 100-499 lines, ignoring generated files.
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.
[Material][Quality][Refactor]
About the PR
This PR moves most direct calls of material procs into item- or atom specific procs. To accomodate it, most material procs that are affected by this are refactored to be passed the broadest class possible, which is for many of these procs atoms.
This fixes #12093
Thus, multiple procs are introduced,
atom/proc/material_on_attack_use
is used when the material is used for an attackatom/proc/material_trigger_on_mob_attacked
is called on every atom in a mob when that mob that contains something out of the material is attacked. "situation modifier" gets passed on this proc the attack zone that the attack tries to hit, if there was any. The respectable material proc was only called on items in the mob, e.g. implants, now it is called on equipped items as well. With some caveat.atom/proc/material_trigger_on_bullet
has the same behaviour, just for bullet hits.atom/proc/material_trigger_when_attacked
is called when an item out of the material is affected. This now gets passed mobs as attacking atoms for cases like wall shamshes or laywer hands on tables/atom/proc/material_trigger_on_temp
,atom/proc/material_trigger_on_explosion
,atom/proc/material_trigger_on_blob_attacked
,atom/proc/material_trigger_on_chems
,/obj/item/proc/material_on_drop
,/obj/item/proc/material_on_pickup
were added for their respectable triggers.This two material procs that are not routed to atom-calls are
triggersOnLife
andtriggersOnEntered
. These require some untangling and more severe modification, to some degree in their design, because of which i decided to move these into their own PR'sTo show off these what these procs enable, the behaviour on how equipped items on mobs call their material effects when the mob is hit was added.
Before, equipped items didn't reacted at all if you attacked someone. Now, they get affected, based on hit location and object size. If you target a location that is covered by a clothing, that clothing's material effect gets triggered.
For items that are not clothing, they are only affected guaranteed when you are blocking with them. Else, there is a chance based of the item size to hit it.
In general, that means someone with an erebite PDA might find it exploding with a small chance while they are wearing it.
Beyond that, multiple occassions were fixed where the wrong proc was called, e.g. when destroying plated handcuffs
Why's this needed?
In general, routing material procs of the respectable atoms enables to more finetune when and how the effects of materials are called. This is especially important since matsci items (spacesuits, spears, arrows) are very janky to make their material effects work properly. This PR will very easy enable to e.g. make the shaft affect the on-entered or on-life effect and the tip of the spear to affect the on-attack-effect.
Also, the cleanup has some interesting side effects. Like reflective walls being able to reflect bullets again. This will also apply to mobs made out of the material now (e.g. syreline-ore-chickens).
Changelog