mirror of
https://github.com/CHOMPstation/CHOMPstation.git
synced 2026-07-21 20:12:31 +01:00
Structures now take damage properly from projectile clouds
This commit is contained in:
@@ -195,11 +195,12 @@
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/closet/bullet_act(var/obj/item/projectile/Proj)
|
||||
if(!(Proj.damage_type == BRUTE || Proj.damage_type == BURN))
|
||||
var/proj_damage = Proj.get_structure_damage()
|
||||
if(!proj_damage)
|
||||
return
|
||||
|
||||
..()
|
||||
damage(Proj.damage)
|
||||
damage(proj_damage)
|
||||
|
||||
return
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
shatter(M)
|
||||
|
||||
/obj/structure/closet/statue/bullet_act(var/obj/item/projectile/Proj)
|
||||
health -= Proj.damage
|
||||
health -= Proj.get_structure_damage()
|
||||
check_health()
|
||||
|
||||
return
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
|
||||
/obj/structure/displaycase/bullet_act(var/obj/item/projectile/Proj)
|
||||
health -= Proj.damage
|
||||
health -= Proj.get_structure_damage()
|
||||
..()
|
||||
src.healthcheck()
|
||||
return
|
||||
|
||||
@@ -27,11 +27,10 @@
|
||||
if(Proj.original != src && !prob(cover))
|
||||
return PROJECTILE_CONTINUE //pass through
|
||||
|
||||
//Tasers and the like should not damage girders.
|
||||
if(!(Proj.damage_type == BRUTE || Proj.damage_type == BURN))
|
||||
var/damage = Proj.get_structure_damage()
|
||||
if(!damage)
|
||||
return
|
||||
|
||||
var/damage = Proj.damage
|
||||
if(!istype(Proj, /obj/item/projectile/beam))
|
||||
damage *= 0.4 //non beams do reduced damage
|
||||
|
||||
|
||||
@@ -64,13 +64,11 @@
|
||||
/obj/structure/grille/bullet_act(var/obj/item/projectile/Proj)
|
||||
if(!Proj) return
|
||||
|
||||
//Tasers and the like should not damage grilles.
|
||||
if(!(Proj.damage_type == BRUTE || Proj.damage_type == BURN))
|
||||
return
|
||||
|
||||
//Flimsy grilles aren't so great at stopping projectiles. However they can absorb some of the impact
|
||||
var/damage = Proj.damage
|
||||
var/damage = Proj.get_structure_damage()
|
||||
var/passthrough = 0
|
||||
|
||||
if(!damage) return
|
||||
|
||||
//20% chance that the grille provides a bit more cover than usual. Support structure for example might take up 20% of the grille's area.
|
||||
//If they click on the grille itself then we assume they are aiming at the grille itself and the extra cover behaviour is always used.
|
||||
|
||||
@@ -38,10 +38,10 @@
|
||||
return 0
|
||||
|
||||
/obj/structure/inflatable/bullet_act(var/obj/item/projectile/Proj)
|
||||
if(!(Proj.damage_type == BRUTE || Proj.damage_type == BURN))
|
||||
return
|
||||
var/proj_damage = Proj.get_structure_damage()
|
||||
if(!proj_damage) return
|
||||
|
||||
health -= Proj.damage
|
||||
health -= proj_damage
|
||||
..()
|
||||
if(health <= 0)
|
||||
deflate(1)
|
||||
|
||||
@@ -30,10 +30,8 @@
|
||||
|
||||
|
||||
/obj/structure/mirror/bullet_act(var/obj/item/projectile/Proj)
|
||||
if(!(Proj.damage_type == BRUTE || Proj.damage_type == BURN))
|
||||
return
|
||||
|
||||
if(prob(Proj.damage * 2))
|
||||
|
||||
if(prob(Proj.get_structure_damage() * 2))
|
||||
if(!shattered)
|
||||
shatter()
|
||||
else
|
||||
|
||||
@@ -99,12 +99,11 @@
|
||||
|
||||
/obj/structure/window/bullet_act(var/obj/item/projectile/Proj)
|
||||
|
||||
//Tasers and the like should not damage windows.
|
||||
if(!(Proj.damage_type == BRUTE || Proj.damage_type == BURN))
|
||||
return
|
||||
var/proj_damage = Proj.get_structure_damage()
|
||||
if(!proj_damage) return
|
||||
|
||||
..()
|
||||
take_damage(Proj.damage)
|
||||
take_damage(proj_damage)
|
||||
return
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user