diff --git a/code/__DEFINES/dcs/signals/signals_mob/signals_mob_carbon.dm b/code/__DEFINES/dcs/signals/signals_mob/signals_mob_carbon.dm index 2abec797fc6..f72e47db97a 100644 --- a/code/__DEFINES/dcs/signals/signals_mob/signals_mob_carbon.dm +++ b/code/__DEFINES/dcs/signals/signals_mob/signals_mob_carbon.dm @@ -125,7 +125,7 @@ #define COMSIG_HUMAN_EARLY_UNARMED_ATTACK "human_early_unarmed_attack" ///from mob/living/carbon/human/UnarmedAttack(): (atom/target, proximity, modifiers) #define COMSIG_HUMAN_MELEE_UNARMED_ATTACK "human_melee_unarmed_attack" -///from /mob/living/carbon/human/proc/check_shields(): (atom/hit_by, damage, attack_text, attack_type, armour_penetration) +///from /mob/living/carbon/human/proc/check_shields(): (atom/hit_by, damage, attack_text, attack_type, armour_penetration, damage_type) #define COMSIG_HUMAN_CHECK_SHIELDS "human_check_shields" #define SHIELD_BLOCK (1<<0) ///from /mob/living/carbon/human/proc/force_say(): () diff --git a/code/__DEFINES/dcs/signals/signals_object.dm b/code/__DEFINES/dcs/signals/signals_object.dm index 03c680c88de..ad2ec4011c8 100644 --- a/code/__DEFINES/dcs/signals/signals_object.dm +++ b/code/__DEFINES/dcs/signals/signals_object.dm @@ -134,7 +134,7 @@ ///from base of mob/living/carbon/attacked_by(): (mob/living/carbon/target, mob/living/user, hit_zone) #define COMSIG_ITEM_ATTACK_ZONE "item_attack_zone" -///from base of obj/item/hit_reaction(): (list/args) +///from base of obj/item/hit_reaction(): (owner, hitby, attack_text, final_block_chance, damage, attack_type, damage_type) #define COMSIG_ITEM_HIT_REACT "item_hit_react" #define COMPONENT_HIT_REACTION_BLOCK (1<<0) ///from base of item/sharpener/attackby(): (amount, max) diff --git a/code/datums/components/shielded.dm b/code/datums/components/shielded.dm index 48235fe350c..d0f5dd49cc4 100644 --- a/code/datums/components/shielded.dm +++ b/code/datums/components/shielded.dm @@ -144,7 +144,7 @@ * This proc fires when we're hit, and is responsible for checking if we're charged, then deducting one + returning that we're blocking if so. * It then runs the callback in [/datum/component/shielded/var/on_hit_effects] which handles the messages/sparks (so the visuals) */ -/datum/component/shielded/proc/on_hit_react(datum/source, mob/living/carbon/human/owner, atom/movable/hitby, attack_text, final_block_chance, damage, attack_type) +/datum/component/shielded/proc/on_hit_react(datum/source, mob/living/carbon/human/owner, atom/movable/hitby, attack_text, final_block_chance, damage, attack_type, damage_type) SIGNAL_HANDLER COOLDOWN_START(src, recently_hit_cd, recharge_start_delay) diff --git a/code/datums/elements/light_eater.dm b/code/datums/elements/light_eater.dm index 6b47e2c6356..f60a922b9d7 100644 --- a/code/datums/elements/light_eater.dm +++ b/code/datums/elements/light_eater.dm @@ -136,7 +136,7 @@ * - final_block_chance: The probability of blocking the target with the source * - attack_type: The type of attack that was blocked */ -/datum/element/light_eater/proc/on_hit_reaction(obj/item/source, mob/living/carbon/human/owner, atom/movable/hitby, attack_text, final_block_chance, damage, attack_type) +/datum/element/light_eater/proc/on_hit_reaction(obj/item/source, mob/living/carbon/human/owner, atom/movable/hitby, attack_text, final_block_chance, damage, attack_type, damage_type) SIGNAL_HANDLER if(prob(final_block_chance)) eat_lights(hitby, source) diff --git a/code/datums/martial/sleeping_carp.dm b/code/datums/martial/sleeping_carp.dm index 8f7028079dc..308bd570073 100644 --- a/code/datums/martial/sleeping_carp.dm +++ b/code/datums/martial/sleeping_carp.dm @@ -243,7 +243,7 @@ else return ..() -/obj/item/staff/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) +/obj/item/staff/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, damage_type = BRUTE) if(!HAS_TRAIT(src, TRAIT_WIELDED)) return ..() return FALSE diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 03cbc1421e8..acef5c01b33 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -635,8 +635,8 @@ // afterattack() and attack() prototypes moved to _onclick/item_attack.dm for consistency -/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(SEND_SIGNAL(src, COMSIG_ITEM_HIT_REACT, owner, hitby, attack_text, final_block_chance, damage, attack_type) & COMPONENT_HIT_REACTION_BLOCK) +/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, damage_type = BRUTE) + if(SEND_SIGNAL(src, COMSIG_ITEM_HIT_REACT, owner, hitby, attack_text, final_block_chance, damage, attack_type, damage_type) & COMPONENT_HIT_REACTION_BLOCK) return TRUE if(prob(final_block_chance)) diff --git a/code/game/objects/items/chainsaw.dm b/code/game/objects/items/chainsaw.dm index 78904a16551..20e3df19a14 100644 --- a/code/game/objects/items/chainsaw.dm +++ b/code/game/objects/items/chainsaw.dm @@ -87,7 +87,7 @@ armour_penetration = 100 force_on = 30 -/obj/item/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) +/obj/item/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, damage_type = BRUTE) if(attack_type == PROJECTILE_ATTACK) owner.visible_message(span_danger("Ranged attacks just make [owner] angrier!")) playsound(src, pick('sound/weapons/bulletflyby.ogg', 'sound/weapons/bulletflyby2.ogg', 'sound/weapons/bulletflyby3.ogg'), 75, TRUE) diff --git a/code/game/objects/items/dualsaber.dm b/code/game/objects/items/dualsaber.dm index bf9eef7eff7..2f3bff682db 100644 --- a/code/game/objects/items/dualsaber.dm +++ b/code/game/objects/items/dualsaber.dm @@ -149,7 +149,7 @@ else user.adjustStaminaLoss(25) -/obj/item/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) +/obj/item/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, damage_type = BRUTE) if(HAS_TRAIT(src, TRAIT_WIELDED)) return ..() return 0 diff --git a/code/game/objects/items/flamethrower.dm b/code/game/objects/items/flamethrower.dm index f889c3bea5f..d17708886f2 100644 --- a/code/game/objects/items/flamethrower.dm +++ b/code/game/objects/items/flamethrower.dm @@ -249,9 +249,8 @@ /obj/item/flamethrower/full/tank create_with_tank = TRUE -/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) - var/obj/projectile/P = hitby - if(damage && attack_type == PROJECTILE_ATTACK && P.damage_type != STAMINA && prob(15)) +/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, damage_type = BRUTE) + if(damage && attack_type == PROJECTILE_ATTACK && damage_type != STAMINA && prob(15)) owner.visible_message(span_danger("\The [attack_text] hits the fuel tank on [owner]'s [name], rupturing it! What a shot!")) var/turf/target_turf = get_turf(owner) owner.log_message("held a flamethrower tank detonated by a projectile ([hitby])", LOG_GAME) diff --git a/code/game/objects/items/grenades/_grenade.dm b/code/game/objects/items/grenades/_grenade.dm index 404c66640c4..fd25df13967 100644 --- a/code/game/objects/items/grenades/_grenade.dm +++ b/code/game/objects/items/grenades/_grenade.dm @@ -224,9 +224,8 @@ /obj/item/grenade/attack_paw(mob/user, list/modifiers) return attack_hand(user, modifiers) -/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) - var/obj/projectile/hit_projectile = hitby - if(damage && attack_type == PROJECTILE_ATTACK && hit_projectile.damage_type != STAMINA && prob(15)) +/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, damage_type = BRUTE) + if(damage && attack_type == PROJECTILE_ATTACK && damage_type != STAMINA && prob(15)) owner.visible_message(span_danger("[attack_text] hits [owner]'s [src], setting it off! What a shot!")) var/turf/source_turf = get_turf(src) var/logmsg = "held a grenade detonated by a projectile ([hitby]) at [COORD(source_turf)]" diff --git a/code/game/objects/items/melee/energy.dm b/code/game/objects/items/melee/energy.dm index 50cfe65e01f..4a2648ed3f0 100644 --- a/code/game/objects/items/melee/energy.dm +++ b/code/game/objects/items/melee/energy.dm @@ -182,7 +182,7 @@ block_sound = 'sound/weapons/block_blade.ogg' embedding = list("embed_chance" = 75, "impact_pain_mult" = 10) -/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) +/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, damage_type = BRUTE) if(blade_active) return ..() return FALSE @@ -226,7 +226,7 @@ active_force = 30 sword_color_icon = null // Stops icon from breaking when turned on. -/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) +/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, damage_type = BRUTE) return FALSE // The colored energy swords we all know and love. diff --git a/code/game/objects/items/melee/misc.dm b/code/game/objects/items/melee/misc.dm index 2f7560dd90b..57e65acd105 100644 --- a/code/game/objects/items/melee/misc.dm +++ b/code/game/objects/items/melee/misc.dm @@ -93,7 +93,7 @@ ) //fast and effective, but as a sword, it might damage the results. -/obj/item/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) +/obj/item/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, damage_type = BRUTE) 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/shields.dm b/code/game/objects/items/shields.dm index 73350b4391d..b06ea245dbd 100644 --- a/code/game/objects/items/shields.dm +++ b/code/game/objects/items/shields.dm @@ -35,7 +35,7 @@ fire = 80 acid = 70 -/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) +/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, damage_type = BRUTE) if(transparent && (hitby.pass_flags & PASSGLASS)) return FALSE if(attack_type == THROWN_PROJECTILE_ATTACK) @@ -44,7 +44,7 @@ final_block_chance = 100 . = ..() if(.) - on_shield_block(owner, hitby, attack_text, damage, attack_type) + on_shield_block(owner, hitby, attack_text, damage, attack_type, damage_type) /obj/item/shield/examine(mob/user) . = ..() @@ -61,8 +61,8 @@ playsound(owner, shield_break_sound, 50) new shield_break_leftover(get_turf(src)) -/obj/item/shield/proc/on_shield_block(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", damage = 0, attack_type = MELEE_ATTACK) - if(!breakable_by_damage) +/obj/item/shield/proc/on_shield_block(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", damage = 0, attack_type = MELEE_ATTACK, damage_type = BRUTE) + if(!breakable_by_damage || (damage_type != BRUTE && damage_type != BURN)) return TRUE if (atom_integrity <= damage) var/turf/owner_turf = get_turf(owner) @@ -265,7 +265,7 @@ clumsy_check = !can_clumsy_use) RegisterSignal(src, COMSIG_TRANSFORMING_ON_TRANSFORM, PROC_REF(on_transform)) -/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) +/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, damage_type = BRUTE) return FALSE /obj/item/shield/energy/IsReflect() @@ -311,7 +311,7 @@ attack_verb_simple_on = list("smack", "strike", "crack", "beat")) RegisterSignal(src, COMSIG_TRANSFORMING_ON_TRANSFORM, PROC_REF(on_transform)) -/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) +/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, damage_type = BRUTE) if(extended) return ..() return FALSE diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index 81e3d3e64f0..82d2ac2adb5 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -593,7 +593,7 @@ attack_verb_continuous = list("attacks", "strikes", "hits") attack_verb_simple = list("attack", "strike", "hit") -/obj/item/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) +/obj/item/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, damage_type = BRUTE) return 0 /obj/item/dualsaber/toy/IsReflect() //Stops Toy Dualsabers from reflecting energy projectiles diff --git a/code/game/objects/items/weaponry.dm b/code/game/objects/items/weaponry.dm index 8a996a65a55..ea221c58187 100644 --- a/code/game/objects/items/weaponry.dm +++ b/code/game/objects/items/weaponry.dm @@ -994,7 +994,7 @@ for further reading, please see: https://github.com/tgstation/tgstation/pull/301 icon_state = "hfrequency[HAS_TRAIT(src, TRAIT_WIELDED)]" return ..() -/obj/item/highfrequencyblade/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) +/obj/item/highfrequencyblade/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK, damage_type = BRUTE) if(attack_type == PROJECTILE_ATTACK) if(HAS_TRAIT(src, TRAIT_WIELDED) || prob(final_block_chance)) owner.visible_message(span_danger("[owner] deflects [attack_text] with [src]!")) diff --git a/code/game/objects/structures/beds_chairs/chair.dm b/code/game/objects/structures/beds_chairs/chair.dm index 30ed7344a3a..63a2ae60d92 100644 --- a/code/game/objects/structures/beds_chairs/chair.dm +++ b/code/game/objects/structures/beds_chairs/chair.dm @@ -379,7 +379,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/chair/stool/bar, 0) -/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) +/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, damage_type = BRUTE) if(attack_type == UNARMED_ATTACK && prob(hit_reaction_chance)) owner.visible_message(span_danger("[owner] fends off [attack_text] with [src]!")) return TRUE diff --git a/code/modules/antagonists/abductor/equipment/abduction_gear.dm b/code/modules/antagonists/abductor/equipment/abduction_gear.dm index d0e013a56f5..46ab0e797f0 100644 --- a/code/modules/antagonists/abductor/equipment/abduction_gear.dm +++ b/code/modules/antagonists/abductor/equipment/abduction_gear.dm @@ -103,7 +103,7 @@ M.cut_overlays() M.regenerate_icons() -/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) +/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, damage_type = BRUTE) DeactivateStealth() /obj/item/clothing/suit/armor/abductor/vest/IsReflect() diff --git a/code/modules/antagonists/changeling/powers/mutations.dm b/code/modules/antagonists/changeling/powers/mutations.dm index a654be3a52c..fbbd4185e7e 100644 --- a/code/modules/antagonists/changeling/powers/mutations.dm +++ b/code/modules/antagonists/changeling/powers/mutations.dm @@ -467,7 +467,7 @@ if(ismob(loc)) loc.visible_message(span_warning("The end of [loc.name]\'s hand inflates rapidly, forming a huge shield-like mass!"), span_warning("We inflate our hand into a strong shield."), span_hear("You hear organic matter ripping and tearing!")) -/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) +/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, damage_type = BRUTE) if(remaining_uses < 1) if(ishuman(loc)) var/mob/living/carbon/human/H = loc diff --git a/code/modules/antagonists/cult/cult_bastard_sword.dm b/code/modules/antagonists/cult/cult_bastard_sword.dm index 35a7a175d32..18b14f4b2fc 100644 --- a/code/modules/antagonists/cult/cult_bastard_sword.dm +++ b/code/modules/antagonists/cult/cult_bastard_sword.dm @@ -84,7 +84,7 @@ return FALSE return TRUE -/obj/item/cult_bastard/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) +/obj/item/cult_bastard/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK, damage_type = BRUTE) if(!prob(final_block_chance)) return FALSE owner.visible_message(span_danger("[owner] parries [attack_text] with [src]!")) diff --git a/code/modules/antagonists/cult/cult_items.dm b/code/modules/antagonists/cult/cult_items.dm index 3d3b492f141..7bbc1e3e8b6 100644 --- a/code/modules/antagonists/cult/cult_items.dm +++ b/code/modules/antagonists/cult/cult_items.dm @@ -41,7 +41,7 @@ Striking a noncultist, however, will tear their flesh."} AddComponent(/datum/component/cult_ritual_item, span_cult(examine_text)) -/obj/item/melee/cultblade/dagger/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) +/obj/item/melee/cultblade/dagger/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK, damage_type = BRUTE) var/block_message = "[owner] parries [attack_text] with [src]" if(owner.get_active_held_item() != src) block_message = "[owner] parries [attack_text] with [src] in their offhand" @@ -84,7 +84,7 @@ Striking a noncultist, however, will tear their flesh."} effectiveness = 100, \ ) -/obj/item/melee/cultblade/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) +/obj/item/melee/cultblade/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK, damage_type = BRUTE) if(IS_CULTIST(owner) && prob(final_block_chance)) new /obj/effect/temp_visual/cult/sparks(get_turf(owner)) owner.visible_message(span_danger("[owner] parries [attack_text] with [src]!")) @@ -731,7 +731,7 @@ Striking a noncultist, however, will tear their flesh."} playsound(T, 'sound/effects/glassbr3.ogg', 100) qdel(src) -/obj/item/melee/cultblade/halberd/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) +/obj/item/melee/cultblade/halberd/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK, damage_type = BRUTE) if(HAS_TRAIT(src, TRAIT_WIELDED)) final_block_chance *= 2 if(IS_CULTIST(owner) && prob(final_block_chance)) @@ -962,20 +962,20 @@ Striking a noncultist, however, will tear their flesh."} block_sound = 'sound/weapons/effects/ric5.ogg' var/illusions = 2 -/obj/item/shield/mirror/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) +/obj/item/shield/mirror/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK, damage_type = BRUTE) if(IS_CULTIST(owner)) - if(isprojectile(hitby)) - var/obj/projectile/P = hitby - if(P.damage_type == BRUTE || P.damage_type == BURN) - if(P.damage >= 30) + if(attack_type == PROJECTILE_ATTACK) + if(damage_type == BRUTE || damage_type == BURN) + if(damage >= 30) var/turf/T = get_turf(owner) - T.visible_message(span_warning("The sheer force from [P] shatters the mirror shield!")) + T.visible_message(span_warning("The sheer force from [hitby] shatters the mirror shield!")) new /obj/effect/temp_visual/cult/sparks(T) playsound(T, 'sound/effects/glassbr3.ogg', 100) owner.Paralyze(25) qdel(src) return FALSE - if(P.reflectable & REFLECT_NORMAL) + var/obj/projectile/projectile = hitby + if(projectile.reflectable & REFLECT_NORMAL) return FALSE //To avoid reflection chance double-dipping with block chance . = ..() if(.) diff --git a/code/modules/antagonists/heretic/knowledge/blade_lore.dm b/code/modules/antagonists/heretic/knowledge/blade_lore.dm index fc9ebbc20bf..5e3bfb438a6 100644 --- a/code/modules/antagonists/heretic/knowledge/blade_lore.dm +++ b/code/modules/antagonists/heretic/knowledge/blade_lore.dm @@ -126,6 +126,7 @@ attack_text = "the attack", attack_type = MELEE_ATTACK, armour_penetration = 0, + damage_type = BRUTE, ) SIGNAL_HANDLER diff --git a/code/modules/antagonists/heretic/status_effects/buffs.dm b/code/modules/antagonists/heretic/status_effects/buffs.dm index 128adb6e016..17d0eb9a5bd 100644 --- a/code/modules/antagonists/heretic/status_effects/buffs.dm +++ b/code/modules/antagonists/heretic/status_effects/buffs.dm @@ -168,6 +168,7 @@ attack_text = "the attack", attack_type = MELEE_ATTACK, armour_penetration = 0, + damage_type = BRUTE, ) SIGNAL_HANDLER diff --git a/code/modules/clothing/spacesuits/softsuit.dm b/code/modules/clothing/spacesuits/softsuit.dm index f855316dce4..510c9e7056f 100644 --- a/code/modules/clothing/spacesuits/softsuit.dm +++ b/code/modules/clothing/spacesuits/softsuit.dm @@ -86,7 +86,7 @@ /datum/armor/space_fragile melee = 5 -/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) +/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, damage_type = BRUTE) if(!torn && prob(50)) to_chat(owner, span_warning("[src] tears from the damage, breaking the air-tight seal!")) clothing_flags &= ~STOPSPRESSUREDAMAGE diff --git a/code/modules/clothing/suits/reactive_armour.dm b/code/modules/clothing/suits/reactive_armour.dm index 353c49dfc66..9537fa7b6ef 100644 --- a/code/modules/clothing/suits/reactive_armour.dm +++ b/code/modules/clothing/suits/reactive_armour.dm @@ -69,7 +69,7 @@ update_icon() add_fingerprint(user) -/obj/item/clothing/suit/armor/reactive/hit_reaction(owner, hitby, attack_text, final_block_chance, damage, attack_type) +/obj/item/clothing/suit/armor/reactive/hit_reaction(owner, hitby, attack_text, final_block_chance, damage, attack_type, damage_type = BRUTE) if(!active || !prob(hit_reaction_chance)) return FALSE if(world.time < reactivearmor_cooldown) diff --git a/code/modules/jobs/job_types/chaplain/chaplain_nullrod.dm b/code/modules/jobs/job_types/chaplain/chaplain_nullrod.dm index e3515e1d44e..a3d90cc63cc 100644 --- a/code/modules/jobs/job_types/chaplain/chaplain_nullrod.dm +++ b/code/modules/jobs/job_types/chaplain/chaplain_nullrod.dm @@ -131,7 +131,7 @@ attack_verb_simple = list("attack", "slash", "stab", "slice", "tear", "lacerate", "rip", "dice", "cut") menu_description = "A sharp claymore which provides a low chance of blocking incoming melee attacks. Can be worn on the back or belt." -/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) +/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, damage_type = BRUTE) if(attack_type == PROJECTILE_ATTACK) final_block_chance = 0 //Don't bring a sword to a gunfight return ..() diff --git a/code/modules/mining/lavaland/megafauna_loot.dm b/code/modules/mining/lavaland/megafauna_loot.dm index 23622c6c54c..2946d5c6765 100644 --- a/code/modules/mining/lavaland/megafauna_loot.dm +++ b/code/modules/mining/lavaland/megafauna_loot.dm @@ -702,7 +702,7 @@ user.visible_message(span_danger("[user] strikes with the force of [ghost_counter] vengeful spirits!")) ..() -/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) +/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, damage_type = BRUTE) var/ghost_counter = ghost_check() final_block_chance += clamp((ghost_counter * 5), 0, 75) owner.visible_message(span_danger("[owner] is protected by a ring of [ghost_counter] ghosts!")) diff --git a/code/modules/mining/lavaland/tendril_loot.dm b/code/modules/mining/lavaland/tendril_loot.dm index 229295fd50f..2c46fca1392 100644 --- a/code/modules/mining/lavaland/tendril_loot.dm +++ b/code/modules/mining/lavaland/tendril_loot.dm @@ -737,7 +737,7 @@ . = ..() end_berserk(user) -/obj/item/clothing/head/hooded/berserker/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) +/obj/item/clothing/head/hooded/berserker/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK, damage_type = BRUTE) if(berserk_active) return var/berserk_value = damage * DAMAGE_TO_CHARGE_SCALE @@ -992,7 +992,7 @@ user.changeNext_move(CLICK_CD_RAPID) return ..() -/obj/item/cursed_katana/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) +/obj/item/cursed_katana/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK, damage_type = BRUTE) if(attack_type == PROJECTILE_ATTACK) final_block_chance = 0 //Don't bring a sword to a gunfight return ..() diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 634206dd433..1cd7090ba67 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -94,7 +94,7 @@ return BULLET_ACT_FORCE_PIERCE // complete projectile permutation - if(check_shields(P, P.damage, "the [P.name]", PROJECTILE_ATTACK, P.armour_penetration)) + if(check_shields(P, P.damage, "the [P.name]", PROJECTILE_ATTACK, P.armour_penetration, P.damage_type)) P.on_hit(src, 100, def_zone, piercing_hit) return BULLET_ACT_HIT @@ -113,31 +113,31 @@ return TRUE return FALSE -/mob/living/carbon/human/proc/check_shields(atom/AM, damage, attack_text = "the attack", attack_type = MELEE_ATTACK, armour_penetration = 0) +/mob/living/carbon/human/proc/check_shields(atom/AM, damage, attack_text = "the attack", attack_type = MELEE_ATTACK, armour_penetration = 0, damage_type = BRUTE) var/block_chance_modifier = round(damage / -3) for(var/obj/item/I in held_items) if(!isclothing(I)) 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, AM, attack_text, final_block_chance, damage, attack_type)) + if(I.hit_reaction(src, AM, attack_text, final_block_chance, damage, attack_type, damage_type)) return TRUE 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, AM, attack_text, final_block_chance, damage, attack_type)) + if(wear_suit.hit_reaction(src, AM, attack_text, final_block_chance, damage, attack_type, damage_type)) return TRUE 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, AM, attack_text, final_block_chance, damage, attack_type)) + if(w_uniform.hit_reaction(src, AM, attack_text, final_block_chance, damage, attack_type, damage_type)) return TRUE if(wear_neck) var/final_block_chance = wear_neck.block_chance - (clamp((armour_penetration-wear_neck.armour_penetration)/2,0,100)) + block_chance_modifier - if(wear_neck.hit_reaction(src, AM, attack_text, final_block_chance, damage, attack_type)) + if(wear_neck.hit_reaction(src, AM, attack_text, final_block_chance, damage, attack_type, damage_type)) return TRUE if(head) var/final_block_chance = head.block_chance - (clamp((armour_penetration-head.armour_penetration)/2,0,100)) + block_chance_modifier - if(head.hit_reaction(src, AM, attack_text, final_block_chance, damage, attack_type)) + if(head.hit_reaction(src, AM, attack_text, final_block_chance, damage, attack_type, damage_type)) return TRUE - if(SEND_SIGNAL(src, COMSIG_HUMAN_CHECK_SHIELDS, AM, damage, attack_text, attack_type, armour_penetration) & SHIELD_BLOCK) + if(SEND_SIGNAL(src, COMSIG_HUMAN_CHECK_SHIELDS, AM, damage, attack_text, attack_type, armour_penetration, damage_type) & SHIELD_BLOCK) return TRUE return FALSE @@ -153,13 +153,15 @@ if(spec_return) return spec_return var/obj/item/I + var/damage_type = BRUTE var/throwpower = 30 if(isitem(AM)) I = AM - throwpower = I.throwforce if(I.thrownby == WEAKREF(src)) //No throwing stuff at yourself to trigger hit reactions return ..() - if(check_shields(AM, throwpower, "\the [AM.name]", THROWN_PROJECTILE_ATTACK)) + throwpower = I.throwforce + damage_type = I.damtype + if(check_shields(AM, throwpower, "\the [AM.name]", THROWN_PROJECTILE_ATTACK, damage_type)) hitpush = FALSE skipcatch = TRUE blocked = TRUE @@ -339,7 +341,7 @@ if(!.) return var/damage = rand(user.melee_damage_lower, user.melee_damage_upper) - if(check_shields(user, damage, "the [user.name]", MELEE_ATTACK, user.armour_penetration)) + if(check_shields(user, damage, "the [user.name]", MELEE_ATTACK, user.armour_penetration, user.melee_damage_type)) return FALSE var/dam_zone = dismembering_strike(user, pick(BODY_ZONE_CHEST, BODY_ZONE_PRECISE_L_HAND, BODY_ZONE_PRECISE_R_HAND, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG)) if(!dam_zone) //Dismemberment successful diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index 8d16412eb99..066fa1fbb4d 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -1274,7 +1274,7 @@ GLOBAL_LIST_EMPTY(features_by_species) /datum/species/proc/spec_attacked_by(obj/item/weapon, mob/living/user, obj/item/bodypart/affecting, mob/living/carbon/human/human) // Allows you to put in item-specific reactions based on species if(user != human) - if(human.check_shields(weapon, weapon.force, "the [weapon.name]", MELEE_ATTACK, weapon.armour_penetration)) + if(human.check_shields(weapon, weapon.force, "the [weapon.name]", MELEE_ATTACK, weapon.armour_penetration, weapon.damtype)) return FALSE if(human.check_block()) human.visible_message(span_warning("[human] blocks [weapon]!"), \ diff --git a/code/modules/mod/modules/modules_antag.dm b/code/modules/mod/modules/modules_antag.dm index c7221c100f3..ce438fed83f 100644 --- a/code/modules/mod/modules/modules_antag.dm +++ b/code/modules/mod/modules/modules_antag.dm @@ -128,8 +128,17 @@ qdel(shield) UnregisterSignal(mod.wearer, COMSIG_HUMAN_CHECK_SHIELDS) -/obj/item/mod/module/energy_shield/proc/shield_reaction(mob/living/carbon/human/owner, atom/movable/hitby, damage = 0, attack_text = "the attack", attack_type = MELEE_ATTACK, armour_penetration = 0) - if(SEND_SIGNAL(mod, COMSIG_ITEM_HIT_REACT, owner, hitby, attack_text, 0, damage, attack_type) & COMPONENT_HIT_REACTION_BLOCK) +/obj/item/mod/module/energy_shield/proc/shield_reaction(mob/living/carbon/human/owner, + atom/movable/hitby, + damage = 0, + attack_text = "the attack", + attack_type = MELEE_ATTACK, + armour_penetration = 0, + damage_type = BRUTE +) + SIGNAL_HANDLER + + if(SEND_SIGNAL(mod, COMSIG_ITEM_HIT_REACT, owner, hitby, attack_text, 0, damage, attack_type, damage_type) & COMPONENT_HIT_REACTION_BLOCK) drain_power(use_power_cost) return SHIELD_BLOCK return NONE diff --git a/code/modules/projectiles/guns/magic/staff.dm b/code/modules/projectiles/guns/magic/staff.dm index b99f2f1c9cb..d347eff5a33 100644 --- a/code/modules/projectiles/guns/magic/staff.dm +++ b/code/modules/projectiles/guns/magic/staff.dm @@ -224,7 +224,7 @@ butcher_sound = hitsound, \ ) -/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) +/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, damage_type = BRUTE) if(attack_type == PROJECTILE_ATTACK) final_block_chance = 0 return ..() diff --git a/code/modules/religion/sparring/ceremonial_gear.dm b/code/modules/religion/sparring/ceremonial_gear.dm index f8bf3b08b63..c21920af410 100644 --- a/code/modules/religion/sparring/ceremonial_gear.dm +++ b/code/modules/religion/sparring/ceremonial_gear.dm @@ -51,7 +51,7 @@ force = old_force throwforce = old_throwforce -/obj/item/ceremonial_blade/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) +/obj/item/ceremonial_blade/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK, damage_type = BRUTE) if(attack_type != MELEE_ATTACK || !ishuman(hitby.loc)) return ..() if(HAS_TRAIT(hitby.loc, TRAIT_SPARRING))