Reworks armor damage reduction + armor components + more goodies. (#11106)

Ports Baystation12/Baystation12#27254 and Baystation12/Baystation12#24787 and everything inbetween I guess.

Note that this PR makes guns and armor overall stronger. Lasers also once again do organ damage.
This commit is contained in:
Matt Atlas
2021-02-14 17:54:45 +02:00
committed by GitHub
parent 3ab59b8ff7
commit c30cd94024
138 changed files with 2187 additions and 848 deletions
@@ -148,7 +148,7 @@
// You are going to knock someone out for longer if they are not wearing a helmet.
var/weaken_duration = 0
if(blocked < 100)
weaken_duration = smash_duration + min(0, force - target.getarmor(hit_zone, "melee") + 10)
weaken_duration = smash_duration + min(0, force - target.get_blocked_ratio(hit_zone, BRUTE) * 100 + 10)
var/mob/living/carbon/human/H = target
if(istype(H) && H.headcheck(hit_zone))
@@ -54,7 +54,7 @@
if(!inj_time)
return
user.visible_message(SPAN_WARNING("\The [user] is trying to inject \the [L] with \the [src]!"), SPAN_NOTICE("You are trying to inject \the [L] with \the [src]."))
if(armorcheck && L.run_armor_check(target_zone,"melee",0,"Your armor slows down the injection!","Your armor slows down the injection!"))
if(armorcheck && L.get_blocked_ratio(target_zone, BRUTE, damage = 10))
inj_time += 6 SECONDS
if(!do_mob(user, L, inj_time))
return 1
@@ -124,7 +124,7 @@
user.visible_message("<b>[user]</b> aims \the [src] between [P] ribs!", SPAN_NOTICE("You aim \the [src] between [SM] ribs!"))
if(!do_mob(user, target, 1.5 SECONDS))
return
var/blocked = H.getarmor_organ(H.organs_by_name[BP_CHEST], "melee")
var/blocked = H.get_blocked_ratio(BP_CHEST, BRUTE, DAM_SHARP, damage = 5)
if(blocked > 20)
user.visible_message("<b>[user]</b> jabs \the [src] into [H], but their armor blocks it!", SPAN_WARNING("You jab \the [src] into [H], but their armor blocks it!"))
return
@@ -306,7 +306,8 @@
if((user != target) && H.check_shields(7, src, user, "\the [src]"))
return
if (target != user && H.getarmor(target_zone, "melee") > 5 && prob(50))
var/armor = H.get_blocked_ratio(target_zone, BRUTE, damage_flags = DAM_SHARP, damage = 5)*100
if (target != user && armor > 50 && prob(50))
for(var/mob/O in viewers(world.view, user))
O.show_message(text(SPAN_DANGER("[user] tries to stab [target] in \the [hit_area] with [src.name], but the attack is deflected by armor!")), 1)
user.remove_from_mob(src)