diff --git a/code/modules/mob/living/carbon/human/human_damage.dm b/code/modules/mob/living/carbon/human/human_damage.dm index 59305a5de3f..17f53a6d578 100644 --- a/code/modules/mob/living/carbon/human/human_damage.dm +++ b/code/modules/mob/living/carbon/human/human_damage.dm @@ -21,7 +21,7 @@ if (stat == CONSCIOUS && (src in dead_mob_list)) //Defib fix update_revive() return - + /mob/living/carbon/human/proc/update_revive() // handles revival through other means than cloning or adminbus (defib, IPC repair) stat = CONSCIOUS dead_mob_list -= src @@ -29,7 +29,7 @@ mob_list |= src ear_deaf = 0 tod = 0 - timeofdeath = 0 + timeofdeath = 0 /mob/living/carbon/human/getBrainLoss() if(species && species.flags & NO_INTORGANS) return @@ -139,7 +139,7 @@ var/datum/organ/external/O = pick(candidates) O.mutate() src << "Something is not right with your [O.display_name]..." - O.add_autopsy_data("Mutation", amount) + O.add_autopsy_data("Mutation", amount) return else if (prob(heal_prob)) @@ -292,7 +292,8 @@ This function restores all organs. //Handle BRUTE and BURN damage handle_suit_punctures(damagetype, damage) - if(blocked >= 2) return 0 + blocked = (100-blocked)/100 + if(blocked <= 0) return 0 var/datum/organ/external/organ = null if(isorgan(def_zone)) @@ -302,8 +303,7 @@ This function restores all organs. organ = get_organ(check_zone(def_zone)) if(!organ) return 0 - if(blocked) - damage = (damage/(blocked+1)) + damage = damage * blocked switch(damagetype) if(BRUTE) diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 29ec501ba7a..46861b76b66 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -271,7 +271,7 @@ emp_act weapon_sharp = 0 weapon_edge = 0 - if(armor >= 2) return 0 + if(armor >= 100) return 0 if(!I.force) return 0 var/Iforce = I.force //to avoid runtimes on the forcesay checks at the bottom. Some items might delete themselves if you drop them. (stunning yourself, ninja swords) diff --git a/code/modules/mob/living/damage_procs.dm b/code/modules/mob/living/damage_procs.dm index ce1ab84b253..9126dc6bd95 100644 --- a/code/modules/mob/living/damage_procs.dm +++ b/code/modules/mob/living/damage_procs.dm @@ -9,29 +9,30 @@ standard 0 if fail */ /mob/living/proc/apply_damage(var/damage = 0,var/damagetype = BRUTE, var/def_zone = null, var/blocked = 0, var/used_weapon = null, var/sharp = 0, var/edge = 0) - if(!damage || (blocked >= 2)) return 0 + blocked = (100-blocked)/100 + if(!damage || (blocked <= 0)) return 0 switch(damagetype) if(BRUTE) - adjustBruteLoss(damage/(blocked+1)) + adjustBruteLoss(damage * blocked) if(BURN) if(M_RESIST_HEAT in mutations) damage = 0 - adjustFireLoss(damage/(blocked+1)) + adjustFireLoss(damage * blocked) if(TOX) - adjustToxLoss(damage/(blocked+1)) + adjustToxLoss(damage * blocked) if(OXY) - adjustOxyLoss(damage/(blocked+1)) + adjustOxyLoss(damage * blocked) if(CLONE) - adjustCloneLoss(damage/(blocked+1)) + adjustCloneLoss(damage * blocked) if(HALLOSS) - adjustHalLoss(damage/(blocked+1)) + adjustHalLoss(damage * blocked) if(STAMINA) - adjustStaminaLoss(damage/(blocked+1)) + adjustStaminaLoss(damage * blocked) updatehealth() return 1 /mob/living/proc/apply_damages(var/brute = 0, var/burn = 0, var/tox = 0, var/oxy = 0, var/clone = 0, var/halloss = 0, var/def_zone = null, var/blocked = 0, var/stamina = 0) - if(blocked >= 2) return 0 + if(blocked >= 100) return 0 if(brute) apply_damage(brute, BRUTE, def_zone, blocked) if(burn) apply_damage(burn, BURN, def_zone, blocked) if(tox) apply_damage(tox, TOX, def_zone, blocked) @@ -44,27 +45,28 @@ /mob/living/proc/apply_effect(var/effect = 0,var/effecttype = STUN, var/blocked = 0) - if(!effect || (blocked >= 2)) return 0 + blocked = (100-blocked)/100 + if(!effect || (blocked <= 0)) return 0 switch(effecttype) if(STUN) - Stun(effect/(blocked+1)) + Stun(effect * blocked) if(WEAKEN) - Weaken(effect/(blocked+1)) + Weaken(effect * blocked) if(PARALYZE) - Paralyse(effect/(blocked+1)) + Paralyse(effect * blocked) if(AGONY) halloss += effect // Useful for objects that cause "subdual" damage. PAIN! if(IRRADIATE) - radiation += max((((effect - (effect*(getarmor(null, "rad")/100))))/(blocked+1)),0)//Rads auto check armor + radiation += max(effect * ((100-run_armor_check(null, "rad", "Your clothes feel warm.", "Your clothes feel warm."))/100),0)//Rads auto check armor if(STUTTER) if(status_flags & CANSTUN) // stun is usually associated with stutter - stuttering = max(stuttering,(effect/(blocked+1))) + stuttering = max(stuttering,(effect * blocked)) if(EYE_BLUR) - eye_blurry = max(eye_blurry,(effect/(blocked+1))) + eye_blurry = max(eye_blurry,(effect * blocked)) if(DROWSY) - drowsyness = max(drowsyness,(effect/(blocked+1))) + drowsyness = max(drowsyness,(effect * blocked)) if(JITTER) - jitteriness = max(jitteriness,(effect/(blocked+1))) + jitteriness = max(jitteriness,(effect * blocked)) updatehealth() return 1 @@ -79,7 +81,7 @@ return ..() /mob/living/proc/apply_effects(var/stun = 0, var/weaken = 0, var/paralyze = 0, var/irradiate = 0, var/stutter = 0, var/eyeblur = 0, var/drowsy = 0, var/agony = 0, var/blocked = 0, var/stamina = 0, var/jitter = 0) - if(blocked >= 2) return 0 + if(blocked >= 100) return 0 if(stun) apply_effect(stun, STUN, blocked) if(weaken) apply_effect(weaken, WEAKEN, blocked) if(paralyze) apply_effect(paralyze, PARALYZE, blocked) diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index 73c5f3b1857..d35ae4ca7e9 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -12,25 +12,19 @@ */ /mob/living/proc/run_armor_check(var/def_zone = null, var/attack_flag = "melee", var/absorb_text = null, var/soften_text = null) var/armor = getarmor(def_zone, attack_flag) - var/absorb = 0 - if(prob(armor)) - absorb += 1 - if(prob(armor)) - absorb += 1 - if(absorb >= 2) - if(absorb_text) - show_message("[absorb_text]") - else - show_message("\red Your armor absorbs the blow!") - return 2 - if(absorb == 1) - if(absorb_text) - show_message("[soften_text]",4) - else - show_message("\red Your armor softens the blow!") - return 1 - return 0 + if(armor >= 100) + if(absorb_text) + src << "[absorb_text]" + else + src << "Your armor absorbs the blow!" + else if(armor > 0) + if(soften_text) + src << "[soften_text]" + else + src << "Your armor softens the blow!" + world << "Armor is [armor]" + return armor //if null is passed for def_zone, then this should return something appropriate for all zones (e.g. area effect damage) /mob/living/proc/getarmor(var/def_zone, var/type) @@ -73,21 +67,20 @@ */ //Armor - var/absorb = run_armor_check(def_zone, P.flag) + var/armor = run_armor_check(def_zone, P.flag) var/proj_sharp = is_sharp(P) var/proj_edge = has_edge(P) if ((proj_sharp || proj_edge) && prob(getarmor(def_zone, P.flag))) proj_sharp = 0 proj_edge = 0 - if(!P.nodamage) - apply_damage(P.damage, P.damage_type, def_zone, absorb, 0, P, sharp=proj_sharp, edge=proj_edge) - - P.on_hit(src, absorb, def_zone) - if(istype(P, /obj/item/projectile/beam/lightning)) + if(istype(P, /obj/item/projectile/beam/lightning)) //Stupid snowflake lightning gun. if(P.damage >= 200) src.dust() - return absorb + + if(!P.nodamage) + apply_damage(P.damage, P.damage_type, def_zone, armor) + return P.on_hit(src, armor, def_zone) //Handles the effects of "stun" weapons /mob/living/proc/stun_effect_act(var/stun_amount, var/agony_amount, var/def_zone, var/used_weapon=null) @@ -117,6 +110,7 @@ /mob/living/hitby(atom/movable/AM as mob|obj,var/speed = 5)//Standardization and logging -Sieve if(istype(AM,/obj/)) var/obj/O = AM + var/zone = ran_zone("chest", 65)//Hits a random part of the body, geared towards the chest var/dtype = BRUTE if(istype(O,/obj/item/weapon)) var/obj/item/weapon/W = O @@ -140,8 +134,7 @@ src.visible_message("\red [src] has been hit by [O].") var/armor = run_armor_check(null, "melee") - if(armor < 2) - apply_damage(throw_damage, dtype, null, armor, is_sharp(O), has_edge(O), O) + apply_damage(throw_damage, dtype, zone, armor, O, is_sharp(O), has_edge(O)) O.throwing = 0 //it hit, so stop moving diff --git a/code/modules/power/singularity/particle_accelerator/particle.dm b/code/modules/power/singularity/particle_accelerator/particle.dm index a38fadbe457..88c87486c3f 100644 --- a/code/modules/power/singularity/particle_accelerator/particle.dm +++ b/code/modules/power/singularity/particle_accelerator/particle.dm @@ -75,14 +75,14 @@ /obj/effect/accelerated_particle/proc/toxmob(var/mob/living/M) - var/radiation = (energy*2) -/* if(istype(M,/mob/living/carbon/human)) + /*var/radiation = (energy*2) + if(istype(M,/mob/living/carbon/human)) if(M:wear_suit) //TODO: check for radiation protection radiation = round(radiation/2,1) if(istype(M,/mob/living/carbon/monkey)) if(M:wear_suit) //TODO: check for radiation protection radiation = round(radiation/2,1)*/ - M.apply_effect((radiation*3),IRRADIATE,0) + M.apply_effect((energy*6),IRRADIATE,0) M.updatehealth() //M << "\red You feel odd." return diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index 38fa509e660..75be76b5af1 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -76,12 +76,10 @@ qdel(src) proc/on_hit(var/atom/target, var/blocked = 0) - if(blocked >= 2) return 0//Full block if(!isliving(target)) return 0 if(isanimal(target)) return 0 var/mob/living/L = target - L.apply_effects(stun, weaken, paralyze, irradiate, stutter, eyeblur, drowsy, agony, blocked, stamina, jitter) // add in AGONY! - return 1 + return L.apply_effects(stun, weaken, paralyze, irradiate, stutter, eyeblur, drowsy, agony, blocked, stamina, jitter) proc/check_fire(var/mob/living/target as mob, var/mob/living/user as mob) //Checks if you can hit them or not. if(!istype(target) || !istype(user))