From 6af9c54da5572b65d85d609453a5a43dccb46381 Mon Sep 17 00:00:00 2001 From: kevinz000 <2003111+kevinz000@users.noreply.github.com> Date: Mon, 16 Mar 2020 04:59:55 -0700 Subject: [PATCH] better --- code/datums/martial/sleeping_carp.dm | 2 +- code/game/objects/items/flamethrower.dm | 2 +- code/game/objects/items/grenades/grenade.dm | 2 +- code/game/objects/items/holy_weapons.dm | 2 +- code/game/objects/items/melee/energy.dm | 4 +-- code/game/objects/items/melee/misc.dm | 2 +- code/game/objects/items/shields.dm | 10 +++---- code/game/objects/items/storage/belt.dm | 2 +- code/game/objects/items/toys.dm | 4 +-- code/game/objects/items/twohanded.dm | 8 +++--- code/game/objects/items/weaponry.dm | 4 +-- .../objects/structures/beds_chairs/chair.dm | 2 +- .../abductor/equipment/abduction_gear.dm | 2 +- .../changeling/powers/mutations.dm | 2 +- code/modules/antagonists/cult/cult_items.dm | 6 ++-- code/modules/assembly/flash.dm | 2 +- code/modules/clothing/spacesuits/hardsuit.dm | 2 +- .../modules/clothing/suits/reactive_armour.dm | 16 +++++------ code/modules/clothing/under/color.dm | 2 +- code/modules/holodeck/items.dm | 2 +- .../mining/lavaland/necropolis_chests.dm | 2 +- code/modules/mob/living/living_block.dm | 28 ++++++++++++------- .../hostile/mining_mobs/elites/herald.dm | 2 +- code/modules/projectiles/guns/magic/staff.dm | 2 +- 24 files changed, 60 insertions(+), 52 deletions(-) diff --git a/code/datums/martial/sleeping_carp.dm b/code/datums/martial/sleeping_carp.dm index e837277fce..2edfcbfd9e 100644 --- a/code/datums/martial/sleeping_carp.dm +++ b/code/datums/martial/sleeping_carp.dm @@ -237,7 +237,7 @@ else return ..() -/obj/item/twohanded/bostaff/run_block(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) +/obj/item/twohanded/bostaff/run_block(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) if(!wielded) return BLOCK_NONE return ..() diff --git a/code/game/objects/items/flamethrower.dm b/code/game/objects/items/flamethrower.dm index 753c273082..b36ad385d6 100644 --- a/code/game/objects/items/flamethrower.dm +++ b/code/game/objects/items/flamethrower.dm @@ -234,7 +234,7 @@ /obj/item/flamethrower/full/tank create_with_tank = TRUE -/obj/item/flamethrower/run_block(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) +/obj/item/flamethrower/run_block(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) if(real_attack && (attack_type & ATTACK_TYPE_PROJECTILE)) var/obj/item/projectile/P = hitby if(istype(P) && (P.damage_type != STAMINA) && damage && !P.nodamage && prob(15)) diff --git a/code/game/objects/items/grenades/grenade.dm b/code/game/objects/items/grenades/grenade.dm index c72813bec3..9f098e21b6 100644 --- a/code/game/objects/items/grenades/grenade.dm +++ b/code/game/objects/items/grenades/grenade.dm @@ -115,7 +115,7 @@ /obj/item/grenade/attack_paw(mob/user) return attack_hand(user) -/obj/item/grenade/run_block(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) +/obj/item/grenade/run_block(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) if(real_attack && (attack_type & ATTACK_TYPE_PROJECTILE)) var/obj/item/projectile/P = object if(damage && !P.nodamage && (P.damage_type != STAMINA) && prob(15)) diff --git a/code/game/objects/items/holy_weapons.dm b/code/game/objects/items/holy_weapons.dm index 20d504a634..03b26a30f6 100644 --- a/code/game/objects/items/holy_weapons.dm +++ b/code/game/objects/items/holy_weapons.dm @@ -328,7 +328,7 @@ hitsound = 'sound/weapons/bladeslice.ogg' attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") -/obj/item/nullrod/claymore/run_block(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) +/obj/item/nullrod/claymore/run_block(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) if(attack_type & ATTACK_TYPE_PROJECTILE) // Don't bring a sword to a gunfight return NONE return ..() diff --git a/code/game/objects/items/melee/energy.dm b/code/game/objects/items/melee/energy.dm index ac29c62d74..766da28d51 100644 --- a/code/game/objects/items/melee/energy.dm +++ b/code/game/objects/items/melee/energy.dm @@ -113,7 +113,7 @@ else RemoveElement(/datum/element/sword_point) -/obj/item/melee/transforming/energy/sword/run_block(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) +/obj/item/melee/transforming/energy/sword/run_block(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) if(!active) return NONE return ..() @@ -148,7 +148,7 @@ tool_behaviour = TOOL_SAW toolspeed = 0.7 -/obj/item/melee/transforming/energy/sword/cyborg/saw/run_block(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) +/obj/item/melee/transforming/energy/sword/cyborg/saw/run_block(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) return NONE /obj/item/melee/transforming/energy/sword/saber diff --git a/code/game/objects/items/melee/misc.dm b/code/game/objects/items/melee/misc.dm index 90d2e74fa3..497a2c8caf 100644 --- a/code/game/objects/items/melee/misc.dm +++ b/code/game/objects/items/melee/misc.dm @@ -75,7 +75,7 @@ AddComponent(/datum/component/butchering, 30, 95, 5) //fast and effective, but as a sword, it might damage the results. AddElement(/datum/element/sword_point) -/obj/item/melee/sabre/run_block(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) +/obj/item/melee/sabre/run_block(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) if(attack_type & ATTACK_TYPE_PROJECTILE) // Don't bring a sword to a gunfight. return BLOCK_NONE return ..() diff --git a/code/game/objects/items/shields.dm b/code/game/objects/items/shields.dm index 904904f7dc..b759c09212 100644 --- a/code/game/objects/items/shields.dm +++ b/code/game/objects/items/shields.dm @@ -26,7 +26,7 @@ transparent = TRUE max_integrity = 75 -/obj/item/shield/run_block(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) +/obj/item/shield/run_block(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) if(transparent && (object.pass_flags & PASSGLASS)) return FALSE if(attack_type & ATTACK_TYPE_THROWN) @@ -69,7 +69,7 @@ playsound(owner, 'sound/effects/glassbr3.ogg', 100) new /obj/item/shard((get_turf(src))) -/obj/item/shield/riot/on_shield_block(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) +/obj/item/shield/riot/on_shield_block(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) if(obj_integrity <= damage) var/turf/T = get_turf(owner) T.visible_message("[attack_text] destroys [src]!") @@ -139,7 +139,7 @@ . = ..() icon_state = "[base_icon_state]0" -/obj/item/shield/energy/run_block(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) +/obj/item/shield/energy/run_block(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) if((attack_type & ATTACK_TYPE_PROJECTILE) && is_energy_reflectable_projectile(object)) block_return[BLOCK_RETURN_REDIRECT_METHOD] = REDIRECT_METHOD_REFLECT return BLOCK_SUCCESS | BLOCK_REDIRECTED | BLOCK_SHOULD_REDIRECT @@ -182,7 +182,7 @@ w_class = WEIGHT_CLASS_NORMAL var/active = 0 -/obj/item/shield/riot/tele/run_block(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) +/obj/item/shield/riot/tele/run_block(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) if(!active) return BLOCK_NONE return ..() @@ -249,7 +249,7 @@ transparent = FALSE item_flags = SLOWS_WHILE_IN_HAND -/obj/item/shield/riot/implant/run_block(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) +/obj/item/shield/riot/implant/run_block(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) if(attack_type & ATTACK_TYPE_PROJECTILE) final_block_chance = 60 //Massive shield return ..() diff --git a/code/game/objects/items/storage/belt.dm b/code/game/objects/items/storage/belt.dm index 091075189e..301b613420 100755 --- a/code/game/objects/items/storage/belt.dm +++ b/code/game/objects/items/storage/belt.dm @@ -806,7 +806,7 @@ fitting_swords = list(/obj/item/melee/rapier) starting_sword = /obj/item/melee/rapier -/obj/item/storage/belt/sabre/rapier/run_block(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) +/obj/item/storage/belt/sabre/rapier/run_block(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) if(attack_type & ATTACK_TYPE_PROJECTILE) // No blocking bullets. return BLOCK_NONE return ..() diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index 3bea7dc234..ef213c233a 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -454,7 +454,7 @@ total_mass_on = TOTAL_MASS_TOY_SWORD sharpness = IS_BLUNT -/obj/item/twohanded/dualsaber/toy/run_block(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) +/obj/item/twohanded/dualsaber/toy/run_block(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) return BLOCK_NONE /obj/item/twohanded/dualsaber/hypereutactic/toy @@ -471,7 +471,7 @@ slowdown_wielded = 0 sharpness = IS_BLUNT -/obj/item/twohanded/dualsaber/hypereutactic/toy/run_block(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) +/obj/item/twohanded/dualsaber/hypereutactic/toy/run_block(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) return BLOCK_NONE /obj/item/twohanded/dualsaber/hypereutactic/toy/rainbow diff --git a/code/game/objects/items/twohanded.dm b/code/game/objects/items/twohanded.dm index 66f85bb459..c689a01177 100644 --- a/code/game/objects/items/twohanded.dm +++ b/code/game/objects/items/twohanded.dm @@ -375,7 +375,7 @@ else user.adjustStaminaLoss(25) -/obj/item/twohanded/dualsaber/run_block(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) +/obj/item/twohanded/dualsaber/run_block(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) if(!wielded) return NONE if(can_reflect && is_energy_reflectable_projectile(object) && (attack_type & ATTACK_TYPE_PROJECTILE)) @@ -751,7 +751,7 @@ armour_penetration = 100 force_on = 30 -/obj/item/twohanded/required/chainsaw/doomslayer/run_block(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) +/obj/item/twohanded/required/chainsaw/doomslayer/run_block(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) if(real_attack && (attack_type & ATTACK_TYPE_PROJECTILE)) 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) @@ -896,7 +896,7 @@ AddComponent(/datum/component/butchering, 20, 105) AddElement(/datum/element/sword_point) -/obj/item/twohanded/vibro_weapon/run_block(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) +/obj/item/twohanded/vibro_weapon/run_block(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) if(wielded) final_block_chance *= 2 if(wielded || !(attack_type & ATTACK_TYPE_PROJECTILE)) @@ -1055,7 +1055,7 @@ var/mob/living/silicon/robot/R = loc . = R.get_cell() -/obj/item/twohanded/electrostaff/run_block(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) +/obj/item/twohanded/electrostaff/run_block(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) if(!on || (!can_block_projectiles && (attack_type & PROJECTILE_ATTACK))) return BLOCK_NONE return ..() diff --git a/code/game/objects/items/weaponry.dm b/code/game/objects/items/weaponry.dm index 58c8aa2d8e..6c23683325 100644 --- a/code/game/objects/items/weaponry.dm +++ b/code/game/objects/items/weaponry.dm @@ -155,7 +155,7 @@ for further reading, please see: https://github.com/tgstation/tgstation/pull/301 return to_chat(user, "[src] thrums and points to the [dir2text(get_dir(user, closest_victim))].") -/obj/item/claymore/highlander/run_block(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) +/obj/item/claymore/highlander/run_block(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) if((attack_type & ATTACK_TYPE_PROJECTILE) && is_energy_reflectable_projectile(object)) return BLOCK_SUCCESS | BLOCK_SHOULD_REDIRECT | BLOCK_PHYSICAL_EXTERNAL | BLOCK_REDIRECTED return ..() @@ -583,7 +583,7 @@ for further reading, please see: https://github.com/tgstation/tgstation/pull/301 force = 12 throwforce = 15 -/obj/item/melee/baseball_bat/ablative/run_block(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) +/obj/item/melee/baseball_bat/ablative/run_block(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) //some day this will reflect thrown items instead of lasers if(is_energy_reflectable_projectile(object) && (attack_type == ATTACK_TYPE_PROJECTILE)) var/turf = get_turf(src) diff --git a/code/game/objects/structures/beds_chairs/chair.dm b/code/game/objects/structures/beds_chairs/chair.dm index 691b6cff90..49ca5013ac 100644 --- a/code/game/objects/structures/beds_chairs/chair.dm +++ b/code/game/objects/structures/beds_chairs/chair.dm @@ -362,7 +362,7 @@ new stack_type(get_turf(loc)) qdel(src) -/obj/item/chair/run_block(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) +/obj/item/chair/run_block(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) if(!(attack_type & ATTACK_TYPE_UNARMED)) return NONE return ..() diff --git a/code/modules/antagonists/abductor/equipment/abduction_gear.dm b/code/modules/antagonists/abductor/equipment/abduction_gear.dm index f8cd51d485..a9f97942a1 100644 --- a/code/modules/antagonists/abductor/equipment/abduction_gear.dm +++ b/code/modules/antagonists/abductor/equipment/abduction_gear.dm @@ -92,7 +92,7 @@ M.cut_overlays() M.regenerate_icons() -/obj/item/clothing/suit/armor/abductor/vest/run_block(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) +/obj/item/clothing/suit/armor/abductor/vest/run_block(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) . = ..() DeactivateStealth() diff --git a/code/modules/antagonists/changeling/powers/mutations.dm b/code/modules/antagonists/changeling/powers/mutations.dm index b95e9a90f4..adc93eacc6 100644 --- a/code/modules/antagonists/changeling/powers/mutations.dm +++ b/code/modules/antagonists/changeling/powers/mutations.dm @@ -447,7 +447,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/run_block(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) +/obj/item/shield/changeling/run_block(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) . = ..() if(real_attack) if(--remaining_uses < 1) diff --git a/code/modules/antagonists/cult/cult_items.dm b/code/modules/antagonists/cult/cult_items.dm index cc6ea983e8..c84076f44a 100644 --- a/code/modules/antagonists/cult/cult_items.dm +++ b/code/modules/antagonists/cult/cult_items.dm @@ -169,7 +169,7 @@ else ..() -/obj/item/twohanded/required/cult_bastard/run_block(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) +/obj/item/twohanded/required/cult_bastard/run_block(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) if(prob(final_block_chance)) if(attack_type & ATTACK_TYPE_PROJECTILE) owner.visible_message("[owner] deflects [attack_text] with [src]!") @@ -725,7 +725,7 @@ playsound(T, 'sound/effects/glassbr3.ogg', 100) qdel(src) -/obj/item/twohanded/cult_spear/run_block(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) +/obj/item/twohanded/cult_spear/run_block(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) if(wielded) final_block_chance *= 2 if(prob(final_block_chance)) @@ -936,7 +936,7 @@ hitsound = 'sound/weapons/smash.ogg' var/illusions = 2 -/obj/item/shield/mirror/run_block(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) +/obj/item/shield/mirror/run_block(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) if(!real_attack) block_return[BLOCK_RETURN_REFLECT_PROJECTILE_CHANCE] = final_block_chance return ..() diff --git a/code/modules/assembly/flash.dm b/code/modules/assembly/flash.dm index 41a44c53e8..3c985660af 100644 --- a/code/modules/assembly/flash.dm +++ b/code/modules/assembly/flash.dm @@ -312,7 +312,7 @@ if(holder) holder.update_icon() -/obj/item/assembly/flash/shield/run_block(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) +/obj/item/assembly/flash/shield/run_block(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) if(real_attack) activate() return ..() diff --git a/code/modules/clothing/spacesuits/hardsuit.dm b/code/modules/clothing/spacesuits/hardsuit.dm index a3d4cf367b..9857cfad94 100644 --- a/code/modules/clothing/spacesuits/hardsuit.dm +++ b/code/modules/clothing/spacesuits/hardsuit.dm @@ -757,7 +757,7 @@ if(!allowed) allowed = GLOB.advanced_hardsuit_allowed -/obj/item/clothing/suit/space/hardsuit/shielded/run_block(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) +/obj/item/clothing/suit/space/hardsuit/shielded/run_block(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) if(!real_attack) if(current_charges > 0) return BLOCK_SUCCESS | BLOCK_PHYSICAL_EXTERNAL diff --git a/code/modules/clothing/suits/reactive_armour.dm b/code/modules/clothing/suits/reactive_armour.dm index 24280f953a..6d52f46d30 100644 --- a/code/modules/clothing/suits/reactive_armour.dm +++ b/code/modules/clothing/suits/reactive_armour.dm @@ -63,12 +63,12 @@ item_state = "reactiveoff" reactivearmor_cooldown = world.time + 200 -/obj/item/clothing/suit/armor/reactive/run_block(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) +/obj/item/clothing/suit/armor/reactive/run_block(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) if(!active) return BLOCK_NONE return block_action(owner, real_attack, object, damage, attack_text, attack_type, armour_penetration, attacker, def_zone, final_block_chance, block_return) -/obj/item/clothing/suit/armor/reactive/proc/block_action(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) +/obj/item/clothing/suit/armor/reactive/proc/block_action(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) return BLOCK_NONE //When the wearer gets hit, this armor will teleport the user a short distance away (to safety or to more danger, no one knows. That's the fun of it!) @@ -80,7 +80,7 @@ var/rad_amount_before = 120 reactivearmor_cooldown_duration = 100 -/obj/item/clothing/suit/armor/reactive/teleport/block_action(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) +/obj/item/clothing/suit/armor/reactive/teleport/block_action(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) if(prob(hit_reaction_chance)) var/mob/living/carbon/human/H = owner if(world.time < reactivearmor_cooldown) @@ -117,7 +117,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/block_action(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) +/obj/item/clothing/suit/armor/reactive/fire/block_action(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) if(prob(hit_reaction_chance)) if(world.time < reactivearmor_cooldown) owner.visible_message("The reactive incendiary armor on [owner] activates, but fails to send out flames as it is still recharging its flame jets!") @@ -140,7 +140,7 @@ reactivearmor_cooldown_duration = 65 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/block_action(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) +/obj/item/clothing/suit/armor/reactive/stealth/block_action(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) if(prob(hit_reaction_chance)) if(world.time < reactivearmor_cooldown) owner.visible_message("The reactive stealth system on [owner] activates, but is still recharging its holographic emitters!") @@ -180,7 +180,7 @@ if(slot_flags & slotdefine2slotbit(slot)) //Was equipped to a valid slot for this item? user.flags_1 |= TESLA_IGNORE_1 -/obj/item/clothing/suit/armor/reactive/tesla/block_action(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) +/obj/item/clothing/suit/armor/reactive/tesla/block_action(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) if(prob(hit_reaction_chance)) if(world.time < reactivearmor_cooldown) var/datum/effect_system/spark_spread/sparks = new /datum/effect_system/spark_spread @@ -209,7 +209,7 @@ reactivearmor_cooldown_duration = 20 desc = "An experimental suit of armor that violently throws back attackers." -/obj/item/clothing/suit/armor/reactive/repulse/block_action(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) +/obj/item/clothing/suit/armor/reactive/repulse/block_action(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) if(prob(hit_reaction_chance)) if(world.time < reactivearmor_cooldown) owner.visible_message("The repulse generator is still recharging!") @@ -245,7 +245,7 @@ desc = "If you can't beat the memes, embrace them." var/tele_range = 10 -/obj/item/clothing/suit/armor/reactive/table/block_action(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) +/obj/item/clothing/suit/armor/reactive/table/block_action(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) if(prob(hit_reaction_chance)) var/mob/living/carbon/human/H = owner if(world.time < reactivearmor_cooldown) diff --git a/code/modules/clothing/under/color.dm b/code/modules/clothing/under/color.dm index cce41b9fc0..43b54f15b5 100644 --- a/code/modules/clothing/under/color.dm +++ b/code/modules/clothing/under/color.dm @@ -79,7 +79,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/run_block(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) +/obj/item/clothing/under/color/grey/glorf/run_block(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) . = ..() if(real_attack && ishuman(owner)) var/mob/living/human/H = owner diff --git a/code/modules/holodeck/items.dm b/code/modules/holodeck/items.dm index 1b1fb26148..b2e016635f 100644 --- a/code/modules/holodeck/items.dm +++ b/code/modules/holodeck/items.dm @@ -34,7 +34,7 @@ . = ..() item_color = "red" -/obj/item/holo/esword/run_block(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) +/obj/item/holo/esword/run_block(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) if(!active) return ..() return ..() diff --git a/code/modules/mining/lavaland/necropolis_chests.dm b/code/modules/mining/lavaland/necropolis_chests.dm index d0b8c113b4..0b0487c164 100644 --- a/code/modules/mining/lavaland/necropolis_chests.dm +++ b/code/modules/mining/lavaland/necropolis_chests.dm @@ -837,7 +837,7 @@ user.visible_message("[user] strikes with the force of [ghost_counter] vengeful spirits!") return ..() -/obj/item/melee/ghost_sword/run_block(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) +/obj/item/melee/ghost_sword/run_block(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) 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/living_block.dm b/code/modules/mob/living/living_block.dm index c3b9fc73f4..47d4aa4899 100644 --- a/code/modules/mob/living/living_block.dm +++ b/code/modules/mob/living/living_block.dm @@ -34,7 +34,8 @@ /** The actual proc for block checks. DO NOT USE THIS DIRECTLY UNLESS YOU HAVE VERY GOOD REASON TO. To reduce copypaste for differences between handling for real attacks and virtual checks. * Automatically checks all held items for /obj/item/proc/run_block() with the same parameters. * @params - * real_attack - If this attack is real + * real_attack - If this attack is real. This one is quirky; If it's real, run_block is called. If it's not, check_block is called and none of the regular checks happen, and this is effectively only useful + * for populating return_list with blocking metadata. * object - Whatever /atom is actually hitting us, in essence. For example, projectile if gun, item if melee, structure/whatever if it's a thrown, etc. * damage - The nominal damage this would do if it was to hit. Obviously doesn't take into effect explosions/magic/similar things.. unless you implement it to raise the value. * attack_text - The text that this attack should show, in the context of something like "[src] blocks [attack_text]!" @@ -53,13 +54,19 @@ sortTim(tocheck, /proc/cmp_item_block_priority_asc) // i don't like this var/block_chance_modifier = round(damage / -3) - for(var/obj/item/I in tocheck) - // i don't like this too - 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 - var/results = I.run_block(src, real_attack, object, damage, attack_text, attack_type, armour_penetration, attacker, def_zone, final_block_chance, return_list) - . |= results - if((results & BLOCK_SUCCESS) && !(results & BLOCK_CONTINUE_CHAIN)) - break + if(real_attack) + for(var/obj/item/I in tocheck) + // i don't like this too + 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 + var/results = I.run_block(src, object, damage, attack_text, attack_type, armour_penetration, attacker, def_zone, final_block_chance, return_list) + . |= results + if((results & BLOCK_SUCCESS) && !(results & BLOCK_CONTINUE_CHAIN)) + break + else + for(var/obj/item/I in tocheck) + // i don't like this too + 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 + I.check_block(src, object, damage, attack_text, attack_type, armour_penetration, attacker, def_zone, final_block_chance, return_list) /// Gets an unsortedlist of objects to run block checks on. /mob/living/proc/get_blocking_items() @@ -77,7 +84,7 @@ var/block_priority = BLOCK_PRIORITY_DEFAULT /// Runs block and returns flag for do_run_block to process. -/obj/item/proc/run_block(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) +/obj/item/proc/run_block(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) SEND_SIGNAL(src, COMSIG_ITEM_RUN_BLOCK, args) if(prob(final_block_chance)) owner.visible_message("[owner] blocks [attack_text] with [src]!") @@ -87,4 +94,5 @@ /// Returns block information using list/block_return. Used for check_block() on mobs. /obj/item/proc/check_block(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) SEND_SIGNAL(src, COMSIG_ITEM_CHECK_BLOCK, args) - block_return[BLOCK_RETURN_NORMAL_BLOCK_CHANCE] = final_block_chance + var/existing = block_return[BLOCK_RETURN_NORMAL_BLOCK_CHANCE] + block_return[BLOCK_RETURN_NORMAL_BLOCK_CHANCE] = max(existing || 0, final_block_chance) diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/herald.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/herald.dm index e1cd55e1b0..27b6a18934 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/herald.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/herald.dm @@ -266,7 +266,7 @@ H.firer = owner H.fire(set_angle) -/obj/item/clothing/neck/cloak/herald_cloak/run_block(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) +/obj/item/clothing/neck/cloak/herald_cloak/run_block(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) . = ..() if(!real_attack) return diff --git a/code/modules/projectiles/guns/magic/staff.dm b/code/modules/projectiles/guns/magic/staff.dm index 274a1c96f9..c993c0013a 100644 --- a/code/modules/projectiles/guns/magic/staff.dm +++ b/code/modules/projectiles/guns/magic/staff.dm @@ -90,7 +90,7 @@ . = ..() AddComponent(/datum/component/butchering, 15, 125, 0, hitsound) -/obj/item/gun/magic/staff/spellblade/run_block(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) +/obj/item/gun/magic/staff/spellblade/run_block(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return) // Do not block projectiles. if(attack_type & ATTACK_TYPE_PROJECTILE) return BLOCK_NONE