From c7d735afeeb5068ec9968d2f748c0d7c9e20f306 Mon Sep 17 00:00:00 2001 From: Kocma-san <112967882+Kocma-san@users.noreply.github.com> Date: Fri, 4 Jul 2025 23:36:30 +0700 Subject: [PATCH] Free photocopier is now really free (#91894) --- _maps/map_files/generic/CentCom.dmm | 6 +++--- code/modules/paperwork/photocopier.dm | 22 +++++++++++++--------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/_maps/map_files/generic/CentCom.dmm b/_maps/map_files/generic/CentCom.dmm index 64c37d5e26c..98db0923396 100644 --- a/_maps/map_files/generic/CentCom.dmm +++ b/_maps/map_files/generic/CentCom.dmm @@ -1601,7 +1601,7 @@ /turf/open/floor/iron/dark, /area/centcom/tdome/observation) "hx" = ( -/obj/machinery/photocopier/prebuilt, +/obj/machinery/photocopier/gratis/prebuilt, /turf/open/floor/iron/grimy, /area/centcom/central_command_areas/briefing) "hz" = ( @@ -3146,10 +3146,10 @@ /turf/open/floor/iron, /area/centcom/central_command_areas/supply) "ou" = ( -/obj/machinery/photocopier/prebuilt, /obj/effect/turf_decal/stripes/line{ dir = 6 }, +/obj/machinery/photocopier/gratis/prebuilt, /turf/open/floor/iron, /area/centcom/central_command_areas/supply) "ov" = ( @@ -7353,7 +7353,6 @@ /turf/open/floor/iron/dark, /area/centcom/central_command_areas/supply) "HY" = ( -/obj/machinery/photocopier/prebuilt, /obj/machinery/button/door/indestructible{ id = "CCsec3"; name = "CC Shutter 3 Control"; @@ -7377,6 +7376,7 @@ pixel_x = -9; pixel_y = 32 }, +/obj/machinery/photocopier/gratis/prebuilt, /turf/open/floor/iron/dark, /area/centcom/central_command_areas/control) "HZ" = ( diff --git a/code/modules/paperwork/photocopier.dm b/code/modules/paperwork/photocopier.dm index cd6ead98d68..1801a23b155 100644 --- a/code/modules/paperwork/photocopier.dm +++ b/code/modules/paperwork/photocopier.dm @@ -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