mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-11 18:22:14 +00:00
Squashed commit of the following:
commit c9143749f3969981bd2b1628be33730b085a3279 Author: nevimer <foxmail@protonmail.com> Date: Sun May 1 23:56:37 2022 -0400 run CI again commit 967bb8fc009630442d314d6abbf0d5b9e71efffb Author: nevimer <foxmail@protonmail.com> Date: Sun May 1 21:55:27 2022 -0400 Makes the lathe tax a preference, fixes more.
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user