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

[SEMI-MODULAR] Ghostrole Cryoing #1003

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Satile1
Copy link

@Satile1 Satile1 commented Nov 12, 2023

About The Pull Request

Adds a new variant of ghostrole spawners that create a Cryopod when used. If the ghostrole player enters their relevant cryopod, it will delete itself and spawn a new ghostrole spawner.

Implemented only in the Hotel and Lavaland Syndicate, but it can be expanded to other roles fairly easily.

Very possibly shitcode. Would appreciate a review!

A Port?

All new.

Pre-Merge Checklist

  • You tested this on a local server.
  • This code did not runtime during testing.
  • You documented all of your changes.

Changelog

🆑
add: Hotel and Lavaland Syndicate ghostrole sleepers now function as Cryopods when empty. If used by the original occupant, the ghostrole is refreshed.
remove: Lavaland Syndicates no longer have a skeleton in their closet
/:cl:

@MosleyTheMalO
Copy link

MosleyTheMalO commented Nov 12, 2023

Adds a new variant of ghostrole spawners that create a Cryopod when used.

Wouldn't this also disallow the ghost role to spawn since there is no longer a spawner for them to come from?

@Satile1
Copy link
Author

Satile1 commented Nov 12, 2023

Adds a new variant of ghostrole spawners that create a Cryopod when used.

Wouldn't this also disallow the ghost role to spawn since there is no longer a spawner for them to come from?

Not sure what you mean!

All ghostrole spawners delete themselves by default once they're done spawning. This code makes them drop a cryopod once that's done.

The cryopod they drop is also capable of doing the same. It'll delete itself and create a new spawner once it's done cryo-ing the specific type of ghostrole that it was created by.

So,

Hotel Spawner -> Cryopod (Watching for Hotel Staff) -> Hotel Spawner

@@ -198,7 +202,15 @@ GLOBAL_LIST_EMPTY(cryopod_computers)
if(!control_computer_weakref)
control_computer_weakref = cryo_find_control_computer(src, urgent = TRUE)

despawn_occupant()
if(mob_occupant.mind) //SPLURT Addition - Ghostrole cryoing

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will not work with the autocryo system, as it checks for occupant.mind which is erased upon ghosting or being disconnected for too long.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very fair. Certainly won't deal with ghostroles that just quit and don't bother using the cryo sleeper.

But that'd require a different implementation signalling the original sleeper somehow which is a touch beyond me this year.

Should work just fine in its limited scope, and not break autocryoing since this check happens before it even reaches the proc autocryo also calls.

Cheers for taking a look at it all!

But incidentally autocryo also uses occupant.mind to clear job slots. Wouldn't the mind still exist, but the client be erased?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very fair. Certainly won't deal with ghostroles that just quit and don't bother using the cryo sleeper.

But that'd require a different implementation signalling the original sleeper somehow which is a touch beyond me this year.

Should work just fine in its limited scope, and not break autocryoing since this check happens before it even reaches the proc autocryo also calls.

Cheers for taking a look at it all!

But incidentally autocryo also uses occupant.mind to clear job slots. Wouldn't the mind still exist, but the client be erased?

I hadn't taken a look at the base despawn proc, I believed it checked for client.assigned_job rather than mind.assigned_job (which was a thing done by /tg/ to better track people ghosting and respawning as ghostroles).

Either way, it should be fine for a testmerge; further improvements can be made, but for now this'll be a massive QOL.

Copy link

@Yawet330 Yawet330 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This in theory works, the code itself looks mostly solid past the aformentioned potential bug with mob.mind handling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants