Explosion Performance (#13988)

This commit is contained in:
Wildkins
2022-05-17 18:11:40 +02:00
committed by GitHub
parent 078e1ab41f
commit fc2a99f1a8
12 changed files with 67 additions and 38 deletions
+8 -6
View File
@@ -79,11 +79,11 @@
qdel(src)
return
if(2.0)
deflate(TRUE)
deflate(TRUE, FALSE)
return
if(3.0)
if(prob(50))
deflate(TRUE)
deflate(TRUE, FALSE)
return
/obj/structure/inflatable/attack_hand(mob/user)
@@ -113,7 +113,7 @@
/obj/structure/inflatable/CtrlClick()
hand_deflate()
/obj/structure/inflatable/proc/deflate(var/violent = FALSE)
/obj/structure/inflatable/proc/deflate(var/violent = FALSE, msg = TRUE)
if(deflating)
return
playsound(loc, 'sound/machines/hiss.ogg', 75, TRUE)
@@ -121,7 +121,8 @@
if(!torn_path)
return
deflating = TRUE
visible_message(SPAN_WARNING("\The [src] rapidly deflates!"))
if(msg)
visible_message(SPAN_WARNING("\The [src] rapidly deflates!"))
var/matrix/M = new
M.Scale(0.6)
M.Turn(pick(-40, 40))
@@ -131,7 +132,8 @@
if(!undeploy_path)
return
deflating = TRUE
visible_message(SPAN_NOTICE("\The [src] slowly deflates."))
if(msg)
visible_message(SPAN_NOTICE("\The [src] slowly deflates."))
var/matrix/M = new
M.Scale(0.6)
animate(src, 2.6 SECONDS, transform = M)
@@ -290,4 +292,4 @@
starts_with = list(/obj/item/inflatable/door = 2, /obj/item/inflatable/wall = 3)
#undef STATE_CLOSED
#undef STATE_OPEN
#undef STATE_OPEN
+9 -6
View File
@@ -52,7 +52,7 @@
/obj/structure/window/update_icon()
queue_smooth(src)
/obj/structure/window/proc/take_damage(var/damage = 0, var/sound_effect = 1)
/obj/structure/window/proc/take_damage(var/damage = 0, var/sound_effect = 1, message = TRUE)
var/initialhealth = health
if(silicate)
@@ -61,18 +61,21 @@
health = max(0, health - damage)
if(health <= 0)
shatter()
shatter(message)
else
if(sound_effect)
playsound(loc, 'sound/effects/glass_hit.ogg', 100, 1)
if(health < maxhealth / 4 && initialhealth >= maxhealth / 4)
visible_message(SPAN_DANGER("[src] looks like it's about to shatter!"))
if(message)
visible_message(SPAN_DANGER("[src] looks like it's about to shatter!"))
playsound(loc, /decl/sound_category/glasscrack_sound, 100, 1)
else if(health < maxhealth / 2 && initialhealth >= maxhealth / 2)
visible_message(SPAN_WARNING("[src] looks seriously damaged!"))
if(message)
visible_message(SPAN_WARNING("[src] looks seriously damaged!"))
playsound(loc, /decl/sound_category/glasscrack_sound, 100, 1)
else if(health < maxhealth * 3/4 && initialhealth >= maxhealth * 3/4)
visible_message(SPAN_WARNING("Cracks begin to appear in [src]!"))
if(message)
visible_message(SPAN_WARNING("Cracks begin to appear in [src]!"))
playsound(loc, /decl/sound_category/glasscrack_sound, 100, 1)
return
@@ -143,7 +146,7 @@
shatter(0)
return
else
take_damage(rand(10,30))
take_damage(rand(10,30), TRUE, FALSE)
//TODO: Make full windows a separate type of window.
//Once a full window, it will always be a full window, so there's no point