Combat Mechs Can Punch More Things (#6303)

* Combat Mechs Can Punch More Things

Removes the var to check for the 5 things it can attack, instead it can punch anything (but not everything will take damage).

Gives punching objects a check so you don't accidently smash something without meaning to.

Gives closets and canisters a proc to take_damage so they'll actually get smashed by the mechs.

* Take_Damage Boogaloo

* More take_damage Stuff

Adds click delay on attacking barriers.
Proper noises when attacking material doors and barricades.

More stuff can be broken by mech punch and simple mobs.

* Adds changelong

* usr to user
This commit is contained in:
Andrew
2019-07-24 12:58:39 -08:00
committed by Atermonera
parent 40277238a4
commit 504c28bc84
27 changed files with 267 additions and 116 deletions
+1 -1
View File
@@ -98,7 +98,7 @@
return 0
return 1
/obj/structure/catwalk/proc/take_damage(amount)
/obj/structure/catwalk/take_damage(amount)
health -= amount
if(health <= 0)
visible_message("<span class='warning'>\The [src] breaks down!</span>")
@@ -467,3 +467,10 @@
if(istype(src.loc, /obj/structure/closet))
return (loc.return_air_for_internal_lifeform(L))
return return_air()
/obj/structure/closet/take_damage(var/damage)
if(damage < STRUCTURE_MIN_DAMAGE_THRESHOLD)
return
dump_contents()
spawn(1) qdel(src)
return 1
+1 -1
View File
@@ -212,7 +212,7 @@
else
return ..()
/obj/structure/girder/proc/take_damage(var/damage)
/obj/structure/girder/take_damage(var/damage)
health -= damage
if(health <= 0)
dismantle()
+5
View File
@@ -281,3 +281,8 @@
return TRUE
return FALSE
/obj/structure/grille/take_damage(var/damage)
health -= damage
spawn(1) healthcheck()
return 1
@@ -137,6 +137,13 @@
user.visible_message("<span class='danger'>[user] [attack_verb] at [src]!</span>")
return 1
/obj/structure/inflatable/take_damage(var/damage)
health -= damage
if(health <= 0)
visible_message("<span class='danger'>The [src] deflates!</span>")
spawn(1) puncture()
return 1
/obj/item/inflatable/door/
name = "inflatable door"
desc = "A folded membrane which rapidly expands into a simple door on activation."
+1 -1
View File
@@ -52,7 +52,7 @@
if(0.5 to 1.0)
to_chat(user, "<span class='notice'>It has a few scrapes and dents.</span>")
/obj/structure/railing/proc/take_damage(amount)
/obj/structure/railing/take_damage(amount)
health -= amount
if(health <= 0)
visible_message("<span class='warning'>\The [src] breaks down!</span>")
+27 -3
View File
@@ -124,15 +124,22 @@
icon_state = material.door_icon_base
/obj/structure/simple_door/attackby(obj/item/weapon/W as obj, mob/user as mob)
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
if(istype(W,/obj/item/weapon/pickaxe))
var/obj/item/weapon/pickaxe/digTool = W
user << "You start digging the [name]."
visible_message("<span class='danger'>[user] starts digging [src]!</span>")
if(do_after(user,digTool.digspeed*hardness) && src)
user << "You finished digging."
visible_message("<span class='danger'>[user] finished digging [src]!</span>")
Dismantle()
else if(istype(W,/obj/item/weapon)) //not sure, can't not just weapons get passed to this proc?
hardness -= W.force/10
user << "You hit the [name] with your [W.name]!"
visible_message("<span class='danger'>[user] hits [src] with [W]!</span>")
if(material == get_material_by_name("resin"))
playsound(loc, 'sound/effects/attackblob.ogg', 100, 1)
else if(material == (get_material_by_name(MAT_WOOD) || get_material_by_name(MAT_SIFWOOD)))
playsound(loc, 'sound/effects/woodcutting.ogg', 100, 1)
else
playsound(src, 'sound/weapons/smash.ogg', 50, 1)
CheckHardness()
else if(istype(W,/obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/WT = W
@@ -146,12 +153,29 @@
hardness -= Proj.force/10
CheckHardness()
/obj/structure/simple_door/take_damage(var/damage)
hardness -= damage/10
CheckHardness()
/obj/structure/simple_door/attack_generic(var/mob/user, var/damage, var/attack_verb)
visible_message("<span class='danger'>[user] [attack_verb] the [src]!</span>")
if(material == get_material_by_name("resin"))
playsound(loc, 'sound/effects/attackblob.ogg', 100, 1)
else if(material == (get_material_by_name(MAT_WOOD) || get_material_by_name(MAT_SIFWOOD)))
playsound(loc, 'sound/effects/woodcutting.ogg', 100, 1)
else
playsound(src, 'sound/weapons/smash.ogg', 50, 1)
user.do_attack_animation(src)
hardness -= damage/10
CheckHardness()
/obj/structure/simple_door/proc/CheckHardness()
if(hardness <= 0)
Dismantle(1)
/obj/structure/simple_door/proc/Dismantle(devastated = 0)
material.place_dismantled_product(get_turf(src))
visible_message("<span class='danger'>The [src] is destroyed!</span>")
qdel(src)
/obj/structure/simple_door/ex_act(severity = 1)
+1 -1
View File
@@ -47,7 +47,7 @@
else
to_chat(user, "<span class='notice'>There is a thick layer of silicate covering it.</span>")
/obj/structure/window/proc/take_damage(var/damage = 0, var/sound_effect = 1)
/obj/structure/window/take_damage(var/damage = 0, var/sound_effect = 1)
var/initialhealth = health
if(silicate)