diff --git a/code/modules/heavy_vehicle/mech_damage.dm b/code/modules/heavy_vehicle/mech_damage.dm index 87bad9f9e3e..007d1e61600 100644 --- a/code/modules/heavy_vehicle/mech_damage.dm +++ b/code/modules/heavy_vehicle/mech_damage.dm @@ -1,5 +1,4 @@ /mob/living/heavy_vehicle/apply_effect(var/effect = 0,var/effecttype = STUN, var/blocked = 0) - if(!effect || (blocked >= 100)) return 0 @@ -7,7 +6,7 @@ if(effect > 0 && effecttype == IRRADIATE) var/mob/living/pilot = pick(pilots) return pilot.apply_effect(effect, effecttype, blocked) - if(effecttype in list(PAIN, STUTTER, EYE_BLUR, DROWSY, STUN, WEAKEN)) + if(!(effecttype in list(PAIN, STUTTER, EYE_BLUR, DROWSY, STUN, WEAKEN))) . = ..() /mob/living/heavy_vehicle/proc/attacked_by(var/obj/item/I, var/mob/living/user, var/def_zone) @@ -74,7 +73,7 @@ else return body -/mob/living/heavy_vehicle/apply_damage(var/damage = 0,var/damagetype = BRUTE, var/def_zone = null, var/blocked = 0, var/used_weapon = null, var/damage_flags, var/armor_pen, var/silent = FALSE) +/mob/living/heavy_vehicle/apply_damage(var/damage = 0, var/damagetype = BRUTE, var/def_zone, var/used_weapon, var/damage_flags, var/armor_pen, var/silent = FALSE) if(!damage) return 0 @@ -82,6 +81,9 @@ damage = after_armor[1] damagetype = after_armor[2] + if(!damage) + return 0 + var/target = zoneToComponent(def_zone) //Only 2 types of damage concern mechs and vehicles switch(damagetype) @@ -111,6 +113,17 @@ return total /mob/living/heavy_vehicle/emp_act(var/severity) + var/ratio = get_blocked_ratio(null, BURN, null, (4-severity) * 20) + + if(ratio >= 0.5) + for(var/mob/living/m in pilots) + to_chat(m, SPAN_NOTICE("Your Faraday shielding absorbed the pulse!")) + return + else if(ratio > 0) + for(var/mob/living/m in pilots) + to_chat(m, SPAN_NOTICE("Your Faraday shielding mitigated the pulse!")) + + emp_damage += round((12 - (severity*3))*( 1 - ratio)) if(severity <= 3) for(var/obj/item/thing in list(arms,legs,head,body)) thing.emp_act(severity) diff --git a/code/modules/mob/living/carbon/carbon_defense.dm b/code/modules/mob/living/carbon/carbon_defense.dm index 12e394b3f55..582eed83701 100644 --- a/code/modules/mob/living/carbon/carbon_defense.dm +++ b/code/modules/mob/living/carbon/carbon_defense.dm @@ -99,7 +99,7 @@ //Apply weapon damage var/damage_flags = I.damage_flags() - apply_damage(effective_force, I.damtype, hit_zone, I, damage_flags) + apply_damage(effective_force, I.damtype, hit_zone, I, damage_flags, I.armor_penetration) //Melee weapon embedded object code. if (I && I.damtype == BRUTE && !I.anchored && !is_robot_module(I)) diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index bd2159e9e5a..056349d6faf 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -119,8 +119,6 @@ var/turf/simulated/location = get_turf(src) if(istype(location)) location.add_blood_floor(src) - return blocked - //returns 0 if the effects failed to apply for some reason, 1 otherwise. /mob/living/proc/standard_weapon_hit_effects(obj/item/I, mob/living/user, var/effective_force, var/hit_zone) if(!effective_force) @@ -132,13 +130,8 @@ //Apply weapon damage var/damage_flags = I.damage_flags() - if(prob(blocked)) //armor provides a chance to turn sharp/edge weapon attacks into blunt ones - damage_flags &= ~DAM_SHARP - damage_flags &= ~DAM_EDGE - apply_damage(effective_force, I.damtype, hit_zone, I, damage_flags, I.armor_penetration) - - return TRUE + return apply_damage(effective_force, I.damtype, hit_zone, I, damage_flags, I.armor_penetration) //this proc handles being hit by a thrown atom /mob/living/hitby(atom/movable/AM, var/speed = THROWFORCE_SPEED_DIVISOR)//Standardization and logging -Sieve diff --git a/html/changelogs/mattatlas-armorfixesagain.yml b/html/changelogs/mattatlas-armorfixesagain.yml new file mode 100644 index 00000000000..1abd250c290 --- /dev/null +++ b/html/changelogs/mattatlas-armorfixesagain.yml @@ -0,0 +1,42 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +# balance +# admin +# backend +# security +# refactor +################################# + +# Your name. +author: MattAtlas + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - bugfix: "Melee weapons can now apply AP to humans too instead of just simple mobs." + - bugfix: "Mech armor code should now be more consistent. Mech armor now actually blocks EMPs."