Skip to content

Commit

Permalink
Merge pull request #26 from EvenInDeathIStillServe/cryo
Browse files Browse the repository at this point in the history
Adds Far Travel (cryo)
  • Loading branch information
GeneralPantsuIsBadAtCoding authored Aug 4, 2024
2 parents c6b0e7f + a77ac30 commit f8e288c
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 0 deletions.
Binary file modified icons/turf/roguefloor.dmi
Binary file not shown.
58 changes: 58 additions & 0 deletions modular_azurepeak/code/game/objects/structures/fartravel.dm
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)

1 change: 1 addition & 0 deletions roguetown.dme
Original file line number Diff line number Diff line change
Expand Up @@ -3527,6 +3527,7 @@
#include "modular\code\modules\maturity-prompt\code\maturity_prompt.dm"
#include "modular\code\modules\maturity-prompt\code\maturity_subsystem.dm"
#include "modular_azurepeak\_statpacks.dm"
#include "modular_azurepeak\code\game\objects\structures\fartravel.dm"
#include "modular_azurepeak\statpacks\agile.dm"
#include "modular_azurepeak\statpacks\mental.dm"
#include "modular_azurepeak\statpacks\physical.dm"
Expand Down

0 comments on commit f8e288c

Please sign in to comment.