diff --git a/code/game/gamemodes/changeling/powers/mutations.dm b/code/game/gamemodes/changeling/powers/mutations.dm index 59e93e2d513..ad754c496c6 100644 --- a/code/game/gamemodes/changeling/powers/mutations.dm +++ b/code/game/gamemodes/changeling/powers/mutations.dm @@ -382,7 +382,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/shield/changeling/hit_reaction() +/obj/item/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 a1bec7a2a83..7ef5baced97 100644 --- a/code/game/gamemodes/cult/cult_items.dm +++ b/code/game/gamemodes/cult/cult_items.dm @@ -160,7 +160,7 @@ user.Dizzy(30) user.Weaken(5) -/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 f6bed7b539f..3491c043b4c 100644 --- a/code/game/gamemodes/miniantags/abduction/abduction_gear.dm +++ b/code/game/gamemodes/miniantags/abduction/abduction_gear.dm @@ -80,7 +80,7 @@ M.overlays.Cut() 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 @@ -455,7 +455,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/machinery/computer/HolodeckControl.dm b/code/game/machinery/computer/HolodeckControl.dm index d3edc588e2d..aeecfa827a2 100644 --- a/code/game/machinery/computer/HolodeckControl.dm +++ b/code/game/machinery/computer/HolodeckControl.dm @@ -420,7 +420,7 @@ /obj/item/holo/esword/red/New() item_color = "red" -/obj/item/holo/esword/hit_reaction(mob/living/carbon/human/owner, attack_text, final_block_chance) +/obj/item/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/game/objects/items.dm b/code/game/objects/items.dm index a5e3ad4205b..e925b3b1629 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -336,7 +336,7 @@ var/global/image/fire_overlay = image("icon" = 'icons/goonstation/effects/fire.d else return ..() -/obj/item/proc/hit_reaction(mob/living/carbon/human/owner, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK, atom/movable/AM) +/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) SEND_SIGNAL(src, COMSIG_ITEM_HIT_REACT, args) if(prob(final_block_chance)) owner.visible_message("[owner] blocks [attack_text] with [src]!") diff --git a/code/game/objects/items/robot/robot_items.dm b/code/game/objects/items/robot/robot_items.dm index f38398180ee..1b20716783a 100644 --- a/code/game/objects/items/robot/robot_items.dm +++ b/code/game/objects/items/robot/robot_items.dm @@ -12,7 +12,7 @@ /obj/item/borg/stun/attack(mob/living/M, mob/living/silicon/robot/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 0 diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index cc7270e73c8..edc7b855c99 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -210,7 +210,7 @@ brightness_on = 0 sharp_when_wielded = FALSE // It's a toy -/obj/item/twohanded/dualsaber/toy/hit_reaction() +/obj/item/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/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 dd67d7c67a4..9051954ae4d 100644 --- a/code/game/objects/items/weapons/flamethrower.dm +++ b/code/game/objects/items/weapons/flamethrower.dm @@ -213,10 +213,11 @@ ptank = new /obj/item/tank/plasma/full(src) update_icon() -/obj/item/flamethrower/hit_reaction(mob/living/carbon/human/owner, attack_text, final_block_chance, damage, attack_type) +/obj/item/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) + var/turf/target_turf = get_turf(owner) + log_game("A projectile ([hitby]) detonated a flamethrower tank held by [key_name(owner)] at [COORD(target_turf)]") ignite_turf(target_turf, 100) qdel(ptank) return 1 //It hit the flamethrower, not them diff --git a/code/game/objects/items/weapons/grenades/chem_grenade.dm b/code/game/objects/items/weapons/grenades/chem_grenade.dm index 3e313bcac33..5c1c7587d8c 100644 --- a/code/game/objects/items/weapons/grenades/chem_grenade.dm +++ b/code/game/objects/items/weapons/grenades/chem_grenade.dm @@ -113,9 +113,12 @@ spawn(det_time) prime() -/obj/item/grenade/hit_reaction(mob/living/carbon/human/owner, attack_text, final_block_chance, damage, attack_type) +/obj/item/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!") + var/turf/T = get_turf(src) + log_game("A projectile ([hitby]) detonated a grenade held by [key_name(owner)] at [COORD(T)]") + message_admins("A projectile ([hitby]) detonated a grenade held by [key_name_admin(owner)] at [ADMIN_COORDJMP(T)]") prime() return 1 //It hit the grenade, not them diff --git a/code/game/objects/items/weapons/holy_weapons.dm b/code/game/objects/items/weapons/holy_weapons.dm index 68e731b8c44..0de138805f1 100644 --- a/code/game/objects/items/weapons/holy_weapons.dm +++ b/code/game/objects/items/weapons/holy_weapons.dm @@ -137,7 +137,7 @@ hitsound = 'sound/weapons/bladeslice.ogg' attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") -/obj/item/nullrod/claymore/hit_reaction(mob/living/carbon/human/owner, attack_text, final_block_chance, damage, attack_type) +/obj/item/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 5e8d170f50b..52e0b24ec4d 100644 --- a/code/game/objects/items/weapons/melee/energy.dm +++ b/code/game/objects/items/weapons/melee/energy.dm @@ -119,7 +119,7 @@ if(item_color == null) item_color = pick("red", "blue", "green", "purple") -/obj/item/melee/energy/sword/hit_reaction(mob/living/carbon/human/owner, attack_text, final_block_chance) +/obj/item/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 @@ -156,7 +156,7 @@ ..() item_color = null -/obj/item/melee/energy/sword/cyborg/saw/hit_reaction() +/obj/item/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/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 943d20e9699..b9f1fa679a8 100644 --- a/code/game/objects/items/weapons/melee/misc.dm +++ b/code/game/objects/items/weapons/melee/misc.dm @@ -44,7 +44,7 @@ hitsound = 'sound/weapons/rapierhit.ogg' materials = list(MAT_METAL = 1000) -/obj/item/melee/rapier/hit_reaction(mob/living/carbon/human/owner, attack_text, final_block_chance, damage, attack_type) +/obj/item/melee/rapier/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/shields.dm b/code/game/objects/items/weapons/shields.dm index 61f83fdea25..2cbf80a6388 100644 --- a/code/game/objects/items/weapons/shields.dm +++ b/code/game/objects/items/weapons/shields.dm @@ -3,7 +3,7 @@ block_chance = 50 armor = list(melee = 50, bullet = 50, laser = 50, energy = 0, bomb = 30, bio = 0, rad = 0) -/obj/item/shield/hit_reaction(mob/living/carbon/human/owner, attack_text, final_block_chance, damage, attack_type) +/obj/item/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) @@ -63,7 +63,7 @@ attack_verb = list("shoved", "bashed") var/active = 0 -/obj/item/shield/energy/hit_reaction(mob/living/carbon/human/owner, attack_text, final_block_chance) +/obj/item/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/shield/energy/IsReflect() @@ -110,7 +110,7 @@ w_class = WEIGHT_CLASS_NORMAL var/active = 0 -/obj/item/shield/riot/tele/hit_reaction(mob/living/carbon/human/owner, attack_text, final_block_chance) +/obj/item/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 526340daea5..1be32df4d2a 100644 --- a/code/game/objects/items/weapons/stunbaton.dm +++ b/code/game/objects/items/weapons/stunbaton.dm @@ -175,7 +175,7 @@ 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, "[user]'s [name]", MELEE_ATTACK)) //No message; check_shields() handles that playsound(L, 'sound/weapons/genhit.ogg', 50, 1) return diff --git a/code/game/objects/items/weapons/swords_axes_etc.dm b/code/game/objects/items/weapons/swords_axes_etc.dm index d0526ebbcb8..409e5575df3 100644 --- a/code/game/objects/items/weapons/swords_axes_etc.dm +++ b/code/game/objects/items/weapons/swords_axes_etc.dm @@ -51,7 +51,7 @@ if(cooldown <= 0) 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/twohanded.dm b/code/game/objects/items/weapons/twohanded.dm index 15456386541..dc20b8582c6 100644 --- a/code/game/objects/items/weapons/twohanded.dm +++ b/code/game/objects/items/weapons/twohanded.dm @@ -267,7 +267,7 @@ user.SpinAnimation(7, 1) sleep(1) -/obj/item/twohanded/dualsaber/hit_reaction(mob/living/carbon/human/owner, attack_text, final_block_chance) +/obj/item/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 FALSE @@ -507,7 +507,7 @@ armour_penetration = 100 force_on = 30 -/obj/item/twohanded/required/chainsaw/doomslayer/hit_reaction(mob/living/carbon/human/owner, attack_text, final_block_chance, damage, attack_type) +/obj/item/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) diff --git a/code/game/objects/items/weapons/weaponry.dm b/code/game/objects/items/weapons/weaponry.dm index 501f1780a0b..c1f45a9fc9b 100644 --- a/code/game/objects/items/weapons/weaponry.dm +++ b/code/game/objects/items/weapons/weaponry.dm @@ -171,11 +171,11 @@ desc = "This thing looks dangerous... Dangerously good at baseball, that is." homerun_able = 1 -/obj/item/melee/baseball_bat/hit_reaction(mob/living/carbon/human/owner, attack_text, final_block_chance, damage, attack_type, atom/movable/AM) +/obj/item/melee/baseball_bat/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(!istype(AM, /obj/item) || attack_type != THROWN_PROJECTILE_ATTACK) + if(!isitem(hitby) || attack_type != THROWN_PROJECTILE_ATTACK) return FALSE - var/obj/item/I = AM + var/obj/item/I = hitby if(I.w_class <= WEIGHT_CLASS_NORMAL || istype(I, /obj/item/beach_ball)) // baseball bat deflecting if(deflectmode) if(prob(10)) diff --git a/code/modules/clothing/spacesuits/hardsuit.dm b/code/modules/clothing/spacesuits/hardsuit.dm index b56d2122ee8..f342cf9f04f 100644 --- a/code/modules/clothing/spacesuits/hardsuit.dm +++ b/code/modules/clothing/spacesuits/hardsuit.dm @@ -527,7 +527,7 @@ var/shield_on = "shield-old" sprite_sheets = null -/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) if(current_charges > 0) do_sparks(2, 1, src) owner.visible_message("[owner]'s shields deflect [attack_text] in a shower of sparks!") diff --git a/code/modules/clothing/suits/armor.dm b/code/modules/clothing/suits/armor.dm index c5242d072e0..1ab7fe58c2b 100644 --- a/code/modules/clothing/suits/armor.dm +++ b/code/modules/clothing/suits/armor.dm @@ -301,7 +301,7 @@ desc = "Someone seperated our Research Director from his own head!" var/tele_range = 6 -/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)) @@ -332,7 +332,7 @@ /obj/item/clothing/suit/armor/reactive/fire name = "reactive incendiary armor" -/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)) @@ -349,7 +349,7 @@ /obj/item/clothing/suit/armor/reactive/stealth name = "reactive stealth armor" -/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)) @@ -366,7 +366,7 @@ /obj/item/clothing/suit/armor/reactive/tesla name = "reactive tesla armor" -/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)) diff --git a/code/modules/clothing/under/color.dm b/code/modules/clothing/under/color.dm index e7f29305929..17db1997174 100644 --- a/code/modules/clothing/under/color.dm +++ b/code/modules/clothing/under/color.dm @@ -60,7 +60,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 81c6d15562a..df04075306d 100644 --- a/code/modules/clothing/under/jobs/civilian.dm +++ b/code/modules/clothing/under/jobs/civilian.dm @@ -74,7 +74,7 @@ . = ..() AddComponent(/datum/component/squeak, list('sound/items/bikehorn.ogg' = 1), 50) -/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) if(ishuman(loc)) var/mob/living/carbon/human/H = loc if(H.mind && H.mind.assigned_role == "Clown") diff --git a/code/modules/customitems/item_defines.dm b/code/modules/customitems/item_defines.dm index b4aa0a62379..e21d0f80c76 100644 --- a/code/modules/customitems/item_defines.dm +++ b/code/modules/customitems/item_defines.dm @@ -135,7 +135,7 @@ force = 5 sharp = 0 -/obj/item/claymore/fluff/hit_reaction() +/obj/item/claymore/fluff/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/fluff/rsik_katana //Xydonus: Rsik Ugsharki Atan diff --git a/code/modules/martial_arts/martial.dm b/code/modules/martial_arts/martial.dm index 2940e810ade..571eefcfb00 100644 --- a/code/modules/martial_arts/martial.dm +++ b/code/modules/martial_arts/martial.dm @@ -277,7 +277,7 @@ return ..() return ..() -/obj/item/twohanded/bostaff/hit_reaction(mob/living/carbon/human/owner, attack_text, final_block_chance) +/obj/item/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/modules/mining/lavaland/loot/ashdragon_loot.dm b/code/modules/mining/lavaland/loot/ashdragon_loot.dm index c9b35e6f883..6a1e563da7a 100644 --- a/code/modules/mining/lavaland/loot/ashdragon_loot.dm +++ b/code/modules/mining/lavaland/loot/ashdragon_loot.dm @@ -101,7 +101,7 @@ user.visible_message("[user] strikes with the force of [ghost_counter] vengeful spirits!") ..() -/obj/item/melee/ghost_sword/hit_reaction(mob/living/carbon/human/owner, attack_text, final_block_chance, damage, attack_type) +/obj/item/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/alien/humanoid/caste/hunter.dm b/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm index bf2158ae58e..f950eee4dbf 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm @@ -99,7 +99,7 @@ var/blocked = 0 if(ishuman(A)) var/mob/living/carbon/human/H = A - if(H.check_shields(0, "the [name]", src, attack_type = LEAP_ATTACK)) + if(H.check_shields(src, 0, "the [name]", attack_type = LEAP_ATTACK)) blocked = 1 if(!blocked) L.visible_message("[src] pounces on [L]!", "[src] pounces on you!") diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index d172fabef00..70ecf8a33c2 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -34,7 +34,7 @@ emp_act return -1 // complete projectile permutation //Shields - 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 @@ -136,24 +136,24 @@ emp_act //End Here -/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) if(l_hand && !istype(l_hand, /obj/item/clothing)) var/final_block_chance = l_hand.block_chance - (Clamp((armour_penetration-l_hand.armour_penetration)/2,0,100)) + block_chance_modifier //So armour piercing blades can still be parried by other blades, for example - if(l_hand.hit_reaction(src, attack_text, final_block_chance, damage, attack_type, AM)) + if(l_hand.hit_reaction(src, AM, attack_text, final_block_chance, damage, attack_type)) return 1 if(r_hand && !istype(r_hand, /obj/item/clothing)) var/final_block_chance = r_hand.block_chance - (Clamp((armour_penetration-r_hand.armour_penetration)/2,0,100)) + block_chance_modifier //Need to reset the var so it doesn't carry over modifications between attempts - if(r_hand.hit_reaction(src, attack_text, final_block_chance, damage, attack_type, AM)) + if(r_hand.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, AM)) + 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, AM)) + if(w_uniform.hit_reaction(src, AM, attack_text, final_block_chance, damage, attack_type)) return 1 return 0 @@ -217,7 +217,7 @@ emp_act if(user != src) user.do_attack_animation(src) - if(check_shields(I.force, "the [I.name]", I, MELEE_ATTACK, I.armour_penetration)) + if(check_shields(I, I.force, "the [I.name]", MELEE_ATTACK, I.armour_penetration)) return 0 if(check_block()) @@ -311,7 +311,7 @@ emp_act throwpower = I.throwforce if(I.thrownby == src) //No throwing stuff at yourself to trigger 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 @@ -392,7 +392,7 @@ emp_act updatehealth("larva attack") /mob/living/carbon/human/attack_alien(mob/living/carbon/alien/humanoid/M) - if(check_shields(0, M.name)) + if(check_shields(M, 0, M.name)) visible_message("[M] attempted to touch [src]!") return 0 @@ -439,7 +439,7 @@ emp_act /mob/living/carbon/human/attack_animal(mob/living/simple_animal/M) 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]", null, MELEE_ATTACK, M.armour_penetration)) return 0 var/dam_zone = pick("head", "chest", "groin", "l_arm", "l_hand", "r_arm", "r_hand", "l_leg", "l_foot", "r_leg", "r_foot") var/obj/item/organ/external/affecting = get_organ(ran_zone(dam_zone)) diff --git a/code/modules/projectiles/guns/magic/staff.dm b/code/modules/projectiles/guns/magic/staff.dm index 560ecf44684..9196596c8b5 100644 --- a/code/modules/projectiles/guns/magic/staff.dm +++ b/code/modules/projectiles/guns/magic/staff.dm @@ -89,7 +89,7 @@ sharp = 1 max_charges = 4 -/obj/item/gun/magic/staff/spellblade/hit_reaction(mob/living/carbon/human/owner, attack_text, final_block_chance, damage, attack_type) +/obj/item/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 ..()