Revert "Revert "Merge branch 'master' into robotic-limbs-PT2""

This reverts commit 27a099c6bf.
This commit is contained in:
DeltaFire
2020-10-11 00:53:18 +02:00
parent 27a099c6bf
commit 4ccf40f775
207 changed files with 8589 additions and 3508 deletions
+5 -2
View File
@@ -18,9 +18,10 @@ GLOBAL_LIST_EMPTY(announcement_systems)
var/obj/item/radio/headset/radio
var/arrival = "%PERSON has signed up as %RANK"
var/arrivalToggle = 1
var/arrivalToggle = TRUE
var/newhead = "%PERSON, %RANK, is the department head."
var/newheadToggle = 1
var/newheadToggle = TRUE
var/cryostorage = "%PERSON, %RANK, has been moved into cryogenic storage." // this shouldnt be changed
var/greenlight = "Light_Green"
var/pinklight = "Light_Pink"
@@ -84,6 +85,8 @@ GLOBAL_LIST_EMPTY(announcement_systems)
message = CompileText(arrival, user, rank)
else if(message_type == "NEWHEAD" && newheadToggle)
message = CompileText(newhead, user, rank)
else if(message_type == "CRYOSTORAGE")
message = CompileText(cryostorage, user, rank)
else if(message_type == "ARRIVALS_BROKEN")
message = "The arrivals shuttle has been damaged. Docking for repairs..."
@@ -11,6 +11,8 @@
var/datum/action/innate/camera_off/off_action = new
var/datum/action/innate/camera_jump/jump_action = new
var/list/actions = list()
/// Should we suppress the user's view?
var/should_supress_view_changes = TRUE
light_color = LIGHT_COLOR_RED
@@ -77,6 +79,7 @@
current_user = null
user.unset_machine()
user.client.view_size.unsupress()
playsound(src, 'sound/machines/terminal_off.ogg', 25, 0)
/obj/machinery/computer/camera_advanced/check_eye(mob/user)
@@ -157,6 +160,8 @@
user.remote_control = eyeobj
user.reset_perspective(eyeobj)
eyeobj.setLoc(eyeobj.loc)
if(should_supress_view_changes)
user.client.view_size.supress()
/mob/camera/aiEye/remote
name = "Inactive Camera Eye"
@@ -273,4 +278,4 @@
C.overlay_fullscreen("flash", /obj/screen/fullscreen/flash/static)
C.clear_fullscreen("flash", 3) //Shorter flash than normal since it's an ~~advanced~~ console!
else
playsound(origin, 'sound/machines/terminal_prompt_deny.ogg', 25, 0)
playsound(origin, 'sound/machines/terminal_prompt_deny.ogg', 25, 0)
@@ -0,0 +1,163 @@
/obj/machinery/computer/mechpad
name = "orbital mech pad console"
desc = "A computer designed to handle the calculations and routing required for sending and receiving mechs from orbit. Requires a link to a nearby Orbital Mech Pad to function."
icon_screen = "mechpad"
icon_keyboard = "teleport_key"
circuit = /obj/item/circuitboard/computer/mechpad
///ID of the mechpad, used for linking up
var/id = "roboticsmining"
///Selected mechpad in the console
var/selected_id
///Mechpads that it can send mechs through to other mechpads
var/obj/machinery/mechpad/connected_mechpad
///List of mechpads connected
var/list/obj/machinery/mechpad/mechpads = list()
///Maximum amount of pads connected at once
var/maximum_pads = 3
/obj/machinery/computer/mechpad/Initialize(mapload)
. = ..()
if(mapload)
connected_mechpad = connect_to_pad()
connected_mechpad.connected_console = src
connected_mechpad.id = id
return INITIALIZE_HINT_LATELOAD
else
id ="handmade"
/obj/machinery/computer/mechpad/LateInitialize()
for(var/obj/machinery/mechpad/pad in GLOB.mechpad_list)
if(pad == connected_mechpad)
continue
if(pad.id != id)
continue
mechpads += pad
LAZYADD(pad.consoles, src)
if(mechpads.len > maximum_pads)
break
/obj/machinery/computer/mechpad/Destroy()
if(connected_mechpad)
connected_mechpad.connected_console = null
connected_mechpad = null
for(var/obj/machinery/mechpad/mechpad in mechpads)
LAZYREMOVE(mechpad.consoles, src)
return ..()
///Tries to locate a pad in the cardinal directions, if it finds one it returns it
/obj/machinery/computer/mechpad/proc/connect_to_pad()
if(connected_mechpad)
return
for(var/direction in GLOB.cardinals)
connected_mechpad = locate(/obj/machinery/mechpad, get_step(src, direction))
if(connected_mechpad)
break
return connected_mechpad
/obj/machinery/computer/mechpad/multitool_act(mob/living/user, obj/item/tool)
if(!multitool_check_buffer(user, tool))
return
var/obj/item/multitool/multitool = tool
if(istype(multitool.buffer, /obj/machinery/mechpad))
var/obj/machinery/mechpad/buffered_console = multitool.buffer
if(!(mechpads.len < maximum_pads))
to_chat(user, "<span class='warning'>[src] cannot handle any more connections!</span>")
return
if(buffered_console == connected_mechpad)
to_chat(user, "<span class='warning'>[src] cannot connect to its own mechpad!</span>")
else if(!connected_mechpad && buffered_console == connect_to_pad())
connected_mechpad = buffered_console
connected_mechpad.connected_console = src
connected_mechpad.id = id
multitool.buffer = null
to_chat(user, "<span class='notice'>You connect the console to the pad with data from the [multitool.name]'s buffer.</span>")
else
mechpads += buffered_console
LAZYADD(buffered_console.consoles, src)
multitool.buffer = null
to_chat(user, "<span class='notice'>You upload the data from the [multitool.name]'s buffer.</span>")
/**
* Tries to call the launch proc on the connected mechpad, returns if there is no connected mechpad or there is no mecha on the pad
* Arguments:
* * user - The user of the proc
* * where - The mechpad that the connected mechpad will try to send a supply pod to
*/
/obj/machinery/computer/mechpad/proc/try_launch(var/mob/user, var/obj/machinery/mechpad/where)
if(!connected_mechpad)
to_chat(user, "<span class='warning'>[src] has no connected pad!</span>")
return
if(connected_mechpad.panel_open)
to_chat(user, "<span class='warning'>[src]'s pad has its' panel open! It won't work!</span>")
return
if(!(locate(/obj/vehicle/sealed/mecha) in get_turf(connected_mechpad)))
to_chat(user, "<span class='warning'>[src] detects no mecha on the pad!</span>")
return
connected_mechpad.launch(where)
///Checks if the pad of a certain number has been QDELETED, if yes returns FALSE, otherwise returns TRUE
/obj/machinery/computer/mechpad/proc/pad_exists(number)
var/obj/machinery/mechpad/pad = mechpads[number]
if(QDELETED(pad))
return FALSE
return TRUE
///Returns the pad of the value specified
/obj/machinery/computer/mechpad/proc/get_pad(number)
var/obj/machinery/mechpad/pad = mechpads[number]
return pad
/obj/machinery/computer/mechpad/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
ui = new(user, src, "MechpadConsole", name)
ui.open()
/obj/machinery/computer/mechpad/ui_data(mob/user)
var/list/data = list()
var/list/pad_list = list()
for(var/i in 1 to LAZYLEN(mechpads))
if(pad_exists(i))
var/obj/machinery/mechpad/pad = get_pad(i)
var/list/this_pad = list()
this_pad["name"] = pad.display_name
this_pad["id"] = i
if(pad.machine_stat & NOPOWER)
this_pad["inactive"] = TRUE
pad_list += list(this_pad)
else
mechpads -= get_pad(i)
data["mechpads"] = pad_list
data["selected_id"] = selected_id
data["connected_mechpad"] = !!connected_mechpad
if(selected_id)
var/obj/machinery/mechpad/current_pad = mechpads[selected_id]
data["pad_name"] = current_pad.display_name
data["selected_pad"] = current_pad
if(QDELETED(current_pad) || (current_pad.machine_stat & NOPOWER))
data["pad_active"] = FALSE
return data
data["pad_active"] = TRUE
return data
/obj/machinery/computer/mechpad/ui_act(action, params)
. = ..()
if(.)
return
var/obj/machinery/mechpad/current_pad = mechpads[selected_id]
switch(action)
if("select_pad")
selected_id = text2num(params["id"])
if("rename")
var/new_name = params["name"]
if(!new_name)
return
current_pad.display_name = new_name
if("remove")
if(usr && alert(usr, "Are you sure?", "Unlink Orbital Pad", "I'm Sure", "Abort") != "Abort")
mechpads -= current_pad
LAZYREMOVE(current_pad.consoles, src)
selected_id = null
if("launch")
try_launch(usr, current_pad)
. = TRUE
+76
View File
@@ -0,0 +1,76 @@
/obj/machinery/mechpad
name = "orbital mech pad"
desc = "A slab of heavy plating designed to withstand orbital-drop impacts. Through some sort of advanced bluespace tech, this one seems able to send and receive Mechs. Requires linking to a console to function."
icon = 'icons/obj/telescience.dmi'
icon_state = "mechpad"
circuit = /obj/item/circuitboard/machine/mechpad
///ID of the console, used for linking up
var/id = "roboticsmining"
///Name of the mechpad in a mechpad console
var/display_name = "Orbital Pad"
///The console the pad is linked to
var/obj/machinery/computer/mechpad/connected_console
///List of consoles that can access the pad
var/list/obj/machinery/computer/mechpad/consoles
/obj/machinery/mechpad/Initialize()
. = ..()
display_name = "Orbital Pad - [get_area_name(src)]"
GLOB.mechpad_list += src
/obj/machinery/mechpad/Destroy()
if(connected_console)
connected_console.connected_mechpad = null
connected_console = null
for(var/obj/machinery/computer/mechpad/console in consoles)
console.mechpads -= src
return ..()
/obj/machinery/mechpad/screwdriver_act(mob/user, obj/item/tool)
. = ..()
if(!.)
return default_deconstruction_screwdriver(user, "mechpad-o", "mechpad", tool)
/obj/machinery/mechpad/crowbar_act(mob/user, obj/item/tool)
..()
if(default_deconstruction_crowbar(tool))
return TRUE
/obj/machinery/mechpad/multitool_act(mob/living/user, obj/item/tool)
if(!panel_open)
return
if(!multitool_check_buffer(user, tool))
return
var/obj/item/multitool/multitool = tool
multitool.buffer = src
to_chat(user, "<span class='notice'>You save the data in the [multitool.name]'s buffer.</span>")
return TRUE
/**
* Spawns a special supply pod whitelisted to only accept mechs and have its drop off location be another mechpad
* Arguments:
* * where - where the supply pod will land after grabbing the mech
*/
/obj/machinery/mechpad/proc/launch(obj/machinery/mechpad/where)
var/obj/structure/closet/supplypod/mechpod/pod = new()
var/turf/target_turf = get_turf(where)
pod.reverse_dropoff_coords = list(target_turf.x, target_turf.y, target_turf.z)
new /obj/effect/pod_landingzone(get_turf(src), pod)
/obj/structure/closet/supplypod/mechpod
style = STYLE_SEETHROUGH
explosionSize = list(0,0,0,0)
reversing = TRUE
landingDelay = 0
openingDelay = 0
departureDelay = 0
effectOrgans = TRUE
effectQuiet = TRUE
leavingSound = 'sound/vehicles/rocketlaunch.ogg'
close_sound = null
pod_flags = FIRST_SOUNDS
/obj/structure/closet/supplypod/mechpod/insertion_allowed(atom/movable/AM)
if(!ismecha(AM))
return FALSE
. = ..()