Skip to content

Commit

Permalink
Merge pull request Baystation12#27162 from comma/windownerf
Browse files Browse the repository at this point in the history
Windows nerfs and sounds
  • Loading branch information
PsiOmegaDelta authored Sep 29, 2019
2 parents c3b3bc6 + 539bec0 commit 15fe9f0
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 6 deletions.
14 changes: 8 additions & 6 deletions code/game/objects/structures/window.dm
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,9 @@

maxhealth = material.integrity
if(reinf_material)
maxhealth += 0.25 * reinf_material.integrity
maxhealth += 0.5 * reinf_material.integrity

if(is_fulltile())
maxhealth *= 4
layer = FULL_WINDOW_LAYER

health = maxhealth
Expand Down Expand Up @@ -106,17 +105,20 @@
if(sound_effect)
playsound(loc, 'sound/effects/Glasshit.ogg', 100, 1)
if(health < maxhealth / 4 && initialhealth >= maxhealth / 4)
visible_message("<span class='notice'>\The [src] looks like it's about to shatter!</span>")
visible_message(SPAN_DANGER("\The [src] looks like it's about to shatter!"))
playsound(loc, "glasscrack", 100, 1)
else if(health < maxhealth / 2 && initialhealth >= maxhealth / 2)
visible_message("\The [src] looks seriously damaged!" )
visible_message(SPAN_WARNING("\The [src] looks seriously damaged!"))
playsound(loc, "glasscrack", 100, 1)
else if(health < maxhealth * 3/4 && initialhealth >= maxhealth * 3/4)
visible_message("Cracks begin to appear in \the [src]!" )
visible_message(SPAN_WARNING("Cracks begin to appear in \the [src]!"))
playsound(loc, "glasscrack", 100, 1)
return

/obj/structure/window/proc/shatter(var/display_message = 1)
playsound(src, "shatter", 70, 1)
if(display_message)
visible_message("<span class='notice'>\The [src] shatters!</span>")
visible_message("<span class='warning'>\The [src] shatters!</span>")

var/debris_count = is_fulltile() ? 4 : 1
for(var/i = 0 to debris_count)
Expand Down
2 changes: 2 additions & 0 deletions code/game/sound.dm
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ GLOBAL_LIST_INIT(keystroke_sound,list('sound/machines/keyboard/keystroke1.ogg','
GLOBAL_LIST_INIT(switch_sound,list('sound/machines/switch1.ogg','sound/machines/switch2.ogg','sound/machines/switch3.ogg','sound/machines/switch4.ogg'))
GLOBAL_LIST_INIT(button_sound,list('sound/machines/button1.ogg','sound/machines/button2.ogg','sound/machines/button3.ogg','sound/machines/button4.ogg'))
GLOBAL_LIST_INIT(chop_sound,list('sound/weapons/chop1.ogg','sound/weapons/chop2.ogg','sound/weapons/chop3.ogg'))
GLOBAL_LIST_INIT(glasscrack_sound,list('sound/effects/glass_crack1.ogg','sound/effects/glass_crack2.ogg','sound/effects/glass_crack3.ogg','sound/effects/glass_crack4.ogg'))

/proc/playsound(var/atom/source, soundin, vol as num, vary, extrarange as num, falloff, var/is_global, var/frequency, var/is_ambiance = 0)

Expand Down Expand Up @@ -185,4 +186,5 @@ var/const/FALLOFF_SOUNDS = 0.5
if ("switch") soundin = pick(GLOB.switch_sound)
if ("button") soundin = pick(GLOB.button_sound)
if ("chop") soundin = pick(GLOB.chop_sound)
if ("glasscrack") soundin = pick(GLOB.glasscrack_sound)
return soundin
Binary file added sound/effects/glass_crack1.ogg
Binary file not shown.
Binary file added sound/effects/glass_crack2.ogg
Binary file not shown.
Binary file added sound/effects/glass_crack3.ogg
Binary file not shown.
Binary file added sound/effects/glass_crack4.ogg
Binary file not shown.

0 comments on commit 15fe9f0

Please sign in to comment.