Nanotrasen Fleet Command Expansion (#7418)

* A

* Update centcom_computers.dm

* a

* Update CommandReportConsole.js

* commandreporter

* Update command_report_computer.dm

* a

* FEET COMMAND

* a

* e

* e

* Update departments.dm

* F

* a

* a

* Update new_player.dm

* Update new_player.dm

* AAAAAA

* Update zombie.dm

* Update zombie.dm

* aaaaaaa

* 0

* a

* Update CentCom_skyrat.dmm

* aa

* Update nsstitan.dmm

* A

* Update station_goal_computer.dm

* Update station_goal_computer.dm

* Update bridge_officer.dm

* Update CentCom_skyrat.dmm

* Update pda.dm

* Revert "Update pda.dm"

This reverts commit fbe1823726f9edb7f7c3ba03c2d34b08b46ae294.

* logic

* cargo system

* 0

* Update import_console.dm

* Update cargo_skyrat.dmm

* noob coder

* Update cargo_shuttle_console.dm

* a

* Update deck_crew.dm

* Update export_console.dm

* Update deck_crew.dm

* 0

* Update CentCom_skyrat_z2.dmm

* AAAA

* 0

* Update CentCom_skyrat_z2.dmm

* Update cargo_shuttle_console.dm

* Update CentCom_skyrat_z2.dmm

* a

* SELLING CREW IS BAD.

* a

* Update supply.dm

* Update CentCom_skyrat_z2.dmm

* Update supply.dm

* A

* a

* a

* Update zombie.dm

* Update modular_skyrat/modules/central_command_module/code/jobs/fleetmaster.dm

Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com>

Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com>
This commit is contained in:
Gandalf
2021-08-17 18:43:19 +01:00
committed by GitHub
co-authored by GoldenAlpharex
parent 4a569fced1
commit a43b8c5fc4
49 changed files with 13707 additions and 3161 deletions
@@ -0,0 +1,111 @@
/obj/machinery/computer/cargo_shuttle_console
name = "NLV Consign Flight Console"
desc = "A console used for controlling the NLV Consign."
icon_screen = "comm"
icon_keyboard = "tech_key"
req_access = list(ACCESS_CENT_CAPTAIN)
circuit = /obj/item/circuitboard/computer/cargo_shuttle_console
light_color = LIGHT_COLOR_BLUE
///The name of the shuttle template being used as the cargo shuttle. 'supply' is default and contains critical code. Don't change this unless you know what you're doing.
var/cargo_shuttle = "supply"
///The docking port called when returning to the station.
var/docking_home = "supply_home"
///The docking port called when leaving the station.
var/docking_away = "supply_away"
var/safety_warning = "For safety and ethical reasons, the automated supply shuttle \
cannot transport human remains, classified nuclear weaponry, mail \
homing beacons, unstable eigenstates or machinery housing any form of artificial intelligence."
var/blockade_warning = "Bluespace instability detected. Shuttle movement impossible."
var/export_categories = EXPORT_CARGO | EXPORT_CONTRABAND | EXPORT_EMAG
var/last_autopilot_change = 0
/// radio used by the console to send messages on supply channel
var/obj/item/radio/headset/radio
/obj/machinery/computer/cargo_shuttle_console/Initialize()
. = ..()
radio = new /obj/item/radio/headset/headset_cargo(src)
/obj/item/circuitboard/computer/cargo_shuttle_console
name = "Flight Control (Computer Board)"
greyscale_colors = CIRCUIT_COLOR_ENGINEERING
build_path = /obj/machinery/computer/cargo_shuttle_console
/obj/machinery/computer/cargo_shuttle_console/ui_interact(mob/user)
var/list/dat = list("<b>SHUTTLE CONTROL SYSTEMS</b>")
var/manual_operation = SSshuttle.supply.manual_operation
dat += "<b>STATUS:</b> [SSshuttle.supply.getStatusText()]"
if(manual_operation)
dat += "<font color='#ff0000'><b>AUTOPILOT OFFLINE</b></font> - <a href='byond://?src=[REF(src)];function=autopilot'>SWITCH TO AUTOPILOT</a>"
dat += "<b>Flight control:</b>"
if(SSshuttle.supply.getDockedId() == docking_away)
dat += "<a href='byond://?src=[REF(src)];function=takeoff'>Navigate to [station_name()]</a>"
else
dat += "<a href='byond://?src=[REF(src)];function=takeoff'>Navigate to NCV Titan</a>"
dat += "<a href='byond://?src=[REF(src)];function=lockdoors'>Bolt doors</a>"
dat += "<a href='byond://?src=[REF(src)];function=unlockdoors'>Unbolt doors</a>"
else
dat += "<font color='#00ff15'>AUTOPILOT ONLINE</font> - <a href='byond://?src=[REF(src)];function=autopilot'>SWITCH TO MANUAL OPERATION</a>"
var/datum/browser/popup = new(user, "flight_control","FLIGHT CONTROL", 400, 400, src)
popup.set_content(dat.Join("<br>"))
popup.open()
onclose(user, "flight_control")
/obj/machinery/computer/cargo_shuttle_console/Topic(href, href_list)
if(..())
return
if(machine_stat & (NOPOWER|BROKEN|MAINT))
return
usr.set_machine(src)
var/function = href_list["function"]
if(href_list["close"])
usr << browse(null, "window=flight_control")
return
switch(function)
if("autopilot")
if((last_autopilot_change + 1 MINUTES) > world.time)
say("Autopilot system in cooldown.")
return
SSshuttle.supply.manual_operation = !SSshuttle.supply.manual_operation
say("Autopilot [SSshuttle.supply.manual_operation ? "disengaged" : "engaged"].")
minor_announce("Cargo shuttle is now in [SSshuttle.supply.manual_operation ? "manual" : "automatic"] operation.", "Cargo Shuttle")
last_autopilot_change = world.time
if("takeoff")
if(!SSshuttle.supply.canMove())
say(safety_warning)
return
if(SSshuttle.supplyBlocked)
say(blockade_warning)
return
if(SSshuttle.supply.getDockedId() == docking_home)
SSshuttle.supply.export_categories = export_categories
SSshuttle.moveShuttle(cargo_shuttle, docking_away, TRUE)
say("Shuttle departing, ETA [SSshuttle.supply.timeLeft(600)] minutes.")
radio.talk_into(src, "NLV Consign departing the station.", RADIO_CHANNEL_SUPPLY)
investigate_log("[key_name(usr)] sent the supply shuttle away.", INVESTIGATE_CARGO)
else
investigate_log("[key_name(usr)] called the supply shuttle.", INVESTIGATE_CARGO)
radio.talk_into(src, "NLV Consign departing towards the station, ETA: [SSshuttle.supply.timeLeft(600)] minutes.", RADIO_CHANNEL_SUPPLY)
say("Shuttle departing, ETA [SSshuttle.supply.timeLeft(600)] minutes.")
SSshuttle.moveShuttle(cargo_shuttle, docking_home, TRUE)
if("lockdoors")
for(var/area/place in SSshuttle.supply.shuttle_areas)
for(var/obj/machinery/door/airlock/iterating_airlock in place)
iterating_airlock.close()
iterating_airlock.bolt()
if("unlockdoors")
for(var/area/place in SSshuttle.supply.shuttle_areas)
for(var/obj/machinery/door/airlock/iterating_airlock in place)
iterating_airlock.unbolt()
updateUsrDialog()
@@ -0,0 +1,86 @@
#define ANNOUNCEMENT_COOLDOWN (10 MINUTES)
/obj/machinery/computer/centcom_announcement
name = "fleet announcement console"
desc = "A console used for making priority Nanotrasen Command Reports."
icon_screen = "comm"
icon_keyboard = "tech_key"
req_access = list(ACCESS_CENT_CAPTAIN)
circuit = /obj/item/circuitboard/computer/communications
light_color = LIGHT_COLOR_BLUE
/// The name of central command that will accompany our report
var/command_name = "Nanotrasen Fleet Command Update"
/// The actual contents of the report we're going to send.
var/command_report_content
/// The title of our report, if anything.
var/command_report_title
/// Whether the report's contents are announced.
var/announce_contents = TRUE
/// The error we encountered while trying to send a report.
var/error = ""
/// Cooldown for sending messages
COOLDOWN_DECLARE(static/announcement_cooldown)
/obj/machinery/computer/centcom_announcement/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
ui = new(user, src, "CommandReportConsole")
ui.open()
/obj/machinery/computer/centcom_announcement/ui_data(mob/user)
var/list/data = list()
data["command_report_content"] = command_report_content
data["announce_contents"] = announce_contents
data["error"] = error
data["command_report_title"] = command_report_title
return data
/obj/machinery/computer/centcom_announcement/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
. = ..()
if(.)
return
switch(action)
if("update_report_contents")
command_report_content = params["updated_contents"]
if("update_report_title")
command_report_title = params["updated_title"]
if("toggle_announce")
announce_contents = !announce_contents
if("submit_report")
error = ""
if(!command_report_content)
error = "ERROR, NO CONTENTS"
return
if (!COOLDOWN_FINISHED(src, announcement_cooldown))
error = "ERROR, SYSTEM IS RECHARGING, ETA: [announcement_cooldown - world.time]"
return
send_announcement()
return TRUE
/*
* The actual proc that sends the priority announcement and reports
*/
/obj/machinery/computer/centcom_announcement/proc/send_announcement()
if (!COOLDOWN_FINISHED(src, announcement_cooldown))
return
/// The sound we're going to play on report.
var/report_sound = SSstation.announcer.get_rand_report_sound()
if(announce_contents)
priority_announce(command_report_content, command_report_title, report_sound, sender_override = command_name, has_important_message = TRUE)
print_command_report(command_report_content, "[announce_contents ? "" : "Classified "][command_name] Update", !announce_contents)
log_admin("[key_name(usr)] has created a command report: \"[command_report_content]\", sent from \"[command_name]\".")
message_admins("[key_name_admin(usr)] has created a command report, sent from \"[command_name]\".")
COOLDOWN_START(src, announcement_cooldown, ANNOUNCEMENT_COOLDOWN)
/obj/item/circuitboard/computer/centcom_announcement
name = "Fleet Announcement (Computer Board)"
greyscale_colors = CIRCUIT_COLOR_ENGINEERING
build_path = /obj/machinery/computer/centcom_announcement
#undef ANNOUNCEMENT_COOLDOWN
@@ -0,0 +1,15 @@
/obj/machinery/computer/ert_control
name = "fleet asset control console"
desc = "A console used for redeploying Nanotrasen Emergency Response assets."
icon_screen = "comm"
icon_keyboard = "tech_key"
req_access = list(ACCESS_CENT_CAPTAIN)
circuit = /obj/item/circuitboard/computer/communications
light_color = LIGHT_COLOR_BLUE
/obj/item/circuitboard/computer/ert_control
name = "Fleet Control (Computer Board)"
greyscale_colors = CIRCUIT_COLOR_ENGINEERING
build_path = /obj/machinery/computer/ert_control
@@ -0,0 +1,124 @@
/obj/machinery/computer/market_link
name = "Nanotrasen Market Link"
desc = "A console used for selling items to the space market."
icon_screen = "comm"
icon_keyboard = "tech_key"
req_access = list(ACCESS_CENT_CAPTAIN)
circuit = /obj/item/circuitboard/computer/market_link
light_color = LIGHT_COLOR_BLUE
/// radio used by the console to send messages on supply channel
var/obj/item/radio/headset/radio
var/list/bay_items = list()
var/list/possible_areas = list()
//Export categories for this run, this is set by console sending the shuttle.
var/export_categories = EXPORT_CARGO
/obj/machinery/computer/market_link/Initialize()
. = ..()
radio = new /obj/item/radio/headset/headset_cargo(src)
for(var/area/centcom/ncvtitan/export_bay/iterating_export_bay in world)
possible_areas += iterating_export_bay
/obj/item/circuitboard/computer/market_link
name = "Market Link (Computer Board)"
greyscale_colors = CIRCUIT_COLOR_ENGINEERING
build_path = /obj/machinery/computer/market_link
/obj/machinery/computer/market_link/ui_interact(mob/user)
var/list/dat = list("<b>Nanotrasen Market Link</b>")
var/manual_operation = SSshuttle.supply.manual_operation
if(manual_operation)
dat += "<a href='byond://?src=[REF(src)];function=scan'>Scan Loading Area</a>"
dat += "CARGO SELLING AREA:"
if(bay_items.len)
dat += "<select name='requested_items' size='number_of_options' multiple='multiple'>"
for(var/atom/iterating_atom in bay_items)
dat += "<option value='[iterating_atom.name]'>[iterating_atom.name]</option>"
dat += "</select>"
dat += "<a href='byond://?src=[REF(src)];function=sell'>EXPORT ITEMS</a>"
else
dat += "NOTHING"
else
dat += "MANUAL SHUTTLE OPERATION IS REQUIRED TO USE THIS TERMINAL."
var/datum/browser/popup = new(user, "export_console","Export Console", 600, 800, src)
popup.set_content(dat.Join("<br>"))
popup.open()
onclose(user, "export_console")
/obj/machinery/computer/market_link/Topic(href, href_list)
if(..())
return
if(machine_stat & (NOPOWER|BROKEN|MAINT))
return
usr.set_machine(src)
var/function = href_list["function"]
if(href_list["close"])
usr << browse(null, "window=export_console")
return
switch(function)
if("scan")
if(!SSshuttle.supply.manual_operation)
say("Manual shuttle operation required.")
return
bay_items.Cut()
for(var/place in possible_areas)
var/area/centcom/ncvtitan/export_bay/exporting_bay = place
for(var/atom/movable/moveable_atom in exporting_bay)
bay_items += moveable_atom
say("Area scanned.")
if("sell")
if(!SSshuttle.supply.manual_operation)
say("Manual shuttle operation required.")
return
sell()
say("Export complete.")
radio.talk_into(src, "NCV Titan has exported your recieved items and credited you accordingly.", RADIO_CHANNEL_SUPPLY)
updateUsrDialog()
/obj/machinery/computer/market_link/proc/sell()
var/datum/bank_account/D = SSeconomy.get_dep_account(ACCOUNT_CAR)
var/presale_points = D.account_balance
if(!GLOB.exports_list.len) // No exports list? Generate it!
setupExports()
var/msg = ""
var/datum/export_report/ex = new
for(var/place in possible_areas)
var/area/centcom/ncvtitan/export_bay/exporting_bay = place
for(var/atom/movable/AM in exporting_bay)
if(isliving(AM))
say("Biological material detected in export area. Halting.")
return
if(iscameramob(AM))
continue
if(!AM.anchored || istype(AM, /obj/vehicle/sealed/mecha))
bay_items -= AM
export_item_and_contents(AM, export_categories , dry_run = FALSE, external_report = ex)
if(ex.exported_atoms)
ex.exported_atoms += "." //ugh
for(var/datum/export/E in ex.total_amount)
var/export_text = E.total_printout(ex)
if(!export_text)
continue
msg += export_text + "\n"
D.adjust_money(ex.total_value[E])
SSeconomy.export_total += (D.account_balance - presale_points)
SSshuttle.centcom_message = msg
investigate_log("Shuttle contents sold for [D.account_balance - presale_points] credits. Contents: [ex.exported_atoms ? ex.exported_atoms.Join(",") + "." : "none."] Message: [SSshuttle.centcom_message || "none."]", INVESTIGATE_CARGO)
@@ -0,0 +1,217 @@
GLOBAL_LIST_EMPTY(cargo_control_consoles)
/obj/machinery/computer/cargo_control_console
name = "NCV Titan Cargo Console"
desc = "A console used for processing requests from the staton."
icon_screen = "comm"
icon_keyboard = "tech_key"
req_access = list(ACCESS_CENT_CAPTAIN)
circuit = /obj/item/circuitboard/computer/cargo_control_console
light_color = LIGHT_COLOR_BLUE
/// radio used by the console to send messages on supply channel
var/obj/item/radio/headset/radio
var/list/possible_floors = list()
/obj/machinery/computer/cargo_control_console/Initialize()
. = ..()
radio = new /obj/item/radio/headset/headset_cargo(src)
GLOB.cargo_control_consoles += src
for(var/area/centcom/ncvtitan/import_bay/iterating_import_bay in world)
for(var/turf/open/floor/iterating_floor in iterating_import_bay)
possible_floors += iterating_floor
/obj/item/circuitboard/computer/cargo_control_console
name = "Cargo Console (Computer Board)"
greyscale_colors = CIRCUIT_COLOR_ENGINEERING
build_path = /obj/machinery/computer/cargo_control_console
/obj/machinery/computer/cargo_control_console/ui_interact(mob/user)
var/list/dat = list("<b>CARGOSYS 3000</b>")
var/manual_operation = SSshuttle.supply.manual_operation
if(manual_operation)
dat += "REQUESTED ITEMS:"
if(SSshuttle.requestlist.len)
dat += "<select name='requested_items' size='number_of_options' multiple='multiple'>"
for(var/datum/supply_order/SO in SSshuttle.requestlist)
dat += "<option value='[SO.pack.id]'>[SO.pack.name] requested by [SO.orderer]</option>"
dat += "</select>"
else
dat += " - NONE"
dat += "PURCHASED ITEMS:"
if(SSshuttle.shoppinglist.len)
dat += "<select name='purchased_items' size='number_of_options' multiple='multiple'>"
for(var/datum/supply_order/SO in SSshuttle.shoppinglist)
dat += "<option value='[SO.pack.id]'>[SO.pack.name] purchased by [SO.orderer]</option>"
dat += "</select>"
dat += "<a href='byond://?src=[REF(src)];function=purchase'>PROCESS PURCHASE LIST</a>"
else
dat += " - NONE"
else
dat += "MANUAL SHUTTLE OPERATION IS REQUIRED TO USE THIS TERMINAL."
var/datum/browser/popup = new(user, "cargo_console","Cargo Console", 600, 400, src)
popup.set_content(dat.Join("<br>"))
popup.open()
onclose(user, "cargo_console")
/obj/machinery/computer/cargo_control_console/Topic(href, href_list)
if(..())
return
if(machine_stat & (NOPOWER|BROKEN|MAINT))
return
usr.set_machine(src)
var/function = href_list["function"]
if(href_list["close"])
usr << browse(null, "window=cargo_console")
return
switch(function)
if("purchase")
if(!SSshuttle.supply.manual_operation)
say("Manual shuttle operation required.")
return
buy()
create_mail()
radio.talk_into(src, "NCV Titan has processed your purchase list, they will deliver it shortly.", RADIO_CHANNEL_SUPPLY)
updateUsrDialog()
/obj/machinery/computer/cargo_control_console/proc/create_mail()
//Early return if there's no mail waiting to prevent taking up a slot. We also don't send mails on sundays or holidays.
if(!SSeconomy.mail_waiting || SSeconomy.mail_blocked)
return
//spawn crate
var/list/empty_turfs = list()
for(var/turf/open/floor/iterating_floor in possible_floors)
if(iterating_floor.is_blocked_turf())
continue
empty_turfs += iterating_floor
new /obj/structure/closet/crate/mail/economy(pick(empty_turfs))
/obj/machinery/computer/cargo_control_console/proc/buy()
var/list/obj/miscboxes = list() //miscboxes are combo boxes that contain all goody orders grouped
var/list/misc_order_num = list() //list of strings of order numbers, so that the manifest can show all orders in a box
var/list/misc_contents = list() //list of lists of items that each box will contain
var/list/misc_costs = list() //list of overall costs sustained by each buyer.
var/list/empty_turfs = list()
for(var/turf/open/floor/iterating_floor in possible_floors)
if(iterating_floor.is_blocked_turf())
continue
empty_turfs += iterating_floor
//quickly and greedily handle chef's grocery runs first, there are a few reasons why this isn't attached to the rest of cargo...
//but the biggest reason is that the chef requires produce to cook and do their job, and if they are using this system they
//already got let down by the botanists. So to open a new chance for cargo to also screw them over any more than is necessary is bad.
if(SSshuttle.chef_groceries.len)
var/obj/structure/closet/crate/freezer/grocery_crate = new(pick_n_take(empty_turfs))
grocery_crate.name = "kitchen produce freezer"
investigate_log("Chef's [SSshuttle.chef_groceries.len] sized produce order arrived. Cost was deducted from orderer, not cargo.", INVESTIGATE_CARGO)
for(var/datum/orderable_item/item as anything in SSshuttle.chef_groceries)//every order
for(var/amt in 1 to SSshuttle.chef_groceries[item])//every order amount
new item.item_instance.type(grocery_crate)
SSshuttle.chef_groceries.Cut() //This lets the console know it can order another round.
if(!SSshuttle.shoppinglist.len)
return
var/value = 0
var/purchases = 0
var/list/goodies_by_buyer = list() // if someone orders more than GOODY_FREE_SHIPPING_MAX goodies, we upcharge to a normal crate so they can't carry around 20 combat shotties
for(var/datum/supply_order/SO in SSshuttle.shoppinglist)
if(!empty_turfs.len)
break
var/price = SO.pack.get_cost()
if(SO.applied_coupon)
price *= (1 - SO.applied_coupon.discount_pct_off)
var/datum/bank_account/D
if(SO.paying_account) //Someone paid out of pocket
D = SO.paying_account
var/list/current_buyer_orders = goodies_by_buyer[SO.paying_account] // so we can access the length a few lines down
if(!SO.pack.goody)
price *= 1.1 //TODO make this customizable by the quartermaster
// note this is before we increment, so this is the GOODY_FREE_SHIPPING_MAX + 1th goody to ship. also note we only increment off this step if they successfully pay the fee, so there's no way around it
else if(LAZYLEN(current_buyer_orders) == 5)
price += 700
D.bank_card_talk("Goody order size exceeds free shipping limit: Assessing [700] credit S&H fee.")
else
D = SSeconomy.get_dep_account(ACCOUNT_CAR)
if(D)
if(!D.adjust_money(-price))
if(SO.paying_account)
D.bank_card_talk("Cargo order #[SO.id] rejected due to lack of funds. Credits required: [price]")
continue
if(SO.paying_account)
if(SO.pack.goody)
LAZYADD(goodies_by_buyer[SO.paying_account], SO)
D.bank_card_talk("Cargo order #[SO.id] has shipped. [price] credits have been charged to your bank account.")
var/datum/bank_account/department/cargo = SSeconomy.get_dep_account(ACCOUNT_CAR)
cargo.adjust_money(price - SO.pack.get_cost()) //Cargo gets the handling fee
value += SO.pack.get_cost()
SSshuttle.shoppinglist -= SO
SSshuttle.orderhistory += SO
QDEL_NULL(SO.applied_coupon)
if(!SO.pack.goody) //we handle goody crates below
SO.generate(pick_n_take(empty_turfs))
SSblackbox.record_feedback("nested tally", "cargo_imports", 1, list("[SO.pack.get_cost()]", "[SO.pack.name]"))
investigate_log("Order #[SO.id] ([SO.pack.name], placed by [key_name(SO.orderer_ckey)]), paid by [D.account_holder] has shipped.", INVESTIGATE_CARGO)
if(SO.pack.dangerous)
message_admins("\A [SO.pack.name] ordered by [ADMIN_LOOKUPFLW(SO.orderer_ckey)], paid by [D.account_holder] has shipped.")
purchases++
// we handle packing all the goodies last, since the type of crate we use depends on how many goodies they ordered. If it's more than GOODY_FREE_SHIPPING_MAX
// then we send it in a crate (including the CRATE_TAX cost), otherwise send it in a free shipping case
for(var/D in goodies_by_buyer)
var/list/buying_account_orders = goodies_by_buyer[D]
var/datum/bank_account/buying_account = D
var/buyer = buying_account.account_holder
if(buying_account_orders.len > 5) // no free shipping, send a crate
var/obj/structure/closet/crate/secure/owned/our_crate = new /obj/structure/closet/crate/secure/owned(pick_n_take(empty_turfs))
our_crate.buyer_account = buying_account
our_crate.name = "goody crate - purchased by [buyer]"
miscboxes[buyer] = our_crate
else //free shipping in a case
miscboxes[buyer] = new /obj/item/storage/lockbox/order(pick_n_take(empty_turfs))
var/obj/item/storage/lockbox/order/our_case = miscboxes[buyer]
our_case.buyer_account = buying_account
miscboxes[buyer].name = "goody case - purchased by [buyer]"
misc_contents[buyer] = list()
for(var/O in buying_account_orders)
var/datum/supply_order/our_order = O
for (var/item in our_order.pack.contains)
misc_contents[buyer] += item
misc_costs[buyer] += our_order.pack.cost
misc_order_num[buyer] = "[misc_order_num[buyer]]#[our_order.id] "
for(var/I in miscboxes)
var/datum/supply_order/SO = new/datum/supply_order()
SO.id = misc_order_num[I]
SO.generateCombo(miscboxes[I], I, misc_contents[I], misc_costs[I])
qdel(SO)
SSeconomy.import_total += value
var/datum/bank_account/cargo_budget = SSeconomy.get_dep_account(ACCOUNT_CAR)
investigate_log("[purchases] orders in this shipment, worth [value] credits. [cargo_budget.account_balance] credits left.", INVESTIGATE_CARGO)
/obj/machinery/computer/cargo_control_console/proc/notify_order(datum/supply_order/SO)
say("New order recieved!")
playsound(src, 'sound/machines/ping.ogg')
SO.generateRequisition(get_turf(src))
@@ -0,0 +1,64 @@
/obj/machinery/computer/station_goal
name = "station goal console"
desc = "A console used for setting the stations goal."
icon_screen = "comm"
icon_keyboard = "tech_key"
req_access = list(ACCESS_CENT_CAPTAIN)
circuit = /obj/item/circuitboard/computer/station_goal
light_color = LIGHT_COLOR_BLUE
var/list/station_goal_cache = list()
var/goal_assigned = FALSE
/obj/item/circuitboard/computer/station_goal
name = "Station Goal (Computer Board)"
greyscale_colors = CIRCUIT_COLOR_ENGINEERING
build_path = /obj/machinery/computer/station_goal
/obj/machinery/computer/station_goal/Initialize()
. = ..()
station_goal_cache = subtypesof(/datum/station_goal)
/obj/machinery/computer/station_goal/ui_interact(mob/user)
var/list/dat = list("<b>STATION GOAL SELECTION - OFFICIAL USE ONLY</b>")
if(!goal_assigned)
dat += "Please select ONE goal to assign to [station_name()]"
for(var/datum/station_goal/iterating_goal as anything in station_goal_cache)
dat += "<b><a href='byond://?src=[REF(src)];selected_goal=[initial(iterating_goal.name)]'>[initial(iterating_goal.name)]</a></b>"
dat += "Once you select a goal, it will be assigned to the station."
else
dat += "<b>GOAL HAS BEEN ASSIGNED.</b>"
var/datum/browser/popup = new(user, "station_goals","Station Goals", 400, 400, src)
popup.set_content(dat.Join("<br>"))
popup.open()
onclose(user, "station_goals")
/obj/machinery/computer/station_goal/Topic(href, href_list)
if(..())
return
if(goal_assigned)
return
if(machine_stat & (NOPOWER|BROKEN|MAINT))
return
usr.set_machine(src)
var/selected_goal = href_list["selected_goal"]
if(href_list["close"])
usr << browse(null, "window=station_goals")
return
for(var/datum/station_goal/iterating_goal as anything in station_goal_cache)
if(initial(iterating_goal.name) == selected_goal)
var/datum/station_goal/goal_to_set = new iterating_goal()
goal_to_set.send_report()
GLOB.station_goals += goal_to_set
goal_assigned = TRUE
break
updateUsrDialog()