Skip to content

Commit

Permalink
Remove lack of smoking smoke (#36)
Browse files Browse the repository at this point in the history
Пошёл по комнате дымок...

https://github.com/ss220club/WyccerraBay220/assets/87862013/110bd341-b764-4736-bae2-2b8bcd028b21

🆑
add: Добавил дымный эффект для всего курибельного
/🆑
  • Loading branch information
ImJustKisik committed Nov 2, 2024
1 parent 15848fe commit ca73d24
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 6 deletions.
1 change: 1 addition & 0 deletions baystation12.dme
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
21 changes: 21 additions & 0 deletions code/game/objects/effects/cig_smoke.dm
Original file line number Diff line number Diff line change
@@ -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)
33 changes: 27 additions & 6 deletions code/modules/clothing/masks/smokable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
Binary file modified icons/effects/effects.dmi
Binary file not shown.

0 comments on commit ca73d24

Please sign in to comment.