diff --git a/baystation12.dme b/baystation12.dme index a837576e39875..fe0e5921f0086 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -903,6 +903,7 @@ #include "code\game\objects\compass\compass_holder.dm" #include "code\game\objects\compass\compass_waypoint.dm" #include "code\game\objects\effects\bump_teleporter.dm" +#include "code\game\objects\effects\cig_smoke.dm" #include "code\game\objects\effects\effect_system.dm" #include "code\game\objects\effects\explosion_particles.dm" #include "code\game\objects\effects\fake_fire.dm" diff --git a/code/game/objects/effects/cig_smoke.dm b/code/game/objects/effects/cig_smoke.dm new file mode 100644 index 0000000000000..f8d5ab6889726 --- /dev/null +++ b/code/game/objects/effects/cig_smoke.dm @@ -0,0 +1,21 @@ +/obj/effect/effect/cig_smoke + name = "smoke" + icon_state = "smallsmoke" + icon = 'icons/effects/effects.dmi' + opacity = FALSE + anchored = TRUE + mouse_opacity = FALSE + layer = ABOVE_HUMAN_LAYER + + var/time_to_live = 3 SECONDS + +/obj/effect/effect/cig_smoke/Initialize() + . = ..() + set_dir(pick(GLOB.cardinal)) + pixel_x = rand(0, 13) + pixel_y = rand(0, 13) + return INITIALIZE_HINT_LATELOAD + +/obj/effect/effect/cig_smoke/LateInitialize() + animate(src, alpha = 0, time_to_live, easing = EASE_IN) + QDEL_IN(src, time_to_live) diff --git a/code/modules/clothing/masks/smokable.dm b/code/modules/clothing/masks/smokable.dm index 13daaa7222b27..5013136b26fe2 100644 --- a/code/modules/clothing/masks/smokable.dm +++ b/code/modules/clothing/masks/smokable.dm @@ -17,6 +17,8 @@ var/ignitermes = "USER lights NAME with FLAME" var/brand var/gas_consumption = 0.04 + var/smoke_effect = 0 + var/smoke_amount = 1 z_flags = ZMM_MANGLE_PLANES @@ -44,16 +46,25 @@ /obj/item/clothing/mask/smokable/fire_act() light(0) -/obj/item/clothing/mask/smokable/proc/smoke(amount) +/obj/item/clothing/mask/smokable/proc/smoke(amount, manual) smoketime -= amount if(reagents && reagents.total_volume) // check if it has any reagents at all + var/smoke_loc = loc if(ishuman(loc)) var/mob/living/carbon/human/C = loc - if (src == C.wear_mask && C.check_has_mouth()) // if it's in the human/monkey mouth, transfer reagents to the mob - reagents.trans_to_mob(C, REM, CHEM_INGEST, 0.2) // Most of it is not inhaled... balance reasons. + smoke_loc = C.loc + if ((src == C.wear_mask || manual) && C.check_has_mouth()) // if it's in the human/monkey mouth, transfer reagents to the mob + reagents.trans_to_mob(C, smoke_amount * amount, CHEM_INGEST, 0.2) add_trace_DNA(C) else // else just remove some of the reagents - reagents.remove_any(REM) + reagents.remove_any(smoke_amount * amount) + + smoke_effect++ + + if(smoke_effect >= 4 || manual) + smoke_effect = 0 + new /obj/effect/effect/cig_smoke(smoke_loc) + var/turf/T = get_turf(src) if(T) var/datum/gas_mixture/environment = T.return_air() @@ -131,6 +142,7 @@ if(flavor_text) var/turf/T = get_turf(src) T.visible_message(flavor_text) + smoke_amount = reagents.total_volume / smoketime START_PROCESSING(SSobj, src) /obj/item/clothing/mask/smokable/proc/extinguish(mob/user, no_message) @@ -337,10 +349,19 @@ to_chat(H, SPAN_WARNING("\The [blocked] is in the way!")) return TRUE playsound(H, "sound/effects/inhale.ogg", 50, 0, -1) - user.visible_message(SPAN_NOTICE("\The [user] takes a drag from their [name].")) - smoke(5) + user.visible_message(\ + "[user] takes a [pick("drag","puff","pull")] on \his [name].", \ + "You take a [pick("drag","puff","pull")] on your [name].") + smoke(12, TRUE) add_trace_DNA(H) + user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) return TRUE + + if(!lit && istype(H) && H.on_fire) + user.do_attack_animation(H) + light(H, user) + return TRUE + return ..() /obj/item/clothing/mask/smokable/cigarette/use_after(obj/item/reagent_containers/glass/glass, mob/living/user, click_parameters) diff --git a/icons/effects/effects.dmi b/icons/effects/effects.dmi index ca60eea9e3c13..134f613ed4c0b 100644 Binary files a/icons/effects/effects.dmi and b/icons/effects/effects.dmi differ