From 703fca5f902700e73f9fc7835bc72b88c6e1b267 Mon Sep 17 00:00:00 2001 From: kevinz000 <2003111+kevinz000@users.noreply.github.com> Date: Mon, 16 Mar 2020 03:24:19 -0700 Subject: [PATCH] add owner argument --- 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 | 2 +- code/game/objects/items/melee/misc.dm | 2 +- code/game/objects/items/shields.dm | 6 +++--- code/game/objects/items/storage/belt.dm | 2 +- code/game/objects/items/toys.dm | 4 ++-- code/game/objects/items/twohanded.dm | 4 ++-- code/modules/assembly/flash.dm | 2 +- code/modules/mob/living/living_block.dm | 2 +- code/modules/projectiles/guns/magic/staff.dm | 2 +- 12 files changed, 16 insertions(+), 16 deletions(-) diff --git a/code/game/objects/items/flamethrower.dm b/code/game/objects/items/flamethrower.dm index 273886c826..3e0a0cfa98 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(real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance) +/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) 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 306cd16a7e..e1c2fccb98 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(real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance) +/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) if(real_attack && (attack_type == ATTACK_TYPE_PROJECTILE)) var/obj/item/projectile/P = hitby 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 0d7ad890e7..e4a5020fa1 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(real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance) +/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) 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 388dab4b19..fb5d465588 100644 --- a/code/game/objects/items/melee/energy.dm +++ b/code/game/objects/items/melee/energy.dm @@ -148,7 +148,7 @@ tool_behaviour = TOOL_SAW toolspeed = 0.7 -/obj/item/melee/transforming/energy/sword/cyborg/saw/run_block(real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance) +/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) 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 ddce728da9..8a5a0f3a31 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(real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance) +/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) 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 85564ed64e..00b036b6f1 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(real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance) +/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) if(transparent && (hitby.pass_flags & PASSGLASS)) return FALSE if(attack_type == ATTACK_TYPE_THROWN) @@ -183,7 +183,7 @@ w_class = WEIGHT_CLASS_NORMAL var/active = 0 -/obj/item/shield/riot/tele/run_block(real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance) +/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) if(!active) return BLOCK_NONE return ..() @@ -250,7 +250,7 @@ transparent = FALSE item_flags = SLOWS_WHILE_IN_HAND -/obj/item/shield/riot/implant/hit_reaction(real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance) +/obj/item/shield/riot/implant/hit_reaction(mob/living/owner, real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance) 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 b019700593..8793a478b9 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(real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance) +/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) if(attack_type & PROJECTILE_ATTACK) // No blocking bullets. return BLOCK_NONE return ..() diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index 8416db8965..ce56819eaf 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(real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance) +/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) 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(real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance) +/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) 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 3126e5c6ba..825b65f991 100644 --- a/code/game/objects/items/twohanded.dm +++ b/code/game/objects/items/twohanded.dm @@ -752,7 +752,7 @@ armour_penetration = 100 force_on = 30 -/obj/item/twohanded/required/chainsaw/doomslayer/run_block(real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance) +/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) if(real_attack && (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) @@ -1055,7 +1055,7 @@ var/mob/living/silicon/robot/R = loc . = R.get_cell() -/obj/item/twohanded/electrostaff/run_block(real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance) +/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) if(!on || (!can_block_projectiles && (attack_type & PROJECTILE_ATTACK))) return BLOCK_NONE return ..() diff --git a/code/modules/assembly/flash.dm b/code/modules/assembly/flash.dm index 166cc4bea4..88a1c9e361 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(real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance) +/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) if(real_attack) activate() return ..() diff --git a/code/modules/mob/living/living_block.dm b/code/modules/mob/living/living_block.dm index 1a7cf4435a..1e957167a8 100644 --- a/code/modules/mob/living/living_block.dm +++ b/code/modules/mob/living/living_block.dm @@ -73,7 +73,7 @@ /// The 0% to 100% chance for the default implementation of random block rolls. var/block_chance = 0 -/obj/item/proc/run_block(real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance) +/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) /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) diff --git a/code/modules/projectiles/guns/magic/staff.dm b/code/modules/projectiles/guns/magic/staff.dm index f27d2b00aa..a73a937224 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(real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance) +/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) // Do not block projectiles. if(attack_type & PROJECTILE_ATTACK) return BLOCK_NONE