Skip to content
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

[MIRROR] Moves bitflag invokes of (~0) to the ALL macro #264

Merged
merged 1 commit into from
Oct 25, 2023

Conversation

Steals-The-PRs
Copy link
Collaborator

Mirrored on Skyrat: Skyrat-SS13/Skyrat-tg#24539
Original PR: tgstation/tgstation#79162

About The Pull Request

ALL aliases to exactly (~0), so lets just use that instead for better explicitness on what we're doing there bitflag wise. Better explicitness throughout the code is always a good thing. Had to rename a file to ensure it would work out but I figure something like this would come back to bite us eventually, so w/e.

…RE] (#24539)

* Moves bitflag invokes of `(~0)` to the `ALL` macro

* Update admin.dm

* Update admin.dm

---------

Co-authored-by: san7890 <[email protected]>
Co-authored-by: Bloop <[email protected]>
@ReezeBL ReezeBL merged commit 4b2c720 into master Oct 25, 2023
23 checks passed
@ReezeBL ReezeBL deleted the upstream-mirror-24539 branch October 25, 2023 06:19
Iajret pushed a commit that referenced this pull request Jan 3, 2024
* Removes the attack_slime proc, and other slime refactors (#80487)

## About The Pull Request

- **Removed attack_slime**. Most of the attack_slime content has been
moved to a proc that signs up for COMSIG_LIVING_UNARMED_ATTACK. Its
ugly, but will make converting slimes to a basic mob easier. They now
use attack_animal for now, which might cause some unexpected
interactions. Hopefully when they are converted to basic mobs, these can
be cleared up properly.

- This caused some issues with cyborgs, who used to get only half damage
dealt to them. As refactoring this would have been too much of a
difficult task without much real gain, after much pondering, I have
decided that since slimes can always flash cyborgs with each of their
strikes, maybe cyborgs should only fear slimes that have electric
charges in them. In addition, slimes electric charges decrease now after
they successfully zap an cyborg, making them more consistent with the
zaps that affect carbons. AIs are still fully immune to slimes.

- The slime.dm and slime.life files were extremely bloated, and
unorganized. I have created two new files, defense.dm and ai.dm. I have
moved the various attack_by/attack_hand/etc procs to defense.dm. Ai.dm
now contains every single proc the slime's "AI" uses; this should help
getting a clearer picture of the current functionality, which should aid
with basic mob conversion and decision tree creation. The remaining
files have been slightly organized, with overrides in front, and new
procs at the back.

- Created a proc for swapping out Adult and Baby states of a slime.
Previously, attack_slime was in many cases ignoring fields like
melee_damage_lower and melee_damage_upper, replacing it with magic
numbers based on the slime's lifestate. Now these values are hard set by
these procs. This has caused slimes to be more consistent, though baby
slimes might do a bit less damage on the low end. I am tempted to turn
these in datums in the future, or as part of this PR.

- Removed baby slime's chance to accidentally attack a window/grille by
bumping into it, they had 0 object damage anyways, unlike adult slimes,
so there was no reason not to early return.

- The proc of `handle_feeding` assumed adjustBruteLoss and adjustToxLoss
return positive values when damage has been done, when in reality, it
returns the total health change along with its direction. This meant
slimes would fell off simple or basic mobs after a single bite. This has
been fixed.

- Also updated the warning before the slime type defines, as they were
out of date.

- I have removed the bespoke spacewalk override for slimes, which should
allow them to drift, should gravity go out.

- The nutrition stats are assigned only once, when the slime grows up,
instead of compared to being an adult every life tick

## Why It's Good For The Game

Less duplicated code.
This refactor should help in the basic mob conversion process.
Cyborgs have an easier time wrangling slimes, who could previously kill
them in three hits, if charged. They are mostly encased in metal, they
should feel fine when not hit with electric attacks.
Lets slimes feast on delicious corgis.

* Removes the attack_slime proc, and other slime refactors

---------

Co-authored-by: Profakos <[email protected]>
Co-authored-by: NovaBot <[email protected]>
Co-authored-by: SomeRandomOwl <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants