Free photocopier is now really free (#91894)

This commit is contained in:
Kocma-san
2025-07-04 23:36:30 +07:00
committed by Roxy
parent 081ad3f69f
commit dbe8aefea9
2 changed files with 94 additions and 90 deletions
+13 -9
View File
@@ -79,12 +79,16 @@ GLOBAL_LIST_INIT(paper_blanks, init_paper_blanks())
var/mob/living/ass
/// A reference to the toner cartridge that's inserted into the copier. Null if there is no cartridge.
var/obj/item/toner/toner_cartridge
/// Type path of toner this photocopier should starts with. Null if he should start without it.
var/obj/item/toner/starting_toner
/// How many copies will be printed with one click of the "copy" button.
var/num_copies = 1
/// Used with photos. Determines if the copied photo will be in greyscale or color.
var/color_mode = PHOTO_COLOR
/// Indicates whether the printer is currently busy copying or not.
var/busy = FALSE
/// How much does it cost to use this photocopier.
var/usage_cost = PHOTOCOPIER_FEE
/// Variable that holds a reference to any object supported for photocopying inside the photocopier
var/obj/object_copy
/// Variable for the UI telling us how many copies are in the queue.
@@ -111,12 +115,9 @@ GLOBAL_LIST_INIT(paper_blanks, init_paper_blanks())
)
/obj/machinery/photocopier/prebuilt
starting_toner = /obj/item/toner
starting_paper = 30
/obj/machinery/photocopier/prebuilt/Initialize(mapload)
toner_cartridge = new(src)
return ..()
/obj/machinery/photocopier/get_save_vars()
. = ..()
. += NAMEOF(src, paper_stack)
@@ -128,10 +129,12 @@ GLOBAL_LIST_INIT(paper_blanks, init_paper_blanks())
AddElement(/datum/element/elevation, pixel_shift = 8) //enough to look like your bums are on the machine.
if(starting_paper)
paper_stack[created_paper] = starting_paper
if(starting_toner)
toner_cartridge = new starting_toner(src)
/// Simply adds the necessary components for this to function.
/obj/machinery/photocopier/proc/setup_components()
AddComponent(/datum/component/payment, PHOTOCOPIER_FEE, SSeconomy.get_dep_account(ACCOUNT_CIV), PAYMENT_CLINICAL)
AddComponent(/datum/component/payment, usage_cost, SSeconomy.get_dep_account(ACCOUNT_CIV), PAYMENT_CLINICAL)
/obj/machinery/photocopier/RefreshParts()
. = ..()
@@ -420,7 +423,7 @@ GLOBAL_LIST_INIT(paper_blanks, init_paper_blanks())
if(get_paper_count(created_paper) < paper_use * copies_amount)
copies_amount = FLOOR(get_paper_count(created_paper) / paper_use, 1)
error_message = span_warning("An error message flashes across \the [src]'s screen: \"Not enough paper to perform [copies_amount >= 1 ? "full " : ""]operation.\"")
if(!(obj_flags & EMAGGED) && (copies_amount > 0) && (attempt_charge(src, user, (copies_amount - 1) * PHOTOCOPIER_FEE) & COMPONENT_OBJ_CANCEL_CHARGE))
if(!(obj_flags & EMAGGED) && (copies_amount > 0) && (attempt_charge(src, user, (copies_amount - 1) * usage_cost) & COMPONENT_OBJ_CANCEL_CHARGE))
copies_amount = 0
error_message = span_warning("An error message flashes across \the [src]'s screen: \"Failed to charge bank account. Aborting.\"")
@@ -853,10 +856,11 @@ GLOBAL_LIST_INIT(paper_blanks, init_paper_blanks())
/// Subtype of photocopier that is free to use.
/obj/machinery/photocopier/gratis
desc = "Does the same important paperwork, but it's free to use! The best type of free."
usage_cost = 0 // it's free! no charge! very cool and gratis-pilled.
/obj/machinery/photocopier/gratis/setup_components()
// it's free! no charge! very cool and gratis-pilled.
AddComponent(/datum/component/payment, 0, SSeconomy.get_dep_account(ACCOUNT_CIV), PAYMENT_CLINICAL)
/obj/machinery/photocopier/gratis/prebuilt
starting_toner = /obj/item/toner
starting_paper = 30
/*
* Toner cartridge