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 17:00:24 -04:00
committed by VirgoBot
parent 4c71587410
commit e4deaa6478
27 changed files with 267 additions and 116 deletions
@@ -16,7 +16,7 @@
H.take_damage(rand(10,30))
qdel()
/obj/item/modular_computer/proc/take_damage(var/amount, var/component_probability, var/damage_casing = 1, var/randomize = 1)
/obj/item/modular_computer/take_damage(var/amount, var/component_probability, var/damage_casing = 1, var/randomize = 1)
if(randomize)
// 75%-125%, rand() works with integers, apparently.
amount *= (rand(75, 125) / 100.0)
@@ -81,7 +81,7 @@
to_chat(user, "It seems to be slightly damaged.")
// Damages the component. Contains necessary checks. Negative damage "heals" the component.
/obj/item/weapon/computer_hardware/proc/take_damage(var/amount)
/obj/item/weapon/computer_hardware/take_damage(var/amount)
damage += round(amount) // We want nice rounded numbers here.
damage = between(0, damage, max_damage) // Clamp the value.
+1 -1
View File
@@ -292,7 +292,7 @@ var/list/organ_cache = list()
W.time_inflicted = world.time
//Note: external organs have their own version of this proc
/obj/item/organ/proc/take_damage(amount, var/silent=0)
/obj/item/organ/take_damage(amount, var/silent=0)
if(src.robotic >= ORGAN_ROBOT)
src.damage = between(0, src.damage + (amount * 0.8), max_damage)
else
+10
View File
@@ -389,6 +389,16 @@ var/global/list/light_type_cache = list()
broken()
return 1
/obj/machinery/light/take_damage(var/damage)
if(!damage)
return
if(status == LIGHT_EMPTY||status == LIGHT_BROKEN)
return
if(!(status == LIGHT_OK||status == LIGHT_BURNED))
return
broken()
return 1
/obj/machinery/light/blob_act()
broken()
+3
View File
@@ -60,6 +60,9 @@
user.do_attack_animation(src)
user.setClickCooldown(user.get_attack_speed())
/obj/effect/energy_field/take_damage(var/damage)
adjust_strength(-damage / 20)
/obj/effect/energy_field/attack_hand(var/mob/living/user)
impact_effect(3) // Harmless, but still produces the 'impact' effect.
..()
+1 -1
View File
@@ -44,7 +44,7 @@ var/list/table_icon_cache = list()
health += maxhealth - old_maxhealth
/obj/structure/table/proc/take_damage(amount)
/obj/structure/table/take_damage(amount)
// 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)
+9
View File
@@ -424,3 +424,12 @@
new /obj/effect/decal/cleanable/blood/oil(src.loc)
spawn(1) healthcheck()
return 1
/obj/vehicle/take_damage(var/damage)
if(!damage)
return
src.health -= damage
if(mechanical && prob(10))
new /obj/effect/decal/cleanable/blood/oil(src.loc)
spawn(1) healthcheck()
return 1