mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Adds Uranium Capability to Circuit Imprinters
Well, looking over the RUST circuits... They required uranium which we didn't even have implemented in the code to work with circuit imprinters. I considered simply changing them to use a different resource, but it honestly makes more sense to improve the current code to have it more versatile-- To this end, I've made circuit imprinters capable of using uranium. As a further note... closes #2757
This commit is contained in:
@@ -12,6 +12,7 @@ using metal and glass, it uses glass and reagents (usually sulfuric acis).
|
||||
var/g_amount = 0
|
||||
var/gold_amount = 0
|
||||
var/diamond_amount = 0
|
||||
var/uranium_amount = 0
|
||||
var/max_material_amount = 75000.0
|
||||
|
||||
New()
|
||||
@@ -46,7 +47,7 @@ using metal and glass, it uses glass and reagents (usually sulfuric acis).
|
||||
return
|
||||
|
||||
proc/TotalMaterials()
|
||||
return g_amount + gold_amount + diamond_amount
|
||||
return g_amount + gold_amount + diamond_amount + uranium_amount
|
||||
|
||||
attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
if (shocked)
|
||||
@@ -85,19 +86,23 @@ using metal and glass, it uses glass and reagents (usually sulfuric acis).
|
||||
if(diamond_amount >= 2000)
|
||||
var/obj/item/stack/sheet/mineral/diamond/G = new /obj/item/stack/sheet/mineral/diamond(src.loc)
|
||||
G.amount = round(diamond_amount / 2000)
|
||||
if(uranium_amount >= 2000)
|
||||
var/obj/item/stack/sheet/mineral/uranium/G = new /obj/item/stack/sheet/mineral/uranium(src.loc)
|
||||
G.amount = round(uranium_amount / 2000)
|
||||
del(src)
|
||||
return 1
|
||||
else
|
||||
user << "\red You can't load the [src.name] while it's opened."
|
||||
return 1
|
||||
if (disabled)
|
||||
user << "\The [name] appears to not be working!"
|
||||
return
|
||||
if (!linked_console)
|
||||
user << "\The [name] must be linked to an R&D console first!"
|
||||
return 1
|
||||
if (O.is_open_container())
|
||||
return 1
|
||||
if (!istype(O, /obj/item/stack/sheet/glass) && !istype(O, /obj/item/stack/sheet/mineral/gold) && !istype(O, /obj/item/stack/sheet/mineral/diamond))
|
||||
if (!istype(O, /obj/item/stack/sheet/glass) && !istype(O, /obj/item/stack/sheet/mineral/gold) && !istype(O, /obj/item/stack/sheet/mineral/diamond) && !istype(O, /obj/item/stack/sheet/mineral/uranium))
|
||||
user << "\red You cannot insert this item into the [name]!"
|
||||
return 1
|
||||
if (stat)
|
||||
@@ -128,6 +133,8 @@ using metal and glass, it uses glass and reagents (usually sulfuric acis).
|
||||
gold_amount += amount * 2000
|
||||
else if(istype(stack, /obj/item/stack/sheet/mineral/diamond))
|
||||
diamond_amount += amount * 2000
|
||||
else if(istype(stack, /obj/item/stack/sheet/mineral/uranium))
|
||||
uranium_amount += amount * 2000
|
||||
stack.use(amount)
|
||||
busy = 0
|
||||
src.updateUsrDialog()
|
||||
|
||||
@@ -429,6 +429,8 @@ won't update every console in existence) but it's more of a hassle to do. Also,
|
||||
linked_imprinter.gold_amount = max(0, (linked_imprinter.gold_amount-being_built.materials[M]))
|
||||
if("$diamond")
|
||||
linked_imprinter.diamond_amount = max(0, (linked_imprinter.diamond_amount-being_built.materials[M]))
|
||||
if("$uranium")
|
||||
linked_imprinter.uranium_amount = max(0, (linked_imprinter.uranium_amount-being_built.materials[M]))
|
||||
else
|
||||
linked_imprinter.reagents.remove_reagent(M, being_built.materials[M])
|
||||
var/obj/new_item = new being_built.build_path(src)
|
||||
@@ -500,6 +502,9 @@ won't update every console in existence) but it's more of a hassle to do. Also,
|
||||
if("diamond")
|
||||
type = /obj/item/stack/sheet/mineral/diamond
|
||||
res_amount = "diamond_amount"
|
||||
if("uranium")
|
||||
type = /obj/item/stack/sheet/mineral/uranium
|
||||
res_amount = "uranium_amount"
|
||||
if(ispath(type) && hasvar(linked_imprinter, res_amount))
|
||||
var/obj/item/stack/sheet/sheet = new type(linked_imprinter.loc)
|
||||
var/available_num_sheets = round(linked_imprinter.vars[res_amount]/sheet.perunit)
|
||||
@@ -851,6 +856,8 @@ won't update every console in existence) but it's more of a hassle to do. Also,
|
||||
if(D.materials[M] > linked_imprinter.gold_amount) check_materials = 0
|
||||
if("$diamond")
|
||||
if(D.materials[M] > linked_imprinter.diamond_amount) check_materials = 0
|
||||
if("$uranium")
|
||||
if(D.materials[M] > linked_imprinter.uranium_amount) check_materials = 0
|
||||
else if (!linked_imprinter.reagents.has_reagent(M, D.materials[M]))
|
||||
check_materials = 0
|
||||
if (check_materials)
|
||||
@@ -891,6 +898,13 @@ won't update every console in existence) but it's more of a hassle to do. Also,
|
||||
if(linked_imprinter.diamond_amount >= 2000) dat += "<A href='?src=\ref[src];imprinter_ejectsheet=diamond;imprinter_ejectsheet_amt=1'>(1 Sheet)</A> "
|
||||
if(linked_imprinter.diamond_amount >= 10000) dat += "<A href='?src=\ref[src];imprinter_ejectsheet=diamond;imprinter_ejectsheet_amt=5'>(5 Sheets)</A> "
|
||||
if(linked_imprinter.diamond_amount >= 2000) dat += "<A href='?src=\ref[src];imprinter_ejectsheet=diamond;imprinter_ejectsheet_amt=50'>(Max Sheets)</A>"
|
||||
dat += "<BR>"
|
||||
//Uranium
|
||||
dat += "* [linked_imprinter.uranium_amount] cm<sup>3</sup> of Uranium || "
|
||||
dat += "Eject: "
|
||||
if(linked_imprinter.uranium_amount >= 2000) dat += "<A href='?src=\ref[src];imprinter_ejectsheet=uranium;imprinter_ejectsheet_amt=1'>(1 Sheet)</A> "
|
||||
if(linked_imprinter.uranium_amount >= 10000) dat += "<A href='?src=\ref[src];imprinter_ejectsheet=uranium;imprinter_ejectsheet_amt=5'>(5 Sheets)</A> "
|
||||
if(linked_imprinter.uranium_amount >= 2000) dat += "<A href='?src=\ref[src];imprinter_ejectsheet=uranium;imprinter_ejectsheet_amt=50'>(Max Sheets)</A>"
|
||||
|
||||
user << browse("<TITLE>Research and Development Console</TITLE><HR>[dat]", "window=rdconsole;size=575x400")
|
||||
onclose(user, "rdconsole")
|
||||
|
||||
@@ -225,7 +225,7 @@ datum/tech/programming
|
||||
|
||||
datum/tech/syndicate
|
||||
name = "Illegal Technologies Research"
|
||||
desc = "The study of technologies that violate Nanotrassen regulations."
|
||||
desc = "The study of technologies that violate standard Nanotrasen regulations."
|
||||
id = "syndicate"
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user