You can now damage walls and girders with weapons + misc tweaks. (#8006)

You can now destroy girders and walls with powerful items. It might take some time, though, and you'll probably be better off deconstructing it unless your weapon is strong.
Two-handed weapons no longer have that awkward Wielded sticking in front of the name when you wield them.
Girders now report their damage status on examine.
This commit is contained in:
Matt Atlas
2020-01-24 19:36:06 -03:00
committed by Alberyk
parent 982c5e808e
commit 21faef9c11
6 changed files with 121 additions and 23 deletions
+45 -15
View File
@@ -1,4 +1,5 @@
/obj/structure/girder
desc = "The basic building block of all walls."
icon_state = "girder"
anchored = 1
density = 1
@@ -10,20 +11,28 @@
var/material/reinf_material
var/reinforcing = 0
/obj/structure/girder/examine(mob/user, distance, infix, suffix)
. = ..()
var/state
var/current_damage = health / initial(health)
switch(current_damage)
if(0 to 0.2)
state = "<span class='danger'>The support struts are collapsing!</span>"
if(0.2 to 0.4)
state = "<span class='warning'>The support struts are warped!</span>"
if(0.4 to 0.8)
state = "<span class='notice'>The support struts are dented, but holding together.</span>"
if(0.8 to 1)
state = "<span class='notice'>The support struts look completely intact.</span>"
to_chat(user, state)
/obj/structure/girder/displaced
name = "displaced girder"
icon_state = "displaced"
anchored = 0
health = 50
cover = 25
/obj/structure/girder/attack_generic(var/mob/user, var/damage, var/attack_message = "smashes apart", var/wallbreaker)
if(!damage || !wallbreaker)
return 0
user.do_attack_animation(src)
visible_message("<span class='danger'>[user] [attack_message] the [src]!</span>")
spawn(1) dismantle()
return 1
/obj/structure/girder/bullet_act(var/obj/item/projectile/Proj)
//Girders only provide partial cover. There's a chance that the projectiles will just pass through. (unless you are trying to shoot the girder)
if(Proj.original != src && !prob(cover))
@@ -36,12 +45,15 @@
if(!istype(Proj, /obj/item/projectile/beam))
damage *= 0.4 //non beams do reduced damage
health -= damage
..()
if(health <= 0)
dismantle()
take_damage(damage)
return
return ..()
/obj/structure/girder/proc/take_damage(var/damage)
health -= damage
if(health <= 0)
visible_message("<span class='warning'>\The [src] falls apart!</span>")
dismantle()
/obj/structure/girder/proc/reset_girder()
anchored = 1
@@ -160,8 +172,26 @@
if(!construct_wall(W, user))
return ..()
else
return ..()
else if(W.force)
var/damage_to_deal = W.force
var/weaken = 0
if(reinf_material)
weaken += reinf_material.integrity * 2.5 //Since girders don't have a secondary material, buff 'em up a bit.
weaken /= 100
visible_message("<span class='notice'>[user] retracts their [W] and starts winding up a strike...</span>")
var/hit_delay = W.w_class * 10 //Heavier weapons take longer to swing, yeah?
if(do_after(user, hit_delay))
do_attack_animation(src)
playsound(src, 'sound/weapons/smash.ogg', 50)
if(damage_to_deal > weaken && (damage_to_deal > MIN_DAMAGE_TO_HIT))
damage_to_deal -= weaken
visible_message("<span class='warning'>[user] strikes \the [src] with \the [W], [is_sharp(W) ? "slicing" : "denting"] a support rod!</span>")
take_damage(damage_to_deal)
else
visible_message("<span class='warning'>[user] strikes \the [src] with \the [W], but it bounces off!</span>")
return
return ..()
/obj/structure/girder/proc/construct_wall(obj/item/stack/material/S, mob/user)
if(S.get_amount() < 2)