port of https://github.com/tgstation/tgstation/pull/54029/files# Aka this is where we get bounty cubes and remove the public bounty console. Credit to ArcaneMusic.

This commit is contained in:
shellspeed1
2022-09-18 21:55:10 -07:00
parent b4f886d999
commit cdb1fbb1e2
15 changed files with 32 additions and 381 deletions
+1 -1
View File
@@ -78,7 +78,7 @@ GLOBAL_LIST_EMPTY(bounties_list)
// Returns a new bounty of random type, but does not add it to GLOB.bounties_list.
/proc/random_bounty(var/guided = 0)
var/bounty_num
if(guided)
if(guided && (guided != CIV_JOB_RANDOM))
bounty_num = guided
else
bounty_num = rand(1,13)
-65
View File
@@ -1,65 +0,0 @@
#define PRINTER_TIMEOUT 10
/obj/machinery/computer/bounty
name = "\improper Nanotrasen bounty console"
desc = "Used to check and claim bounties offered by Nanotrasen"
icon_screen = "bounty"
circuit = /obj/item/circuitboard/computer/bounty
light_color = "#E2853D"//orange
var/printer_ready = 0 //cooldown var
var/static/datum/bank_account/cargocash
/obj/machinery/computer/bounty/Initialize(mapload)
. = ..()
printer_ready = world.time + PRINTER_TIMEOUT
cargocash = SSeconomy.get_dep_account(ACCOUNT_CAR)
/obj/machinery/computer/bounty/proc/print_paper()
new /obj/item/paper/bounty_printout(loc)
/obj/item/paper/bounty_printout
name = "paper - Bounties"
/obj/item/paper/bounty_printout/Initialize(mapload)
. = ..()
info = "<h2>Nanotrasen Cargo Bounties</h2></br>"
update_icon()
for(var/datum/bounty/B in GLOB.bounties_list)
if(B.claimed)
continue
info += {"<h3>[B.name]</h3>
<ul><li>Reward: [B.reward_string()]</li>
<li>Completed: [B.completion_string()]</li></ul>"}
/obj/machinery/computer/bounty/ui_interact(mob/user, datum/tgui/ui)
if(!GLOB.bounties_list.len)
setup_bounties()
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
ui = new(user, src, "CargoBountyConsole", name)
ui.open()
/obj/machinery/computer/bounty/ui_data(mob/user)
var/list/data = list()
var/list/bountyinfo = list()
for(var/datum/bounty/B in GLOB.bounties_list)
bountyinfo += list(list("name" = B.name, "description" = B.description, "reward_string" = B.reward_string(), "completion_string" = B.completion_string() , "claimed" = B.claimed, "can_claim" = B.can_claim(), "priority" = B.high_priority, "bounty_ref" = REF(B)))
data["stored_cash"] = cargocash.account_balance
data["bountydata"] = bountyinfo
return data
/obj/machinery/computer/bounty/ui_act(action,params)
if(..())
return
switch(action)
if("ClaimBounty")
var/datum/bounty/cashmoney = locate(params["bounty"]) in GLOB.bounties_list
if(cashmoney)
cashmoney.claim()
return TRUE
if("Print")
if(printer_ready < world.time)
printer_ready = world.time + PRINTER_TIMEOUT
print_paper()
return
@@ -0,0 +1,8 @@
/datum/export/bounty_box
cost = 1
k_elasticity = 0 //Bounties are non-elastic funds.
unit_name = "completed bounty cube"
export_types = list(/obj/item/bounty_cube)
/datum/export/bounty_box/get_cost(obj/item/bounty_cube/cube, allowed_categories, apply_elastic)
return cube.bounty_value
@@ -19,6 +19,7 @@
paycheck_department = ACCOUNT_CAR
display_order = JOB_DISPLAY_ORDER_CARGO_TECHNICIAN
bounty_types = CIV_JOB_RANDOM
threat = 0.2
/datum/outfit/job/cargo_tech
@@ -33,6 +33,7 @@
ACCESS_HOP, ACCESS_RC_ANNOUNCE, ACCESS_KEYCARD_AUTH, ACCESS_GATEWAY)
paycheck = PAYCHECK_COMMAND
paycheck_department = ACCOUNT_SRV
bounty_types = CIV_JOB_RANDOM
display_order = JOB_DISPLAY_ORDER_HEAD_OF_PERSONNEL
@@ -27,6 +27,7 @@
ACCESS_SEC_DOORS, ACCESS_HEADS)
paycheck = PAYCHECK_HARD //They can already buy stuff using cargo budget, don't give em a command-level paycheck. //alright i'll agree to that -qweq
paycheck_department = ACCOUNT_CAR
bounty_types = CIV_JOB_RANDOM
display_order = JOB_DISPLAY_ORDER_QUARTERMASTER
blacklisted_quirks = list(/datum/quirk/mute, /datum/quirk/brainproblems, /datum/quirk/insanity)
@@ -1,47 +0,0 @@
/datum/computer_file/program/bounty
filename = "bounty"
filedesc = "Nanotrasen Bounty Hunter"
program_icon_state = "bounty"
extended_desc = "A basic interface for supply personnel to check and claim bounties."
requires_ntnet = TRUE
transfer_access = ACCESS_CARGO
size = 10
tgui_id = "NtosBountyConsole"
///cooldown var for printing paper sheets.
var/printer_ready = 0
///The cargo account for grabbing the cargo account's credits.
var/static/datum/bank_account/cargocash
/datum/computer_file/program/bounty/proc/print_paper()
new /obj/item/paper/bounty_printout(get_turf(computer))
/datum/computer_file/program/bounty/ui_interact(mob/user, datum/tgui/ui)
if(!GLOB.bounties_list.len)
setup_bounties()
printer_ready = world.time + PRINTER_TIMEOUT
cargocash = SSeconomy.get_dep_account(ACCOUNT_CAR)
. = ..()
/datum/computer_file/program/bounty/ui_data(mob/user)
var/list/data = get_header_data()
var/list/bountyinfo = list()
for(var/datum/bounty/B in GLOB.bounties_list)
bountyinfo += list(list("name" = B.name, "description" = B.description, "reward_string" = B.reward_string(), "completion_string" = B.completion_string() , "claimed" = B.claimed, "can_claim" = B.can_claim(), "priority" = B.high_priority, "bounty_ref" = REF(B)))
data["stored_cash"] = cargocash.account_balance
data["bountydata"] = bountyinfo
return data
/datum/computer_file/program/bounty/ui_act(action,params)
if(..())
return
switch(action)
if("ClaimBounty")
var/datum/bounty/cashmoney = locate(params["bounty"]) in GLOB.bounties_list
if(cashmoney)
cashmoney.claim()
return TRUE
if("Print")
if(printer_ready < world.time)
printer_ready = world.time + PRINTER_TIMEOUT
print_paper()
return
@@ -17,15 +17,7 @@
build_path = /obj/item/circuitboard/computer/cargo/request
category = list("Computer Boards")
departmental_flags = DEPARTMENTAL_FLAG_CARGO
/datum/design/board/bounty
name = "Computer Design (Bounty Console)"
desc = "Allows for the construction of circuit boards used to build a Bounty Console."
id = "bounty"
build_path = /obj/item/circuitboard/computer/bounty
category = list("Computer Boards")
departmental_flags = DEPARTMENTAL_FLAG_CARGO
/datum/design/board/mining
name = "Computer Design (Outpost Status Display)"
desc = "Allows for the construction of circuit boards used to build an outpost status display console."