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
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 17 additions & 23 deletions _maps/RandomRuins/LavaRuins/lavaland_surface_syndicate_base1.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -319,14 +319,6 @@
/obj/effect/turf_decal/tile/green,
/turf/open/floor/plasteel,
/area/ruin/lavaland/unpowered/syndicate_lava_base)
"bS" = (
/obj/structure/closet/secure_closet/personal/patient,
/obj/effect/decal/cleanable/dirt,
/mob/living/simple_animal/hostile/skeleton,
/turf/open/floor/plasteel/white/side{
dir = 9
},
/area/ruin/lavaland/unpowered/syndicate_lava_base/virology)
"cA" = (
/obj/structure/table/reinforced,
/obj/item/book/manual/wiki/chemistry,
Expand Down Expand Up @@ -2835,9 +2827,8 @@
/turf/open/floor/plasteel,
/area/ruin/lavaland/unpowered/syndicate_lava_base/main)
"ib" = (
/obj/effect/mob_spawn/human/lavaland_syndicate{
dir = 4;
faction = list("Syndicate")
/obj/effect/mob_spawn/human/cryocapable/lavaland_syndicate{
dir = 4
},
/turf/open/floor/plasteel/grimy,
/area/ruin/lavaland/unpowered/syndicate_lava_base/dormitories)
Expand Down Expand Up @@ -2875,9 +2866,8 @@
/turf/open/floor/plasteel/dark,
/area/ruin/lavaland/unpowered/syndicate_lava_base/dormitories)
"ie" = (
/obj/effect/mob_spawn/human/lavaland_syndicate/comms{
dir = 8;
faction = list("Syndicate")
/obj/effect/mob_spawn/human/cryocapable/lavaland_syndicate/comms{
dir = 8
},
/turf/open/floor/plasteel/grimy,
/area/ruin/lavaland/unpowered/syndicate_lava_base/dormitories)
Expand Down Expand Up @@ -3305,6 +3295,12 @@
/obj/effect/turf_decal/tile/neutral{
dir = 8
},
/obj/machinery/computer/cryopod{
dir = 1;
pixel_y = -26;
req_access_txt = "150";
req_one_access = null
},
/turf/open/floor/plasteel{
heat_capacity = 1e+006
},
Expand Down Expand Up @@ -3538,13 +3534,12 @@
/turf/open/floor/plasteel,
/area/ruin/lavaland/unpowered/syndicate_lava_base/main)
"jn" = (
/obj/effect/mob_spawn/human/lavaland_syndicate{
dir = 4;
faction = list("Syndicate")
},
/obj/machinery/airalarm/syndicate{
pixel_y = 24
},
/obj/effect/mob_spawn/human/cryocapable/lavaland_syndicate{
dir = 4
},
/turf/open/floor/plasteel/grimy,
/area/ruin/lavaland/unpowered/syndicate_lava_base/dormitories)
"jo" = (
Expand All @@ -3564,13 +3559,12 @@
/turf/open/floor/plating,
/area/ruin/lavaland/unpowered/syndicate_lava_base/main)
"jq" = (
/obj/effect/mob_spawn/human/lavaland_syndicate{
dir = 8;
faction = list("Syndicate")
},
/obj/machinery/airalarm/syndicate{
pixel_y = 24
},
/obj/effect/mob_spawn/human/cryocapable/lavaland_syndicate{
dir = 8
},
/turf/open/floor/plasteel/grimy,
/area/ruin/lavaland/unpowered/syndicate_lava_base/dormitories)
"jr" = (
Expand Down Expand Up @@ -7366,7 +7360,7 @@ ab
ab
ac
eh
bS
eG
fh
eI
gr
Expand Down
14 changes: 13 additions & 1 deletion code/game/machinery/cryopod.dm
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@ GLOBAL_LIST_EMPTY(cryopod_computers)
///Weakref to our controller
var/datum/weakref/control_computer_weakref

///Splurt addition - Ghostrole cryoing
var/respawn_ghostrole = FALSE
var/create_spawner = FALSE

/obj/machinery/cryopod/Initialize(mapload)
..()
return INITIALIZE_HINT_LATELOAD //Gotta populate the cryopod computer GLOB first
Expand Down Expand Up @@ -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.

var/role = mob_occupant.mind.assigned_role
if(role == respawn_ghostrole)
despawn_occupant()
create_spawner = TRUE
qdel(src)
return

despawn_occupant()

/proc/cryo_handle_objectives(mob/living/mob_occupant)
// Update any existing objectives involving this mob.
Expand Down
2 changes: 1 addition & 1 deletion code/modules/jobs/jobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ GLOBAL_LIST_INIT(exp_jobsmap, list(
GLOBAL_LIST_INIT(exp_specialmap, list(
EXP_TYPE_LIVING = list(), // all living mobs
EXP_TYPE_ANTAG = list(),
EXP_TYPE_SPECIAL = list("Lifebringer","Ash Walker","Exile","Servant Golem","Free Golem","Hermit","Translocated Vet","Escaped Prisoner","Hotel Staff","SuperFriend","Space Syndicate","Ancient Crew","Space Doctor","Space Bartender","Beach Bum","Skeleton","Zombie","Space Bar Patron","Lavaland Syndicate","Ghost Role", "Ghost Cafe Visitor"), // Ghost roles
EXP_TYPE_SPECIAL = list("Lifebringer","Ash Walker","Exile","Servant Golem","Free Golem","Hermit","Translocated Vet","Escaped Prisoner","Hotel Staff","Hotel Manager","SuperFriend","Space Syndicate","Ancient Crew","Space Doctor","Space Bartender","Beach Bum","Skeleton","Zombie","Space Bar Patron","Lavaland Syndicate","Ghost Role", "Ghost Cafe Visitor"), // Ghost roles
EXP_TYPE_GHOST = list() // dead people, observers
))
GLOBAL_PROTECT(exp_jobsmap)
Expand Down
Loading
Loading