diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm
index 8c0b5d84382..1c74362c2ea 100644
--- a/code/_onclick/item_attack.dm
+++ b/code/_onclick/item_attack.dm
@@ -74,7 +74,7 @@ avoid code duplication. This includes items that may sometimes act as a standard
return 1
-//Called when a weapon is used to make a successful melee attack on a mob.
+//Called when a weapon is used to make a successful melee attack on a mob. Returns the blocked result
/obj/item/proc/apply_hit_effect(mob/living/target, mob/living/user, var/hit_zone)
if(hitsound)
playsound(loc, hitsound, 50, 1, -1)
diff --git a/code/game/objects/items/robot/robot_items.dm b/code/game/objects/items/robot/robot_items.dm
index 7284b1709d5..164c3dd73c2 100644
--- a/code/game/objects/items/robot/robot_items.dm
+++ b/code/game/objects/items/robot/robot_items.dm
@@ -14,11 +14,11 @@
if(!istype(user))
return
+ user.visible_message("\The [user] has prodded \the [M] with \a [src]!")
+
if(!user.cell || !user.cell.checked_use(1250)) //Slightly more than a baton.
- user.visible_message("\The [user] has prodded \the [M] with its arm!")
return
- user.visible_message("\The [user] has prodded \the [M] with \a [src]!")
playsound(loc, 'sound/weapons/Egloves.ogg', 50, 1, -1)
M.apply_effect(5, STUTTER)
diff --git a/code/game/objects/items/weapons/stunbaton.dm b/code/game/objects/items/weapons/stunbaton.dm
index b0ca19215dd..be236de6378 100644
--- a/code/game/objects/items/weapons/stunbaton.dm
+++ b/code/game/objects/items/weapons/stunbaton.dm
@@ -107,8 +107,7 @@
/obj/item/weapon/melee/baton/apply_hit_effect(mob/living/target, mob/living/user, var/hit_zone)
if(isrobot(target))
- ..()
- return
+ return ..()
var/agony = agonyforce
var/stun = stunforce
@@ -118,7 +117,7 @@
affecting = H.get_organ(hit_zone)
if(user.a_intent == I_HURT)
- ..()
+ . = ..()
//whacking someone causes a much poorer electrical contact than deliberately prodding them.
agony *= 0.5
stun *= 0.5
diff --git a/code/modules/hydroponics/grown.dm b/code/modules/hydroponics/grown.dm
index 838a51d7886..7506d92de6c 100644
--- a/code/modules/hydroponics/grown.dm
+++ b/code/modules/hydroponics/grown.dm
@@ -235,7 +235,7 @@
..()
/obj/item/weapon/reagent_containers/food/snacks/grown/apply_hit_effect(mob/living/target, mob/living/user, var/hit_zone)
- ..()
+ . = ..()
if(seed && seed.get_trait(TRAIT_STINGS))
if(!reagents || reagents.total_volume <= 0)
diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm
index 4d88414e150..9d5fce632d4 100644
--- a/code/modules/mob/living/carbon/human/human_defense.dm
+++ b/code/modules/mob/living/carbon/human/human_defense.dm
@@ -178,7 +178,7 @@ emp_act
var/blocked = run_armor_check(hit_zone, "melee", I.armor_penetration, "Your armor has protected your [affecting.name].", "Your armor has softened the blow to your [affecting.name].")
standard_weapon_hit_effects(I, user, effective_force, blocked, hit_zone)
- return 1
+ return blocked
/mob/living/carbon/human/standard_weapon_hit_effects(obj/item/I, mob/living/user, var/effective_force, var/blocked, var/hit_zone)
var/obj/item/organ/external/affecting = get_organ(hit_zone)
diff --git a/code/modules/mob/living/carbon/human/species/xenomorphs/alien_facehugger.dm b/code/modules/mob/living/carbon/human/species/xenomorphs/alien_facehugger.dm
index 48bf73e16c4..691ac149bdf 100644
--- a/code/modules/mob/living/carbon/human/species/xenomorphs/alien_facehugger.dm
+++ b/code/modules/mob/living/carbon/human/species/xenomorphs/alien_facehugger.dm
@@ -33,7 +33,7 @@ var/const/MAX_ACTIVE_TIME = 400
..()
/obj/item/clothing/mask/facehugger/apply_hit_effect(mob/living/target, mob/living/user, var/hit_zone)
- ..()
+ . = ..()
user.drop_from_inventory(src)
if(hit_zone == "head")
Attach(target)
diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm
index e5ff5833e65..aaa5ae3c836 100644
--- a/code/modules/mob/living/living_defense.dm
+++ b/code/modules/mob/living/living_defense.dm
@@ -111,35 +111,10 @@
O.emp_act(severity)
..()
-/*
-//Whereas attackby() handles the general case of using items on mobs, this handles the specific case of attacking a mob with an item as a weapon.
-/mob/living/proc/attacked_with_item(obj/item/I, mob/living/user, var/target_zone)
- if(!istype(user))
- return 0
-
- /////////////////////////
- user.lastattacked = M
- M.lastattacker = user
-
- if(!no_attack_log)
- user.attack_log += "\[[time_stamp()]\] Attacked [M.name] ([M.ckey]) with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])"
- M.attack_log += "\[[time_stamp()]\] Attacked by [user.name] ([user.ckey]) with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])"
- msg_admin_attack("[key_name(user)] attacked [key_name(M)] with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])" )
- /////////////////////////
-
- user.do_attack_animation(M)
-
- var/hit_zone = resolve_hit_zone(I, user, target_zone)
- if(hit_zone)
- I.apply_hit_effect(src, user, hit_zone)
-
- return 1
-*/
-
/mob/living/proc/resolve_item_attack(obj/item/I, mob/living/user, var/target_zone)
return target_zone
-//Called when the mob is hit with an item in combat.
+//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, var/effective_force, var/hit_zone)
visible_message("[src] has been [I.attack_verb.len? pick(I.attack_verb) : "attacked"] with [I.name] by [user]!")
@@ -150,6 +125,8 @@
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/blocked, var/hit_zone)
if(!effective_force || blocked >= 2)
diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm
index 81468ed5b27..f904b66aeb8 100644
--- a/code/modules/mob/living/simple_animal/simple_animal.dm
+++ b/code/modules/mob/living/simple_animal/simple_animal.dm
@@ -293,18 +293,21 @@
/mob/living/simple_animal/hit_with_weapon(obj/item/O, mob/living/user, var/effective_force, var/hit_zone)
- if(O.force > resistance)
- var/damage = O.force
- if (O.damtype == HALLOSS)
- damage = 0
- if(supernatural && istype(O,/obj/item/weapon/nullrod))
- damage *= 2
- purge = 3
- adjustBruteLoss(damage)
- else
- user << "This weapon is ineffective, it does no damage."
+ visible_message("\The [src] has been attacked with \the [O] by [user].")
- visible_message("\The [src] has been attacked with \the [O] by [user].")
+ if(O.force <= resistance)
+ user << "This weapon is ineffective, it does no damage."
+ return 2
+
+ var/damage = O.force
+ if (O.damtype == HALLOSS)
+ damage = 0
+ if(supernatural && istype(O,/obj/item/weapon/nullrod))
+ damage *= 2
+ purge = 3
+ adjustBruteLoss(damage)
+
+ return 0
/mob/living/simple_animal/movement_delay()
var/tally = 0 //Incase I need to add stuff other than "speed" later
diff --git a/code/modules/reagents/reagent_containers/food/drinks/bottle.dm b/code/modules/reagents/reagent_containers/food/drinks/bottle.dm
index fdaf407fa3b..8e0f26dce3b 100644
--- a/code/modules/reagents/reagent_containers/food/drinks/bottle.dm
+++ b/code/modules/reagents/reagent_containers/food/drinks/bottle.dm
@@ -117,60 +117,34 @@
else
set_light(0)
-/obj/item/weapon/reagent_containers/food/drinks/bottle/attack(mob/living/target as mob, mob/living/user as mob)
- if(!target)
+/obj/item/weapon/reagent_containers/food/drinks/bottle/apply_hit_effect(mob/living/target, mob/living/user, var/hit_zone)
+ var/blocked = ..()
+
+ if(user.a_intent != I_HURT)
return
-
- if(user.a_intent != I_HURT || !isGlass)
- return ..()
-
- var/obj/item/organ/external/affecting = user.zone_sel.selecting //Find what the player is aiming at
-
- var/armor_block = 0 //Get the target's armour values for normal attack damage.
- var/armor_duration = 0 //The more force the bottle has, the longer the duration.
-
- //Calculating duration and calculating damage.
- armor_block = target.run_armor_check(affecting, "melee")
-
- //force will counteract armour, but will never increase duration
- armor_duration = smash_duration + min(0, force - target.getarmor(affecting, "melee") + 10)
-
- //Apply the damage!
- target.apply_damage(force, BRUTE, affecting, armor_block, sharp=0)
-
+ if(!smash_check(1))
+ return //won't always break on the first hit
+
// You are going to knock someone out for longer if they are not wearing a helmet.
- var/do_smash = smash_check(1) //won't always break on the first hit
- if(affecting == "head" && istype(target, /mob/living/carbon/) && do_smash)
-
- //Display an attack message.
- for(var/mob/O in viewers(user, null))
- if(target != user) O.show_message(text("\red [target] has been hit over the head with a bottle of [src.name], by [user]!"), 1)
- else O.show_message(text("\red [target] hit \himself with a bottle of [src.name] on the head!"), 1)
- //Weaken the target for the duration that we calculated and divide it by 5.
- if(armor_duration)
- target.apply_effect(min(armor_duration, 5) , WEAKEN, armor_block) // Never weaken more than a flash!
+ var/weaken_duration = 0
+ if(blocked < 2)
+ weaken_duration = smash_duration + min(0, force - target.getarmor(hit_zone, "melee") + 10)
+
+ if(hit_zone == "head" && istype(target, /mob/living/carbon/))
+ user.visible_message("\The [user] smashes [src] over [target]'s head!")
+ if(weaken_duration)
+ target.apply_effect(min(weaken_duration, 5), WEAKEN, blocked) // Never weaken more than a flash!
else
- //Default attack message and don't weaken the target.
- for(var/mob/O in viewers(user, null))
- if(target != user) O.show_message(text("\red [target] has been attacked with a bottle of [src.name], by [user]!"), 1)
- else O.show_message(text("\red [target] has attacked \himself with a bottle of [src.name]!"), 1)
+ user.visible_message("\The [user] smashes [src] into [target]!")
- //Attack logs
- user.attack_log += text("\[[time_stamp()]\] Has attacked [target.name] ([target.ckey]) with a bottle!")
- target.attack_log += text("\[[time_stamp()]\] Has been smashed with a bottle by [user.name] ([user.ckey])")
- msg_admin_attack("[user.name] ([user.ckey]) attacked [target.name] ([target.ckey]) with a bottle. (INTENT: [uppertext(user.a_intent)]) (JMP)")
+ //The reagents in the bottle splash all over the target, thanks for the idea Nodrak
+ if(reagents)
+ user.visible_message("The contents of the [src] splash all over [target]!")
+ reagents.splash(target, reagents.total_volume)
- if(do_smash)
- //The reagents in the bottle splash all over the target, thanks for the idea Nodrak
- if(reagents)
- user.visible_message("The contents of the [src] splash all over [target]!")
- reagents.splash(target, reagents.total_volume)
-
- //Finally, smash the bottle. This kills (qdel) the bottle.
- var/obj/item/weapon/broken_bottle/B = src.smash(target.loc, target)
- user.put_in_active_hand(B)
-
- return
+ //Finally, smash the bottle. This kills (qdel) the bottle.
+ var/obj/item/weapon/broken_bottle/B = smash(target.loc, target)
+ user.put_in_active_hand(B)
//Keeping this here for now, I'll ask if I should keep it here.
/obj/item/weapon/broken_bottle