diff --git a/code/game/machinery/civilian_bountys.dm b/code/game/machinery/civilian_bountys.dm index 1173faa5d8..e983afeed1 100644 --- a/code/game/machinery/civilian_bountys.dm +++ b/code/game/machinery/civilian_bountys.dm @@ -104,6 +104,32 @@ playsound(loc, 'sound/machines/synth_yes.ogg', 30 , TRUE) sending = FALSE +///Here is where cargo bounties are added to the player's bank accounts, then adjusted and scaled into a civilian bounty. +/obj/machinery/computer/piratepad_control/civilian/proc/add_bounties() + if(!inserted_scan_id || !inserted_scan_id.registered_account) + return + var/datum/bank_account/pot_acc = inserted_scan_id.registered_account + if(pot_acc.civilian_bounty && ((world.time) < pot_acc.bounty_timer + 5 MINUTES)) + var/curr_time = round(((pot_acc.bounty_timer + (5 MINUTES))-world.time)/ (1 MINUTES), 0.01) + to_chat(usr, "Internal ID network spools coiling, try again in [curr_time] minutes!") + return FALSE + if(!pot_acc.account_job) + to_chat(usr, "The console smartly rejects your ID card, as it lacks a job assignment!") + return FALSE + var/list/datum/bounty/crumbs = list(random_bounty(pot_acc.account_job.bounty_types), // We want to offer 2 bounties from their appropriate job catagories + random_bounty(pot_acc.account_job.bounty_types), // and 1 guarenteed assistant bounty if the other 2 suck. + random_bounty(CIV_JOB_BASIC)) + pot_acc.bounty_timer = world.time + pot_acc.bounties = crumbs + +/obj/machinery/computer/piratepad_control/civilian/proc/pick_bounty(choice) + if(inserted_scan_id?.registered_account) + playsound(loc, 'sound/machines/synth_no.ogg', 40 , TRUE) + return + inserted_scan_id.registered_account.civilian_bounty = inserted_scan_id.registered_account.bounties[choice] + inserted_scan_id.registered_account.bounties = null + return inserted_scan_id.registered_account.civilian_bounty + /obj/machinery/computer/piratepad_control/civilian/AltClick(mob/user) . = ..() id_eject(user, inserted_scan_id) @@ -122,9 +148,20 @@ data["status_report"] = status_report data["id_inserted"] = inserted_scan_id if(inserted_scan_id && inserted_scan_id.registered_account) - data["id_bounty_info"] = inserted_scan_id.registered_account.bounty_text() - data["id_bounty_num"] = inserted_scan_id.registered_account.bounty_num() - data["id_bounty_value"] = inserted_scan_id.registered_account.bounty_value() + if(inserted_scan_id.registered_account.civilian_bounty) + data["id_bounty_info"] = inserted_scan_id.registered_account.civilian_bounty.description + data["id_bounty_num"] = inserted_scan_id.registered_account.bounty_num() + data["id_bounty_value"] = inserted_scan_id.registered_account.civilian_bounty.reward + if(inserted_scan_id.registered_account.bounties) + data["picking"] = TRUE + data["id_bounty_names"] = list(inserted_scan_id.registered_account.bounties[1].name, + inserted_scan_id.registered_account.bounties[2].name, + inserted_scan_id.registered_account.bounties[3].name) + data["id_bounty_values"] = list(inserted_scan_id.registered_account.bounties[1].reward, + inserted_scan_id.registered_account.bounties[2].reward, + inserted_scan_id.registered_account.bounties[3].reward) + else + data["picking"] = FALSE return data /obj/machinery/computer/piratepad_control/civilian/ui_act(action, params) @@ -141,19 +178,13 @@ start_sending() if("stop") stop_sending() + if("pick") + pick_bounty(params["value"]) if("bounty") - if(!inserted_scan_id || !inserted_scan_id.registered_account) - return - var/datum/bank_account/pot_acc = inserted_scan_id.registered_account - if(pot_acc.civilian_bounty && ((world.time) < pot_acc.bounty_timer + 5 MINUTES)) - var/curr_time = round(((pot_acc.bounty_timer + (5 MINUTES))-world.time)/ (1 MINUTES), 0.01) - to_chat(usr, "You already have an incomplete civilian bounty, try again in [curr_time] minutes to replace it!") - return FALSE - var/datum/bounty/crumbs = random_bounty(pot_acc.account_job.bounty_types) - COOLDOWN_START(pot_acc, bounty_timer, 5 MINUTES) - pot_acc.civilian_bounty = crumbs + add_bounties() if("eject") id_eject(usr, inserted_scan_id) + inserted_scan_id = null . = TRUE ///Self explanitory, holds the ID card inthe console for bounty payout and manipulation. diff --git a/code/modules/economy/account.dm b/code/modules/economy/account.dm index af3eced8db..18fdfd2667 100644 --- a/code/modules/economy/account.dm +++ b/code/modules/economy/account.dm @@ -11,6 +11,7 @@ var/being_dumped = FALSE //pink levels are rising var/withdrawDelay = 0 var/datum/bounty/civilian_bounty + var/list/datum/bounty/bounties COOLDOWN_DECLARE(bounty_timer) /datum/bank_account/New(newname, job) diff --git a/code/modules/events/pirates.dm b/code/modules/events/pirates.dm index f68e8f8b18..749c2e4f3e 100644 --- a/code/modules/events/pirates.dm +++ b/code/modules/events/pirates.dm @@ -264,12 +264,12 @@ I.buffer = src return TRUE -/obj/machinery/piratepad/screwdriver_act_secondary(mob/living/user, obj/item/screwdriver/screw) +/obj/machinery/piratepad/screwdriver_act(mob/living/user, obj/item/screwdriver/screw) . = ..() if(!.) return default_deconstruction_screwdriver(user, "lpad-idle-open", "lpad-idle-off", screw) -/obj/machinery/piratepad/crowbar_act_secondary(mob/living/user, obj/item/tool) +/obj/machinery/piratepad/crowbar_act(mob/living/user, obj/item/tool) . = ..() default_deconstruction_crowbar(tool) return TRUE @@ -285,6 +285,8 @@ var/datum/export_report/total_report var/sending_timer var/cargo_hold_id + ///Reference to the specific pad that the control computer is linked up to. + var/datum/weakref/pad_ref /obj/machinery/computer/piratepad_control/Initialize(mapload) ..() diff --git a/tgui/packages/tgui/interfaces/CivCargoHoldTerminal.js b/tgui/packages/tgui/interfaces/CivCargoHoldTerminal.js index 42fc0d8bbb..fb6954a347 100644 --- a/tgui/packages/tgui/interfaces/CivCargoHoldTerminal.js +++ b/tgui/packages/tgui/interfaces/CivCargoHoldTerminal.js @@ -1,75 +1,63 @@ -import { Fragment } from 'inferno'; import { useBackend } from '../backend'; -import { Button, Flex, LabeledList, NoticeBox, Section } from '../components'; +import { Box, Button, Flex, LabeledList, NoticeBox, Section } from '../components'; import { Window } from '../layouts'; export const CivCargoHoldTerminal = (props, context) => { const { act, data } = useBackend(context); - const { - pad, - sending, - status_report, - id_inserted, - id_bounty_info, - id_bounty_value, - id_bounty_num, - } = data; - const in_text = "Welcome valued employee."; - const out_text = "To begin, insert your ID into the console."; + const { pad, sending, status_report, id_inserted, id_bounty_info, picking } = + data; + const in_text = 'Welcome valued employee.'; + const out_text = 'To begin, insert your ID into the console.'; return ( - + - + {id_inserted ? in_text : out_text} -
+
+
- - - - - + + + + + + + + +
+ ); +};