[MIRROR] Merges the Export Scanner, Sales Tagger, and Price Tagger into one item. [MDB IGNORE] (#17212)

* Merges the Export Scanner, Sales Tagger, and Price Tagger into one item.

* Update code/game/objects/structures/crates_lockers/closets/secure/cargo.dm

Co-authored-by: coldud13 <coldud13@users.noreply.github.com>

* maps and crates

Co-authored-by: ArcaneMusic <41715314+ArcaneMusic@users.noreply.github.com>
Co-authored-by: Tastyfish <crazychris32@gmail.com>
Co-authored-by: coldud13 <coldud13@users.noreply.github.com>
This commit is contained in:
SkyratBot
2022-10-28 22:11:01 -04:00
committed by GitHub
co-authored by coldud13 ArcaneMusic Tastyfish
parent b2aec95405
commit 7502ddf9bb
18 changed files with 249 additions and 131 deletions
@@ -14661,10 +14661,10 @@
/obj/item/stack/package_wrap,
/obj/item/stack/package_wrap,
/obj/item/hand_labeler,
/obj/item/price_tagger{
/obj/item/universal_scanner{
pixel_x = 4
},
/obj/item/sales_tagger,
/obj/item/universal_scanner,
/turf/open/floor/iron/dark,
/area/station/maintenance/abandon_cafeteria/hydro)
"lGB" = (
@@ -39232,14 +39232,14 @@
dir = 8
},
/obj/structure/window,
/obj/item/price_tagger{
/obj/item/universal_scanner{
pixel_x = 5;
pixel_y = 16
},
/obj/structure/displaycase/forsale/kitchen{
pixel_y = 8
},
/obj/item/sales_tagger{
/obj/item/universal_scanner{
pixel_y = 16
},
/turf/open/floor/iron/dark,
@@ -73361,7 +73361,7 @@
/turf/closed/wall,
/area/station/maintenance/starboard/aft)
"xOH" = (
/obj/item/price_tagger,
/obj/item/universal_scanner,
/obj/structure/cable,
/obj/machinery/atmospherics/pipe/smart/simple/supply/hidden/layer4{
dir = 5
+1 -1
View File
@@ -51695,7 +51695,7 @@
/area/station/tcommsat/server)
"oOL" = (
/obj/structure/lattice,
/obj/item/export_scanner,
/obj/item/universal_scanner,
/turf/open/space/basic,
/area/space/nearstation)
"oOX" = (
+7
View File
@@ -40,6 +40,13 @@
/// The baseline unit for cargo crates. Adjusting this will change the cost of all in-game shuttles, crate export values, bounty rewards, and all supply pack import values, as they use this as their unit of measurement.
#define CARGO_CRATE_VALUE 200
/// Universal Scanner mode for export scanning.
#define SCAN_EXPORTS 1
/// Universal Scanner mode for using the sales tagger.
#define SCAN_SALES_TAG 2
/// Universal Scanner mode for using the price tagger.
#define SCAN_PRICE_TAG 3
GLOBAL_LIST_EMPTY(supplypod_loading_bays)
GLOBAL_LIST_INIT(podstyles, list(\
@@ -8,8 +8,7 @@
/obj/item/storage/box/shipping/PopulateContents()
var/static/items_inside = list(
/obj/item/dest_tagger=1,
/obj/item/export_scanner=1,
/obj/item/sales_tagger=1,
/obj/item/universal_scanner=1,
/obj/item/stack/package_wrap/small=2,
/obj/item/stack/wrapping_paper/small=1,
)
@@ -21,7 +21,7 @@
new /obj/item/clothing/gloves/fingerless(src)
new /obj/item/megaphone/cargo(src)
new /obj/item/tank/internals/emergency_oxygen(src)
new /obj/item/export_scanner(src)
new /obj/item/universal_scanner(src)
new /obj/item/door_remote/quartermaster(src)
new /obj/item/circuitboard/machine/techfab/department/cargo(src)
new /obj/item/storage/photo_album/qm(src)
-50
View File
@@ -1,50 +0,0 @@
/obj/item/export_scanner
name = "export scanner"
desc = "A device used to check objects against Nanotrasen exports database."
icon = 'icons/obj/device.dmi'
icon_state = "export_scanner"
inhand_icon_state = "radio"
lefthand_file = 'icons/mob/inhands/items/devices_lefthand.dmi'
righthand_file = 'icons/mob/inhands/items/devices_righthand.dmi'
item_flags = NOBLUDGEON
w_class = WEIGHT_CLASS_SMALL
/obj/item/export_scanner/afterattack(obj/O, mob/user, proximity)
. = ..()
if(!istype(O) || !proximity)
return
// Before you fix it:
// yes, checking manifests is a part of intended functionality.
var/datum/export_report/ex = export_item_and_contents(O, dry_run=TRUE)
var/price = 0
for(var/x in ex.total_amount)
price += ex.total_value[x]
if(price)
to_chat(user, span_notice("Scanned [O], value: <b>[price]</b> credits[O.contents.len ? " (contents included)" : ""]."))
else
to_chat(user, span_warning("Scanned [O], no export value."))
if(ishuman(user))
var/mob/living/carbon/human/scan_human = user
if(istype(O, /obj/item/bounty_cube))
var/obj/item/bounty_cube/cube = O
var/datum/bank_account/scanner_account = scan_human.get_bank_account()
if(!istype(get_area(cube), /area/shuttle/supply))
to_chat(user, span_warning("Shuttle placement not detected. Handling tip not registered."))
else if(cube.bounty_handler_account)
to_chat(user, span_warning("Bank account for handling tip already registered!"))
else if(scanner_account)
cube.AddComponent(/datum/component/pricetag, scanner_account, cube.handler_tip, FALSE)
cube.bounty_handler_account = scanner_account
cube.bounty_handler_account.bank_card_talk("Bank account for [price ? "<b>[price * cube.handler_tip]</b> credit " : ""]handling tip successfully registered.")
if(cube.bounty_holder_account != cube.bounty_handler_account) //No need to send a tracking update to the person scanning it
cube.bounty_holder_account.bank_card_talk("<b>[cube]</b> was scanned in \the <b>[get_area(cube)]</b> by <b>[scan_human] ([scan_human.job])</b>.")
else
to_chat(user, span_warning("Bank account not detected. Handling tip not registered."))
+1 -1
View File
@@ -9,7 +9,7 @@
cost = CARGO_CRATE_VALUE * 1.75
contains = list(/obj/item/stamp,
/obj/item/stamp/denied,
/obj/item/export_scanner,
/obj/item/universal_scanner,
/obj/item/dest_tagger,
/obj/item/hand_labeler,
/obj/item/stack/package_wrap,
+223
View File
@@ -0,0 +1,223 @@
#define PAPER_PER_SHEET 10
/obj/item/universal_scanner
name = "universal scanner"
desc = "A device used to check objects against Nanotrasen exports database, assign price tags, or ready an item for a custom vending machine."
icon = 'icons/obj/device.dmi'
icon_state = "export scanner"
inhand_icon_state = "radio"
lefthand_file = 'icons/mob/inhands/items/devices_lefthand.dmi'
righthand_file = 'icons/mob/inhands/items/devices_righthand.dmi'
item_flags = NOBLUDGEON
w_class = WEIGHT_CLASS_SMALL
/// Which mode is the scanner currently on?
var/scanning_mode = SCAN_EXPORTS
/// A list of all available export scanner modes.
var/list/scale_mode = list()
/// The paper currently stored by the export scanner.
var/paper_count = 10
/// The maximum paper to be stored by the export scanner.
var/max_paper_count = 20
/// The price of the item used by price tagger mode.
var/new_custom_price = 1
/// The account which is receiving the split profits in sales tagger mode.
var/datum/bank_account/payments_acc = null
/// The person who tagged this will receive the sale value multiplied by this number in sales tagger mode.
var/cut_multiplier = 0.5
/// Maximum value for cut_multiplier in sales tagger mode.
var/cut_max = 0.5
/// Minimum value for cut_multiplier in sales tagger mode.
var/cut_min = 0.01
/obj/item/universal_scanner/Initialize(mapload)
. = ..()
scale_mode = sort_list(list(
"export scanner" = image(icon = src.icon, icon_state = "export scanner"),
"price tagger" = image(icon = src.icon, icon_state = "price tagger"),
"sales tagger" = image(icon = src.icon, icon_state = "sales tagger"),
))
/obj/item/universal_scanner/attack_self(mob/user, modifiers)
. = ..()
var/choice = show_radial_menu(user, src , scale_mode, custom_check = CALLBACK(src, .proc/check_menu, user), radius = 36, require_near = TRUE)
if(!choice)
return FALSE
if(icon_state == "[choice]")
return FALSE
switch(choice)
if("export scanner")
scanning_mode = SCAN_EXPORTS
if("price tagger")
scanning_mode = SCAN_PRICE_TAG
if("sales tagger")
scanning_mode = SCAN_SALES_TAG
icon_state = "[choice]"
playsound(src, 'sound/machines/click.ogg', 40, TRUE)
/obj/item/universal_scanner/afterattack(obj/object, mob/user, proximity)
. = ..()
if(!istype(object) || !proximity)
return
if(scanning_mode == SCAN_EXPORTS)
export_scan(object, user)
return
if(scanning_mode == SCAN_PRICE_TAG)
price_tag(target = object, user = user)
/obj/item/universal_scanner/attackby(obj/item/attacking_item, mob/user, params)
. = ..()
if(scanning_mode == SCAN_SALES_TAG && isidcard(attacking_item))
var/obj/item/card/id/potential_acc = attacking_item
if(potential_acc.registered_account)
if(payments_acc == potential_acc.registered_account)
to_chat(user, span_notice("ID card already registered."))
return
else
payments_acc = potential_acc.registered_account
playsound(src, 'sound/machines/ping.ogg', 40, TRUE)
to_chat(user, span_notice("[src] registers the ID card. Tag a wrapped item to create a barcode."))
else if(!potential_acc.registered_account)
to_chat(user, span_warning("This ID card has no account registered!"))
return
if(istype(attacking_item, /obj/item/paper))
if (!(paper_count >= max_paper_count))
paper_count += PAPER_PER_SHEET
qdel(attacking_item)
if (paper_count >= max_paper_count)
paper_count = max_paper_count
to_chat(user, span_notice("[src]'s paper supply is now full."))
return
to_chat(user, span_notice("You refill [src]'s paper supply, you have [paper_count] left."))
else
to_chat(user, span_notice("[src]'s paper supply is full."))
/obj/item/universal_scanner/attack_self_secondary(mob/user, modifiers)
. = ..()
if(scanning_mode == SCAN_SALES_TAG)
if(paper_count <= 0)
to_chat(user, span_warning("You're out of paper!'."))
return
if(!payments_acc)
to_chat(user, span_warning("You need to swipe [src] with an ID card first."))
return
paper_count--
playsound(src, 'sound/machines/click.ogg', 40, TRUE)
to_chat(user, span_notice("You print a new barcode."))
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.cut_multiplier = cut_multiplier // Also the registered percent cut.
user.put_in_hands(new_barcode)
if(scanning_mode == SCAN_PRICE_TAG)
if(loc != user)
to_chat(user, span_warning("You must be holding \the [src] to continue!"))
return
var/chosen_price = tgui_input_number(user, "Set price", "Price", new_custom_price)
if(!chosen_price || QDELETED(user) || QDELETED(src) || !user.canUseTopic(src, be_close = TRUE, no_dexterity = FALSE, no_tk = TRUE) || loc != user)
return
new_custom_price = chosen_price
to_chat(user, span_notice("The [src] will now give things a [new_custom_price] cr tag."))
/obj/item/universal_scanner/CtrlClick(mob/user)
. = ..()
if(scanning_mode == SCAN_SALES_TAG)
payments_acc = null
to_chat(user, span_notice("You clear the registered account."))
/obj/item/universal_scanner/AltClick(mob/user)
. = ..()
if(!scanning_mode == SCAN_SALES_TAG)
return
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)
cut_multiplier = initial(cut_multiplier)
cut_multiplier = clamp(round(potential_cut/100, cut_min), cut_min, cut_max)
to_chat(user, span_notice("[round(cut_multiplier*100)]% profit will be received if a package with a barcode is sold."))
/obj/item/universal_scanner/examine(mob/user)
. = ..()
. += span_notice("It has [paper_count]/[max_paper_count] available barcodes. Refill with paper.")
if(scanning_mode == SCAN_SALES_TAG)
. += span_notice("Profit split on sale is currently set to [round(cut_multiplier*100)]%. <b>Alt-click</b> to change.")
if(payments_acc)
. += span_notice("<b>Ctrl-click</b> to clear the registered account.")
if(scanning_mode == SCAN_PRICE_TAG)
. += span_notice("The current custom price is set to [new_custom_price] cr.")
/**
* Scans an object, target, and provides it's export value based on selling to the cargo shuttle, to mob/user.
*/
/obj/item/universal_scanner/proc/export_scan(obj/target, mob/user)
// Before you fix it:
// yes, checking manifests is a part of intended functionality.
var/datum/export_report/ex = export_item_and_contents(target, dry_run = TRUE)
var/price = 0
for(var/x in ex.total_amount)
price += ex.total_value[x]
if(price)
to_chat(user, span_notice("Scanned [target], value: <b>[price]</b> credits[target.contents.len ? " (contents included)" : ""]."))
else
to_chat(user, span_warning("Scanned [target], no export value."))
if(ishuman(user))
var/mob/living/carbon/human/scan_human = user
if(istype(target, /obj/item/bounty_cube))
var/obj/item/bounty_cube/cube = target
var/datum/bank_account/scanner_account = scan_human.get_bank_account()
if(!istype(get_area(cube), /area/shuttle/supply))
to_chat(user, span_warning("Shuttle placement not detected. Handling tip not registered."))
else if(cube.bounty_handler_account)
to_chat(user, span_warning("Bank account for handling tip already registered!"))
else if(scanner_account)
cube.AddComponent(/datum/component/pricetag, scanner_account, cube.handler_tip, FALSE)
cube.bounty_handler_account = scanner_account
cube.bounty_handler_account.bank_card_talk("Bank account for [price ? "<b>[price * cube.handler_tip]</b> credit " : ""]handling tip successfully registered.")
if(cube.bounty_holder_account != cube.bounty_handler_account) //No need to send a tracking update to the person scanning it
cube.bounty_holder_account.bank_card_talk("<b>[cube]</b> was scanned in \the <b>[get_area(cube)]</b> by <b>[scan_human] ([scan_human.job])</b>.")
else
to_chat(user, span_warning("Bank account not detected. Handling tip not registered."))
/**
* Scans an object, target, and sets it's custom_price variable to new_custom_price, presenting it to the user.
*/
/obj/item/universal_scanner/proc/price_tag(obj/target, mob/user)
if(isitem(target))
var/obj/item/selected_target = target
selected_target.custom_price = new_custom_price
to_chat(user, span_notice("You set the price of [selected_target] to [new_custom_price] cr."))
/**
* check_menu: Checks if we are allowed to interact with a radial menu
*
* Arguments:
* * user The mob interacting with a menu
*/
/obj/item/universal_scanner/proc/check_menu(mob/living/user)
if(!istype(user))
return FALSE
if(user.incapacitated())
return FALSE
return TRUE
/obj/item/barcode
name = "barcode tag"
desc = "A tiny tag, associated with a crewmember's account. Attach to a wrapped item to give that account a portion of the wrapped item's profit."
icon = 'icons/obj/bureaucracy.dmi'
icon_state = "barcode"
w_class = WEIGHT_CLASS_TINY
//All values inherited from the sales tagger it came from.
///The bank account assigned to pay out to from the sales tagger.
var/datum/bank_account/payments_acc = null
///The percentage of profit to give to the payments_acc, from 0 to 1.
var/cut_multiplier = 0.5
#undef PAPER_PER_SHEET
@@ -47,7 +47,7 @@
uniform = /obj/item/clothing/under/rank/cargo/tech
belt = /obj/item/modular_computer/tablet/pda/cargo
ears = /obj/item/radio/headset/headset_cargo
l_hand = /obj/item/export_scanner
l_hand = /obj/item/universal_scanner
/datum/outfit/job/cargo_tech/mod
name = "Cargo Technician (MODsuit)"
+6 -14
View File
@@ -148,8 +148,10 @@
note = item
update_appearance()
else if(istype(item, /obj/item/sales_tagger))
var/obj/item/sales_tagger/sales_tagger = item
else if(istype(item, /obj/item/universal_scanner))
var/obj/item/universal_scanner/sales_tagger = item
if(sales_tagger.scanning_mode != SCAN_SALES_TAG)
return
if(sticker)
to_chat(user, span_warning("This package already has a barcode attached!"))
return
@@ -257,8 +259,8 @@
name = "destination tagger"
desc = "Used to set the destination of properly wrapped packages."
icon = 'icons/obj/device.dmi'
icon_state = "cargotagger"
worn_icon_state = "cargotagger"
icon_state = "cargo tagger"
worn_icon_state = "cargo tagger"
var/currTag = 0 //Destinations are stored in code\globalvars\lists\flavor_misc.dm
var/locked_destination = FALSE //if true, users can't open the destination tag window to prevent changing the tagger's current destination
w_class = WEIGHT_CLASS_TINY
@@ -406,13 +408,3 @@
cut_multiplier = initial(cut_multiplier)
cut_multiplier = clamp(round(potential_cut/100, cut_min), cut_min, cut_max)
to_chat(user, span_notice("[round(cut_multiplier*100)]% profit will be received if a package with a barcode is sold."))
/obj/item/barcode
name = "barcode tag"
desc = "A tiny tag, associated with a crewmember's account. Attach to a wrapped item to give that account a portion of the wrapped item's profit."
icon = 'icons/obj/bureaucracy.dmi'
icon_state = "barcode"
w_class = WEIGHT_CLASS_TINY
///All values inheirited from the sales tagger it came from.
var/datum/bank_account/payments_acc = null
var/cut_multiplier = 0.5
@@ -1472,18 +1472,6 @@
)
departmental_flags = DEPARTMENT_BITFLAG_CARGO | DEPARTMENT_BITFLAG_SERVICE
/datum/design/salestagger
name = "Sales Tagger"
id = "salestagger"
build_type = AUTOLATHE | PROTOLATHE | AWAY_LATHE
materials = list(/datum/material/iron = 700, /datum/material/glass = 200)
build_path = /obj/item/sales_tagger
category = list(
RND_CATEGORY_INITIAL,
RND_CATEGORY_TOOLS + RND_SUBCATEGORY_TOOLS_CARGO
)
departmental_flags = DEPARTMENT_BITFLAG_CARGO | DEPARTMENT_BITFLAG_SERVICE
/datum/design/handlabeler
name = "Hand Labeler"
id = "handlabel"
@@ -1670,18 +1658,6 @@
)
departmental_flags = DEPARTMENT_BITFLAG_ENGINEERING | DEPARTMENT_BITFLAG_SCIENCE
/datum/design/price_tagger
name = "Price Tagger"
id = "price_tagger"
build_type = AUTOLATHE | PROTOLATHE | AWAY_LATHE
materials = list(/datum/material/iron = 1500, /datum/material/glass = 500)
build_path = /obj/item/price_tagger
category = list(
RND_CATEGORY_INITIAL,
RND_CATEGORY_TOOLS + RND_SUBCATEGORY_TOOLS_CARGO
)
departmental_flags = DEPARTMENT_BITFLAG_CARGO
/datum/design/custom_vendor_refill
name = "Custom Vendor Refill"
id = "custom_vendor_refill"
@@ -93,7 +93,6 @@
"recorder",
"rglass",
"roll",
"salestagger",
"sec_38",
"sec_beanbag_slug",
"sec_dart",
-28
View File
@@ -1425,34 +1425,6 @@ GLOBAL_LIST_EMPTY(vending_products)
icon_state = "refill_custom"
custom_premium_price = PAYCHECK_CREW
/obj/item/price_tagger
name = "price tagger"
desc = "This tool is used to set a price for items used in custom vendors."
icon = 'icons/obj/device.dmi'
icon_state = "pricetagger"
custom_premium_price = PAYCHECK_CREW * 0.5
///the price of the item
var/price = 1
/obj/item/price_tagger/attack_self(mob/user)
if(loc != user)
to_chat(user, span_warning("You must be holding the price tagger to continue!"))
return
var/chosen_price = tgui_input_number(user, "Set price", "Price", price)
if(!chosen_price || QDELETED(user) || QDELETED(src) || !user.canUseTopic(src, be_close = TRUE, no_dexterity = FALSE, no_tk = TRUE) || loc != user)
return
price = chosen_price
to_chat(user, span_notice(" The [src] will now give things a [price] cr tag."))
/obj/item/price_tagger/afterattack(atom/target, mob/user, proximity)
. = ..()
if(!proximity)
return
if(isitem(target))
var/obj/item/I = target
I.custom_price = price
to_chat(user, span_notice("You set the price of [I] to [price] cr."))
/obj/machinery/vending/custom/greed //name and like decided by the spawn
icon_state = "greed"
icon_deny = "greed-deny"
+1 -1
View File
@@ -25,7 +25,7 @@
premium = list(
/obj/item/assembly/igniter/condenser = 2,
/obj/item/circuitboard/machine/vendor = 3,
/obj/item/price_tagger = 3,
/obj/item/universal_scanner = 3,
/obj/item/vending_refill/custom = 3,
)
Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 64 KiB

@@ -15,7 +15,7 @@
/obj/item/dest_tagger,
/obj/item/crowbar/cyborg,
/obj/item/extinguisher,
/obj/item/export_scanner,
/obj/item/universal_scanner,
)
radio_channels = list(RADIO_CHANNEL_SUPPLY)
emag_modules = list(
+1 -1
View File
@@ -2704,7 +2704,6 @@
#include "code\modules\cargo\centcom_podlauncher.dm"
#include "code\modules\cargo\coupon.dm"
#include "code\modules\cargo\department_order.dm"
#include "code\modules\cargo\export_scanner.dm"
#include "code\modules\cargo\exports.dm"
#include "code\modules\cargo\expressconsole.dm"
#include "code\modules\cargo\gondolapod.dm"
@@ -2713,6 +2712,7 @@
#include "code\modules\cargo\orderconsole.dm"
#include "code\modules\cargo\supplypod.dm"
#include "code\modules\cargo\supplypod_beacon.dm"
#include "code\modules\cargo\universal_scanner.dm"
#include "code\modules\cargo\bounties\assistant.dm"
#include "code\modules\cargo\bounties\atmos.dm"
#include "code\modules\cargo\bounties\botany.dm"