mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 18:32:03 +00:00
Fix #6532.
This commit is contained in:
@@ -104,25 +104,41 @@
|
|||||||
R << "<span class='warning'>You need to select a sheet type first!</span>"
|
R << "<span class='warning'>You need to select a sheet type first!</span>"
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
if(material_type && matter)
|
if (material_type && matter >= 1)
|
||||||
var/modifier = MAT_COST_COMMON
|
var/modifier
|
||||||
if(initial(active_material.perunit) < 3750) //Synthesizing is EXPENSIVE
|
var/unit_can_produce
|
||||||
modifier = MAT_COST_MEDIUM
|
var/tospawn
|
||||||
if(initial(active_material.perunit) < 2000)
|
var/per_unit = initial(active_material.perunit)
|
||||||
|
|
||||||
|
if (per_unit < 2000)
|
||||||
modifier = MAT_COST_RARE
|
modifier = MAT_COST_RARE
|
||||||
var/tospawn = input(user, "How many sheets of [initial(material_type.name)] do you want to synthesize? (0 - [matter / modifier])", "Material Synthesizer") as num
|
else if (per_unit < 3750)
|
||||||
tospawn = Clamp(round(tospawn, 1), 0, round(matter / modifier, 1))
|
modifier = MAT_COST_MEDIUM
|
||||||
if(tospawn && material_type)
|
else
|
||||||
var/obj/item/stack/sheet/spawned_sheet = new material_type(get_turf(src))
|
modifier = MAT_COST_COMMON
|
||||||
spawned_sheet.amount = tospawn
|
|
||||||
TakeCost(tospawn, modifier, user)
|
unit_can_produce = round(matter / modifier)
|
||||||
else if(matter)
|
|
||||||
|
if (unit_can_produce >= 1)
|
||||||
|
tospawn = input(user, "How many sheets of [initial(material_type.name)] do you want to synthesize? (0 - [unit_can_produce])", "Material Synthesizer") as num
|
||||||
|
tospawn = Clamp(round(tospawn), 0, unit_can_produce)
|
||||||
|
|
||||||
|
if (tospawn >= 1)
|
||||||
|
var/obj/item/stack/sheet/spawned_sheet = new material_type(get_turf(src))
|
||||||
|
spawned_sheet.amount = tospawn
|
||||||
|
|
||||||
|
TakeCost(tospawn, modifier, user)
|
||||||
|
else
|
||||||
|
user << "<span class='warning'>\The [src] matter is not enough to create the selected material!</span>"
|
||||||
|
return
|
||||||
|
else if (matter >= 1)
|
||||||
user << "<span class='warning'>You must select a sheet type first!</span>"
|
user << "<span class='warning'>You must select a sheet type first!</span>"
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
user << "<span class='warning'>\The [src] is empty!</span>"
|
user << "<span class='warning'>\The [src] is empty!</span>"
|
||||||
|
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
/obj/item/device/material_synth/afterattack(atom/target, mob/user, proximity_flag, click_parameters)
|
/obj/item/device/material_synth/afterattack(atom/target, mob/user, proximity_flag, click_parameters)
|
||||||
if(!proximity_flag)
|
if(!proximity_flag)
|
||||||
return 0 // not adjacent
|
return 0 // not adjacent
|
||||||
|
|||||||
Reference in New Issue
Block a user