Added fire and grill sounds to the bonfire.

This commit is contained in:
MistakeNot4892
2024-01-18 19:31:15 +11:00
parent b9c71c9a95
commit 1d03b7a3d5
9 changed files with 41 additions and 3 deletions

View File

@@ -42,4 +42,17 @@
/datum/looping_sound/small_motor/get_sound(starttime)
speed = clamp(speed, 1, 3)
return ..(starttime, mid_sounds[speed])
return ..(starttime, mid_sounds[speed])
/datum/looping_sound/fire_crackles
start_sound = 'sound/ambience/firecrackle01.ogg'
start_length = 10
mid_sounds = list(
'sound/ambience/firecrackle02.ogg',
'sound/ambience/firecrackle03.ogg',
'sound/ambience/firecrackle04.ogg',
'sound/ambience/firecrackle05.ogg'
)
mid_length = 10
end_sound = 'sound/ambience/firecrackle06.ogg'
volume = 10

View File

@@ -14,9 +14,13 @@
var/datum/material/material
var/set_temperature = T0C + 30 //K
var/heating_power = 80000
var/datum/looping_sound/fire_crackles/fire_loop
var/datum/looping_sound/grill/grill_loop // Used when food is cooking on the fire.
/obj/structure/bonfire/Initialize(var/ml, material_name)
. = ..()
fire_loop = new(list(src), FALSE)
grill_loop = new(list(src), FALSE)
if(!material_name)
material_name = MAT_WOOD
material = get_material_by_name("[material_name]")
@@ -25,6 +29,11 @@
return
color = material.icon_colour
/obj/structure/bonfire/sifwood/Destroy()
QDEL_NULL(fire_loop)
QDEL_NULL(grill_loop)
return ..()
// Blue wood.
/obj/structure/bonfire/sifwood/Initialize(var/ml, material_name)
. = ..(ml, MAT_SIFWOOD)
@@ -176,6 +185,8 @@
update_icon()
STOP_PROCESSING(SSobj, src)
visible_message("<span class='notice'>\The [src] stops burning.</span>")
if(fire_loop?.started)
fire_loop.stop(src)
/obj/structure/bonfire/proc/ignite()
if(!burning && get_fuel_amount())
@@ -183,6 +194,8 @@
update_icon()
START_PROCESSING(SSobj, src)
visible_message("<span class='warning'>\The [src] starts burning!</span>")
if(fire_loop && !fire_loop.started)
fire_loop.start(src)
/obj/structure/bonfire/proc/burn()
var/turf/current_location = get_turf(src)
@@ -236,12 +249,24 @@
if(!consume_fuel(pop(contents)))
extinguish()
return
var/do_grill_sound = FALSE
if(grill)
for(var/obj/item/thing in view(2, src))
thing.dry_out(src, 3 - get_dist(thing, src), (thing.loc == loc), silent = TRUE)
if(thing.dry_out(src, 3 - get_dist(thing, src), (thing.loc == loc), silent = TRUE))
do_grill_sound = TRUE
else
burn()
if(grill_loop)
if(do_grill_sound)
if(!grill_loop.started)
grill_loop.start(src)
else
if(grill_loop.started)
grill_loop.stop(src)
if(!burning)
return
var/W = get_fuel_amount()

View File

@@ -116,4 +116,4 @@
if (!stat)
for (var/i in cooking_objs)
do_cooking_tick(i)
*/
*/

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.