mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-28 15:47:15 +01:00
Allows duplicates of shuttle templates (#39219)
* Allows duplicates of shuttle templates * Trigger shuttle linkage from template load
This commit is contained in:
@@ -69,3 +69,6 @@
|
||||
obj_flags |= EMAGGED
|
||||
to_chat(user, "<span class='notice'>You fried the consoles ID checking system.</span>")
|
||||
|
||||
/obj/machinery/computer/shuttle/proc/connect_to_shuttle(obj/docking_port/mobile/port, obj/docking_port/stationary/dock, idnum, override=FALSE)
|
||||
if(port && (shuttleId == initial(shuttleId) || override))
|
||||
shuttleId = port.id
|
||||
@@ -427,26 +427,6 @@
|
||||
to_chat(usr, "<span class='warning'>Escape pods will only launch during \"Code Red\" security alert.</span>")
|
||||
return TRUE
|
||||
|
||||
/obj/docking_port/mobile/pod/Initialize()
|
||||
. = ..()
|
||||
var/static/i = 1
|
||||
if(id == initial(id))
|
||||
id = "[initial(id)][i]"
|
||||
if(name == initial(name))
|
||||
name = "[initial(name)] [i]"
|
||||
|
||||
for(var/k in shuttle_areas)
|
||||
var/area/place = k
|
||||
for(var/obj/machinery/computer/shuttle/pod/pod_comp in place)
|
||||
if(pod_comp.shuttleId == initial(pod_comp.shuttleId))
|
||||
pod_comp.shuttleId = id
|
||||
if(pod_comp.possible_destinations == initial(pod_comp.possible_destinations))
|
||||
pod_comp.possible_destinations = "pod_lavaland[i]"
|
||||
|
||||
i++
|
||||
|
||||
|
||||
|
||||
/obj/docking_port/mobile/pod/cancel()
|
||||
return
|
||||
|
||||
@@ -470,6 +450,11 @@
|
||||
obj_flags |= EMAGGED
|
||||
to_chat(user, "<span class='warning'>You fry the pod's alert level checking system.</span>")
|
||||
|
||||
/obj/machinery/computer/shuttle/pod/connect_to_shuttle(obj/docking_port/mobile/port, obj/docking_port/stationary/dock, idnum, override=FALSE)
|
||||
. = ..()
|
||||
if(possible_destinations == initial(possible_destinations) || override)
|
||||
possible_destinations = "pod_lavaland[idnum]"
|
||||
|
||||
/obj/docking_port/stationary/random
|
||||
name = "escape pod"
|
||||
id = "pod"
|
||||
|
||||
@@ -198,7 +198,8 @@
|
||||
preview_template = null
|
||||
|
||||
if(!preview_shuttle)
|
||||
load_template(loading_template)
|
||||
if(load_template(loading_template))
|
||||
preview_shuttle.linkup(loading_template, destination_port)
|
||||
preview_template = loading_template
|
||||
|
||||
// get the existing shuttle information, if any
|
||||
@@ -249,8 +250,8 @@
|
||||
existing_shuttle = null
|
||||
selected = null
|
||||
|
||||
/obj/machinery/shuttle_manipulator/proc/load_template(
|
||||
datum/map_template/shuttle/S)
|
||||
/obj/machinery/shuttle_manipulator/proc/load_template(datum/map_template/shuttle/S)
|
||||
. = FALSE
|
||||
// load shuttle template, centred at shuttle import landmark,
|
||||
var/turf/landmark_turf = get_turf(locate(/obj/effect/landmark/shuttle_import) in GLOB.landmarks_list)
|
||||
S.load(landmark_turf, centered = TRUE)
|
||||
@@ -293,6 +294,7 @@
|
||||
return
|
||||
//Everything fine
|
||||
S.on_bought()
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/shuttle_manipulator/proc/unload_preview()
|
||||
if(preview_shuttle)
|
||||
|
||||
@@ -247,6 +247,12 @@
|
||||
current_user.client.images -= remove_images
|
||||
current_user.client.images += add_images
|
||||
|
||||
/obj/machinery/computer/camera_advanced/shuttle_docker/proc/connect_to_shuttle(obj/docking_port/mobile/port, obj/docking_port/stationary/dock, idnum, override=FALSE)
|
||||
if(port && (shuttleId == initial(shuttleId) || override))
|
||||
shuttleId = port.id
|
||||
if(dock)
|
||||
jumpto_ports += dock.id
|
||||
|
||||
/mob/camera/aiEye/remote/shuttle_docker
|
||||
visible_icon = FALSE
|
||||
use_static = USE_STATIC_NONE
|
||||
|
||||
@@ -303,6 +303,26 @@
|
||||
highlight("#0f0")
|
||||
#endif
|
||||
|
||||
// Called after the shuttle is loaded from template
|
||||
/obj/docking_port/mobile/proc/linkup(datum/map_template/shuttle/template, obj/docking_port/stationary/dock)
|
||||
var/list/static/shuttle_id = list()
|
||||
var/idnum
|
||||
if(!shuttle_id[template])
|
||||
shuttle_id[template] = idnum = 1
|
||||
else
|
||||
idnum = shuttle_id[template]++
|
||||
if(id == initial(id))
|
||||
id = "[id][idnum]"
|
||||
if(name == initial(name) && idnum > 1)
|
||||
name = "[name] [idnum]"
|
||||
for(var/i in shuttle_areas)
|
||||
var/area/place = i
|
||||
for(var/obj/machinery/computer/shuttle/comp in place)
|
||||
comp.connect_to_shuttle(src, dock, idnum)
|
||||
for(var/obj/machinery/computer/camera_advanced/shuttle_docker/comp in place)
|
||||
comp.connect_to_shuttle(src, dock, idnum)
|
||||
|
||||
|
||||
//this is a hook for custom behaviour. Maybe at some point we could add checks to see if engines are intact
|
||||
/obj/docking_port/mobile/proc/canMove()
|
||||
return TRUE
|
||||
|
||||
Reference in New Issue
Block a user