From 4e528c257c8baddd03eb48aaefbcba3377bfb78b Mon Sep 17 00:00:00 2001 From: iero-srv <> Date: Mon, 17 Apr 2023 20:41:02 -0400 Subject: [PATCH] Squashed commit of the following: commit c9143749f3969981bd2b1628be33730b085a3279 Author: nevimer Date: Sun May 1 23:56:37 2022 -0400 run CI again commit 967bb8fc009630442d314d6abbf0d5b9e71efffb Author: nevimer Date: Sun May 1 21:55:27 2022 -0400 Makes the lathe tax a preference, fixes more. --- .../modules/research/machinery/_production.dm | 30 +------------------ config/game_options.txt | 4 +++ .../modules/research/techweb/protolathe.dm | 29 ++++++++++++++++++ tgstation.dme | 1 + 4 files changed, 35 insertions(+), 29 deletions(-) create mode 100644 modular_skyrat/master_files/code/modules/research/techweb/protolathe.dm diff --git a/code/modules/research/machinery/_production.dm b/code/modules/research/machinery/_production.dm index c39261512c5..7c043b545b7 100644 --- a/code/modules/research/machinery/_production.dm +++ b/code/modules/research/machinery/_production.dm @@ -287,35 +287,7 @@ say("Not enough reagents to complete prototype[print_quantity > 1? "s" : ""].") return FALSE - // Charge the lathe tax at least once per ten items. - var/total_cost = LATHE_TAX * max(round(print_quantity / 10), 1) - - if(!charges_tax) - total_cost = 0 - - if(isliving(usr)) - var/mob/living/user = usr - var/obj/item/card/id/card = user.get_idcard(TRUE) - - if(!card && istype(user.pulling, /obj/item/card/id)) - card = user.pulling - - if(card && card.registered_account) - var/datum/bank_account/our_acc = card.registered_account - if(our_acc.account_job.departments_bitflags & allowed_department_flags) - total_cost = 0 // We are not charging crew for printing their own supplies and equipment. - - if(attempt_charge(src, usr, total_cost) & COMPONENT_OBJ_CANCEL_CHARGE) - say("Insufficient funds to complete prototype. Please present a holochip or valid ID card.") - return FALSE - - if(iscyborg(usr)) - var/mob/living/silicon/robot/borg = usr - - if(!borg.cell) - return FALSE - - borg.cell.use(SILICON_LATHE_TAX) + lathe_tax() materials.mat_container.use_materials(efficient_mats, print_quantity) materials.silo_log(src, "built", -print_quantity, "[design.name]", efficient_mats) diff --git a/config/game_options.txt b/config/game_options.txt index e72fc3af8c4..4c113a217ce 100644 --- a/config/game_options.txt +++ b/config/game_options.txt @@ -551,6 +551,10 @@ MAXFINE 2000 ## Whether native FoV is enabled for all people. #NATIVE_FOV +## How much does the protolathe cost to use on station? Disabled is off. + +##PROTOLATHE_TAX 10 + ## Whether circuit sounds are allowed to be played or not. #DISALLOW_CIRCUIT_SOUNDS diff --git a/modular_skyrat/master_files/code/modules/research/techweb/protolathe.dm b/modular_skyrat/master_files/code/modules/research/techweb/protolathe.dm new file mode 100644 index 00000000000..80998cf3216 --- /dev/null +++ b/modular_skyrat/master_files/code/modules/research/techweb/protolathe.dm @@ -0,0 +1,29 @@ +/obj/machinery/rnd/production + var/total_cost = 0 + var/on_station_lathe = TRUE + var/free_lathe = FALSE + +/obj/machinery/rnd/production/proc/lathe_tax() + total_cost ? (free_lathe ? 0 : total_cost) : (CONFIG_GET(number/protolathe_tax)) + + if(is_station_level(z) && on_station_lathe && total_cost && !free_lathe) + var/mob/living/user = usr + var/obj/item/card/id/card = user.get_idcard(TRUE) + if(!card && istype(user.pulling, /obj/item/card/id)) + card = user.pulling + if(card) + var/datum/bank_account/our_acc = card.registered_account + if(our_acc.account_job && SSeconomy.get_dep_account(our_acc.account_job?.paycheck_department) == SSeconomy.get_dep_account(payment_department)) + total_cost = 0 //We are not charging crew for printing their own supplies and equipment. + if(!iscarbon(usr)) // catch all cyborg types + total_cost = 0 + if(attempt_charge(src, usr, total_cost) & COMPONENT_OBJ_CANCEL_CHARGE) + return FALSE + +/obj/machinery/rnd/production/protolathe/offstation + on_station_lathe = FALSE + +/datum/config_entry/number/protolathe_tax + default = 0 + min_val = 0 + max_val = 65535 diff --git a/tgstation.dme b/tgstation.dme index 90317860438..db9b785d823 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -5354,6 +5354,7 @@ #include "modular_skyrat\master_files\code\modules\research\designs\misc_designs.dm" #include "modular_skyrat\master_files\code\modules\research\machinery\departmental_circuit_imprinter.dm" #include "modular_skyrat\master_files\code\modules\research\techweb\all_nodes.dm" +#include "modular_skyrat\master_files\code\modules\research\techweb\protolathe.dm" #include "modular_skyrat\master_files\code\modules\shuttle\shuttle.dm" #include "modular_skyrat\master_files\code\modules\surgery\surgery.dm" #include "modular_skyrat\master_files\code\modules\surgery\organs\tongue.dm"