diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index 2f5378278baba..fbb82033fa9fc 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -298,6 +298,7 @@ avoid code duplication. This includes items that may sometimes act as a standard SPAN_WARNING("You felt something bounce off you harmlessly.") ) return TRUE +<<<<<<< ours var/hit_zone = resolve_item_attack(weapon, user, user.zone_sel? user.zone_sel.selecting : ran_zone()) if (!hit_zone) @@ -323,6 +324,12 @@ avoid code duplication. This includes items that may sometimes act as a standard "Was attacked with \a [weapon] (DAMTYE: [uppertext(weapon.damtype)])", "used \a [weapon] (DAMTYE: [uppertext(weapon.damtype)]) to attack" ) +======= + + var/hit_zone = resolve_item_attack(weapon, user, user.zone_sel? user.zone_sel.selecting : ran_zone()) + if (!hit_zone) + return TRUE +>>>>>>> theirs var/datum/attack_result/result = hit_zone if (istype(result)) @@ -451,6 +458,11 @@ avoid code duplication. This includes items that may sometimes act as a standard * Returns boolean to indicate whether or not damage was dealt. */ /obj/item/proc/apply_hit_effect(mob/living/target, mob/living/user, hit_zone) +<<<<<<< ours +======= + if (hitsound) + playsound(loc, hitsound, 75, TRUE) +>>>>>>> theirs var/power = force if (MUTATION_HULK in user.mutations && damtype == DAMAGE_BRUTE) //Repeat this check here because it is only used under use_weapon to check if it's even possible to damage the mob. Value not carried over here. power *= 2 diff --git a/code/modules/mob/living/damage_procs.dm b/code/modules/mob/living/damage_procs.dm index ab9716a9142a3..99c4230d32ba1 100644 --- a/code/modules/mob/living/damage_procs.dm +++ b/code/modules/mob/living/damage_procs.dm @@ -18,6 +18,14 @@ if(!damage) return FALSE + switch (damagetype) + if (DAMAGE_EMP, DAMAGE_FIRE) + return FALSE // These damages are handled separately by existing legacy code + if (DAMAGE_BIO) + damagetype = DAMAGE_TOXIN + if (DAMAGE_EXPLODE, DAMAGE_PSIONIC) + damagetype = DAMAGE_BRUTE + switch(damagetype) if (DAMAGE_BRUTE) adjustBruteLoss(damage) @@ -31,12 +39,14 @@ adjustOxyLoss(damage) if (DAMAGE_GENETIC) adjustCloneLoss(damage) - if (DAMAGE_PAIN) + if (DAMAGE_STUN, DAMAGE_PAIN) adjustHalLoss(damage) if (DAMAGE_SHOCK) electrocute_act(damage, used_weapon, 1, def_zone) if (DAMAGE_RADIATION) apply_radiation(damage) + if (DAMAGE_BRAIN) + adjustBrainLoss(damage) updatehealth() return TRUE diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index 85170b9e950a6..99675b77b0c25 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -133,6 +133,22 @@ ///Called when the mob is hit with an item in combat. Returns the blocked result /mob/living/proc/hit_with_weapon(obj/item/I, mob/living/user, effective_force, hit_zone) +<<<<<<< ours +======= + var/weapon_mention + if(I.attack_message_name()) + weapon_mention = " with [I.attack_message_name()]" + visible_message(SPAN_DANGER("\The [src] has been [length(I.attack_verb)? pick(I.attack_verb) : "attacked"][weapon_mention] by \the [user]!")) + + . = standard_weapon_hit_effects(I, user, effective_force, hit_zone) + + if (I.damtype == DAMAGE_BRUTE && prob(33)) // Added blood for whacking non-humans too + var/turf/simulated/location = get_turf(src) + if(istype(location)) location.add_blood_floor(src) + +///returns false if the effects failed to apply for some reason, true otherwise. +/mob/living/proc/standard_weapon_hit_effects(obj/item/I, mob/living/user, effective_force, hit_zone) +>>>>>>> theirs if(!effective_force) return FALSE diff --git a/code/modules/mob/living/simple_animal/defense.dm b/code/modules/mob/living/simple_animal/defense.dm index 353eb5dc511ff..a05330f10827a 100644 --- a/code/modules/mob/living/simple_animal/defense.dm +++ b/code/modules/mob/living/simple_animal/defense.dm @@ -59,6 +59,10 @@ return +<<<<<<< ours +======= + +>>>>>>> theirs /mob/living/simple_animal/use_tool(obj/item/tool, mob/user, list/click_params) // Butcher's Cleaver - Butcher dead mob if (istype(tool, /obj/item/material/knife/kitchen/cleaver)) @@ -121,14 +125,25 @@ return ..() +<<<<<<< ours /mob/living/simple_animal/post_use_item(obj/item/tool, mob/living/user, interaction_handled, use_call) +======= +/mob/living/simple_animal/post_use_item(obj/item/tool, mob/living/user, interaction_handled, use_call, click_params) +>>>>>>> theirs if (interaction_handled && ai_holder && (use_call == "attack" || use_call == "weapon")) ai_holder.react_to_attack(user) ..() +<<<<<<< ours /mob/living/simple_animal/hit_with_weapon(obj/item/O, mob/living/user, effective_force, hit_zone) if(O.force <= resistance) +======= +/mob/living/simple_animal/hit_with_weapon(obj/item/O, mob/living/user, effective_force, hit_zone) + + visible_message(SPAN_DANGER("\The [src] has been attacked with \the [O] by [user]!")) + if (O.force <= resistance) +>>>>>>> theirs to_chat(user, SPAN_DANGER("This weapon is ineffective; it does no damage.")) return FALSE @@ -143,6 +158,11 @@ adjustBruteLoss(damage) if (O.edge || O.sharp) adjustBleedTicks(damage) +<<<<<<< ours +======= + if (ai_holder) + ai_holder.react_to_attack(user) +>>>>>>> theirs return TRUE /mob/living/simple_animal/proc/reflect_unarmed_damage(mob/living/carbon/human/attacker, damage_type, description)