Explosion Performance (#13988)

This commit is contained in:
Wildkins
2022-05-17 12:11:40 -04:00
committed by GitHub
parent 078e1ab41f
commit fc2a99f1a8
12 changed files with 67 additions and 38 deletions

View File

@@ -37,7 +37,7 @@
health += maxhealth - old_maxhealth
/obj/structure/table/proc/take_damage(amount)
/obj/structure/table/proc/take_damage(amount, msg = TRUE)
// If the table is made of a brittle material, and is *not* reinforced with a non-brittle material, damage is multiplied by TABLE_BRITTLE_MATERIAL_MULTIPLIER
if(material && material.is_brittle())
if(reinforced)
@@ -47,7 +47,8 @@
amount *= TABLE_BRITTLE_MATERIAL_MULTIPLIER
health -= amount
if(health <= 0)
visible_message(SPAN_WARNING("\The [src] breaks down!"), intent_message = THUNK_SOUND)
if(msg)
visible_message(SPAN_WARNING("\The [src] breaks down!"), intent_message = THUNK_SOUND)
return break_to_parts() // if we break and form shards, return them to the caller to do !FUN! things with
@@ -57,9 +58,9 @@
qdel(src)
return
if(2.0)
take_damage(rand(100,400))
take_damage(rand(100,400), FALSE)
if(3.0)
take_damage(rand(50,150))
take_damage(rand(50,150), FALSE)
/obj/structure/table/Initialize()