Return of the King(and the limits)

This commit is contained in:
SmArtKar
2020-08-16 16:21:17 +03:00
parent 0a6eca818c
commit dd64dcc4ea
3 changed files with 12 additions and 1 deletions
@@ -1,3 +1,4 @@
#define SHUTTLE_CREATOR_MAX_SIZE CONFIG_GET(number/max_shuttle_size)
#define CARDINAL_DIRECTIONS_X list(1, 0, -1, 0)
#define CARDINAL_DIRECTIONS_Y list(0, 1, 0, -1)
@@ -41,6 +42,7 @@ GLOBAL_LIST_EMPTY(custom_shuttle_machines) //Machines that require updating (He
. = ..()
internal_shuttle_creator = new()
internal_shuttle_creator.owner_rsd = src
desc += " Attention, the max size of the shuttle is [SHUTTLE_CREATOR_MAX_SIZE]."
overlay_holder = new()
/obj/item/shuttle_creator/Destroy()
@@ -284,10 +286,13 @@ GLOBAL_LIST_EMPTY(custom_shuttle_machines) //Machines that require updating (He
return TRUE
//Checks an area to ensure that the turfs provided are valid to be made into a shuttle
/obj/item/shuttle_creator/proc/check_area(list/turfs)
/obj/item/shuttle_creator/proc/check_area(list/turfs, addingTurfs = TRUE)
if(!turfs)
to_chat(usr, "<span class='warning'>Shuttles must be created in an airtight space, ensure that the shuttle is airtight, including corners.</span>")
return FALSE
if(turfs.len + (addingTurfs ? loggedTurfs.len : 0) > SHUTTLE_CREATOR_MAX_SIZE)
to_chat(usr, "<span class='warning'>The [src]'s internal cooling system wizzes violently and a message appears on the screen, \"Caution, this device can only handle the creation of shuttles up to [SHUTTLE_CREATOR_MAX_SIZE] units in size. Please reduce your shuttle by [turfs.len-SHUTTLE_CREATOR_MAX_SIZE]. Sorry for the inconvinience\"</span>")
return FALSE
//Check to see if it's a valid shuttle
for(var/i in 1 to turfs.len)
var/area/place = get_area(turfs[i])
@@ -81,6 +81,9 @@
return
if(shuttle_creator.linkedShuttleId)
return
if(shuttle_creator.loggedTurfs.len > SHUTTLE_CREATOR_MAX_SIZE)
to_chat(C, "<span class='warning'>This shuttle is too large!</span>")
return
if(!shuttle_creator.getNonShuttleDirection(T))
to_chat(C, "<span class='warning'>Docking port must be on an external wall, with only 1 side exposed to space.</span>")
return