-
Notifications
You must be signed in to change notification settings - Fork 565
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
Refactors totalXenos, tweaks some tier 0 things, adds a xeno anti-delay warning #5847
Conversation
This will mess with early game latejoins, I have to iron this out. The rest should be ready to review |
if(SSticker.mode && SSticker.current_state != GAME_STATE_FINISHED && hive.hivenumber == XENO_HIVE_NORMAL) | ||
// Notify the hive that we are about to perish | ||
if(LAZYLEN(hive.total_living_xenos_advanced == XENO_HIVE_COLLAPSE_THRESHOLD)) | ||
xeno_message(SPAN_XENOANNOUNCE("We can feel our hive's power weakening - only a few of us are left.")) |
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.
xeno_message(SPAN_XENOANNOUNCE("We can feel our hive's power weakening - only a few of us are left.")) | |
xeno_message(SPAN_XENOANNOUNCE("We can feel our hive's power weakening - there are only a few of us are left.")) |
@@ -136,7 +136,7 @@ | |||
to_chat(owner, SPAN_ALERT("Hive choice error. Aborting.")) | |||
return | |||
var/datum/hive_status/Hive = GLOB.hive_datum[hives[faction]] | |||
var/list/targets = Hive.totalXenos | |||
var/list/targets = Hive.total_living_xenos |
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.
completely unrelated to your refactor really but this needs a .Copy() at the end, as otherwise this ends up mutating the actual list
if(LAZYLEN(hive.total_living_xenos_advanced) == 1) | ||
var/mob/living/carbon/xenomorph/X = LAZYACCESS(hive.total_living_xenos_advanced, 1) |
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.
this isn't generally treated as a lazy list, why here?
Co-authored-by: harryob <[email protected]>
Co-authored-by: harryob <[email protected]>
This PR has been inactive for long enough to be automatically marked as stale. This means it is at risk of being auto closed in ~ 7 days, please address any outstanding review items and ensure your PR is finished, if these are all true and you are auto-staled anyway, you need to actively ask maintainers if your PR will be merged. Once you have done any of the previous actions then you should request a maintainer remove the stale label on your PR, to reset the stale timer. If you feel no maintainer will respond in that time, you may wish to close this PR youself, while you seek maintainer comment, as you will then be able to reopen the PR yourself |
Temporarily closing it as I have no mental capacity to deal with this right now - but I want to get back to it eventually (especially since it already got reviewed.) |
About the pull request
wow, expanding on xeno code surely doesn't turn into huge refactors
This PR splits the
totalXenos
list into two separate lists. Currently, thetotalXenos
list contains every tier, including facehuggers and lessers (tier 0s). A few calculations in the game have to snowflakely exclude them, while at other places, tier 0s should simply not matter, but they do (e.g. currently, if you are the last living xeno, like a drone, you won't get the warning for it, because a facehugger is AFKing somewhere under a desk).What this PR does is that when you join as a xeno, you get added to two lists:
total_living_xenos
: Every single xenomorph in the hive, including tier 0s.total_living_xenos_advanced
: Every xenomorph excluding tier 0s.This PR will change a few things:
this last thing is what I wanted to add but it ended up being an entire refactor
If this refactor doesn't actually make the code better, feel free to just close it, I'm not married to the idea.
Explain why it's good for the game
Code-wise, I believe it cleans up things a lot, including:
counts_for_slots
variable that was solely used for mobs that hadtier = 0
. Just usetier
.get_real_total_xeno_count()
which was a snowflake check just for tier 0s..len
withlength()
at many places, I cannot remember though why we preferred length over len.Game-wise, it is a common occurrence that once the Queen dies, xenos scatter; then we end up with a facehugger afking under a table, a drone running around aimlessly, and a runner harassing the FOB. None of these three players know the round is basically over. Let them know it.
Testing Photographs and Procedure
Cannot really screenshot anything, it is mainly a refactor.
Changelog
🆑
refactor: Refactored the living xenomorph list (totalXenos) into two separate ones to iron out some jankiness with facehuggers and lesser drones, leading to the following changes.
add: Xenomorphs are now notified if there are only three tier 1-4s are left (excluding tier 0s) to avoid further delays.
balance: The last xenomorph is now counted as the last one who is tier 1-4. A random facehugger afking under a table will no longer stop ARES from showing marines where the last xenomorph is hiding.
balance: You can no longer join as a facehugger or as a lesser drone when there is not a single tier 1-4 alive.
balance: Hive collapse now happens when there are less than 4 tier 1-4s. Previously, tier 0s also stopped a hive collapse, leading to a possible marine minor instead of a marine major.
balance: Queens can no longer hijack if more than half of her tier 1-4s are not onboard. This was already a thing, but it counted facehuggers and lessers too, who should not matter in this calculation.
balance: Queens can no longer select tier 0s to give evolution to, in exchange for a larva.
/:cl: