mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-20 03:26:37 +01:00
Updates Icons, mapping and mechanism per discussions
This commit is contained in:
@@ -1,22 +1,33 @@
|
||||
/obj/machinery/injector_maker
|
||||
name = "Ready-to-Use Medicine 3000"
|
||||
desc = "Fills plastic autoinjectors with chemicals! \n Add a beaker or a bottle filled with chemicals and an autoinjector of appropriate size to use!"
|
||||
desc = "Fills plastic autoinjectors with chemicals! Molds new injectors if needed! \n Add a beaker or a bottle filled with chemicals and an autoinjector of appropriate size or sheets of plastic to use!"
|
||||
icon = 'icons/obj/chemical_vr.dmi'
|
||||
icon_state = "injector"
|
||||
use_power = USE_POWER_IDLE
|
||||
anchored = FALSE
|
||||
anchored = TRUE
|
||||
density = FALSE
|
||||
layer = ABOVE_WINDOW_LAYER
|
||||
vis_flags = VIS_HIDE
|
||||
unacidable = TRUE
|
||||
clicksound = "button"
|
||||
clickvol = 30
|
||||
clickvol = 60
|
||||
idle_power_usage = 5
|
||||
active_power_usage = 100
|
||||
circuit = /obj/item/weapon/circuitboard/injector_maker
|
||||
var/obj/item/weapon/reagent_containers/beaker = null
|
||||
var/list/beaker_reagents_list = list()
|
||||
|
||||
|
||||
var/count_large_injector = 0
|
||||
var/count_small_injector = 0
|
||||
var/capacity_large_injector = 10
|
||||
var/capacity_small_injector = 30
|
||||
var/list/beaker_reagents_list = list()
|
||||
var/capacity_large_injector = 40
|
||||
var/capacity_small_injector = 40
|
||||
|
||||
var/count_plastic = 0 //Given in "units", not sheets
|
||||
var/value_plastic = 2000 //1 sheet translates to 2000 units
|
||||
var/cost_plastic_small = 30
|
||||
var/cost_plastic_large = 1500
|
||||
var/capacity_plastic = 60000 // cost_plastic_large * 40
|
||||
|
||||
|
||||
/obj/machinery/injector_maker/Initialize()
|
||||
@@ -24,14 +35,20 @@
|
||||
default_apply_parts()
|
||||
|
||||
/obj/machinery/injector_maker/update_icon()
|
||||
if(!count_large_injector && !count_small_injector && !beaker)
|
||||
if(!beaker && !count_plastic && !count_small_injector && !count_large_injector) //Empty
|
||||
icon_state = "injector"
|
||||
else if(!count_large_injector && !count_small_injector && beaker != null)
|
||||
else if(beaker != null && !count_plastic && !count_small_injector && !count_large_injector ) //Has just beaker
|
||||
icon_state = "injector_b"
|
||||
else if(!beaker && (count_large_injector > 0 || count_small_injector > 0))
|
||||
else if(!beaker && !count_plastic && (count_large_injector > 0 || count_small_injector > 0)) //Has just injectors
|
||||
icon_state = "injector_i"
|
||||
else if(beaker != null && count_large_injector > 0 && count_small_injector > 0)
|
||||
else if(!beaker && count_plastic > 0 && !count_large_injector && !count_small_injector) //Has just plastic
|
||||
icon_state = "injector_p"
|
||||
else if(beaker != null && !count_plastic && (count_large_injector > 0 || count_small_injector > 0)) //beaker + injectors
|
||||
icon_state = "injector_ib"
|
||||
else if(beaker != null && count_plastic > 0 && !count_large_injector && !count_small_injector) //beaker + plastic
|
||||
icon_state = "injector_pb"
|
||||
else if(beaker != null && count_plastic > 0 && (count_large_injector > 0 || count_small_injector > 0)) //Has everything
|
||||
icon_state = "injector_ipb"
|
||||
return
|
||||
|
||||
|
||||
@@ -67,7 +84,6 @@
|
||||
src.count_small_injector = src.count_small_injector + 1
|
||||
qdel(E)
|
||||
update_icon()
|
||||
|
||||
if(istype(O,/obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/empty))
|
||||
var/obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/empty/E = O
|
||||
if(src.count_large_injector >= src.capacity_large_injector)
|
||||
@@ -81,6 +97,22 @@
|
||||
update_icon()
|
||||
|
||||
|
||||
if(istype(O,/obj/item/stack/material))
|
||||
if(O.get_material_name() == MAT_PLASTIC)
|
||||
var/obj/item/stack/S = O
|
||||
var/input_amount = tgui_input_number(user, "How many sheets would you like to add?", "Add plastic", 0, S.get_amount(), 0, 0, TRUE)
|
||||
if(input_amount == 0)
|
||||
return
|
||||
var/plastic_input = input_amount * value_plastic
|
||||
var/free_space = capacity_plastic - src.count_plastic
|
||||
if(plastic_input > free_space)
|
||||
to_chat(user, SPAN_WARNING("Storage is full! There is only [free_space] units worth of space left!"))
|
||||
else
|
||||
S.use(input_amount)
|
||||
src.count_plastic = src.count_plastic + plastic_input
|
||||
update_icon()
|
||||
|
||||
|
||||
/obj/machinery/injector_maker/AltClick(mob/user)
|
||||
. = ..()
|
||||
if(beaker)
|
||||
@@ -88,7 +120,7 @@
|
||||
user.put_in_hands(beaker)
|
||||
else
|
||||
beaker.forceMove(drop_location())
|
||||
beaker = null
|
||||
src.beaker = null
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/injector_maker/examine(mob/user)
|
||||
@@ -102,11 +134,12 @@
|
||||
if(beaker)
|
||||
. += "<span class='notice'>- \A [beaker].</span>"
|
||||
|
||||
. += "<span class ='notice'>\The [src] contains [count_small_injector] small injectors and [count_large_injector] large injectors.\n </span>"
|
||||
. += "<span_class ='notice'> It can hold [capacity_small_injector] small and [capacity_large_injector] large injectors respectively.\n </span>"
|
||||
. += "<span class ='notice'>\The [src] contains [src.count_small_injector] small injectors and [src.count_large_injector] large injectors.\n </span>"
|
||||
. += "<span class ='notice'> It can hold [capacity_small_injector] small and [capacity_large_injector] large injectors respectively.\n </span>"
|
||||
. += "<span class ='notice'> \The [src] contains [src.count_plastic] units of plastic. It can hold up to [capacity_plastic] units.\n </span>"
|
||||
|
||||
if(!(stat & (NOPOWER|BROKEN)))
|
||||
. += "<span class='notice'>The status display reads:</span>\n"
|
||||
. += "<span class='notice'>The status display reads the following reagents:</span>\n"
|
||||
if(beaker)
|
||||
for(var/datum/reagent/R in beaker.reagents.reagent_list)
|
||||
. += "<span class='notice'>- [R.volume] units of [R.name].</span>"
|
||||
@@ -128,63 +161,121 @@
|
||||
user.put_in_hands(beaker)
|
||||
else
|
||||
beaker.forceMove(drop_location())
|
||||
beaker = null
|
||||
src.beaker = null
|
||||
update_icon()
|
||||
|
||||
|
||||
if("small injector")
|
||||
var/material = tgui_input_list(user, "Use autoinjector storage, or mold new injectors to fill?", "Choose Material", list("mold plastic", "use injectors"))
|
||||
switch(material)
|
||||
if("mold plastic")
|
||||
if(src.count_plastic < cost_plastic_small)
|
||||
to_chat(user, SPAN_WARNING("Not enough plastic! Need at least [cost_plastic_small] units."))
|
||||
return
|
||||
if("use injectors")
|
||||
if(!src.count_small_injector)
|
||||
to_chat(user, SPAN_WARNING("Small injector rack is empty!"))
|
||||
return
|
||||
if(!beaker.reagents.total_volume)
|
||||
to_chat(user, SPAN_WARNING("Chemical storage is empty!"))
|
||||
return
|
||||
if(!src.capacity_small_injector)
|
||||
to_chat(user, SPAN_WARNING("Small injector rack is empty!!"))
|
||||
return
|
||||
var/injector_amount = tgui_input_number(user, "How many injectors would you like?", "Make small injectors", 0, 100, 0, 0, TRUE)
|
||||
if(injector_amount > 0)
|
||||
|
||||
if(src.count_small_injector < injector_amount )
|
||||
to_chat(user, SPAN_WARNING("Not enough autoinjectors! You only have [src.count_small_injector]"))
|
||||
return
|
||||
switch(material)
|
||||
if("mold plastic")
|
||||
var/plastic_cost = cost_plastic_small * injector_amount
|
||||
if(src.count_plastic < plastic_cost)
|
||||
to_chat(user, SPAN_WARNING("Not enough plastic! Need at least [plastic_cost] units."))
|
||||
return
|
||||
if("use injectors")
|
||||
if(src.count_small_injector < injector_amount)
|
||||
to_chat(user, SPAN_WARNING("Not enough autoinjectors! You only have [src.count_small_injector]"))
|
||||
return
|
||||
var/name = sanitize(tgui_input_text(user, "Name Injector", "Naming", null, 32, 0, 0, 0, 0),MAX_MESSAGE_LEN,0,0,0)
|
||||
make_injector("large injector", injector_amount, name)
|
||||
make_injector("large injector", injector_amount, name, material, user)
|
||||
update_icon()
|
||||
|
||||
|
||||
if("large injector")
|
||||
var/material = tgui_input_list(user, "Use autoinjector storage, or mold new injectors to fill?", "Choose Material", list("mold plastic", "use injectors"))
|
||||
switch(material)
|
||||
if("mold plastic")
|
||||
if(src.count_plastic < cost_plastic_large)
|
||||
to_chat(user, SPAN_WARNING("Not enough plastic! Need at least [cost_plastic_large] units."))
|
||||
return
|
||||
if("use injectors")
|
||||
if(!src.count_large_injector)
|
||||
to_chat(user, SPAN_WARNING("Large injector rack is empty!"))
|
||||
return
|
||||
if(!beaker.reagents.total_volume)
|
||||
to_chat(user, SPAN_WARNING("Chemical storage is empty!"))
|
||||
return
|
||||
if(!src.capacity_large_injector)
|
||||
to_chat(user, SPAN_WARNING("Large injector rack is empty!"))
|
||||
return
|
||||
var/injector_amount = tgui_input_number(user, "How many injectors would you like?", "Make small injectors", 0, 100, 0, 0, TRUE)
|
||||
var/injector_amount = tgui_input_number(user, "How many injectors would you like?", "Make large injectors", 0, 100, 0, 0, TRUE)
|
||||
if(injector_amount > 0)
|
||||
if(src.count_large_injector < injector_amount)
|
||||
to_chat(user, SPAN_WARNING("Not enough autoinjectors! You only have [src.count_large_injector]"))
|
||||
return
|
||||
switch(material)
|
||||
if("mold plastic")
|
||||
var/plastic_cost = cost_plastic_large * injector_amount
|
||||
if(src.count_plastic < plastic_cost)
|
||||
to_chat(user, SPAN_WARNING("Not enough plastic! Need at least [plastic_cost] units."))
|
||||
return
|
||||
if("use injectors")
|
||||
if(src.count_large_injector < injector_amount)
|
||||
to_chat(user, SPAN_WARNING("Not enough autoinjectors! You only have [src.count_large_injector]"))
|
||||
return
|
||||
var/name = sanitize(tgui_input_text(user, "Name Injector", "Naming", null, 32, 0, 0, 0, 0),MAX_MESSAGE_LEN,0,0,0)
|
||||
make_injector("large injector", injector_amount, name)
|
||||
make_injector("large injector", injector_amount, name, material,user)
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/injector_maker/proc/make_injector(var/size, var/amount, var/new_name)
|
||||
|
||||
/obj/machinery/injector_maker/proc/make_injector(var/size, var/amount, var/new_name, var/material, mob/user as mob)
|
||||
if(!beaker)
|
||||
return
|
||||
var/amount_per_injector = null
|
||||
var/proceed = "Yes" //Defaulting to Yes. We only check if the amount/injector gets under max volume
|
||||
switch(size)
|
||||
if("small injector")
|
||||
amount_per_injector = CLAMP(beaker.reagents.total_volume / amount, 0, 5)
|
||||
if("large injector")
|
||||
amount_per_injector = CLAMP(beaker.reagents.total_volume / amount, 0, 15)
|
||||
if((size == "small injector" && amount_per_injector < 5) || size == "large injector" && amount_per_injector < 15)
|
||||
proceed = tgui_alert(usr, "Heads up! Less than max volume per injector!\n Making [amount] [size](s) filled with [amount_per_injector] total reagent volume each!","Proceed?",list("No","Yes"))
|
||||
if(proceed == "No" || !amount_per_injector)
|
||||
return
|
||||
for(var/i, i < amount, i++)
|
||||
switch(size)
|
||||
if("small injector")
|
||||
var/amount_per_injector = CLAMP(beaker.reagents.total_volume / amount, 0, 15)
|
||||
if(!amount_per_injector || src.count_small_injector < 1)
|
||||
return
|
||||
switch(material)
|
||||
if("mold plastic")
|
||||
if(src.count_plastic < cost_plastic_small)
|
||||
return
|
||||
else
|
||||
src.count_plastic = src.count_plastic - cost_plastic_small
|
||||
if("use injectors")
|
||||
if(!src.count_small_injector)
|
||||
return
|
||||
else
|
||||
src.count_small_injector = src.count_small_injector - 1
|
||||
var/obj/item/weapon/reagent_containers/hypospray/autoinjector/empty/P = new(loc)
|
||||
beaker.reagents.trans_to_obj(P, amount_per_injector)
|
||||
P.update_icon()
|
||||
if(new_name)
|
||||
P.name = new_name
|
||||
src.count_small_injector = src.count_small_injector - 1
|
||||
|
||||
|
||||
if("large injector")
|
||||
var/amount_per_injector = CLAMP(beaker.reagents.total_volume / amount, 0, 15)
|
||||
if(!amount_per_injector || src.count_large_injector < 1)
|
||||
return
|
||||
switch(material)
|
||||
if("mold plastic")
|
||||
if(src.count_plastic < cost_plastic_large)
|
||||
return
|
||||
else
|
||||
src.count_plastic = src.count_plastic - cost_plastic_large
|
||||
if("use injectors")
|
||||
if(!src.count_large_injector)
|
||||
return
|
||||
else
|
||||
src.count_large_injector = src.count_large_injector - 1
|
||||
var/obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/empty/P = new(loc)
|
||||
beaker.reagents.trans_to_obj(P, amount_per_injector)
|
||||
P.update_icon()
|
||||
if(new_name)
|
||||
P.name = new_name
|
||||
src.count_large_injector = src.count_large_injector - 1
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.9 KiB |
@@ -2739,6 +2739,9 @@
|
||||
/obj/machinery/light{
|
||||
dir = 8
|
||||
},
|
||||
/obj/machinery/injector_maker{
|
||||
pixel_x = -29
|
||||
},
|
||||
/turf/simulated/floor/tiled/white,
|
||||
/area/groundbase/medical/Chemistry)
|
||||
"hK" = (
|
||||
@@ -14968,7 +14971,9 @@
|
||||
dir = 1
|
||||
},
|
||||
/obj/structure/table/glass,
|
||||
/obj/machinery/injector_maker,
|
||||
/obj/machinery/injector_maker{
|
||||
pixel_y = -31
|
||||
},
|
||||
/turf/simulated/floor/tiled/white,
|
||||
/area/groundbase/medical/triage)
|
||||
"QG" = (
|
||||
|
||||
@@ -4177,6 +4177,9 @@
|
||||
/obj/item/weapon/reagent_containers/glass/beaker/large,
|
||||
/obj/item/weapon/reagent_containers/dropper,
|
||||
/obj/machinery/atmospherics/unary/vent_pump/on,
|
||||
/obj/machinery/injector_maker{
|
||||
pixel_y = 21
|
||||
},
|
||||
/turf/simulated/floor/tiled/eris/white/bluecorner,
|
||||
/area/medical/chemistry)
|
||||
"jg" = (
|
||||
@@ -4436,10 +4439,6 @@
|
||||
/area/stellardelight/deck2/fore)
|
||||
"jK" = (
|
||||
/obj/structure/table/glass,
|
||||
/obj/machinery/camera/network/medbay{
|
||||
dir = 4
|
||||
},
|
||||
/obj/machinery/injector_maker,
|
||||
/turf/simulated/floor/tiled/eris/white/bluecorner,
|
||||
/area/stellardelight/deck2/triage)
|
||||
"jL" = (
|
||||
@@ -22227,6 +22226,9 @@
|
||||
/obj/machinery/camera/network/medbay{
|
||||
dir = 8
|
||||
},
|
||||
/obj/machinery/injector_maker{
|
||||
pixel_x = 29
|
||||
},
|
||||
/turf/simulated/floor/tiled/eris/white/bluecorner,
|
||||
/area/stellardelight/deck2/triage)
|
||||
"WZ" = (
|
||||
|
||||
@@ -407,8 +407,6 @@
|
||||
dir = 6
|
||||
},
|
||||
/obj/machinery/camera/network/medbay,
|
||||
/obj/structure/table/glass,
|
||||
/obj/machinery/injector_maker,
|
||||
/turf/simulated/floor/tiled/white,
|
||||
/area/tether/surfacebase/medical/triage)
|
||||
"aaJ" = (
|
||||
@@ -5331,6 +5329,9 @@
|
||||
pixel_x = -4;
|
||||
pixel_y = 5
|
||||
},
|
||||
/obj/machinery/injector_maker{
|
||||
pixel_x = -27
|
||||
},
|
||||
/turf/simulated/floor/tiled/white,
|
||||
/area/tether/surfacebase/medical/triage)
|
||||
"ahP" = (
|
||||
@@ -7071,8 +7072,8 @@
|
||||
/obj/machinery/light{
|
||||
dir = 4
|
||||
},
|
||||
/obj/structure/sign/poster{
|
||||
dir = 4
|
||||
/obj/machinery/injector_maker{
|
||||
pixel_x = 28
|
||||
},
|
||||
/turf/simulated/floor/tiled/white,
|
||||
/area/tether/surfacebase/medical/chemistry)
|
||||
|
||||
Reference in New Issue
Block a user