#define PRINTER_TIMEOUT 10
/obj/machinery/computer/bounty
name = "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
/obj/machinery/computer/bounty/Initialize()
. = ..()
printer_ready = world.time + PRINTER_TIMEOUT
/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()
. = ..()
info = "
Nanotrasen Cargo Bounties
"
for(var/datum/bounty/B in GLOB.bounties_list)
if(B.claimed)
continue
info += {"[B.name]
- Reward: [B.reward_string()]
- Completed: [B.completion_string()]
"}
/obj/machinery/computer/bounty/ui_interact(mob/user)
. = ..()
if(!GLOB.bounties_list.len)
setup_bounties()
var/list/dat = list({"Refresh
Print Paper
Credits: [SSshuttle.points]
| Name | Description | Reward | Completion | Status |
"})
for(var/datum/bounty/B in GLOB.bounties_list)
if(B.claimed)
dat += ""
else if(B.can_claim())
dat += "
"
else
dat += "
"
if(B.high_priority)
dat += {"| [B.name] |
High Priority: [B.description] |
[B.reward_string()] | "}
else
dat += {"[B.name] |
[B.description] |
[B.reward_string()] | "}
dat += "[B.completion_string()] | "
if(B.claimed)
dat += "Claimed | "
else if(B.can_claim())
dat += "Claim | "
else
dat += "Unclaimed | "
dat += "
"
dat += "
"
dat = dat.Join()
var/datum/browser/popup = new(user, "bounties", "Nanotrasen Bounties", 700, 600)
popup.set_content(dat)
popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
popup.open()
/obj/machinery/computer/bounty/Topic(href, href_list)
if(..())
return
switch(href_list["choice"])
if("Print")
if(printer_ready < world.time)
printer_ready = world.time + PRINTER_TIMEOUT
print_paper()
if("Claim")
var/datum/bounty/B = locate(href_list["d_rec"])
if(B in GLOB.bounties_list)
B.claim()
if(href_list["refresh"])
playsound(src, "terminal_type", 25, 0)
updateUsrDialog()