mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Replaced "area" shuttles with "landmark" shuttles.
Largely ported from the work done at Baystation in https://github.com/Baystation12/Baystation12/pull/17460 and later commits. - Shuttles no longer require a separate area for each location they jump to. Instead destinations are indicated by landmark objects, which are not necessarily exclusive to that shuttle. This means that more than one shuttle could use the same docking port (not at the same time of course). - Enhanced shuttle control computers to use nanoui if they didn't. - Organizes shuttle datum code a bit better so there is less re-inventing the wheel in subtypes. - Allows the possibility of shuttles (or destinations) that start on late-loaded maps. - Deprecate the "extra" shuttle areas that are no longer needed and update shuttle areas in unit tests This all required a bit of infrastructure improvements. - ChangeArea proc, for changing the area of a turf. - Fixed lighting overlays actually being able to be destroyed. - Added a few utility macros and procs. - Added "turf translation" procs which are like move_contents_to but more flexible.
This commit is contained in:
@@ -2,17 +2,17 @@
|
||||
name = "Jump a Shuttle"
|
||||
|
||||
/datum/admin_secret_item/admin_secret/jump_shuttle/can_execute(var/mob/user)
|
||||
if(!shuttle_controller) return 0
|
||||
if(!SSshuttles) return 0
|
||||
return ..()
|
||||
|
||||
/datum/admin_secret_item/admin_secret/jump_shuttle/execute(var/mob/user)
|
||||
. = ..()
|
||||
if(!.)
|
||||
return
|
||||
var/shuttle_tag = input(user, "Which shuttle do you want to jump?") as null|anything in shuttle_controller.shuttles
|
||||
var/shuttle_tag = input(user, "Which shuttle do you want to jump?") as null|anything in SSshuttles.shuttles
|
||||
if (!shuttle_tag) return
|
||||
|
||||
var/datum/shuttle/S = shuttle_controller.shuttles[shuttle_tag]
|
||||
var/datum/shuttle/S = SSshuttles.shuttles[shuttle_tag]
|
||||
|
||||
var/origin_area = input(user, "Which area is the shuttle at now? (MAKE SURE THIS IS CORRECT OR THINGS WILL BREAK)") as null|area in world
|
||||
if (!origin_area) return
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
name = "Launch a Shuttle"
|
||||
|
||||
/datum/admin_secret_item/admin_secret/launch_shuttle/can_execute(var/mob/user)
|
||||
if(!shuttle_controller) return 0
|
||||
if(!SSshuttles) return 0
|
||||
return ..()
|
||||
|
||||
/datum/admin_secret_item/admin_secret/launch_shuttle/execute(var/mob/user)
|
||||
@@ -10,15 +10,15 @@
|
||||
if(!.)
|
||||
return
|
||||
var/list/valid_shuttles = list()
|
||||
for (var/shuttle_tag in shuttle_controller.shuttles)
|
||||
if (istype(shuttle_controller.shuttles[shuttle_tag], /datum/shuttle/ferry))
|
||||
for (var/shuttle_tag in SSshuttles.shuttles)
|
||||
if (istype(SSshuttles.shuttles[shuttle_tag], /datum/shuttle/autodock))
|
||||
valid_shuttles += shuttle_tag
|
||||
|
||||
var/shuttle_tag = input(user, "Which shuttle do you want to launch?") as null|anything in valid_shuttles
|
||||
if (!shuttle_tag)
|
||||
return
|
||||
|
||||
var/datum/shuttle/ferry/S = shuttle_controller.shuttles[shuttle_tag]
|
||||
var/datum/shuttle/autodock/S = SSshuttles.shuttles[shuttle_tag]
|
||||
if (S.can_launch())
|
||||
S.launch(user)
|
||||
log_and_message_admins("launched the [shuttle_tag] shuttle", user)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
name = "Launch a Shuttle (Forced)"
|
||||
|
||||
/datum/admin_secret_item/admin_secret/launch_shuttle_forced/can_execute(var/mob/user)
|
||||
if(!shuttle_controller) return 0
|
||||
if(!SSshuttles) return 0
|
||||
return ..()
|
||||
|
||||
/datum/admin_secret_item/admin_secret/launch_shuttle_forced/execute(var/mob/user)
|
||||
@@ -10,15 +10,15 @@
|
||||
if(!.)
|
||||
return
|
||||
var/list/valid_shuttles = list()
|
||||
for (var/shuttle_tag in shuttle_controller.shuttles)
|
||||
if (istype(shuttle_controller.shuttles[shuttle_tag], /datum/shuttle/ferry))
|
||||
for (var/shuttle_tag in SSshuttles.shuttles)
|
||||
if (istype(SSshuttles.shuttles[shuttle_tag], /datum/shuttle/autodock))
|
||||
valid_shuttles += shuttle_tag
|
||||
|
||||
var/shuttle_tag = input(user, "Which shuttle's launch do you want to force?") as null|anything in valid_shuttles
|
||||
if (!shuttle_tag)
|
||||
return
|
||||
|
||||
var/datum/shuttle/ferry/S = shuttle_controller.shuttles[shuttle_tag]
|
||||
var/datum/shuttle/autodock/S = SSshuttles.shuttles[shuttle_tag]
|
||||
if (S.can_force())
|
||||
S.force_launch(user)
|
||||
log_and_message_admins("forced the [shuttle_tag] shuttle", user)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
name = "Move a Shuttle"
|
||||
|
||||
/datum/admin_secret_item/admin_secret/move_shuttle/can_execute(var/mob/user)
|
||||
if(!shuttle_controller) return 0
|
||||
if(!SSshuttles) return 0
|
||||
return ..()
|
||||
|
||||
/datum/admin_secret_item/admin_secret/move_shuttle/execute(var/mob/user)
|
||||
@@ -13,16 +13,15 @@
|
||||
if (confirm == "Cancel")
|
||||
return
|
||||
|
||||
var/shuttle_tag = input(user, "Which shuttle do you want to jump?") as null|anything in shuttle_controller.shuttles
|
||||
var/shuttle_tag = input(user, "Which shuttle do you want to jump?") as null|anything in SSshuttles.shuttles
|
||||
if (!shuttle_tag) return
|
||||
|
||||
var/datum/shuttle/S = shuttle_controller.shuttles[shuttle_tag]
|
||||
var/datum/shuttle/S = SSshuttles.shuttles[shuttle_tag]
|
||||
|
||||
var/origin_area = input(user, "Which area is the shuttle at now? (MAKE SURE THIS IS CORRECT OR THINGS WILL BREAK)") as null|area in world
|
||||
if (!origin_area) return
|
||||
var/destination_tag = input(user, "Which landmark do you want to jump to? (IF YOU GET THIS WRONG THINGS WILL BREAK)") as null|anything in SSshuttles.registered_shuttle_landmarks
|
||||
if (!destination_tag) return
|
||||
var/destination_location = SSshuttles.get_landmark(destination_tag)
|
||||
if (!destination_location) return
|
||||
|
||||
var/destination_area = input(user, "Which area is the shuttle at now? (MAKE SURE THIS IS CORRECT OR THINGS WILL BREAK)") as null|area in world
|
||||
if (!destination_area) return
|
||||
|
||||
S.move(origin_area, destination_area)
|
||||
S.attempt_move(destination_location)
|
||||
log_and_message_admins("moved the [shuttle_tag] shuttle", user)
|
||||
|
||||
Reference in New Issue
Block a user