Skip to content

Commit

Permalink
Adds flashlight, cigarette and lighter sounds.
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmatterson111 committed Apr 6, 2019
1 parent a7e2ca1 commit e030f99
Show file tree
Hide file tree
Showing 13 changed files with 92 additions and 0 deletions.
2 changes: 2 additions & 0 deletions beestation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
// BEGIN_INCLUDE
#include "beestation\code\__HELPERS\roundend.dm"
#include "beestation\code\datums\mutations.dm"
#include "beestation\code\game\objects\items\cigs_lighters.dm"
#include "beestation\code\game\objects\items\flashlight.dm"
#include "beestation\code\game\objects\items\devices\sound_synth.dm"
#include "beestation\code\modules\admin\verbs\adminhelp.dm"
#include "beestation\code\modules\admin\verbs\cluwneplayer.dm"
Expand Down
78 changes: 78 additions & 0 deletions beestation/code/game/objects/items/cigs_lighters.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
//In order to try and stay atomic with TG's shit, I have copied and pasted their stuff here, with my very unatomic changes.
//If they update their lighter stuff we'll probably have to update this too but better to do that than to have to deal with conflicts.

/obj/item/clothing/mask/cigarette/light(flavor_text = null)
..()
playsound(src, 'sound/items/cig_light.ogg', 75, 1, -1)


/obj/item/clothing/mask/cigarette/process()
var/turf/location = get_turf(src)
var/mob/living/M = loc
if(isliving(loc))
M.IgniteMob()
smoketime--
if(smoketime < 1)
new type_butt(location)
if(ismob(loc))
to_chat(M, "<span class='notice'>Your [name] goes out.</span>")
playsound(src, 'sound/items/cig_snuff.ogg', 25, 1)
qdel(src)
return
open_flame()
if((reagents && reagents.total_volume) && (nextdragtime <= world.time))
nextdragtime = world.time + dragtime
handle_reagents()

/obj/item/clothing/mask/cigarette/attack_self(mob/user)
if(lit)
user.visible_message("<span class='notice'>[user] calmly drops and treads on \the [src], putting it out instantly.</span>")
new type_butt(user.loc)
new /obj/effect/decal/cleanable/ash(user.loc)
playsound(src, 'sound/items/cig_snuff.ogg', 25, 1)
qdel(src)
. = ..()

/obj/item/lighter/attack_self(mob/living/user)
if(user.is_holding(src))
if(!lit)
set_lit(TRUE)
if(fancy)
user.visible_message("Without even breaking stride, [user] flips open and lights [src] in one smooth movement.", "<span class='notice'>Without even breaking stride, you flip open and light [src] in one smooth movement.</span>")
playsound(src.loc, 'sound/items/zippo_on.ogg', 100, 1)
else
var/prot = FALSE
var/mob/living/carbon/human/H = user

if(istype(H) && H.gloves)
var/obj/item/clothing/gloves/G = H.gloves
if(G.max_heat_protection_temperature)
prot = (G.max_heat_protection_temperature > 360)
else
prot = TRUE

if(prot || prob(75))
user.visible_message("After a few attempts, [user] manages to light [src].", "<span class='notice'>After a few attempts, you manage to light [src].</span>")
else
var/hitzone = user.held_index_to_dir(user.active_hand_index) == "r" ? BODY_ZONE_PRECISE_R_HAND : BODY_ZONE_PRECISE_L_HAND
user.apply_damage(5, BURN, hitzone)
user.visible_message("<span class='warning'>After a few attempts, [user] manages to light [src] - however, [user.p_they()] burn [user.p_their()] finger in the process.</span>", "<span class='warning'>You burn yourself while lighting the lighter!</span>")
SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "burnt_thumb", /datum/mood_event/burnt_thumb)
playsound(src.loc, 'sound/items/lighter_on.ogg', 100, 1)

else
set_lit(FALSE)
if(fancy)
user.visible_message("You hear a quiet click, as [user] shuts off [src] without even looking at what [user.p_theyre()] doing. Wow.", "<span class='notice'>You quietly shut off [src] without even looking at what you're doing. Wow.</span>")
playsound(src.loc, 'sound/items/zippo_off.ogg', 100, 1)
else
user.visible_message("[user] quietly shuts off [src].", "<span class='notice'>You quietly shut off [src].</span>")
playsound(src.loc, 'sound/items/lighter_off.ogg', 100, 1)
else
. = ..()

//Throwing matches down here too because there isn't anything else to do with them.
/obj/item/storage/box/matches/attackby(obj/item/match/W as obj, mob/user as mob, params)
if(istype(W, /obj/item/match))
W.matchignite()
playsound(src.loc, 'sound/items/matchstick_lit.ogg', 100, 1)
12 changes: 12 additions & 0 deletions beestation/code/game/objects/items/flashlight.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/obj/item/flashlight/update_brightness(mob/user = null)
if(on)
icon_state = "[initial(icon_state)]-on"
if(flashlight_power)
set_light(l_range = brightness_on, l_power = flashlight_power)
else
set_light(brightness_on)
playsound(src, 'sound/items/flashlight_on.ogg', 25, 1)
else
icon_state = initial(icon_state)
set_light(0)
playsound(src, 'sound/items/flashlight_off.ogg', 25, 1)
Binary file added sound/effects/inhale.ogg
Binary file not shown.
Binary file added sound/items/cig_light.ogg
Binary file not shown.
Binary file added sound/items/cig_snuff.ogg
Binary file not shown.
Binary file added sound/items/flashlight_off.ogg
Binary file not shown.
Binary file added sound/items/flashlight_on.ogg
Binary file not shown.
Binary file added sound/items/lighter_off.ogg
Binary file not shown.
Binary file added sound/items/lighter_on.ogg
Binary file not shown.
Binary file added sound/items/matchstick_lit.ogg
Binary file not shown.
Binary file added sound/items/zippo_off.ogg
Binary file not shown.
Binary file added sound/items/zippo_on.ogg
Binary file not shown.

0 comments on commit e030f99

Please sign in to comment.