mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2025-12-10 18:02:57 +00:00
61 lines
1.9 KiB
Plaintext
61 lines
1.9 KiB
Plaintext
|
|
|
|
/*
|
|
Destructive Analyzer
|
|
|
|
It is used to destroy hand-held objects and advance technological research. Controls are in the linked R&D console.
|
|
|
|
Note: Must be placed within 3 tiles of the R&D Console
|
|
*/
|
|
/obj/machinery/r_n_d/destructive_analyzer
|
|
name = "destructive analyzer"
|
|
desc = "Learn science by destroying things!"
|
|
icon_state = "d_analyzer"
|
|
circuit = /obj/item/circuitboard/machine/destructive_analyzer
|
|
var/decon_mod = 0
|
|
|
|
/obj/machinery/r_n_d/destructive_analyzer/RefreshParts()
|
|
var/T = 0
|
|
for(var/obj/item/stock_parts/S in component_parts)
|
|
T += S.rating
|
|
decon_mod = T
|
|
|
|
|
|
/obj/machinery/r_n_d/destructive_analyzer/proc/ConvertReqString2List(list/source_list)
|
|
var/list/temp_list = params2list(source_list)
|
|
for(var/O in temp_list)
|
|
temp_list[O] = text2num(temp_list[O])
|
|
return temp_list
|
|
|
|
/obj/machinery/r_n_d/destructive_analyzer/disconnect_console()
|
|
linked_console.linked_destroy = null
|
|
..()
|
|
|
|
/obj/machinery/r_n_d/destructive_analyzer/Insert_Item(obj/item/O, mob/user)
|
|
if(user.a_intent != INTENT_HARM)
|
|
. = 1
|
|
if(!is_insertion_ready(user))
|
|
return
|
|
if(!O.origin_tech)
|
|
to_chat(user, "<span class='warning'>This doesn't seem to have a tech origin!</span>")
|
|
return
|
|
var/list/temp_tech = ConvertReqString2List(O.origin_tech)
|
|
if (temp_tech.len == 0)
|
|
to_chat(user, "<span class='warning'>You cannot deconstruct this item!</span>")
|
|
return
|
|
if(!user.transferItemToLoc(O, src))
|
|
to_chat(user, "<span class='warning'>\The [O] is stuck to your hand, you cannot put it in the [src.name]!</span>")
|
|
return
|
|
busy = TRUE
|
|
loaded_item = O
|
|
to_chat(user, "<span class='notice'>You add the [O.name] to the [src.name]!</span>")
|
|
flick("d_analyzer_la", src)
|
|
addtimer(CALLBACK(src, .proc/finish_loading), 10)
|
|
|
|
/obj/machinery/r_n_d/destructive_analyzer/proc/finish_loading()
|
|
update_icon()
|
|
busy = FALSE
|
|
|
|
/obj/machinery/r_n_d/destructive_analyzer/update_icon()
|
|
icon_state = "d_analyzer_l"
|