diff --git a/code/game/objects/effects/decals/Cleanable/misc_cleanables.dm b/code/game/objects/effects/decals/Cleanable/misc_cleanables.dm
index 0076975c7f0..6e025ccb152 100644
--- a/code/game/objects/effects/decals/Cleanable/misc_cleanables.dm
+++ b/code/game/objects/effects/decals/Cleanable/misc_cleanables.dm
@@ -77,6 +77,11 @@
icon = 'icons/effects/effects.dmi'
icon_state = "flour"
+/obj/effect/decal/cleanable/flour/nanofrost
+ name = "nanofrost residue"
+ desc = "Residue left behind from a nanofrost detonation. Perhaps there was a fire here?"
+ color = "#B2FFFF"
+
/obj/effect/decal/cleanable/flour/foam
name = "Fire fighting foam"
desc = "It's foam."
diff --git a/code/game/objects/effects/effect_system/effects_foam.dm b/code/game/objects/effects/effect_system/effects_foam.dm
index fc2a414eddd..f07d0243c18 100644
--- a/code/game/objects/effects/effect_system/effects_foam.dm
+++ b/code/game/objects/effects/effect_system/effects_foam.dm
@@ -13,14 +13,14 @@
var/expand = 1
var/metal = 0
-/obj/effect/particle_effect/foam/New(loc, ismetal=0)
+/obj/effect/particle_effect/foam/New(loc, ismetal = FALSE)
..(loc)
icon_state = "[ismetal ? "m":""]foam"
if(!ismetal && reagents)
color = mix_color_from_reagents(reagents.reagent_list)
metal = ismetal
- playsound(src, 'sound/effects/bubbles2.ogg', 80, 1, -3)
- spawn(3 + metal*3)
+ playsound(src, 'sound/effects/bubbles2.ogg', 80, TRUE, -3)
+ spawn(3 + metal * 3)
process()
spawn(120)
STOP_PROCESSING(SSobj, src)
diff --git a/code/game/objects/effects/effect_system/effects_smoke.dm b/code/game/objects/effects/effect_system/effects_smoke.dm
index 0c0520bc876..cc88b207b85 100644
--- a/code/game/objects/effects/effect_system/effects_smoke.dm
+++ b/code/game/objects/effects/effect_system/effects_smoke.dm
@@ -171,7 +171,7 @@
for(var/obj/item/Item in T)
Item.extinguish()
-/datum/effect_system/smoke_spread/freezing/set_up(amount = 5, only_cardinals = FALSE, source, desired_direction, blasting = 0)
+/datum/effect_system/smoke_spread/freezing/set_up(amount = 5, only_cardinals = FALSE, source, desired_direction, blasting = FALSE)
..()
blast = blasting
diff --git a/code/game/objects/items/weapons/extinguisher.dm b/code/game/objects/items/weapons/extinguisher.dm
index 90cdcd251e0..5fff7b07f6c 100644
--- a/code/game/objects/items/weapons/extinguisher.dm
+++ b/code/game/objects/items/weapons/extinguisher.dm
@@ -85,7 +85,6 @@
safety = old_safety
return TRUE
-
/obj/item/extinguisher/afterattack(atom/target, mob/user, flag)
. = ..()
//TODO; Add support for reagents in water.
diff --git a/code/game/objects/items/weapons/tanks/watertank.dm b/code/game/objects/items/weapons/tanks/watertank.dm
index 1c7ee387e2e..4472a0ad8f0 100644
--- a/code/game/objects/items/weapons/tanks/watertank.dm
+++ b/code/game/objects/items/weapons/tanks/watertank.dm
@@ -230,10 +230,14 @@
cooling_power = 5
w_class = WEIGHT_CLASS_HUGE
flags = NODROP //Necessary to ensure that the nozzle and tank never seperate
+ /// A reference to the tank that this nozzle is linked to
var/obj/item/watertank/tank
- var/nozzle_mode = 0
+ /// What mode are we currently in?
+ var/nozzle_mode = EXTINGUISHER
+ /// Are we overusing the metal synthesizer? can be used 5 times in quick succession, regains 1 use per 10 seconds
var/metal_synthesis_cooldown = 0
- var/nanofrost_cooldown = 0
+ /// Is our nanofrost on cooldown?
+ var/nanofrost_cooldown = FALSE
/obj/item/extinguisher/mini/nozzle/Initialize(mapload)
if(!check_tank_exists(loc, src))
@@ -253,29 +257,24 @@
/obj/item/extinguisher/mini/nozzle/Move()
..()
if(tank && loc != tank.loc)
- loc = tank
- return
+ forceMove(tank)
-/obj/item/extinguisher/mini/nozzle/attack_self(mob/user as mob)
+/obj/item/extinguisher/mini/nozzle/attack_self(mob/user)
switch(nozzle_mode)
if(EXTINGUISHER)
nozzle_mode = NANOFROST
tank.icon_state = "waterbackpackatmos_1"
to_chat(user, "Swapped to nanofrost launcher")
- return
if(NANOFROST)
nozzle_mode = METAL_FOAM
tank.icon_state = "waterbackpackatmos_2"
to_chat(user, "Swapped to metal foam synthesizer")
- return
if(METAL_FOAM)
nozzle_mode = EXTINGUISHER
tank.icon_state = "waterbackpackatmos_0"
to_chat(user, "Swapped to water extinguisher")
- return
- return
-/obj/item/extinguisher/mini/nozzle/dropped(mob/user as mob)
+/obj/item/extinguisher/mini/nozzle/dropped(mob/user)
..()
to_chat(user, "The nozzle snaps back onto the tank!")
tank.on = FALSE
@@ -288,42 +287,40 @@
var/Adj = user.Adjacent(target)
if(Adj)
AttemptRefill(target, user)
- if(nozzle_mode == NANOFROST)
- if(Adj)
- return //Safety check so you don't blast yourself trying to refill your tank
- var/datum/reagents/R = reagents
- if(R.total_volume < 100)
- to_chat(user, "You need at least 100 units of water to use the nanofrost launcher!")
- return
- if(nanofrost_cooldown)
- to_chat(user, "Nanofrost launcher is still recharging")
- return
- nanofrost_cooldown = 1
- R.remove_any(100)
- var/obj/effect/nanofrost_container/A = new /obj/effect/nanofrost_container(get_turf(src))
- log_game("[key_name(user)] used Nanofrost at [get_area(user)] ([user.x], [user.y], [user.z]).")
- playsound(src,'sound/items/syringeproj.ogg',40,1)
- for(var/a=0, a<5, a++)
- step_towards(A, target)
- sleep(2)
- A.Smoke()
- spawn(100)
- if(src)
- nanofrost_cooldown = 0
- return
- if(nozzle_mode == METAL_FOAM)
- if(!Adj|| !isturf(target))
- return
- if(metal_synthesis_cooldown < 5)
- var/obj/effect/particle_effect/foam/F = new /obj/effect/particle_effect/foam(get_turf(target), 1)
+
+ switch(nozzle_mode)
+ if(NANOFROST)
+ if(Adj)
+ return //Safety check so you don't blast yourself trying to refill your tank
+ if(reagents.total_volume < 100)
+ to_chat(user, "You need at least 100 units of water to use the nanofrost launcher!")
+ return
+ if(nanofrost_cooldown)
+ to_chat(user, "Nanofrost launcher is still recharging.")
+ return
+ nanofrost_cooldown = TRUE
+ reagents.remove_any(100)
+ var/obj/effect/nanofrost_container/A = new /obj/effect/nanofrost_container(get_turf(src))
+ log_game("[key_name(user)] used Nanofrost at [get_area(user)] ([user.x], [user.y], [user.z]).")
+ playsound(src,'sound/items/syringeproj.ogg', 40, TRUE)
+ for(var/a in 1 to 6)
+ step_towards(A, target)
+ sleep(2)
+ A.Smoke()
+ addtimer(VARSET_CALLBACK(src, nanofrost_cooldown, FALSE))
+ if(METAL_FOAM)
+ if(!Adj)
+ return
+ if(metal_synthesis_cooldown >= 5)
+ to_chat(user, "Metal foam mix is still being synthesized.")
+ return
+ var/obj/effect/particle_effect/foam/F = new /obj/effect/particle_effect/foam(get_turf(target), TRUE)
F.amount = 0
metal_synthesis_cooldown++
- spawn(100)
- if(src)
- metal_synthesis_cooldown--
- else
- to_chat(user, "Metal foam mix is still being synthesized.")
- return
+ addtimer(CALLBACK(src, PROC_REF(metal_cooldown)), 10 SECONDS)
+
+/obj/item/extinguisher/mini/nozzle/proc/metal_cooldown()
+ metal_synthesis_cooldown--
/obj/effect/nanofrost_container
name = "nanofrost container"
@@ -335,13 +332,10 @@
/obj/effect/nanofrost_container/proc/Smoke()
var/datum/effect_system/smoke_spread/freezing/S = new
- S.set_up(6, FALSE, loc, null, 1)
+ S.set_up(6, FALSE, loc, null, TRUE)
S.start()
- var/obj/effect/decal/cleanable/flour/F = new /obj/effect/decal/cleanable/flour(src.loc)
- F.color = "#B2FFFF"
- F.name = "nanofrost residue"
- F.desc = "Residue left behind from a nanofrost detonation. Perhaps there was a fire here?"
- playsound(src,'sound/effects/bamf.ogg',100,1)
+ new /obj/effect/decal/cleanable/flour/nanofrost(get_turf(src))
+ playsound(src, 'sound/effects/bamf.ogg', 100, TRUE)
qdel(src)
#undef EXTINGUISHER
diff --git a/code/modules/mob/inventory_procs.dm b/code/modules/mob/inventory_procs.dm
index e551dc7b683..171aeaf9c2f 100644
--- a/code/modules/mob/inventory_procs.dm
+++ b/code/modules/mob/inventory_procs.dm
@@ -55,18 +55,18 @@
//Puts the item into your l_hand if possible and calls all necessary triggers/updates. returns 1 on success.
/mob/proc/put_in_l_hand(obj/item/W, skip_blocked_hands_check = FALSE)
if(!put_in_hand_check(W, skip_blocked_hands_check))
- return 0
+ return FALSE
if(!l_hand && has_left_hand())
W.forceMove(src) //TODO: move to equipped?
l_hand = W
W.layer = ABOVE_HUD_LAYER //TODO: move to equipped?
W.plane = ABOVE_HUD_PLANE //TODO: move to equipped?
- W.equipped(src,SLOT_HUD_LEFT_HAND)
+ W.equipped(src, SLOT_HUD_LEFT_HAND)
if(pulling == W)
stop_pulling()
update_inv_l_hand()
- return 1
- return 0
+ return TRUE
+ return FALSE
//Puts the item into your r_hand if possible and calls all necessary triggers/updates. returns 1 on success.
/mob/proc/put_in_r_hand(obj/item/W, skip_blocked_hands_check = FALSE)
@@ -96,8 +96,10 @@
//Puts the item into our active hand if possible. returns 1 on success.
/mob/proc/put_in_active_hand(obj/item/W)
- if(hand) return put_in_l_hand(W)
- else return put_in_r_hand(W)
+ if(hand)
+ return put_in_l_hand(W)
+ else
+ return put_in_r_hand(W)
//Puts the item into our inactive hand if possible. returns 1 on success.
/mob/proc/put_in_inactive_hand(obj/item/W)