[MIRROR] Slime type datum, and cleans up slime related code #832
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.
Mirrored on Skyrat: Skyrat-SS13/Skyrat-tg#25250
Original PR: tgstation/tgstation#79852
About The Pull Request
I have decided to help out with basic mobbing slimes, and found out, that this code is ancient and crusty. So I have decided to refactor and tweak things bit but but, until the moment I will hit AI related stuff.
I might have gone a bit overboard, and performed a melange of fixes. I have done the following in order:
slime_type datum
. This means the slime's core is no longer spawned using text operations on the slime's colour, and the slime's mutation is no longer a single large switch statement that returns an exactly four element length array. Icons are still based on the slime's colour define, but that is now more changeable.This has been an extremely large scrubbing. I am willing to try rip it up into smaller chunks, even if most of it is just single letter vars and if pyramids.
Why It's Good For The Game
If code is more readable and expandable, it will aid in further refactors.
Changelog
🆑 Profakos
refactor: Slimes's colour, core type and mutation list is now held in a slime type datum
code: Slime's variables have been documented, and renamed a bit to add clarity. Please report bugs that might stem from renaming.
fix: Slimes are not longer prevented from attacking pacifist humans.
qol: Slime scans now display the actual amount of genetic instability, instead of hiding it if a slime doesn't mutate further, or tweaking it if it might mutate back into itself. This will make it easier to parse which slime to breed further to get a rainbow slime.
/:cl: