Skip to content

Commit

Permalink
Merge branch 'Bleeding-Edge' into reticulite
Browse files Browse the repository at this point in the history
  • Loading branch information
SECBATON-GRIFFON committed Dec 30, 2024
2 parents 02087aa + d221546 commit 2d22b8a
Show file tree
Hide file tree
Showing 67 changed files with 1,582 additions and 1,036 deletions.
2 changes: 2 additions & 0 deletions __DEFINES/_macros.dm
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,8 @@

#define istimeagent(H) (H.mind && (H.mind.GetRole(TIMEAGENT) || (H.mind.GetRole(TIMEAGENTTWIN))))

#define isdivergentclone(H) (H.mind && (H.mind.GetRole(DIVERGENTCLONE)))

#define isERT(H) (H.mind && H.mind.GetRole(RESPONDER))

#define isclownling(H) (H.mind && H.mind.GetRole(CLOWN_LING))
Expand Down
1 change: 1 addition & 0 deletions __DEFINES/role_datums_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
#define JUDGE "judge"
#define GRUE "grue"
#define NANOTRASENOFFICIAL "nanotrasen official"
#define DIVERGENTCLONE "divergent clone"

#define GREET_DEFAULT "default"
#define GREET_ROUNDSTART "roundstart"
Expand Down
102 changes: 0 additions & 102 deletions code/__HELPERS/unsorted.dm
Original file line number Diff line number Diff line change
Expand Up @@ -762,108 +762,6 @@
var/datum/coords/CR = new(x_pos+C.x_pos,y_pos+C.y_pos,z_pos+C.z_pos)
return CR

// If you're looking at this proc and thinking "that's exactly what I need!"
// then you're wrong and you need to take a step back and reconsider.
/atom/movable/proc/DuplicateObject(var/location)
var/atom/movable/duplicate = new src.type(location)
duplicate.change_dir(dir)
duplicate.plane = plane
duplicate.layer = layer
duplicate.name = name
duplicate.desc = desc
duplicate.pixel_x = pixel_x
duplicate.pixel_y = pixel_y
duplicate.pixel_w = pixel_w
duplicate.pixel_z = pixel_z
return duplicate

/area/proc/copy_contents_to(area/A , platingRequired = FALSE)
//Takes: Area. Optional: If it should copy to areas that don't have plating
//Returns: Nothing.
//Notes: Attempts to move the contents of one area to another area.
// Movement based on lower left corner. Tiles that do not fit
// into the new area will not be moved.

if(!A || !src)
return 0

var/list/turfs_src = get_area_turfs(src.type)
var/list/turfs_trg = get_area_turfs(A.type)

var/src_min_x = 0
var/src_min_y = 0
for (var/turf/T in turfs_src)
if(T.x < src_min_x || !src_min_x)
src_min_x = T.x
if(T.y < src_min_y || !src_min_y)
src_min_y = T.y

var/trg_min_x = 0
var/trg_min_y = 0
for (var/turf/T in turfs_trg)
if(T.x < trg_min_x || !trg_min_x)
trg_min_x = T.x
if(T.y < trg_min_y || !trg_min_y)
trg_min_y = T.y

var/list/refined_src = new/list()
for(var/turf/T in turfs_src)
refined_src += T
refined_src[T] = new/datum/coords
var/datum/coords/C = refined_src[T]
C.x_pos = (T.x - src_min_x)
C.y_pos = (T.y - src_min_y)

var/list/refined_trg = new/list()
for(var/turf/T in turfs_trg)
refined_trg += T
refined_trg[T] = new/datum/coords
var/datum/coords/C = refined_trg[T]
C.x_pos = (T.x - trg_min_x)
C.y_pos = (T.y - trg_min_y)

var/list/copiedobjs = list()

moving:
for (var/turf/T in refined_src)
var/datum/coords/C_src = refined_src[T]
for (var/turf/B in refined_trg)
var/datum/coords/C_trg = refined_trg[B]
if(C_src.x_pos == C_trg.x_pos && C_src.y_pos == C_trg.y_pos)
var/old_name = T.name
var/old_dir = T.dir
var/old_icon_state = T.icon_state
var/old_icon = T.icon

if(platingRequired)
if(istype(B, /turf/space))
continue moving

B.ChangeTurf(T.type)
B.name = old_name
B.dir = old_dir
B.icon_state = old_icon_state
B.icon = old_icon

B.return_air().copy_from(T.return_air())

for(var/obj/O in T)
copiedobjs += O.DuplicateObject(B)

for(var/mob/M in T)
if(!M.can_shuttle_move())
continue
copiedobjs += M.DuplicateObject(B)

refined_src -= T
refined_trg -= B
continue moving

for(var/obj/machinery/door/new_door in copiedobjs)
new_door.update_nearby_tiles()

return copiedobjs

/proc/view_or_range(distance = world.view , center = usr , type)
switch(type)
if("view")
Expand Down
99 changes: 49 additions & 50 deletions code/controllers/shuttle_controller.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var/global/datum/emergency_shuttle/emergency_shuttle
/datum/emergency_shuttle
var/alert = 0 //0 = emergency, 1 = crew cycle

var/location = 0 //0 = in transit (or on standby), 1 = at the station, 2 = at centcom
var/location = 0 //0 = in transit (or on standby) [SHUTTLE_ON_STANDBY], 1 = at the station [SHUTTLE_ON_STATION], 2 = at centcom [SHUTTLE_ON_CENTCOM]
var/online = 0
var/direction = 0 //-1 = going back to centcom (recalled), 0 = on standby, 1 = going to the station, 2 = in transit to centcom (not recalled)

Expand Down Expand Up @@ -59,11 +59,11 @@ var/global/datum/emergency_shuttle/emergency_shuttle
if((!universe.OnShuttleCall(null) || deny_shuttle) && alert == 1) //crew transfer shuttle does not gets recalled by gamemode
return
if(endtime)
setdirection(1)
setdirection(EMERGENCY_SHUTTLE_GOING_TO_STATION)
else
settimeleft(SHUTTLEARRIVETIME*coeff)
online = 1
setdirection(1)
setdirection(EMERGENCY_SHUTTLE_GOING_TO_STATION)
if(always_fake_recall)
fake_recall = rand(300,500)
//turning on the red lights in hallways
Expand All @@ -83,22 +83,22 @@ var/global/datum/emergency_shuttle/emergency_shuttle
return
if(!can_recall)
return
if(direction == 1)
if(direction == EMERGENCY_SHUTTLE_GOING_TO_STATION)
var/timeleft = timeleft()
if(alert == 0)
if(timeleft >= 600)
return
command_alert(/datum/command_alert/emergency_shuttle_recalled)
world << sound('sound/AI/shuttlerecalled.ogg')
setdirection(-1)
setdirection(EMERGENCY_SHUTTLE_RECALLED)
online = 1
for(var/area/A in areas)
if(istype(A, /area/hallway))
A.readyreset()
return
else //makes it possible to send shuttle back.
captain_announce("The shuttle has been recalled.")
setdirection(-1)
setdirection(EMERGENCY_SHUTTLE_RECALLED)
online = 1
return

Expand Down Expand Up @@ -176,8 +176,8 @@ var/global/datum/emergency_shuttle/emergency_shuttle
online=0
shutdown=1

if(direction == 2)
location = 1
if(direction == EMERGENCY_SHUTTLE_GOING_TO_CENTCOMM)
location = SHUTTLE_ON_STATION

//main shuttle
if(shuttle && istype(shuttle,/datum/shuttle/escape))
Expand Down Expand Up @@ -240,7 +240,7 @@ var/global/datum/emergency_shuttle/emergency_shuttle
/datum/emergency_shuttle/proc/shuttle_phase(var/phase, var/casual = 1)
switch (phase)
if ("station")
location = 1
location = SHUTTLE_ON_STATION

if(shuttle && istype(shuttle,/datum/shuttle/escape))
var/datum/shuttle/escape/E = shuttle
Expand All @@ -266,18 +266,18 @@ var/global/datum/emergency_shuttle/emergency_shuttle
to_chat(world, "<span class='sinister' style='font-size:3'> A vile force of darkness is making its way toward the escape shuttle.</span>")
*/
if ("transit")
location = 0 // in deep space
location = SHUTTLE_ON_STANDBY // in deep space

for(var/obj/machinery/door/unpowered/shuttle/D in shuttle.linked_area)
spawn(0)
D.close()
D.locked = 1

if (casual)
direction = 1
direction = EMERGENCY_SHUTTLE_GOING_TO_STATION
else
departed = 1 // It's going!
direction = 2 // heading to centcom
direction = EMERGENCY_SHUTTLE_GOING_TO_CENTCOMM // heading to centcom
settimeleft(SHUTTLETRANSITTIME)

command_alert(/datum/command_alert/emergency_shuttle_left)
Expand Down Expand Up @@ -307,11 +307,11 @@ var/global/datum/emergency_shuttle/emergency_shuttle

if ("centcom")
if (casual)
location = 0
direction = 0
location = SHUTTLE_ON_STANDBY
direction = EMERGENCY_SHUTTLE_STANDBY
else
vote_preload()
location = 2
location = EMERGENCY_SHUTTLE_GOING_TO_CENTCOMM

//if the crew brought items ordered by centcom with them, they get paid for those as if it were the supply shuttle
for(var/atom/movable/MA in shuttle.linked_area)
Expand Down Expand Up @@ -361,10 +361,22 @@ var/global/datum/emergency_shuttle/emergency_shuttle
warmup_sound = 0

switch(location)
if(0)
if(SHUTTLE_ON_STANDBY)

/* --- Shuttle is in transit toward centcom --- */
if(direction == 2)
if(direction == EMERGENCY_SHUTTLE_GOING_TO_CENTCOMM)
if(timeleft <= 0)
/* --- Shuttle has arrived at centcom --- */

//main shuttle
shuttle_phase("centcom",0)

//pods
for (var/pod in escape_pods)
move_pod(pod, "centcom")

hyperspace_sounds("end")
return 1
for(var/obj/structure/shuttle/engine/propulsion/P in shuttle.linked_area)
spawn()
P.shoot_exhaust(backward = 3)
Expand All @@ -378,24 +390,10 @@ var/global/datum/emergency_shuttle/emergency_shuttle
if(collision_imminent)
playsound(shuttle.linked_port, 'sound/misc/weather_warning.ogg', 80, 0, 7, 0, 0)

if(timeleft>0)
return 0

/* --- Shuttle has arrived at centcom --- */
else
return 0



//main shuttle
shuttle_phase("centcom",0)

//pods
for (var/pod in escape_pods)
move_pod(pod, "centcom")

hyperspace_sounds("end")
return 1

/* --- Shuttle has docked centcom after being recalled --- */
if(timeleft>timelimit)
online = 0
Expand All @@ -415,25 +413,9 @@ var/global/datum/emergency_shuttle/emergency_shuttle
shuttle_phase("station",0)
return 1

if(1)
if(timeleft <= 6 && !warmup_sound)
warmup_sound = 1
hyperspace_sounds("begin")
// Just before it leaves, close the damn doors!
if(timeleft == 2 || timeleft == 1)
for(var/obj/machinery/door/unpowered/shuttle/D in shuttle.linked_area)
spawn(0)
D.close()
D.locked = 1
for(var/obj/structure/shuttle/engine/propulsion/P in shuttle.linked_area)
spawn()
P.shoot_exhaust(backward = 3)

if(timeleft>0)
return 0

if(SHUTTLE_ON_STATION)
if(timeleft <= 0)
/* --- Shuttle leaves the station, enters transit --- */
else

//main shuttle
shuttle_phase ("transit",0)
Expand All @@ -447,6 +429,23 @@ var/global/datum/emergency_shuttle/emergency_shuttle

return 1

else if(timeleft <= 2) // Just before it leaves, close the damn doors!
for(var/obj/machinery/door/unpowered/shuttle/D in shuttle.linked_area)
spawn(0)
D.close()
D.locked = 1
for(var/obj/structure/shuttle/engine/propulsion/P in shuttle.linked_area)
spawn()
P.shoot_exhaust(backward = 3)

else if(timeleft <= 6 && !warmup_sound)
warmup_sound = 1
hyperspace_sounds("begin")

else
return 0


else
return 1

Expand Down
Loading

0 comments on commit 2d22b8a

Please sign in to comment.