module things, jfc

This commit is contained in:
Poojawa
2018-09-11 07:51:01 -05:00
parent 8b9ef1e400
commit 284e9d0325
695 changed files with 11343 additions and 5661 deletions
@@ -36,10 +36,6 @@ Note: Must be placed within 3 tiles of the R&D Console
. = 1
if(!is_insertion_ready(user))
return
if(istype (O, /obj/item/bodybag/bluespace)) // CITADEL ADD. STOP PUTTING FUCKING BORGS INTO THE ANALYZER
if(O.contents.len != 0)
to_chat(user, "<span class='warning'>\The [O] has dangerous levels of activity, you cannot put it in the [src.name]!</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
@@ -63,11 +59,14 @@ Note: Must be placed within 3 tiles of the R&D Console
/obj/machinery/rnd/destructive_analyzer/proc/reclaim_materials_from(obj/item/thing)
. = 0
if(linked_console && linked_console.linked_lathe) //Also sends salvaged materials to a linked protolathe, if any.
var/datum/component/material_container/storage = linked_console?.linked_lathe?.materials.mat_container
if(storage) //Also sends salvaged materials to a linked protolathe, if any.
for(var/material in thing.materials)
var/can_insert = min((linked_console.linked_lathe.materials.max_amount - linked_console.linked_lathe.materials.total_amount), (max(thing.materials[material]*(decon_mod/10), thing.materials[material])))
linked_console.linked_lathe.materials.insert_amount(can_insert, material)
var/can_insert = min((storage.max_amount - storage.total_amount), (max(thing.materials[material]*(decon_mod/10), thing.materials[material])))
storage.insert_amount(can_insert, material)
. += can_insert
if (.)
linked_console.linked_lathe.materials.silo_log(src, "reclaimed", 1, "[thing.name]", thing.materials)
/obj/machinery/rnd/destructive_analyzer/proc/destroy_item(obj/item/thing, innermode = FALSE)
if(QDELETED(thing) || QDELETED(src) || QDELETED(linked_console))