forked from Rotwood-Vale/Ratwood-Keep
-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from EvenInDeathIStillServe/cryo
Adds Far Travel (cryo)
- Loading branch information
Showing
3 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
58 changes: 58 additions & 0 deletions
58
modular_azurepeak/code/game/objects/structures/fartravel.dm
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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
//AKA cryosleep. | ||
|
||
/obj/structure/far_travel //Shamelessly jury-rigged from the way Fallout13 handles this. | ||
name = "far travel" | ||
desc = "Anywhere is better than here.\n(Drag your sprite onto this to exit the round!)" | ||
icon = 'icons/turf/roguefloor.dmi' | ||
icon_state = "fartravel" | ||
layer = ABOVE_MOB_LAYER | ||
density = TRUE | ||
anchored = TRUE | ||
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF | ||
var/in_use = FALSE | ||
|
||
/obj/structure/far_travel/MouseDrop_T(atom/dropping, mob/user) | ||
. = ..() | ||
if(!isliving(user) || user.incapacitated()) | ||
return //No ghosts or incapacitated folk allowed to do this. | ||
if(!ishuman(dropping)) | ||
return //Only humans have job slots to be freed. | ||
if(in_use) // Someone's already going in. | ||
return | ||
var/mob/living/carbon/human/departing_mob = dropping | ||
var/datum/job/mob_job | ||
if(departing_mob != user && departing_mob.client) | ||
to_chat(user, "<span class='warning'>This one retains their free will. It's their choice if they want to leave the round or not.</span>") | ||
return | ||
if(alert("Are you sure you want to [departing_mob == user ? "depart the round for good (you" : "send this person away (they"] will be removed from the current round, the job slot freed)?", "Departing", "Confirm", "Cancel") != "Confirm") | ||
return | ||
if(user.incapacitated() || QDELETED(departing_mob) || (departing_mob != user && departing_mob.client) || get_dist(src, dropping) > 2 || get_dist(src, user) > 2) | ||
return //Things have changed since the alert happened. | ||
user.visible_message("<span class='warning'>[user] [departing_mob == user ? "is trying to depart from Rockhill!" : "is trying to send [departing_mob] away!"]</span>", "<span class='notice'>You [departing_mob == user ? "are trying to depart from Rockhill." : "are trying to send [departing_mob] away."]</span>") | ||
in_use = TRUE | ||
if(!do_after(user, 50, target = src)) | ||
in_use = FALSE | ||
return | ||
in_use = FALSE | ||
update_icon() | ||
var/dat = "[key_name(user)] has despawned [departing_mob == user ? "themselves" : departing_mob], job [departing_mob.job], at [AREACOORD(src)]. Contents despawned along:" | ||
if(departing_mob.mind) | ||
mob_job = SSjob.GetJob(departing_mob.mind.assigned_role) | ||
mob_job.current_positions = max(0, mob_job.current_positions - 1) | ||
if(!length(departing_mob.contents)) | ||
dat += " none." | ||
else | ||
var/atom/movable/content = departing_mob.contents[1] | ||
dat += " [content.name]" | ||
for(var/i in 2 to length(departing_mob.contents)) | ||
content = departing_mob.contents[i] | ||
dat += ", [content.name]" | ||
dat += "." | ||
message_admins(dat) | ||
log_admin(dat) | ||
if(departing_mob.stat == DEAD) | ||
departing_mob.visible_message("<span class='notice'>[user] sends the body of [departing_mob] away. They're someone else's problem now.</span>") | ||
else | ||
departing_mob.visible_message("<span class='notice'>[departing_mob == user ? "Out of their own volition, " : "Ushered by [user], "][departing_mob] leaves Rockhill.</span>") | ||
qdel(departing_mob) | ||
|
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