[READY]Refactors reagent container types

This commit is contained in:
ACCount
2017-12-18 22:54:51 -06:00
committed by CitadelStationBot
parent d5708c981a
commit 522b8383d8
51 changed files with 577 additions and 204 deletions
+13
View File
@@ -59,6 +59,19 @@
if(my_atom && my_atom.reagents == src)
my_atom.reagents = null
// Used in attack logs for reagents in pills and such
/datum/reagents/proc/log_list()
if(!length(reagent_list))
return "no reagents"
var/list/data = list()
for(var/r in reagent_list) //no reagents will be left behind
var/datum/reagent/R = r
data += "[R.id] ([round(R.volume, 0.1)]u)"
//Using IDs because SOME chemicals (I'm looking at you, chlorhydrate-beer) have the same names as other chemicals.
return english_list(data)
/datum/reagents/proc/remove_any(amount = 1)
var/list/cached_reagents = reagent_list
var/total_transfered = 0
@@ -184,7 +184,7 @@
if(default_unfasten_wrench(user, I))
return
if(istype(I, /obj/item/reagent_containers) && (I.container_type & OPENCONTAINER_1))
if(istype(I, /obj/item/reagent_containers) && I.is_open_container())
var/obj/item/reagent_containers/B = I
. = 1 //no afterattack
if(beaker)
@@ -64,7 +64,7 @@
if(default_deconstruction_crowbar(I))
return
if(istype(I, /obj/item/reagent_containers) && (I.container_type & OPENCONTAINER_1))
if(istype(I, /obj/item/reagent_containers) && I.is_open_container())
. = 1 //no afterattack
if(beaker)
to_chat(user, "<span class='warning'>A container is already loaded into [src]!</span>")
@@ -88,7 +88,7 @@
if(default_unfasten_wrench(user, I))
return
if(istype(I, /obj/item/reagent_containers) && (I.container_type & OPENCONTAINER_1))
if(istype(I, /obj/item/reagent_containers) && I.is_open_container())
. = 1 // no afterattack
if(panel_open)
to_chat(user, "<span class='warning'>You can't use the [src.name] while its panel is opened!</span>")
@@ -225,7 +225,7 @@
/obj/machinery/computer/pandemic/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/reagent_containers) && (I.container_type & OPENCONTAINER_1))
if(istype(I, /obj/item/reagent_containers) && I.is_open_container())
. = TRUE //no afterattack
if(stat & (NOPOWER|BROKEN))
return
@@ -62,7 +62,7 @@
if(default_unfasten_wrench(user, I))
return
if (istype(I, /obj/item/reagent_containers) && (I.container_type & OPENCONTAINER_1) )
if (istype(I, /obj/item/reagent_containers) && I.is_open_container())
if (!beaker)
if(!user.transferItemToLoc(I, src))
to_chat(user, "<span class='warning'>[I] is stuck to your hand!</span>")