forked from BeeStation/BeeStation-Hornet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Force-cryo refactor + improvements (BeeStation#10235)
* Force-cryo refactor + improvements * Address reviews. * Only use on-station pods * fix comment * forgot to fix this comment too * Fix player panel layout * Address reviews
- Loading branch information
Showing
8 changed files
with
150 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,14 @@ | ||
/// Cryo's the target, opening up their job slot in the lobby | ||
/datum/smite/forcecryo | ||
name = "Force Cryo" | ||
/datum/smite/force_cryo_pod | ||
name = "Force Cryo (using centcom pod)" | ||
|
||
/datum/smite/forcecryo/effect(client/user, mob/living/target) | ||
/datum/smite/force_cryo_pod/effect(client/user, mob/living/target) | ||
. = ..() | ||
forcecryo(target) | ||
force_cryo(target) | ||
|
||
/datum/smite/force_cryo_instant | ||
name = "Force Cryo (instant)" | ||
|
||
/datum/smite/force_cryo_instant/effect(client/user, mob/living/target) | ||
. = ..() | ||
instant_force_cryo(target) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,81 @@ | ||
/proc/forcecryo(mob/target) | ||
var/turf/T = get_turf(target) | ||
new /obj/effect/temp_visual/tornado(T) | ||
sleep(20) | ||
for(var/obj/machinery/cryopod/C in GLOB.machines) | ||
if(!C.occupant) | ||
C.close_machine(target) | ||
C.despawn_occupant() | ||
break | ||
/proc/force_cryo_ckey(target_ckey, instant = FALSE) | ||
var/mob/living/target = get_ckey_last_living(target_ckey, healthy = TRUE) | ||
if(!target) | ||
return | ||
var/method = instant ? GLOBAL_PROC_REF(instant_force_cryo) : GLOBAL_PROC_REF(force_cryo) | ||
INVOKE_ASYNC(GLOBAL_PROC, method, target) | ||
|
||
/proc/force_cryo(mob/living/target) | ||
if(!istype(target)) | ||
return | ||
var/obj/machinery/cryopod/pod_loc = target.loc | ||
if(istype(pod_loc) && pod_loc.occupant == target) | ||
pod_loc.despawn_occupant() | ||
return | ||
var/turf/target_turf = get_turf(target) | ||
target.ghostize(can_reenter_corpse = FALSE) | ||
// unbuckle them from everything and release them from any pulls | ||
target.unbuckle_all_mobs(force = TRUE) | ||
target.stop_pulling() | ||
target.pulledby?.stop_pulling() | ||
target.buckled?.unbuckle_mob(target, force = TRUE) | ||
// ensure that they don't move / get moved and cause any weirdness | ||
target.mouse_opacity = MOUSE_OPACITY_TRANSPARENT | ||
target.Stun(INFINITY, ignore_canstun = TRUE) | ||
target.move_resist = INFINITY | ||
target.anchored = TRUE | ||
target.status_flags |= GODMODE | ||
// ensure they're on a turf | ||
target.forceMove(target_turf) | ||
// send a fancy centcom pod, so nobody ICly questions this | ||
var/obj/structure/closet/supplypod/force_cryo/cryo_express = new | ||
cryo_express.target = target | ||
new /obj/effect/pod_landingzone(target_turf, cryo_express) | ||
|
||
/proc/instant_force_cryo(mob/living/target) | ||
if(!istype(target)) | ||
return | ||
// unbuckle them from everything, and release them from any pulls | ||
target.pulledby?.stop_pulling() | ||
target.buckled?.unbuckle_mob(target, force = TRUE) | ||
for(var/obj/machinery/cryopod/pod in GLOB.machines) | ||
if(!is_station_level(pod.z) || !QDELETED(pod.occupant) || pod.panel_open) | ||
continue | ||
pod.close_machine(target) | ||
pod.despawn_occupant() | ||
return | ||
message_admins("<span class='danger'>Failed to force-cryo [ADMIN_LOOKUPFLW(target)] (no valid cryopods)</span>") | ||
log_admin("Failed to force-cryo [key_name(target)] (no valid cryopods)") | ||
|
||
/obj/structure/closet/supplypod/force_cryo | ||
name = "\improper CentCom employee retrieval pod" | ||
desc = "A pod used by Central Command to retrieve certain employees from the station for long-term cryogenic storage." | ||
style = STYLE_CENTCOM | ||
bluespace = TRUE | ||
reversing = TRUE | ||
specialised = TRUE | ||
explosionSize = list(0, 0, 0, 0) | ||
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF | ||
reverse_delays = list(POD_TRANSIT = 0.5 SECONDS, POD_FALLING = 0.5 SECONDS, POD_OPENING = 0.5 SECONDS, POD_LEAVING = 1.5 SECONDS) | ||
var/mob/living/target | ||
|
||
/obj/structure/closet/supplypod/force_cryo/insert(mob/living/to_insert, atom/movable/holder) | ||
if(!insertion_allowed(to_insert)) | ||
return FALSE | ||
// make SURE they aren't buckled or being pulled. | ||
to_insert.pulledby?.stop_pulling() | ||
to_insert.buckled?.unbuckle_mob(target, force = TRUE) | ||
to_insert.forceMove(holder) | ||
return TRUE | ||
|
||
/obj/structure/closet/supplypod/force_cryo/insertion_allowed(atom/to_insert) | ||
return to_insert == target | ||
|
||
/obj/structure/closet/supplypod/force_cryo/preOpen() | ||
// if we're going back to centcom, now we just cryo them | ||
if(!reversing && !QDELETED(target)) | ||
target.moveToNullspace() | ||
INVOKE_ASYNC(GLOBAL_PROC, GLOBAL_PROC_REF(instant_force_cryo), target) | ||
qdel(src) | ||
return | ||
return ..() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters