mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-13 11:43:31 +00:00
Added code to allow adding more steel or glass to the synth body printer.
This commit is contained in:
@@ -111,7 +111,7 @@
|
|||||||
|
|
||||||
var/spods_list_ui[0]
|
var/spods_list_ui[0]
|
||||||
for(var/obj/machinery/transhuman/synthprinter/spod in spods)
|
for(var/obj/machinery/transhuman/synthprinter/spod in spods)
|
||||||
spods_list_ui[++spods_list_ui.len] = list("spod" = spod, "steel" = spod.steel, "glass" = spod.glass)
|
spods_list_ui[++spods_list_ui.len] = list("spod" = spod, "steel" = spod.stored_material[DEFAULT_WALL_MATERIAL], "glass" = spod.stored_material["glass"])
|
||||||
|
|
||||||
var/sleevers_list_ui[0]
|
var/sleevers_list_ui[0]
|
||||||
for(var/obj/machinery/transhuman/resleever/resleever in sleevers)
|
for(var/obj/machinery/transhuman/resleever/resleever in sleevers)
|
||||||
@@ -229,9 +229,9 @@
|
|||||||
temp = "Error: SynthFab is currently busy."
|
temp = "Error: SynthFab is currently busy."
|
||||||
|
|
||||||
//Not enough steel or glass
|
//Not enough steel or glass
|
||||||
else if(spod.steel < spod.body_cost)
|
else if(spod.stored_material[DEFAULT_WALL_MATERIAL] < spod.body_cost)
|
||||||
temp = "Error: Not enough steel in SynthFab."
|
temp = "Error: Not enough [DEFAULT_WALL_MATERIAL] in SynthFab."
|
||||||
else if(spod.glass < spod.body_cost)
|
else if(spod.stored_material["glass"] < spod.body_cost)
|
||||||
temp = "Error: Not enough glass in SynthFab."
|
temp = "Error: Not enough glass in SynthFab."
|
||||||
|
|
||||||
//Gross pod (broke mid-cloning or something).
|
//Gross pod (broke mid-cloning or something).
|
||||||
|
|||||||
@@ -150,8 +150,7 @@
|
|||||||
density = 1
|
density = 1
|
||||||
anchored = 1
|
anchored = 1
|
||||||
|
|
||||||
var/steel = 30000 //Starting steel
|
var/list/stored_material = list(DEFAULT_WALL_MATERIAL = 30000, "glass" = 30000)
|
||||||
var/glass = 30000 //Starting glass
|
|
||||||
var/connected //What console it's done up with
|
var/connected //What console it's done up with
|
||||||
var/busy = 0 //Busy cloning
|
var/busy = 0 //Busy cloning
|
||||||
var/body_cost = 15000 //Cost of a cloned body (metal and glass ea.)
|
var/body_cost = 15000 //Cost of a cloned body (metal and glass ea.)
|
||||||
@@ -189,7 +188,7 @@
|
|||||||
if(!istype(BR) || busy)
|
if(!istype(BR) || busy)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
if(steel < body_cost || glass < body_cost)
|
if(stored_material[DEFAULT_WALL_MATERIAL] < body_cost || stored_material["glass"] < body_cost)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
current_project = BR
|
current_project = BR
|
||||||
@@ -249,8 +248,8 @@
|
|||||||
H.adjustFireLoss(20)
|
H.adjustFireLoss(20)
|
||||||
|
|
||||||
//Cha-ching.
|
//Cha-ching.
|
||||||
steel -= body_cost
|
stored_material[DEFAULT_WALL_MATERIAL] -= body_cost
|
||||||
glass -= body_cost
|
stored_material["glass"] -= body_cost
|
||||||
|
|
||||||
//Plonk them here.
|
//Plonk them here.
|
||||||
H.loc = get_turf(src)
|
H.loc = get_turf(src)
|
||||||
@@ -267,13 +266,42 @@
|
|||||||
|
|
||||||
/obj/machinery/transhuman/synthprinter/attackby(obj/item/W as obj, mob/user as mob)
|
/obj/machinery/transhuman/synthprinter/attackby(obj/item/W as obj, mob/user as mob)
|
||||||
src.add_fingerprint(user)
|
src.add_fingerprint(user)
|
||||||
|
if(busy)
|
||||||
|
user << "<span class='notice'>\The [src] is busy. Please wait for completion of previous operation.</span>"
|
||||||
|
return
|
||||||
if(default_deconstruction_screwdriver(user, W))
|
if(default_deconstruction_screwdriver(user, W))
|
||||||
return
|
return
|
||||||
if(default_deconstruction_crowbar(user, W))
|
if(default_deconstruction_crowbar(user, W))
|
||||||
return
|
return
|
||||||
if(default_part_replacement(user, W))
|
if(default_part_replacement(user, W))
|
||||||
return
|
return
|
||||||
return ..()
|
if(panel_open)
|
||||||
|
user << "<span class='notice'>You can't load \the [src] while it's opened.</span>"
|
||||||
|
return
|
||||||
|
if(!istype(W, /obj/item/stack/material))
|
||||||
|
user << "<span class='notice'>You cannot insert this item into \the [src]!</span>"
|
||||||
|
return
|
||||||
|
|
||||||
|
var/obj/item/stack/material/S = W
|
||||||
|
if(!(S.material.name in stored_material))
|
||||||
|
user << "<span class='warning'>\the [src] doesn't accept [S.material]!</span>"
|
||||||
|
return
|
||||||
|
|
||||||
|
var/amnt = S.perunit
|
||||||
|
var/max_res_amount = 30000
|
||||||
|
if(stored_material[S.material.name] + amnt <= max_res_amount)
|
||||||
|
if(S && S.amount >= 1)
|
||||||
|
var/count = 0
|
||||||
|
while(stored_material[S.material.name] + amnt <= max_res_amount && S.amount >= 1)
|
||||||
|
stored_material[S.material.name] += amnt
|
||||||
|
S.use(1)
|
||||||
|
count++
|
||||||
|
user << "You insert [count] [S.name] into \the [src]."
|
||||||
|
else
|
||||||
|
user << "\the [src] cannot hold more [S.name]."
|
||||||
|
|
||||||
|
updateUsrDialog()
|
||||||
|
return
|
||||||
|
|
||||||
/obj/machinery/transhuman/synthprinter/update_icon()
|
/obj/machinery/transhuman/synthprinter/update_icon()
|
||||||
..()
|
..()
|
||||||
|
|||||||
Reference in New Issue
Block a user