Merge pull request #6176 from Fox-McCloud/reagents-noreact-refactor

Makes Reagents Holder Process and Refactors NOREACT
This commit is contained in:
Crazy Lemon
2017-01-26 03:47:30 -08:00
committed by GitHub
13 changed files with 45 additions and 28 deletions
+5 -3
View File
@@ -42,11 +42,13 @@ LIGHTERS ARE IN LIGHTERS.DM
/obj/item/clothing/mask/cigarette/New()
..()
flags |= NOREACT // so it doesn't react until you light it
create_reagents(chem_volume) // making the cigarrete a chemical holder with a maximum volume of 30
reagents.set_reacting(FALSE) // so it doesn't react until you light it
/obj/item/clothing/mask/cigarette/Destroy()
qdel(reagents)
if(reagents)
qdel(reagents)
processing_objects -= src
return ..()
/obj/item/clothing/mask/cigarette/attack(var/mob/living/M, var/mob/living/user, def_zone)
@@ -135,7 +137,7 @@ LIGHTERS ARE IN LIGHTERS.DM
M.unEquip(src, 1)
qdel(src)
return
flags &= ~NOREACT // allowing reagents to react after being lit
reagents.set_reacting(TRUE)
reagents.handle_reactions()
icon_state = icon_on
item_state = icon_on
@@ -176,8 +176,8 @@
/obj/item/weapon/storage/fancy/cigarettes/New()
..()
flags |= NOREACT
create_reagents(30 * storage_slots)//so people can inject cigarettes without opening a packet, now with being able to inject the whole one
reagents.set_reacting(FALSE)
for(var/i = 1 to storage_slots)
var/obj/item/clothing/mask/cigarette/C = new cigarette_type(src)
unlaced_cigarettes += C