lets not have bounty cubes worth a bunch more than they should be. port of https://github.com/tgstation/tgstation/pull/56914 Credit to cacogen.

This commit is contained in:
shellspeed1
2022-09-20 20:55:38 -07:00
parent a55b2c4ff3
commit de4d468472
2 changed files with 26 additions and 16 deletions
+4 -2
View File
@@ -94,12 +94,14 @@
stop_sending()
if(curr_bounty.can_claim())
//Pay for the bounty with the ID's department funds.
status_report += "Bounty Completed! Please send your completed bounty cube to cargo for your automated payout shortly."
status_report += "Bounty completed! Please give your bounty cube to cargo for your automated payout shortly."
inserted_scan_id.registered_account.reset_bounty()
SSeconomy.civ_bounty_tracker++
var/obj/item/bounty_cube/reward = new /obj/item/bounty_cube(drop_location())
reward.set_up(curr_bounty, inserted_scan_id)
pad.visible_message("<span class='notice'>[pad] activates!</span>")
pad.visible_message(span_notice("[pad] activates!"))
flick(pad.sending_state,pad)
pad.icon_state = pad.idle_state
playsound(loc, 'sound/machines/synth_yes.ogg', 30 , TRUE)
+22 -14
View File
@@ -79,11 +79,11 @@
tagger.paper_count -= 1
sticker = new /obj/item/barcode(src)
sticker.payments_acc = tagger.payments_acc //new tag gets the tagger's current account.
sticker.percent_cut = tagger.percent_cut //same, but for the percentage taken.
sticker.cut_multiplier = tagger.cut_multiplier //same, but for the percentage taken.
var/list/wrap_contents = src.GetAllContents()
for(var/obj/I in wrap_contents)
I.AddComponent(/datum/component/pricetag, sticker.payments_acc, tagger.percent_cut)
I.AddComponent(/datum/component/pricetag, sticker.payments_acc, tagger.cut_multiplier)
var/overlaystring = "[icon_state]_tag"
if(giftwrapped)
overlaystring = copytext(overlaystring, 5)
@@ -222,11 +222,11 @@
tagger.paper_count -= 1
sticker = new /obj/item/barcode(src)
sticker.payments_acc = tagger.payments_acc //new tag gets the tagger's current account.
sticker.percent_cut = tagger.percent_cut //as above, as before.
sticker.cut_multiplier = tagger.cut_multiplier //as above, as before.
var/list/wrap_contents = src.GetAllContents()
for(var/obj/I in wrap_contents)
I.AddComponent(/datum/component/pricetag, sticker.payments_acc, tagger.percent_cut)
I.AddComponent(/datum/component/pricetag, sticker.payments_acc, tagger.cut_multiplier)
var/overlaystring = "[icon_state]_tag"
if(giftwrapped)
overlaystring = copytext(overlaystring, 5)
@@ -317,7 +317,7 @@
/obj/item/sales_tagger
name = "sales tagger"
desc = "A scanner that lets you tag wrapped items for sale, splitting the profit between you and cargo. Ctrl-Click to clear the registered account."
desc = "A scanner that lets you tag wrapped items for sale, splitting the profit between you and cargo."
icon = 'icons/obj/device.dmi'
icon_state = "salestagger"
item_state = "electronic"
@@ -330,12 +330,19 @@
var/paper_count = 10
var/max_paper_count = 20
///Details the percentage the scanned account recieves off the final sale.
var/percent_cut = 20
///The person who tagged this will receive the sale value multiplied by this number.
var/cut_multiplier = 0.5
///Maximum value for cut_multiplier.
var/cut_max = 0.5
///Minimum value for cut_multiplier.
var/cut_min = 0.01
/obj/item/sales_tagger/examine(mob/user)
. = ..()
. += "[src] has [paper_count]/[max_paper_count] available barcodes. Refill with paper."
. += "Profit split on sale is currently set to [percent_cut]%."
. += "<span class='notice'>[src] has [paper_count]/[max_paper_count] available barcodes. Refill with paper.</span>"
. += "<span class='notice'>Profit split on sale is currently set to [round(cut_multiplier*100)]%. <b>Alt-click</b> to change.</span>"
if(payments_acc)
. += "<span class='notice'><b>Ctrl-click</b> to clear the registered account.</span>"
/obj/item/sales_tagger/attackby(obj/item/I, mob/living/user, params)
. = ..()
@@ -376,7 +383,8 @@
playsound(src, 'sound/machines/click.ogg', 40, TRUE)
to_chat(user, "<span class='notice'>You print a new barcode.</span>")
var/obj/item/barcode/new_barcode = new /obj/item/barcode(src)
new_barcode.payments_acc = payments_acc //The sticker gets the scanner's registered account.
new_barcode.payments_acc = payments_acc // The sticker gets the scanner's registered account.
new_barcode.cut_multiplier = cut_multiplier // Also the registered percent cut.
user.put_in_hands(new_barcode)
/obj/item/sales_tagger/CtrlClick(mob/user)
@@ -386,11 +394,11 @@
/obj/item/sales_tagger/AltClick(mob/user)
. = ..()
var/potential_cut = input("How much would you like to payout to the registered card?","Percentage Profit") as num|null
var/potential_cut = input("How much would you like to pay out to the registered card?","Percentage Profit ([round(cut_min*100)]% - [round(cut_max*100)]%)") as num|null
if(!potential_cut)
percent_cut = 50
percent_cut = clamp(round(potential_cut, 1), 1, 50)
to_chat(user, "<span class='notice'>[percent_cut]% profit will be recieved if a package with a barcode is sold.</span>")
cut_multiplier = initial(cut_multiplier)
cut_multiplier = clamp(round(potential_cut/100, cut_min), cut_min, cut_max)
to_chat(user, "<span class='notice'>[round(cut_multiplier*100)]% profit will be received if a package with a barcode is sold.</span>")
/obj/item/barcode
name = "Barcode tag"
@@ -400,4 +408,4 @@
w_class = WEIGHT_CLASS_TINY
///All values inheirited from the sales tagger it came from.
var/datum/bank_account/payments_acc = null
var/percent_cut = 5
var/cut_multiplier = 0.5