diff --git a/code/datums/martial/sleeping_carp.dm b/code/datums/martial/sleeping_carp.dm index 26926c5cc1e..42575b85fb3 100644 --- a/code/datums/martial/sleeping_carp.dm +++ b/code/datums/martial/sleeping_carp.dm @@ -241,7 +241,7 @@ else return ..() -/obj/item/weapon/twohanded/bostaff/hit_reaction(mob/living/carbon/human/owner, attack_text, final_block_chance) +/obj/item/weapon/twohanded/bostaff/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) if(wielded) return ..() return 0 diff --git a/code/game/gamemodes/changeling/powers/mutations.dm b/code/game/gamemodes/changeling/powers/mutations.dm index aef9b6f1d26..99631f18f49 100644 --- a/code/game/gamemodes/changeling/powers/mutations.dm +++ b/code/game/gamemodes/changeling/powers/mutations.dm @@ -403,7 +403,7 @@ if(ismob(loc)) loc.visible_message("The end of [loc.name]\'s hand inflates rapidly, forming a huge shield-like mass!", "We inflate our hand into a strong shield.", "You hear organic matter ripping and tearing!") -/obj/item/weapon/shield/changeling/hit_reaction() +/obj/item/weapon/shield/changeling/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) if(remaining_uses < 1) if(ishuman(loc)) var/mob/living/carbon/human/H = loc diff --git a/code/game/gamemodes/cult/cult_items.dm b/code/game/gamemodes/cult/cult_items.dm index 622fd4e7d5b..9d9bb86d60f 100644 --- a/code/game/gamemodes/cult/cult_items.dm +++ b/code/game/gamemodes/cult/cult_items.dm @@ -200,7 +200,7 @@ user.adjustBruteLoss(25) user.dropItemToGround(src, TRUE) -/obj/item/clothing/suit/hooded/cultrobes/cult_shield/hit_reaction(mob/living/carbon/human/owner, attack_text, isinhands) +/obj/item/clothing/suit/hooded/cultrobes/cult_shield/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) if(current_charges) owner.visible_message("\The [attack_text] is deflected in a burst of blood-red sparks!") current_charges-- diff --git a/code/game/gamemodes/miniantags/abduction/abduction_gear.dm b/code/game/gamemodes/miniantags/abduction/abduction_gear.dm index 6ee2ca12191..038bb9c7e06 100644 --- a/code/game/gamemodes/miniantags/abduction/abduction_gear.dm +++ b/code/game/gamemodes/miniantags/abduction/abduction_gear.dm @@ -83,7 +83,7 @@ M.cut_overlays() M.regenerate_icons() -/obj/item/clothing/suit/armor/abductor/vest/hit_reaction() +/obj/item/clothing/suit/armor/abductor/vest/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) DeactivateStealth() return 0 @@ -393,7 +393,7 @@ Congratulations! You are now trained for invasive xenobiology research!"} if(ishuman(L)) var/mob/living/carbon/human/H = L - if(H.check_shields(0, "[user]'s [name]", src, MELEE_ATTACK)) + if(H.check_shields(src, 0, "[user]'s [name]", MELEE_ATTACK)) playsound(L, 'sound/weapons/genhit.ogg', 50, 1) return 0 diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 4ded6d26df6..045ee1c00e9 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -365,7 +365,7 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE) // afterattack() and attack() prototypes moved to _onclick/item_attack.dm for consistency -/obj/item/proc/hit_reaction(mob/living/carbon/human/owner, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) +/obj/item/proc/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) if(prob(final_block_chance)) owner.visible_message("[owner] blocks [attack_text] with [src]!") return 1 diff --git a/code/game/objects/items/robot/robot_items.dm b/code/game/objects/items/robot/robot_items.dm index b9774b0d805..8d6c74a83cd 100644 --- a/code/game/objects/items/robot/robot_items.dm +++ b/code/game/objects/items/robot/robot_items.dm @@ -13,7 +13,7 @@ /obj/item/borg/stun/attack(mob/living/M, mob/living/user) if(ishuman(M)) var/mob/living/carbon/human/H = M - if(H.check_shields(0, "[M]'s [name]", src, MELEE_ATTACK)) + if(H.check_shields(src, 0, "[M]'s [name]", MELEE_ATTACK)) playsound(M, 'sound/weapons/genhit.ogg', 50, 1) return FALSE if(iscyborg(user)) diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index e99f6aaffeb..5472fc10e7f 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -316,7 +316,7 @@ origin_tech = null attack_verb = list("attacked", "struck", "hit") -/obj/item/weapon/twohanded/dualsaber/toy/hit_reaction() +/obj/item/weapon/twohanded/dualsaber/toy/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) return 0 /obj/item/weapon/twohanded/dualsaber/toy/IsReflect()//Stops Toy Dualsabers from reflecting energy projectiles diff --git a/code/game/objects/items/weapons/flamethrower.dm b/code/game/objects/items/weapons/flamethrower.dm index 8ea4e7a5d13..9f241914837 100755 --- a/code/game/objects/items/weapons/flamethrower.dm +++ b/code/game/objects/items/weapons/flamethrower.dm @@ -222,7 +222,7 @@ /obj/item/weapon/flamethrower/full/tank create_with_tank = TRUE -/obj/item/weapon/flamethrower/hit_reaction(mob/living/carbon/human/owner, attack_text, final_block_chance, damage, attack_type) +/obj/item/weapon/flamethrower/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) if(ptank && damage && attack_type == PROJECTILE_ATTACK && prob(15)) owner.visible_message("[attack_text] hits the fueltank on [owner]'s [src], rupturing it! What a shot!") var/target_turf = get_turf(owner) diff --git a/code/game/objects/items/weapons/grenades/grenade.dm b/code/game/objects/items/weapons/grenades/grenade.dm index 008b39ea51d..245d495e2a4 100644 --- a/code/game/objects/items/weapons/grenades/grenade.dm +++ b/code/game/objects/items/weapons/grenades/grenade.dm @@ -104,7 +104,7 @@ /obj/item/weapon/grenade/attack_paw(mob/user) return attack_hand(user) -/obj/item/weapon/grenade/hit_reaction(mob/living/carbon/human/owner, attack_text, final_block_chance, damage, attack_type) +/obj/item/weapon/grenade/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) if(damage && attack_type == PROJECTILE_ATTACK && prob(15)) owner.visible_message("[attack_text] hits [owner]'s [src], setting it off! What a shot!") prime() diff --git a/code/game/objects/items/weapons/holy_weapons.dm b/code/game/objects/items/weapons/holy_weapons.dm index 4b5acd949d3..00482abf2f5 100644 --- a/code/game/objects/items/weapons/holy_weapons.dm +++ b/code/game/objects/items/weapons/holy_weapons.dm @@ -91,7 +91,7 @@ hitsound = 'sound/weapons/bladeslice.ogg' attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") -/obj/item/weapon/nullrod/claymore/hit_reaction(mob/living/carbon/human/owner, attack_text, final_block_chance, damage, attack_type) +/obj/item/weapon/nullrod/claymore/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) if(attack_type == PROJECTILE_ATTACK) final_block_chance = 0 //Don't bring a sword to a gunfight return ..() diff --git a/code/game/objects/items/weapons/melee/energy.dm b/code/game/objects/items/weapons/melee/energy.dm index d88c1371a74..ff8db01d3ce 100644 --- a/code/game/objects/items/weapons/melee/energy.dm +++ b/code/game/objects/items/weapons/melee/energy.dm @@ -95,7 +95,7 @@ else STOP_PROCESSING(SSobj, src) -/obj/item/weapon/melee/energy/sword/hit_reaction(mob/living/carbon/human/owner, attack_text, final_block_chance) +/obj/item/weapon/melee/energy/sword/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) if(active) return ..() return 0 @@ -188,7 +188,7 @@ icon_state = "esaw_0" item_color = null -/obj/item/weapon/melee/energy/sword/cyborg/saw/hit_reaction() +/obj/item/weapon/melee/energy/sword/cyborg/saw/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) return 0 /obj/item/weapon/melee/energy/sword/saber diff --git a/code/game/objects/items/weapons/melee/misc.dm b/code/game/objects/items/weapons/melee/misc.dm index 19b9e07f73a..d17b5d5d33a 100644 --- a/code/game/objects/items/weapons/melee/misc.dm +++ b/code/game/objects/items/weapons/melee/misc.dm @@ -60,7 +60,7 @@ hitsound = 'sound/weapons/rapierhit.ogg' materials = list(MAT_METAL = 1000) -/obj/item/weapon/melee/sabre/hit_reaction(mob/living/carbon/human/owner, attack_text, final_block_chance, damage, attack_type) +/obj/item/weapon/melee/sabre/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) if(attack_type == PROJECTILE_ATTACK) final_block_chance = 0 //Don't bring a sword to a gunfight return ..() @@ -105,7 +105,7 @@ if(cooldown <= world.time) if(ishuman(target)) var/mob/living/carbon/human/H = target - if (H.check_shields(0, "[user]'s [name]", src, MELEE_ATTACK)) + if (H.check_shields(src, 0, "[user]'s [name]", MELEE_ATTACK)) return if(check_martial_counter(H, user)) return diff --git a/code/game/objects/items/weapons/shields.dm b/code/game/objects/items/weapons/shields.dm index 2bc4ada646c..b8270158133 100644 --- a/code/game/objects/items/weapons/shields.dm +++ b/code/game/objects/items/weapons/shields.dm @@ -29,7 +29,7 @@ else return ..() -/obj/item/weapon/shield/hit_reaction(mob/living/carbon/human/owner, attack_text, final_block_chance, damage, attack_type) +/obj/item/weapon/shield/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) if(attack_type == THROWN_PROJECTILE_ATTACK) final_block_chance += 30 if(attack_type == LEAP_ATTACK) @@ -66,7 +66,7 @@ attack_verb = list("shoved", "bashed") var/active = 0 -/obj/item/weapon/shield/energy/hit_reaction(mob/living/carbon/human/owner, attack_text, final_block_chance) +/obj/item/weapon/shield/energy/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) return 0 /obj/item/weapon/shield/energy/IsReflect() @@ -109,7 +109,7 @@ w_class = WEIGHT_CLASS_NORMAL var/active = 0 -/obj/item/weapon/shield/riot/tele/hit_reaction(mob/living/carbon/human/owner, attack_text, final_block_chance) +/obj/item/weapon/shield/riot/tele/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) if(active) return ..() return 0 diff --git a/code/game/objects/items/weapons/stunbaton.dm b/code/game/objects/items/weapons/stunbaton.dm index 9788e06b2ca..4efa447a134 100644 --- a/code/game/objects/items/weapons/stunbaton.dm +++ b/code/game/objects/items/weapons/stunbaton.dm @@ -141,7 +141,7 @@ /obj/item/weapon/melee/baton/proc/baton_stun(mob/living/L, mob/user) if(ishuman(L)) var/mob/living/carbon/human/H = L - if(H.check_shields(0, "[user]'s [name]", src, MELEE_ATTACK)) //No message; check_shields() handles that + if(H.check_shields(src, 0, "[user]'s [name]", MELEE_ATTACK)) //No message; check_shields() handles that playsound(L, 'sound/weapons/genhit.ogg', 50, 1) return 0 if(iscyborg(loc)) diff --git a/code/game/objects/items/weapons/twohanded.dm b/code/game/objects/items/weapons/twohanded.dm index 9c141e69674..fae85432d7b 100644 --- a/code/game/objects/items/weapons/twohanded.dm +++ b/code/game/objects/items/weapons/twohanded.dm @@ -317,7 +317,7 @@ else user.adjustStaminaLoss(25) -/obj/item/weapon/twohanded/dualsaber/hit_reaction(mob/living/carbon/human/owner, attack_text, final_block_chance) +/obj/item/weapon/twohanded/dualsaber/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) if(wielded) return ..() return 0 @@ -522,7 +522,7 @@ armour_penetration = 100 force_on = 30 -/obj/item/weapon/twohanded/required/chainsaw/doomslayer/hit_reaction(mob/living/carbon/human/owner, attack_text, final_block_chance, damage, attack_type) +/obj/item/weapon/twohanded/required/chainsaw/doomslayer/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) if(attack_type == PROJECTILE_ATTACK) owner.visible_message("Ranged attacks just make [owner] angrier!") playsound(src, pick('sound/weapons/bulletflyby.ogg', 'sound/weapons/bulletflyby2.ogg', 'sound/weapons/bulletflyby3.ogg'), 75, 1) @@ -648,7 +648,7 @@ slot_flags = SLOT_BACK hitsound = 'sound/weapons/bladeslice.ogg' -/obj/item/weapon/twohanded/vibro_weapon/hit_reaction(mob/living/carbon/human/owner, attack_text, final_block_chance, damage, attack_type) +/obj/item/weapon/twohanded/vibro_weapon/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) if(wielded) final_block_chance *= 2 if(wielded || attack_type != PROJECTILE_ATTACK) diff --git a/code/game/objects/structures/beds_chairs/chair.dm b/code/game/objects/structures/beds_chairs/chair.dm index 7a265c2d41d..8b94bb92078 100644 --- a/code/game/objects/structures/beds_chairs/chair.dm +++ b/code/game/objects/structures/beds_chairs/chair.dm @@ -274,7 +274,7 @@ -/obj/item/chair/hit_reaction(mob/living/carbon/human/owner, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) +/obj/item/chair/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) if(attack_type == UNARMED_ATTACK && prob(hit_reaction_chance)) owner.visible_message("[owner] fends off [attack_text] with [src]!") return 1 diff --git a/code/modules/assembly/flash.dm b/code/modules/assembly/flash.dm index 40c084ac99b..2fe1dd4c050 100644 --- a/code/modules/assembly/flash.dm +++ b/code/modules/assembly/flash.dm @@ -278,6 +278,6 @@ if(holder) holder.update_icon() -/obj/item/device/assembly/flash/shield/hit_reaction(obj/item/weapon/W, mob/user, params) +/obj/item/device/assembly/flash/shield/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) activate() return ..() diff --git a/code/modules/clothing/spacesuits/hardsuit.dm b/code/modules/clothing/spacesuits/hardsuit.dm index 6da80ac261b..0748edd27b4 100644 --- a/code/modules/clothing/spacesuits/hardsuit.dm +++ b/code/modules/clothing/spacesuits/hardsuit.dm @@ -562,7 +562,7 @@ var/shield_state = "shield-old" var/shield_on = "shield-old" -/obj/item/clothing/suit/space/hardsuit/shielded/hit_reaction(mob/living/carbon/human/owner, attack_text) +/obj/item/clothing/suit/space/hardsuit/shielded/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) recharge_cooldown = world.time + recharge_delay if(current_charges > 0) var/datum/effect_system/spark_spread/s = new diff --git a/code/modules/clothing/spacesuits/miscellaneous.dm b/code/modules/clothing/spacesuits/miscellaneous.dm index 49c698e7d63..fba754ca413 100644 --- a/code/modules/clothing/spacesuits/miscellaneous.dm +++ b/code/modules/clothing/spacesuits/miscellaneous.dm @@ -326,7 +326,7 @@ Contains: armor = list(melee = 5, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 10, fire = 0, acid = 0) strip_delay = 65 -/obj/item/clothing/suit/space/fragile/hit_reaction(mob/living/carbon/human/owner, attack_text, final_block_chance) +/obj/item/clothing/suit/space/fragile/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) if(!torn && prob(50)) to_chat(owner, "[src] tears from the damage, breaking the air-tight seal!") src.flags -= STOPSPRESSUREDMAGE diff --git a/code/modules/clothing/suits/armor.dm b/code/modules/clothing/suits/armor.dm index a93150892f1..3bedb2124bd 100644 --- a/code/modules/clothing/suits/armor.dm +++ b/code/modules/clothing/suits/armor.dm @@ -196,7 +196,7 @@ var/rad_amount= 15 reactivearmor_cooldown_duration = 100 -/obj/item/clothing/suit/armor/reactive/teleport/hit_reaction(mob/living/carbon/human/owner, attack_text, final_block_chance) +/obj/item/clothing/suit/armor/reactive/teleport/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) if(!active) return 0 if(prob(hit_reaction_chance)) @@ -229,7 +229,7 @@ name = "reactive incendiary armor" desc = "An experimental suit of armor with a reactive sensor array rigged to a flame emitter. For the stylish pyromaniac." -/obj/item/clothing/suit/armor/reactive/fire/hit_reaction(mob/living/carbon/human/owner, attack_text) +/obj/item/clothing/suit/armor/reactive/fire/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) if(!active) return 0 if(prob(hit_reaction_chance)) @@ -251,7 +251,7 @@ name = "reactive stealth armor" desc = "An experimental suit of armor that renders the wearer invisible on detection of imminent harm, and creates a decoy that runs away from the owner. You can't fight what you can't see." -/obj/item/clothing/suit/armor/reactive/stealth/hit_reaction(mob/living/carbon/human/owner, attack_text) +/obj/item/clothing/suit/armor/reactive/stealth/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) if(!active) return 0 if(prob(hit_reaction_chance)) @@ -278,7 +278,7 @@ var/tesla_boom = FALSE var/tesla_stun = FALSE -/obj/item/clothing/suit/armor/reactive/tesla/hit_reaction(mob/living/carbon/human/owner, attack_text) +/obj/item/clothing/suit/armor/reactive/tesla/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) if(!active) return 0 if(prob(hit_reaction_chance)) @@ -298,7 +298,7 @@ desc = "If you can't beat the memes, embrace them." var/tele_range = 10 -/obj/item/clothing/suit/armor/reactive/table/hit_reaction(mob/living/carbon/human/owner, attack_text) +/obj/item/clothing/suit/armor/reactive/table/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) if(!active) return 0 if(prob(hit_reaction_chance)) diff --git a/code/modules/clothing/under/color.dm b/code/modules/clothing/under/color.dm index e6d5b6bdb0a..54b3996851b 100644 --- a/code/modules/clothing/under/color.dm +++ b/code/modules/clothing/under/color.dm @@ -30,7 +30,7 @@ name = "ancient jumpsuit" desc = "A terribly ragged and frayed grey jumpsuit. It looks like it hasn't been washed in over a decade." -/obj/item/clothing/under/color/grey/glorf/hit_reaction(mob/living/carbon/human/owner) +/obj/item/clothing/under/color/grey/glorf/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) owner.forcesay(GLOB.hit_appends) return 0 diff --git a/code/modules/clothing/under/jobs/civilian.dm b/code/modules/clothing/under/jobs/civilian.dm index 6ee444adb18..19cfc834f9b 100644 --- a/code/modules/clothing/under/jobs/civilian.dm +++ b/code/modules/clothing/under/jobs/civilian.dm @@ -58,7 +58,7 @@ fitted = FEMALE_UNIFORM_TOP can_adjust = 0 -/obj/item/clothing/under/rank/clown/hit_reaction() +/obj/item/clothing/under/rank/clown/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) playsound(loc, 'sound/items/bikehorn.ogg', 50, 1, -1) return 0 diff --git a/code/modules/holodeck/items.dm b/code/modules/holodeck/items.dm index 98bd319c033..79417f927a8 100644 --- a/code/modules/holodeck/items.dm +++ b/code/modules/holodeck/items.dm @@ -32,7 +32,7 @@ ..() item_color = "red" -/obj/item/weapon/holo/esword/hit_reaction(mob/living/carbon/human/owner, attack_text, final_block_chance) +/obj/item/weapon/holo/esword/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) if(active) return ..() return 0 diff --git a/code/modules/mining/lavaland/necropolis_chests.dm b/code/modules/mining/lavaland/necropolis_chests.dm index 1dad6d7ee19..ebbb4fecb33 100644 --- a/code/modules/mining/lavaland/necropolis_chests.dm +++ b/code/modules/mining/lavaland/necropolis_chests.dm @@ -640,7 +640,7 @@ user.visible_message("[user] strikes with the force of [ghost_counter] vengeful spirits!") ..() -/obj/item/weapon/melee/ghost_sword/hit_reaction(mob/living/carbon/human/owner, attack_text, final_block_chance, damage, attack_type) +/obj/item/weapon/melee/ghost_sword/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) var/ghost_counter = ghost_check() final_block_chance += Clamp((ghost_counter * 5), 0, 75) owner.visible_message("[owner] is protected by a ring of [ghost_counter] ghosts!") diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 0250ffe2e35..239edb959f0 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -70,7 +70,7 @@ return -1 // complete projectile permutation - if(check_shields(P.damage, "the [P.name]", P, PROJECTILE_ATTACK, P.armour_penetration)) + if(check_shields(P, P.damage, "the [P.name]", PROJECTILE_ATTACK, P.armour_penetration)) P.on_hit(src, 100, def_zone) return 2 @@ -85,21 +85,21 @@ return 1 return 0 -/mob/living/carbon/human/proc/check_shields(damage = 0, attack_text = "the attack", atom/movable/AM, attack_type = MELEE_ATTACK, armour_penetration = 0) +/mob/living/carbon/human/proc/check_shields(atom/AM, var/damage, attack_text = "the attack", attack_type = MELEE_ATTACK, armour_penetration = 0) var/block_chance_modifier = round(damage / -3) for(var/obj/item/I in held_items) if(!istype(I, /obj/item/clothing)) var/final_block_chance = I.block_chance - (Clamp((armour_penetration-I.armour_penetration)/2,0,100)) + block_chance_modifier //So armour piercing blades can still be parried by other blades, for example - if(I.hit_reaction(src, attack_text, final_block_chance, damage, attack_type)) + if(I.hit_reaction(src, AM, attack_text, final_block_chance, damage, attack_type)) return 1 if(wear_suit) var/final_block_chance = wear_suit.block_chance - (Clamp((armour_penetration-wear_suit.armour_penetration)/2,0,100)) + block_chance_modifier - if(wear_suit.hit_reaction(src, attack_text, final_block_chance, damage, attack_type)) + if(wear_suit.hit_reaction(src, AM, attack_text, final_block_chance, damage, attack_type)) return 1 if(w_uniform) var/final_block_chance = w_uniform.block_chance - (Clamp((armour_penetration-w_uniform.armour_penetration)/2,0,100)) + block_chance_modifier - if(w_uniform.hit_reaction(src, attack_text, final_block_chance, damage, attack_type)) + if(w_uniform.hit_reaction(src, AM, attack_text, final_block_chance, damage, attack_type)) return 1 return 0 @@ -122,7 +122,7 @@ throwpower = I.throwforce if(I.thrownby == src) //No throwing stuff at yourself to trigger hit reactions return ..() - if(check_shields(throwpower, "\the [AM.name]", AM, THROWN_PROJECTILE_ATTACK)) + if(check_shields(AM, throwpower, "\the [AM.name]", THROWN_PROJECTILE_ATTACK)) hitpush = 0 skipcatch = 1 blocked = 1 @@ -170,7 +170,7 @@ /mob/living/carbon/human/attack_hulk(mob/living/carbon/human/user, does_attack_animation = 0) if(user.a_intent == INTENT_HARM) var/hulk_verb = pick("smash","pummel") - if(check_shields(15, "the [hulk_verb]ing")) + if(check_shields(user, 15, "the [hulk_verb]ing")) return ..(user, 1) playsound(loc, user.dna.species.attack_sound, 25, 1, -1) @@ -219,7 +219,7 @@ if(can_inject(M, 1, affecting))//Thick suits can stop monkey bites. if(..()) //successful monkey bite, this handles disease contraction. var/damage = rand(1, 3) - if(check_shields(damage)) + if(check_shields(M, damage, "the [M.name]")) return 0 if(stat != DEAD) apply_damage(damage, BRUTE, affecting, run_armor_check(affecting, "melee")) @@ -227,7 +227,7 @@ return 1 /mob/living/carbon/human/attack_alien(mob/living/carbon/alien/humanoid/M) - if(check_shields(0, M.name)) + if(check_shields(M, 0, "the M.name")) visible_message("[M] attempted to touch [src]!") return 0 @@ -272,7 +272,7 @@ if(..()) //successful larva bite. var/damage = rand(1, 3) - if(check_shields(damage, "the [L.name]")) + if(check_shields(L, damage, "the [L.name]")) return 0 if(stat != DEAD) L.amount_grown = min(L.amount_grown + damage, L.max_grown) @@ -288,7 +288,7 @@ . = ..() if(.) var/damage = rand(M.melee_damage_lower, M.melee_damage_upper) - if(check_shields(damage, "the [M.name]", null, MELEE_ATTACK, M.armour_penetration)) + if(check_shields(M, damage, "the [M.name]", MELEE_ATTACK, M.armour_penetration)) return FALSE var/dam_zone = dismembering_strike(M, pick("chest", "l_hand", "r_hand", "l_leg", "r_leg")) if(!dam_zone) //Dismemberment successful @@ -307,7 +307,7 @@ if(M.is_adult) damage = rand(10, 35) - if(check_shields(damage, "the [M.name]")) + if(check_shields(M, damage, "the [M.name]")) return 0 var/dam_zone = dismembering_strike(M, pick("head", "chest", "l_arm", "r_arm", "l_leg", "r_leg")) diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index 814d3d34d75..685a443a6c7 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -1145,7 +1145,7 @@ return if(M.mind) attacker_style = M.mind.martial_art - if((M != H) && M.a_intent != INTENT_HELP && H.check_shields(0, M.name, attack_type = UNARMED_ATTACK)) + if((M != H) && M.a_intent != INTENT_HELP && H.check_shields(M, 0, M.name, attack_type = UNARMED_ATTACK)) add_logs(M, H, "attempted to touch") H.visible_message("[M] attempted to touch [H]!") return 0 @@ -1165,7 +1165,7 @@ /datum/species/proc/spec_attacked_by(obj/item/I, mob/living/user, obj/item/bodypart/affecting, intent, mob/living/carbon/human/H) // Allows you to put in item-specific reactions based on species if(user != H) - if(H.check_shields(I.force, "the [I.name]", I, MELEE_ATTACK, I.armour_penetration)) + if(H.check_shields(I, I.force, "the [I.name]", MELEE_ATTACK, I.armour_penetration)) return 0 if(H.check_block()) H.visible_message("[H] blocks [I]!") diff --git a/code/modules/mob/living/simple_animal/guardian/types/charger.dm b/code/modules/mob/living/simple_animal/guardian/types/charger.dm index c1be82b8208..9de906bccba 100644 --- a/code/modules/mob/living/simple_animal/guardian/types/charger.dm +++ b/code/modules/mob/living/simple_animal/guardian/types/charger.dm @@ -59,7 +59,7 @@ blocked = 1 if(ishuman(A)) var/mob/living/carbon/human/H = A - if(H.check_shields(90, "[name]", src, attack_type = THROWN_PROJECTILE_ATTACK)) + if(H.check_shields(src, 90, "[name]", attack_type = THROWN_PROJECTILE_ATTACK)) blocked = 1 if(!blocked) L.drop_all_held_items() diff --git a/code/modules/projectiles/guns/magic/staff.dm b/code/modules/projectiles/guns/magic/staff.dm index 41b1d9ecf55..45a1eccd65c 100644 --- a/code/modules/projectiles/guns/magic/staff.dm +++ b/code/modules/projectiles/guns/magic/staff.dm @@ -81,7 +81,7 @@ sharpness = IS_SHARP max_charges = 4 -/obj/item/weapon/gun/magic/staff/spellblade/hit_reaction(mob/living/carbon/human/owner, attack_text, final_block_chance, damage, attack_type) +/obj/item/weapon/gun/magic/staff/spellblade/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) if(attack_type == PROJECTILE_ATTACK) final_block_chance = 0 return ..()