From 9783f47514c10a9c86ada087b7183e752801f2d1 Mon Sep 17 00:00:00 2001 From: Bjorn Neergaard Date: Wed, 3 Feb 2016 13:38:20 -0600 Subject: [PATCH] Centralize shuttle computers --- code/controllers/subsystem/shuttles/supply.dm | 335 ------------------ code/modules/cargo/order_computer.dm | 250 +++++++++++++ code/modules/cargo/request_computer.dm | 113 ++++++ code/modules/shuttle/computer.dm | 78 ++++ .../shuttle/emergency.dm} | 42 +-- code/modules/shuttle/ferry.dm | 24 ++ code/modules/shuttle/shuttle.dm | 105 ------ .../shuttle/syndicate.dm} | 79 ++--- code/modules/shuttle/white_ship.dm | 6 + tgstation.dme | 8 +- 10 files changed, 517 insertions(+), 523 deletions(-) create mode 100644 code/modules/cargo/order_computer.dm create mode 100644 code/modules/cargo/request_computer.dm create mode 100644 code/modules/shuttle/computer.dm rename code/{game/machinery/computer/shuttle.dm => modules/shuttle/emergency.dm} (72%) create mode 100644 code/modules/shuttle/ferry.dm rename code/{game/machinery/computer/syndicate_shuttle.dm => modules/shuttle/syndicate.dm} (95%) create mode 100644 code/modules/shuttle/white_ship.dm diff --git a/code/controllers/subsystem/shuttles/supply.dm b/code/controllers/subsystem/shuttles/supply.dm index 4bb2baf855e..f3b2bcf2d74 100644 --- a/code/controllers/subsystem/shuttles/supply.dm +++ b/code/controllers/subsystem/shuttles/supply.dm @@ -240,338 +240,3 @@ return 0 -/obj/machinery/computer/ordercomp/attack_hand(mob/user) - if(..()) - return - user.set_machine(src) - var/dat - if(temp) - dat = temp - else - dat += {"
Shuttle Location: [SSshuttle.supply.name]
-
Supply Points: [SSshuttle.points]
- -
\nRequest items

- View approved orders

- View requests

- Close"} - - // Removing the old window method but leaving it here for reference - //user << browse(dat, "window=computer;size=575x450") - //onclose(user, "computer") - - // Added the new browser window method - var/datum/browser/popup = new(user, "computer", "Supply Ordering Console", 575, 450) - popup.set_content(dat) - popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state)) - popup.open() - return - -/obj/machinery/computer/ordercomp/Topic(href, href_list) - if(..()) - return - - if( isturf(loc) && (in_range(src, usr) || istype(usr, /mob/living/silicon)) ) - usr.set_machine(src) - - if(href_list["order"]) - if(href_list["order"] == "categories") - //all_supply_groups - //Request what? - last_viewed_group = "categories" - temp = "
Supply points: [SSshuttle.points]
" - temp += "Main Menu

" - temp += "Select a category

" - for(var/cat in all_supply_groups ) - temp += "[get_supply_group_name(cat)]
" - else - last_viewed_group = href_list["order"] - var/cat = text2num(last_viewed_group) - temp = "
Supply points: [SSshuttle.points]
" - temp += "Back to all categories

" - temp += "Request from: [get_supply_group_name(cat)]

" - for(var/supply_type in SSshuttle.supply_packs ) - var/datum/supply_packs/N = SSshuttle.supply_packs[supply_type] - if(N.hidden || N.contraband || N.group != cat) - continue //Have to send the type instead of a reference to - temp += "[N.name] Cost: [N.cost]
" //the obj because it would get caught by the garbage - else if (href_list["doorder"]) - if(world.time < reqtime) - say("[world.time - reqtime] seconds remaining until another requisition form may be printed.") - return - - //Find the correct supply_pack datum - if(!SSshuttle.supply_packs["[href_list["doorder"]]"]) - return - - var/timeout = world.time + 600 - var/reason = stripped_input(usr,"Reason:","Why do you require this item?","") - if(world.time > timeout) - return - if(!reason) - return - - var/idname = "*None Provided*" - var/idrank = "*None Provided*" - if(ishuman(usr)) - var/mob/living/carbon/human/H = usr - idname = H.get_authentification_name() - idrank = H.get_assignment() - else if(issilicon(usr)) - idname = usr.real_name - - var/datum/supply_order/O = SSshuttle.generateSupplyOrder(href_list["doorder"], idname, idrank, reason) - if(!O) - return - O.generateRequisition(loc) - - reqtime = (world.time + 5) % 1e5 - - temp = "Thanks for your request. The cargo team will process it as soon as possible.
" - temp += "
Back Main Menu" - - else if (href_list["vieworders"]) - temp = "Main Menu

Current approved orders:

" - for(var/datum/supply_order/SO in SSshuttle.shoppinglist) - temp += "[SO.object.name] approved by [SO.orderedby] [SO.comment ? "([SO.comment])":""]
" - - else if (href_list["viewrequests"]) - temp = "Main Menu

Current requests:

" - for(var/datum/supply_order/SO in SSshuttle.requestlist) - temp += "#[SO.ordernum] - [SO.object.name] requested by [SO.orderedby]
" - - else if (href_list["mainmenu"]) - temp = null - - add_fingerprint(usr) - updateUsrDialog() - return - -/obj/machinery/computer/supplycomp/attack_hand(mob/user) - if(!allowed(user)) - user << "Access Denied." - return - - if(..()) - return - user.set_machine(src) - post_signal("supply") - var/dat - if (temp) - dat = temp - else - var/atDepot = (SSshuttle.supply.getDockedId() == "supply_away") - var/inTransit = (SSshuttle.supply.mode != SHUTTLE_IDLE) - var/canOrder = atDepot && !inTransit - - dat += {"
Supply shuttle
- Location: [SSshuttle.supply.getStatusText()]
-
\nSupply Points: [SSshuttle.points]
\n

- [canOrder ? "\nOrder items
\n
" : "\n*Must be away to order items*
\n
"] - [inTransit ? "\n*Shuttle already called*
\n
": atDepot ? "\nSend to station
\n
":"\nSend to centcom
\n
"] - [SSshuttle.shuttle_loan ? (SSshuttle.shuttle_loan.dispatched ? "\n*Shuttle loaned to Centcom*
\n
" : "\nLoan shuttle to Centcom (5 mins duration)
\n
") : "\n*No pending external shuttle requests*
\n
"] - \nView requests
\n
- \nView orders
\n
- \nClose
-
\nCentral Command messages:
[SSshuttle.centcom_message ? SSshuttle.centcom_message : "Remember to stamp and send back the supply manifests."]"} - - var/datum/browser/popup = new(user, "computer", "Supply Shuttle Console", 700, 455) - popup.set_content(dat) - popup.open() - return - -/obj/machinery/computer/supplycomp/emag_act(mob/user) - if(!hacked) - user << "Special supplies unlocked." - hacked = 1 - -/obj/machinery/computer/supplycomp/Topic(href, href_list) - if(..()) - return - - if(isturf(loc) && ( in_range(src, usr) || istype(usr, /mob/living/silicon) ) ) - usr.set_machine(src) - - //Calling the shuttle - if(href_list["send"]) - if(SSshuttle.supply.canMove()) - if(SSshuttle.shuttle_loan) - temp = "The supply shuttle must be docked to send new commands.

Main Menu" - else - temp = "For safety reasons the automated supply shuttle cannot transport live organisms, classified nuclear weaponry or homing beacons.

Main Menu" - - else if(SSshuttle.supply.getDockedId() == "supply_home") - if(href_list["loan"] && SSshuttle.shuttle_loan) - if(!SSshuttle.shuttle_loan.dispatched) - SSshuttle.shuttle_loan.loan_shuttle() - temp = "The supply shuttle has been loaned to Centcom.

Main Menu" - post_signal("supply") - else - temp = "You can not loan the supply shuttle at this time.

Main Menu" - else - temp = "The supply shuttle has departed.

Main Menu" - SSshuttle.toggleShuttle("supply", "supply_home", "supply_away", 1) - investigate_log("[usr.key] has sent the supply shuttle away. Remaining points: [SSshuttle.points]. Shuttle contents:[SSshuttle.sold_atoms]", "cargo") - else - if(href_list["loan"] && SSshuttle.shuttle_loan) - if(!SSshuttle.shuttle_loan.dispatched && SSshuttle.supply.mode == SHUTTLE_IDLE) // Must either be at centcom, or at the station. No redirecting off course! - SSshuttle.shuttle_loan.loan_shuttle() - temp = "The supply shuttle has been loaned to Centcom.

Main Menu" - post_signal("supply") - else - temp = "You can not loan the supply shuttle at this time.

Main Menu" - else - if(!SSshuttle.supply.request(SSshuttle.getDock("supply_home"))) - temp = "The supply shuttle has been called and will arrive in [SSshuttle.supply.timeLeft(600)] minutes.

Main Menu" - post_signal("supply") - - else if (href_list["order"]) - if(SSshuttle.supply.mode != SHUTTLE_IDLE) - return - if(href_list["order"] == "categories") - //all_supply_groups - //Request what? - last_viewed_group = "categories" - temp = "
Supply points: [SSshuttle.points]
" - temp += "Main Menu

" - temp += "Select a category

" - for(var/cat in all_supply_groups ) - temp += "[get_supply_group_name(cat)]
" - else - last_viewed_group = href_list["order"] - var/cat = text2num(last_viewed_group) - temp = "
Supply points: [SSshuttle.points]
" - temp += "Back to all categories

" - temp += "Request from: [get_supply_group_name(cat)]

" - for(var/supply_type in SSshuttle.supply_packs ) - var/datum/supply_packs/N = SSshuttle.supply_packs[supply_type] - if((N.hidden && !hacked) || (N.contraband && !can_order_contraband) || N.group != cat) - continue //Have to send the type instead of a reference to - temp += "[N.name] Cost: [N.cost]
" //the obj because it would get caught by the garbage - - /*temp = "Supply points: [supply_shuttle.points]


Request what?

" - - for(var/supply_name in supply_shuttle.supply_packs ) - var/datum/supply_packs/N = supply_shuttle.supply_packs[supply_name] - if(N.hidden && !hacked) continue - if(N.contraband && !can_order_contraband) continue - temp += "[supply_name] Cost: [N.cost]
" //the obj because it would get caught by the garbage - temp += "
OK"*/ - - else if (href_list["doorder"]) - if(world.time < reqtime) - say("[world.time - reqtime] seconds remaining until another requisition form may be printed.") - return - - //Find the correct supply_pack datum - if(!SSshuttle.supply_packs[href_list["doorder"]]) - return - - var/timeout = world.time + 600 - var/reason = stripped_input(usr,"Reason:","Why do you require this item?","") - if(world.time > timeout) - return -// if(!reason) -// return - - var/idname = "*None Provided*" - var/idrank = "*None Provided*" - if(ishuman(usr)) - var/mob/living/carbon/human/H = usr - idname = H.get_authentification_name() - idrank = H.get_assignment() - else if(issilicon(usr)) - idname = usr.real_name - - var/datum/supply_order/O = SSshuttle.generateSupplyOrder(href_list["doorder"], idname, idrank, reason) - if(!O) - return - O.generateRequisition(loc) - - reqtime = (world.time + 5) % 1e5 - - temp = "Order request placed.
" - temp += "
Back | Main Menu | Authorize Order" - - else if(href_list["confirmorder"]) - //Find the correct supply_order datum - var/ordernum = text2num(href_list["confirmorder"]) - var/datum/supply_order/O - var/datum/supply_packs/P - temp = "Invalid Request" - for(var/i=1, i<=SSshuttle.requestlist.len, i++) - var/datum/supply_order/SO = SSshuttle.requestlist[i] - if(SO && SO.ordernum == ordernum) - O = SO - P = O.object - if(SSshuttle.points >= P.cost) - SSshuttle.requestlist.Cut(i,i+1) - SSshuttle.points -= P.cost - SSshuttle.shoppinglist += O - temp = "Thanks for your order." - investigate_log("[usr.key] has authorized an order for [P.name]. Remaining points: [SSshuttle.points].", "cargo") - else - temp = "Not enough supply points." - break - temp += "

Back Main Menu" - - else if (href_list["vieworders"]) - temp = "Main Menu

Current approved orders:

" - for(var/datum/supply_order/SO in SSshuttle.shoppinglist) - temp += "#[SO.ordernum] - [SO.object.name] approved by [SO.orderedby][SO.comment ? " ([SO.comment])":""]
"// (Cancel)
" - temp += "
Main Menu" -/* - else if (href_list["cancelorder"]) - var/datum/supply_order/remove_supply = href_list["cancelorder"] - supply_shuttle_shoppinglist -= remove_supply - supply_shuttle_points += remove_supply.object.cost - temp += "Canceled: [remove_supply.object.name]


" - - for(var/S in supply_shuttle_shoppinglist) - var/datum/supply_order/SO = S - temp += "[SO.object.name] approved by [SO.orderedby][SO.comment ? " ([SO.comment])":""] (Cancel)
" - temp += "
Main Menu" -*/ - else if (href_list["viewrequests"]) - temp = "Main Menu

Current requests:

" - for(var/datum/supply_order/SO in SSshuttle.requestlist) - temp += "#[SO.ordernum] - [SO.object.name] requested by [SO.orderedby] [SSshuttle.supply.getDockedId() == "supply_away" ? "Approve Remove" : ""]
" - - temp += "
Clear list" - - else if (href_list["rreq"]) - var/ordernum = text2num(href_list["rreq"]) - temp = "Invalid Request.
" - for(var/i=1, i<=SSshuttle.requestlist.len, i++) - var/datum/supply_order/SO = SSshuttle.requestlist[i] - if(SO && SO.ordernum == ordernum) - SSshuttle.requestlist.Cut(i,i+1) - temp = "Request removed.
" - break - temp += "
Back Main Menu" - - else if (href_list["clearreq"]) - SSshuttle.requestlist.Cut() - temp = "List cleared.
" - temp += "
Main Menu" - - else if (href_list["mainmenu"]) - temp = null - - add_fingerprint(usr) - updateUsrDialog() - return - -/obj/machinery/computer/supplycomp/proc/post_signal(command) - - var/datum/radio_frequency/frequency = SSradio.return_frequency(1435) - - if(!frequency) - return - - var/datum/signal/status_signal = new - status_signal.source = src - status_signal.transmission_method = 1 - status_signal.data["command"] = command - - frequency.post_signal(src, status_signal) diff --git a/code/modules/cargo/order_computer.dm b/code/modules/cargo/order_computer.dm new file mode 100644 index 00000000000..b24874add8e --- /dev/null +++ b/code/modules/cargo/order_computer.dm @@ -0,0 +1,250 @@ +/obj/machinery/computer/supplycomp + name = "supply shuttle console" + desc = "Used to order supplies." + icon_screen = "supply" + req_access = list(access_cargo) + circuit = /obj/item/weapon/circuitboard/supplycomp + verb_say = "flashes" + verb_ask = "flashes" + verb_exclaim = "flashes" + var/temp = null + var/reqtime = 0 //Cooldown for requisitions - Quarxink + var/hacked = 0 + var/can_order_contraband = 0 + var/last_viewed_group = "categories" + +/obj/machinery/computer/supplycomp/New() + ..() + + var/obj/item/weapon/circuitboard/supplycomp/board = circuit + can_order_contraband = board.contraband_enabled + +/obj/machinery/computer/supplycomp/attack_hand(mob/user) + if(!allowed(user)) + user << "Access Denied." + return + + if(..()) + return + user.set_machine(src) + post_signal("supply") + var/dat + if (temp) + dat = temp + else + var/atDepot = (SSshuttle.supply.getDockedId() == "supply_away") + var/inTransit = (SSshuttle.supply.mode != SHUTTLE_IDLE) + var/canOrder = atDepot && !inTransit + + dat += {"
Supply shuttle
+ Location: [SSshuttle.supply.getStatusText()]
+
\nSupply Points: [SSshuttle.points]
\n

+ [canOrder ? "\nOrder items
\n
" : "\n*Must be away to order items*
\n
"] + [inTransit ? "\n*Shuttle already called*
\n
": atDepot ? "\nSend to station
\n
":"\nSend to centcom
\n
"] + [SSshuttle.shuttle_loan ? (SSshuttle.shuttle_loan.dispatched ? "\n*Shuttle loaned to Centcom*
\n
" : "\nLoan shuttle to Centcom (5 mins duration)
\n
") : "\n*No pending external shuttle requests*
\n
"] + \nView requests
\n
+ \nView orders
\n
+ \nClose
+
\nCentral Command messages:
[SSshuttle.centcom_message ? SSshuttle.centcom_message : "Remember to stamp and send back the supply manifests."]"} + + var/datum/browser/popup = new(user, "computer", "Supply Shuttle Console", 700, 455) + popup.set_content(dat) + popup.open() + return + +/obj/machinery/computer/supplycomp/emag_act(mob/user) + if(!hacked) + user << "Special supplies unlocked." + hacked = 1 + +/obj/machinery/computer/supplycomp/Topic(href, href_list) + if(..()) + return + + if(isturf(loc) && ( in_range(src, usr) || istype(usr, /mob/living/silicon) ) ) + usr.set_machine(src) + + //Calling the shuttle + if(href_list["send"]) + if(SSshuttle.supply.canMove()) + if(SSshuttle.shuttle_loan) + temp = "The supply shuttle must be docked to send new commands.

Main Menu" + else + temp = "For safety reasons the automated supply shuttle cannot transport live organisms, classified nuclear weaponry or homing beacons.

Main Menu" + + else if(SSshuttle.supply.getDockedId() == "supply_home") + if(href_list["loan"] && SSshuttle.shuttle_loan) + if(!SSshuttle.shuttle_loan.dispatched) + SSshuttle.shuttle_loan.loan_shuttle() + temp = "The supply shuttle has been loaned to Centcom.

Main Menu" + post_signal("supply") + else + temp = "You can not loan the supply shuttle at this time.

Main Menu" + else + temp = "The supply shuttle has departed.

Main Menu" + SSshuttle.toggleShuttle("supply", "supply_home", "supply_away", 1) + investigate_log("[usr.key] has sent the supply shuttle away. Remaining points: [SSshuttle.points]. Shuttle contents:[SSshuttle.sold_atoms]", "cargo") + else + if(href_list["loan"] && SSshuttle.shuttle_loan) + if(!SSshuttle.shuttle_loan.dispatched && SSshuttle.supply.mode == SHUTTLE_IDLE) // Must either be at centcom, or at the station. No redirecting off course! + SSshuttle.shuttle_loan.loan_shuttle() + temp = "The supply shuttle has been loaned to Centcom.

Main Menu" + post_signal("supply") + else + temp = "You can not loan the supply shuttle at this time.

Main Menu" + else + if(!SSshuttle.supply.request(SSshuttle.getDock("supply_home"))) + temp = "The supply shuttle has been called and will arrive in [SSshuttle.supply.timeLeft(600)] minutes.

Main Menu" + post_signal("supply") + + else if (href_list["order"]) + if(SSshuttle.supply.mode != SHUTTLE_IDLE) + return + if(href_list["order"] == "categories") + //all_supply_groups + //Request what? + last_viewed_group = "categories" + temp = "
Supply points: [SSshuttle.points]
" + temp += "Main Menu

" + temp += "Select a category

" + for(var/cat in all_supply_groups ) + temp += "[get_supply_group_name(cat)]
" + else + last_viewed_group = href_list["order"] + var/cat = text2num(last_viewed_group) + temp = "
Supply points: [SSshuttle.points]
" + temp += "Back to all categories

" + temp += "Request from: [get_supply_group_name(cat)]

" + for(var/supply_type in SSshuttle.supply_packs ) + var/datum/supply_packs/N = SSshuttle.supply_packs[supply_type] + if((N.hidden && !hacked) || (N.contraband && !can_order_contraband) || N.group != cat) + continue //Have to send the type instead of a reference to + temp += "[N.name] Cost: [N.cost]
" //the obj because it would get caught by the garbage + + /*temp = "Supply points: [supply_shuttle.points]


Request what?

" + + for(var/supply_name in supply_shuttle.supply_packs ) + var/datum/supply_packs/N = supply_shuttle.supply_packs[supply_name] + if(N.hidden && !hacked) continue + if(N.contraband && !can_order_contraband) continue + temp += "[supply_name] Cost: [N.cost]
" //the obj because it would get caught by the garbage + temp += "
OK"*/ + + else if (href_list["doorder"]) + if(world.time < reqtime) + say("[world.time - reqtime] seconds remaining until another requisition form may be printed.") + return + + //Find the correct supply_pack datum + if(!SSshuttle.supply_packs[href_list["doorder"]]) + return + + var/timeout = world.time + 600 + var/reason = stripped_input(usr,"Reason:","Why do you require this item?","") + if(world.time > timeout) + return +// if(!reason) +// return + + var/idname = "*None Provided*" + var/idrank = "*None Provided*" + if(ishuman(usr)) + var/mob/living/carbon/human/H = usr + idname = H.get_authentification_name() + idrank = H.get_assignment() + else if(issilicon(usr)) + idname = usr.real_name + + var/datum/supply_order/O = SSshuttle.generateSupplyOrder(href_list["doorder"], idname, idrank, reason) + if(!O) + return + O.generateRequisition(loc) + + reqtime = (world.time + 5) % 1e5 + + temp = "Order request placed.
" + temp += "
Back | Main Menu | Authorize Order" + + else if(href_list["confirmorder"]) + //Find the correct supply_order datum + var/ordernum = text2num(href_list["confirmorder"]) + var/datum/supply_order/O + var/datum/supply_packs/P + temp = "Invalid Request" + for(var/i=1, i<=SSshuttle.requestlist.len, i++) + var/datum/supply_order/SO = SSshuttle.requestlist[i] + if(SO && SO.ordernum == ordernum) + O = SO + P = O.object + if(SSshuttle.points >= P.cost) + SSshuttle.requestlist.Cut(i,i+1) + SSshuttle.points -= P.cost + SSshuttle.shoppinglist += O + temp = "Thanks for your order." + investigate_log("[usr.key] has authorized an order for [P.name]. Remaining points: [SSshuttle.points].", "cargo") + else + temp = "Not enough supply points." + break + temp += "

Back Main Menu" + + else if (href_list["vieworders"]) + temp = "Main Menu

Current approved orders:

" + for(var/datum/supply_order/SO in SSshuttle.shoppinglist) + temp += "#[SO.ordernum] - [SO.object.name] approved by [SO.orderedby][SO.comment ? " ([SO.comment])":""]
"// (Cancel)
" + temp += "
Main Menu" +/* + else if (href_list["cancelorder"]) + var/datum/supply_order/remove_supply = href_list["cancelorder"] + supply_shuttle_shoppinglist -= remove_supply + supply_shuttle_points += remove_supply.object.cost + temp += "Canceled: [remove_supply.object.name]


" + + for(var/S in supply_shuttle_shoppinglist) + var/datum/supply_order/SO = S + temp += "[SO.object.name] approved by [SO.orderedby][SO.comment ? " ([SO.comment])":""] (Cancel)
" + temp += "
Main Menu" +*/ + else if (href_list["viewrequests"]) + temp = "Main Menu

Current requests:

" + for(var/datum/supply_order/SO in SSshuttle.requestlist) + temp += "#[SO.ordernum] - [SO.object.name] requested by [SO.orderedby] [SSshuttle.supply.getDockedId() == "supply_away" ? "Approve Remove" : ""]
" + + temp += "
Clear list" + + else if (href_list["rreq"]) + var/ordernum = text2num(href_list["rreq"]) + temp = "Invalid Request.
" + for(var/i=1, i<=SSshuttle.requestlist.len, i++) + var/datum/supply_order/SO = SSshuttle.requestlist[i] + if(SO && SO.ordernum == ordernum) + SSshuttle.requestlist.Cut(i,i+1) + temp = "Request removed.
" + break + temp += "
Back Main Menu" + + else if (href_list["clearreq"]) + SSshuttle.requestlist.Cut() + temp = "List cleared.
" + temp += "
Main Menu" + + else if (href_list["mainmenu"]) + temp = null + + add_fingerprint(usr) + updateUsrDialog() + return + +/obj/machinery/computer/supplycomp/proc/post_signal(command) + + var/datum/radio_frequency/frequency = SSradio.return_frequency(1435) + + if(!frequency) + return + + var/datum/signal/status_signal = new + status_signal.source = src + status_signal.transmission_method = 1 + status_signal.data["command"] = command + + frequency.post_signal(src, status_signal) + diff --git a/code/modules/cargo/request_computer.dm b/code/modules/cargo/request_computer.dm new file mode 100644 index 00000000000..45991e01f95 --- /dev/null +++ b/code/modules/cargo/request_computer.dm @@ -0,0 +1,113 @@ +/obj/machinery/computer/ordercomp + name = "supply ordering console" + desc = "Used to order supplies from cargo staff." + icon_screen = "request" + circuit = /obj/item/weapon/circuitboard/ordercomp + verb_say = "flashes" + verb_ask = "flashes" + verb_exclaim = "flashes" + var/temp = null + var/reqtime = 0 //Cooldown for requisitions - Quarxink + var/last_viewed_group = "categories" + +/obj/machinery/computer/ordercomp/attack_hand(mob/user) + if(..()) + return + user.set_machine(src) + var/dat + if(temp) + dat = temp + else + dat += {"
Shuttle Location: [SSshuttle.supply.name]
+
Supply Points: [SSshuttle.points]
+ +
\nRequest items

+ View approved orders

+ View requests

+ Close"} + + var/datum/browser/popup = new(user, "computer", "Supply Ordering Console", 575, 450) + popup.set_content(dat) + popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state)) + popup.open() + return + +/obj/machinery/computer/ordercomp/Topic(href, href_list) + if(..()) + return + + if( isturf(loc) && (in_range(src, usr) || istype(usr, /mob/living/silicon)) ) + usr.set_machine(src) + + if(href_list["order"]) + if(href_list["order"] == "categories") + //all_supply_groups + //Request what? + last_viewed_group = "categories" + temp = "
Supply points: [SSshuttle.points]
" + temp += "Main Menu

" + temp += "Select a category

" + for(var/cat in all_supply_groups ) + temp += "[get_supply_group_name(cat)]
" + else + last_viewed_group = href_list["order"] + var/cat = text2num(last_viewed_group) + temp = "
Supply points: [SSshuttle.points]
" + temp += "Back to all categories

" + temp += "Request from: [get_supply_group_name(cat)]

" + for(var/supply_type in SSshuttle.supply_packs ) + var/datum/supply_packs/N = SSshuttle.supply_packs[supply_type] + if(N.hidden || N.contraband || N.group != cat) + continue //Have to send the type instead of a reference to + temp += "[N.name] Cost: [N.cost]
" //the obj because it would get caught by the garbage + else if (href_list["doorder"]) + if(world.time < reqtime) + say("[world.time - reqtime] seconds remaining until another requisition form may be printed.") + return + + //Find the correct supply_pack datum + if(!SSshuttle.supply_packs["[href_list["doorder"]]"]) + return + + var/timeout = world.time + 600 + var/reason = stripped_input(usr,"Reason:","Why do you require this item?","") + if(world.time > timeout) + return + if(!reason) + return + + var/idname = "*None Provided*" + var/idrank = "*None Provided*" + if(ishuman(usr)) + var/mob/living/carbon/human/H = usr + idname = H.get_authentification_name() + idrank = H.get_assignment() + else if(issilicon(usr)) + idname = usr.real_name + + var/datum/supply_order/O = SSshuttle.generateSupplyOrder(href_list["doorder"], idname, idrank, reason) + if(!O) + return + O.generateRequisition(loc) + + reqtime = (world.time + 5) % 1e5 + + temp = "Thanks for your request. The cargo team will process it as soon as possible.
" + temp += "
Back Main Menu" + + else if (href_list["vieworders"]) + temp = "Main Menu

Current approved orders:

" + for(var/datum/supply_order/SO in SSshuttle.shoppinglist) + temp += "[SO.object.name] approved by [SO.orderedby] [SO.comment ? "([SO.comment])":""]
" + + else if (href_list["viewrequests"]) + temp = "Main Menu

Current requests:

" + for(var/datum/supply_order/SO in SSshuttle.requestlist) + temp += "#[SO.ordernum] - [SO.object.name] requested by [SO.orderedby]
" + + else if (href_list["mainmenu"]) + temp = null + + add_fingerprint(usr) + updateUsrDialog() + return \ No newline at end of file diff --git a/code/modules/shuttle/computer.dm b/code/modules/shuttle/computer.dm new file mode 100644 index 00000000000..2b5968cc068 --- /dev/null +++ b/code/modules/shuttle/computer.dm @@ -0,0 +1,78 @@ +/obj/machinery/computer/shuttle + name = "Shuttle Console" + icon_screen = "shuttle" + icon_keyboard = "tech_key" + req_access = list( ) + circuit = /obj/item/weapon/circuitboard/shuttle + var/shuttleId + var/possible_destinations = "" + var/admin_controlled + var/no_destination_swap = 0 + +/obj/machinery/computer/shuttle/New(location, obj/item/weapon/circuitboard/shuttle/C) + ..() + if(istype(C)) + possible_destinations = C.possible_destinations + shuttleId = C.shuttleId + +/obj/machinery/computer/shuttle/attack_hand(mob/user) + if(..(user)) + return + src.add_fingerprint(usr) + + var/list/options = params2list(possible_destinations) + var/obj/docking_port/mobile/M = SSshuttle.getShuttle(shuttleId) + var/dat = "Status: [M ? M.getStatusText() : "*Missing*"]

" + if(M) + var/destination_found + for(var/obj/docking_port/stationary/S in SSshuttle.stationary) + if(!options.Find(S.id)) + continue + if(M.canDock(S)) + continue + destination_found = 1 + dat += "Send to [S.name]
" + if(!destination_found) + dat += "Shuttle Locked
" + if(admin_controlled) + dat += "Authorized personnel only
" + dat += "Request Authorization
" + dat += "Close" + + var/datum/browser/popup = new(user, "computer", M ? M.name : "shuttle", 300, 200) + popup.set_content("
[dat]
") + popup.set_title_image(usr.browse_rsc_icon(src.icon, src.icon_state)) + popup.open() + +/obj/machinery/computer/shuttle/Topic(href, href_list) + if(..()) + return + usr.set_machine(src) + src.add_fingerprint(usr) + if(!allowed(usr)) + usr << "Access denied." + return + + if(href_list["move"]) + var/obj/docking_port/mobile/M = SSshuttle.getShuttle(shuttleId) + if(M.launch_status == ENDGAME_LAUNCHED) + usr << "You've already escaped. Never going back to that place again!" + return + if(no_destination_swap) + if(M.mode != SHUTTLE_IDLE) + usr << "Shuttle already in transit." + return + switch(SSshuttle.moveShuttle(shuttleId, href_list["move"], 1)) + if(0) + usr << "Shuttle received message and will be sent shortly." + if(1) + usr << "Invalid shuttle requested." + else + usr << "Unable to comply." + +/obj/machinery/computer/shuttle/emag_act(mob/user) + if(!emagged) + src.req_access = list() + emagged = 1 + user << "You fried the consoles ID checking system." + diff --git a/code/game/machinery/computer/shuttle.dm b/code/modules/shuttle/emergency.dm similarity index 72% rename from code/game/machinery/computer/shuttle.dm rename to code/modules/shuttle/emergency.dm index 10c1af8d7a6..f3da90aae59 100644 --- a/code/game/machinery/computer/shuttle.dm +++ b/code/modules/shuttle/emergency.dm @@ -73,44 +73,4 @@ log_game("[key_name(user)] has emagged the emergency shuttle in ([x],[y],[z]) [time] seconds before launch.") minor_announce("The emergency shuttle will launch in 10 seconds", "SYSTEM ERROR:",null,1) SSshuttle.emergency.setTimer(100) - emagged = 1 - -/obj/machinery/computer/supplycomp - name = "supply shuttle console" - desc = "Used to order supplies." - icon_screen = "supply" - req_access = list(access_cargo) - circuit = /obj/item/weapon/circuitboard/supplycomp - verb_say = "flashes" - verb_ask = "flashes" - verb_exclaim = "flashes" - var/temp = null - var/reqtime = 0 //Cooldown for requisitions - Quarxink - var/hacked = 0 - var/can_order_contraband = 0 - var/last_viewed_group = "categories" - -/obj/machinery/computer/supplycomp/New() - ..() - - var/obj/item/weapon/circuitboard/supplycomp/board = circuit - can_order_contraband = board.contraband_enabled - -/obj/machinery/computer/ordercomp - name = "supply ordering console" - desc = "Used to order supplies from cargo staff." - icon_screen = "request" - circuit = /obj/item/weapon/circuitboard/ordercomp - verb_say = "flashes" - verb_ask = "flashes" - verb_exclaim = "flashes" - var/temp = null - var/reqtime = 0 //Cooldown for requisitions - Quarxink - var/last_viewed_group = "categories" - -/obj/machinery/computer/shuttle/white_ship - name = "White Ship Console" - desc = "Used to control the White Ship." - circuit = /obj/item/weapon/circuitboard/white_ship - shuttleId = "whiteship" - possible_destinations = "whiteship_away;whiteship_home;whiteship_z4" + emagged = 1 \ No newline at end of file diff --git a/code/modules/shuttle/ferry.dm b/code/modules/shuttle/ferry.dm new file mode 100644 index 00000000000..0921e074f06 --- /dev/null +++ b/code/modules/shuttle/ferry.dm @@ -0,0 +1,24 @@ +/obj/machinery/computer/shuttle/ferry + name = "transport ferry console" + circuit = /obj/item/weapon/circuitboard/ferry + shuttleId = "ferry" + possible_destinations = "ferry_home;ferry_away" + + +/obj/machinery/computer/shuttle/ferry/request + name = "ferry console" + circuit = /obj/item/weapon/circuitboard/ferry/request + var/cooldown //prevents spamming admins + possible_destinations = "ferry_home" + admin_controlled = 1 + +/obj/machinery/computer/shuttle/ferry/request/Topic(href, href_list) + ..() + if(href_list["request"]) + if(cooldown) + return + cooldown = 1 + usr << "Your request has been recieved by Centcom." + admins << "FERRY: [key_name_admin(usr)] (?) (FLW) (Move Ferry) is requesting to move the transport ferry to Centcom." + spawn(600) //One minute cooldown + cooldown = 0 \ No newline at end of file diff --git a/code/modules/shuttle/shuttle.dm b/code/modules/shuttle/shuttle.dm index c7925e422f3..a124f2e765b 100644 --- a/code/modules/shuttle/shuttle.dm +++ b/code/modules/shuttle/shuttle.dm @@ -530,111 +530,6 @@ else dst = destination . += " towards [dst ? dst.name : "unknown location"] ([timeLeft(600)]mins)" - -/obj/machinery/computer/shuttle - name = "Shuttle Console" - icon_screen = "shuttle" - icon_keyboard = "tech_key" - req_access = list( ) - circuit = /obj/item/weapon/circuitboard/shuttle - var/shuttleId - var/possible_destinations = "" - var/admin_controlled - var/no_destination_swap = 0 - -/obj/machinery/computer/shuttle/New(location, obj/item/weapon/circuitboard/shuttle/C) - ..() - if(istype(C)) - possible_destinations = C.possible_destinations - shuttleId = C.shuttleId - -/obj/machinery/computer/shuttle/attack_hand(mob/user) - if(..(user)) - return - src.add_fingerprint(usr) - - var/list/options = params2list(possible_destinations) - var/obj/docking_port/mobile/M = SSshuttle.getShuttle(shuttleId) - var/dat = "Status: [M ? M.getStatusText() : "*Missing*"]

" - if(M) - var/destination_found - for(var/obj/docking_port/stationary/S in SSshuttle.stationary) - if(!options.Find(S.id)) - continue - if(M.canDock(S)) - continue - destination_found = 1 - dat += "Send to [S.name]
" - if(!destination_found) - dat += "Shuttle Locked
" - if(admin_controlled) - dat += "Authorized personnel only
" - dat += "Request Authorization
" - dat += "Close" - - var/datum/browser/popup = new(user, "computer", M ? M.name : "shuttle", 300, 200) - popup.set_content("
[dat]
") - popup.set_title_image(usr.browse_rsc_icon(src.icon, src.icon_state)) - popup.open() - -/obj/machinery/computer/shuttle/Topic(href, href_list) - if(..()) - return - usr.set_machine(src) - src.add_fingerprint(usr) - if(!allowed(usr)) - usr << "Access denied." - return - - if(href_list["move"]) - var/obj/docking_port/mobile/M = SSshuttle.getShuttle(shuttleId) - if(M.launch_status == ENDGAME_LAUNCHED) - usr << "You've already escaped. Never going back to that place again!" - return - if(no_destination_swap) - if(M.mode != SHUTTLE_IDLE) - usr << "Shuttle already in transit." - return - switch(SSshuttle.moveShuttle(shuttleId, href_list["move"], 1)) - if(0) - usr << "Shuttle received message and will be sent shortly." - if(1) - usr << "Invalid shuttle requested." - else - usr << "Unable to comply." - -/obj/machinery/computer/shuttle/emag_act(mob/user) - if(!emagged) - src.req_access = list() - emagged = 1 - user << "You fried the consoles ID checking system." - -/obj/machinery/computer/shuttle/ferry - name = "transport ferry console" - circuit = /obj/item/weapon/circuitboard/ferry - shuttleId = "ferry" - possible_destinations = "ferry_home;ferry_away" - - -/obj/machinery/computer/shuttle/ferry/request - name = "ferry console" - circuit = /obj/item/weapon/circuitboard/ferry/request - var/cooldown //prevents spamming admins - possible_destinations = "ferry_home" - admin_controlled = 1 - -/obj/machinery/computer/shuttle/ferry/request/Topic(href, href_list) - ..() - if(href_list["request"]) - if(cooldown) - return - cooldown = 1 - usr << "Your request has been recieved by Centcom." - admins << "FERRY: [key_name_admin(usr)] (?) (FLW) (Move Ferry) is requesting to move the transport ferry to Centcom." - spawn(600) //One minute cooldown - cooldown = 0 - - #undef DOCKING_PORT_HIGHLIGHT diff --git a/code/game/machinery/computer/syndicate_shuttle.dm b/code/modules/shuttle/syndicate.dm similarity index 95% rename from code/game/machinery/computer/syndicate_shuttle.dm rename to code/modules/shuttle/syndicate.dm index ff61abf9798..b79c1b175fa 100644 --- a/code/game/machinery/computer/syndicate_shuttle.dm +++ b/code/modules/shuttle/syndicate.dm @@ -1,41 +1,40 @@ -#define SYNDICATE_CHALLENGE_TIMER 12000 //20 minutes - -/obj/machinery/computer/shuttle/syndicate - name = "syndicate shuttle terminal" - icon_screen = "syndishuttle" - icon_keyboard = "syndie_key" - req_access = list(access_syndicate) - shuttleId = "syndicate" - possible_destinations = "syndicate_away;syndicate_z5;syndicate_ne;syndicate_nw;syndicate_n;syndicate_se;syndicate_sw;syndicate_s" - var/challenge = FALSE - -/obj/machinery/computer/shuttle/syndicate/recall - name = "syndicate shuttle recall terminal" - possible_destinations = "syndicate_away" - - -/obj/machinery/computer/shuttle/syndicate/Topic(href, href_list) - if(href_list["move"]) - if(challenge && world.time < SYNDICATE_CHALLENGE_TIMER) - usr << "You've issued a combat challenge to the station! You've got to give them at least [round(((SYNDICATE_CHALLENGE_TIMER - world.time) / 10) / 60)] more minutes to allow them to prepare." - return 0 - ..() - -/obj/machinery/computer/shuttle/syndicate/drop_pod - name = "syndicate assault pod control" - icon = 'icons/obj/terminals.dmi' - icon_state = "dorm_available" - req_access = list(access_syndicate) - shuttleId = "steel_rain" - possible_destinations = null - -/obj/machinery/computer/shuttle/syndicate/drop_pod/Topic(href, href_list) - if(href_list["move"]) - if(z != ZLEVEL_CENTCOM) - usr << "Pods are one way!" - return 0 - ..() - - - +#define SYNDICATE_CHALLENGE_TIMER 12000 //20 minutes + +/obj/machinery/computer/shuttle/syndicate + name = "syndicate shuttle terminal" + icon_screen = "syndishuttle" + icon_keyboard = "syndie_key" + req_access = list(access_syndicate) + shuttleId = "syndicate" + possible_destinations = "syndicate_away;syndicate_z5;syndicate_ne;syndicate_nw;syndicate_n;syndicate_se;syndicate_sw;syndicate_s" + var/challenge = FALSE + +/obj/machinery/computer/shuttle/syndicate/recall + name = "syndicate shuttle recall terminal" + possible_destinations = "syndicate_away" + + +/obj/machinery/computer/shuttle/syndicate/Topic(href, href_list) + if(href_list["move"]) + if(challenge && world.time < SYNDICATE_CHALLENGE_TIMER) + usr << "You've issued a combat challenge to the station! You've got to give them at least [round(((SYNDICATE_CHALLENGE_TIMER - world.time) / 10) / 60)] more minutes to allow them to prepare." + return 0 + ..() + +/obj/machinery/computer/shuttle/syndicate/drop_pod + name = "syndicate assault pod control" + icon = 'icons/obj/terminals.dmi' + icon_state = "dorm_available" + req_access = list(access_syndicate) + shuttleId = "steel_rain" + possible_destinations = null + +/obj/machinery/computer/shuttle/syndicate/drop_pod/Topic(href, href_list) + if(href_list["move"]) + if(z != ZLEVEL_CENTCOM) + usr << "Pods are one way!" + return 0 + ..() + + #undef SYNDICATE_CHALLENGE_TIMER \ No newline at end of file diff --git a/code/modules/shuttle/white_ship.dm b/code/modules/shuttle/white_ship.dm new file mode 100644 index 00000000000..2d0ed77ad06 --- /dev/null +++ b/code/modules/shuttle/white_ship.dm @@ -0,0 +1,6 @@ +/obj/machinery/computer/shuttle/white_ship + name = "White Ship Console" + desc = "Used to control the White Ship." + circuit = /obj/item/weapon/circuitboard/white_ship + shuttleId = "whiteship" + possible_destinations = "whiteship_away;whiteship_home;whiteship_z4" \ No newline at end of file diff --git a/tgstation.dme b/tgstation.dme index 4daf3d2c370..6d666d98d83 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -420,9 +420,7 @@ #include "code\game\machinery\computer\prisoner.dm" #include "code\game\machinery\computer\robot.dm" #include "code\game\machinery\computer\security.dm" -#include "code\game\machinery\computer\shuttle.dm" #include "code\game\machinery\computer\station_alert.dm" -#include "code\game\machinery\computer\syndicate_shuttle.dm" #include "code\game\machinery\computer\telecrystalconsoles.dm" #include "code\game\machinery\doors\airlock.dm" #include "code\game\machinery\doors\airlock_electronics.dm" @@ -893,6 +891,7 @@ #include "code\modules\awaymissions\mission_code\spacebattle.dm" #include "code\modules\awaymissions\mission_code\stationCollision.dm" #include "code\modules\awaymissions\mission_code\wildwest.dm" +#include "code\modules\cargo\order_computer.dm" #include "code\modules\client\asset_cache.dm" #include "code\modules\client\client defines.dm" #include "code\modules\client\client procs.dm" @@ -1535,7 +1534,12 @@ #include "code\modules\ruins\ruin_areas.dm" #include "code\modules\security levels\keycard authentication.dm" #include "code\modules\security levels\security levels.dm" +#include "code\modules\shuttle\computer.dm" +#include "code\modules\shuttle\emergency.dm" +#include "code\modules\shuttle\ferry.dm" #include "code\modules\shuttle\shuttle.dm" +#include "code\modules\shuttle\syndicate.dm" +#include "code\modules\shuttle\white_ship.dm" #include "code\modules\space transition\space_transition.dm" #include "code\modules\spells\spell.dm" #include "code\modules\spells\spell_types\area_teleport.dm"