mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-01-09 08:52:29 +00:00
Added fire and grill sounds to the bonfire.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -116,4 +116,4 @@
|
||||
if (!stat)
|
||||
for (var/i in cooking_objs)
|
||||
do_cooking_tick(i)
|
||||
*/
|
||||
*/
|
||||
|
||||
BIN
sound/ambience/firecrackle01.ogg
Normal file
BIN
sound/ambience/firecrackle01.ogg
Normal file
Binary file not shown.
BIN
sound/ambience/firecrackle02.ogg
Normal file
BIN
sound/ambience/firecrackle02.ogg
Normal file
Binary file not shown.
BIN
sound/ambience/firecrackle03.ogg
Normal file
BIN
sound/ambience/firecrackle03.ogg
Normal file
Binary file not shown.
BIN
sound/ambience/firecrackle04.ogg
Normal file
BIN
sound/ambience/firecrackle04.ogg
Normal file
Binary file not shown.
BIN
sound/ambience/firecrackle05.ogg
Normal file
BIN
sound/ambience/firecrackle05.ogg
Normal file
Binary file not shown.
BIN
sound/ambience/firecrackle06.ogg
Normal file
BIN
sound/ambience/firecrackle06.ogg
Normal file
Binary file not shown.
Reference in New Issue
Block a user