diff --git a/aurorastation.dme b/aurorastation.dme
index 1142acaf889..075c171ffb6 100644
--- a/aurorastation.dme
+++ b/aurorastation.dme
@@ -168,6 +168,7 @@
#include "code\__DEFINES\dcs\signals\signals_spatial_grid.dm"
#include "code\__DEFINES\dcs\signals\signals_subsystem.dm"
#include "code\__DEFINES\dcs\signals\signals_turf.dm"
+#include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_attack.dm"
#include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_main.dm"
#include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_movable.dm"
#include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_movement.dm"
diff --git a/code/__DEFINES/dcs/signals/signals_atom/signals_atom_attack.dm b/code/__DEFINES/dcs/signals/signals_atom/signals_atom_attack.dm
new file mode 100644
index 00000000000..84198c71317
--- /dev/null
+++ b/code/__DEFINES/dcs/signals/signals_atom/signals_atom_attack.dm
@@ -0,0 +1,17 @@
+// Atom attack signals. Format:
+// When the signal is called: (signal arguments)
+// All signals send the source datum of the signal as the first argument
+
+///from base of atom/attackby(): (/obj/item, /mob/living, params)
+#define COMSIG_ATOM_ATTACKBY "atom_attackby"
+
+/// From [/item/attack()], sent by an atom which was just attacked by an item: (/obj/item/weapon, /mob/user, proximity_flag, click_parameters)
+#define COMSIG_ATOM_AFTER_ATTACKEDBY "atom_after_attackby"
+
+///Return this in response if you don't want afterattack to be called
+ #define COMPONENT_NO_AFTERATTACK (1<<0)
+
+ ///Ends the attack chain. If sent early might cause posterior attacks not to happen.
+ #define COMPONENT_CANCEL_ATTACK_CHAIN (1<<0)
+ ///Skips the specific attack step, continuing for the next one to happen.
+ #define COMPONENT_SKIP_ATTACK (1<<1)
diff --git a/code/__DEFINES/dcs/signals/signals_mob/signals_mob_main.dm b/code/__DEFINES/dcs/signals/signals_mob/signals_mob_main.dm
index 390b3d0c4de..06f96a6157b 100644
--- a/code/__DEFINES/dcs/signals/signals_mob/signals_mob_main.dm
+++ b/code/__DEFINES/dcs/signals/signals_mob/signals_mob_main.dm
@@ -12,5 +12,8 @@
/// The arugment of move_args which dictates our movement direction
#define MOVE_ARG_DIRECTION 2
+///from base of /obj/item/attack(): (mob/M, mob/user)
+#define COMSIG_MOB_ITEM_ATTACK "mob_item_attack"
+
///From base of mob/update_movespeed():area
#define COMSIG_MOB_MOVESPEED_UPDATED "mob_update_movespeed"
diff --git a/code/__DEFINES/dcs/signals/signals_object/signals_object.dm b/code/__DEFINES/dcs/signals/signals_object/signals_object.dm
index bf28b192571..16f54e6d985 100644
--- a/code/__DEFINES/dcs/signals/signals_object/signals_object.dm
+++ b/code/__DEFINES/dcs/signals/signals_object/signals_object.dm
@@ -18,6 +18,12 @@
///from base of obj/item/pickup(): (mob/user)
#define COMSIG_ITEM_PICKUP "item_pickup"
+///from base of /obj/item/attack(): (mob/living, mob/living, params)
+#define COMSIG_ITEM_ATTACK "item_attack"
+
+///from base of [obj/item/attack()]: (atom/target, mob/user, proximity_flag, click_parameters)
+#define COMSIG_ITEM_AFTERATTACK "item_afterattack"
+
// /obj/projectile signals (sent to the firer)
///from base of /obj/projectile/proc/on_hit(), like COMSIG_PROJECTILE_ON_HIT but on the projectile itself and with the hit limb (if any): (atom/movable/firer, atom/target, angle, hit_limb, blocked)
diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm
index c9217db38e9..30fcad081a8 100644
--- a/code/_onclick/item_attack.dm
+++ b/code/_onclick/item_attack.dm
@@ -28,7 +28,6 @@ avoid code duplication. This includes items that may sometimes act as a standard
log_attack("[A] at [A?.loc]/[A.x]-[A.y]-[A.z] got ITEM attacked by [usr]/[usr?.ckey] on INTENT [usr?.a_intent] with [src]")
return A.attackby(src, user, click_parameters)
-// attackby should return TRUE if all desired actions are resolved from that attack, within attackby. This prevents afterattack being called.
/**
* Called on an object being hit by an item
*
@@ -41,38 +40,46 @@ avoid code duplication. This includes items that may sometimes act as a standard
* * params - Click params such as alt/shift etc
*/
/atom/proc/attackby(obj/item/attacking_item, mob/user, params)
+ if(SEND_SIGNAL(src, COMSIG_ATOM_ATTACKBY, attacking_item, user, params) & COMPONENT_NO_AFTERATTACK)
+ return TRUE
return FALSE
/atom/movable/attackby(obj/item/attacking_item, mob/user, params)
+ if(..())
+ return TRUE
+
if((user?.a_intent == I_HURT) && !(attacking_item.item_flags & ITEM_FLAG_NO_BLUDGEON))
visible_message(SPAN_DANGER("[src] has been hit by [user] with [attacking_item]."))
-/mob/living/attackby(obj/item/I, mob/user)
+/mob/living/attackby(obj/item/attacking_item, mob/user, params)
+ if(..())
+ return TRUE
+
if(!ismob(user))
return FALSE
var/selected_zone = user.zone_sel ? user.zone_sel.selecting : BP_CHEST
var/operating = can_operate(src)
if(operating == SURGERY_SUCCESS)
- if(do_surgery(src, user, I))
+ if(do_surgery(src, user, attacking_item))
return TRUE
else
- return I.attack(src, user, selected_zone) //This is necessary to make things like health analyzers work. -mattatlas
+ return attacking_item.attack(src, user, selected_zone) //This is necessary to make things like health analyzers work. -mattatlas
if(operating == SURGERY_FAIL)
- if(do_surgery(src, user, I, TRUE))
+ if(do_surgery(src, user, attacking_item, TRUE))
return TRUE
else
- return I.attack(src, user, selected_zone)
+ return attacking_item.attack(src, user, selected_zone)
else
- return I.attack(src, user, selected_zone)
+ return attacking_item.attack(src, user, selected_zone)
-/mob/living/carbon/human/attackby(obj/item/I, mob/user)
- if(user == src && user.a_intent == I_GRAB && zone_sel?.selecting == BP_MOUTH && can_devour(I, silent = TRUE))
+/mob/living/carbon/human/attackby(obj/item/attacking_item, mob/user, params)
+ if(user == src && user.a_intent == I_GRAB && zone_sel?.selecting == BP_MOUTH && can_devour(attacking_item, silent = TRUE))
var/obj/item/blocked = src.check_mouth_coverage()
if(blocked)
to_chat(user, SPAN_WARNING("\The [blocked] is in the way!"))
return TRUE
- if(devour(I))
+ if(devour(attacking_item))
return TRUE
return ..()
@@ -88,12 +95,25 @@ avoid code duplication. This includes items that may sometimes act as a standard
else
return Clamp(w_class * 6, 10, 100) // Multiply the item's weight class by 6, then clamp the value between 10 and 100
-//I would prefer to rename this attack_as_weapon(), but that would involve touching hundreds of files.
-/obj/item/proc/attack(mob/living/M, mob/living/user, var/target_zone = BP_CHEST)
+/**
+ * Called from [/mob/living/proc/attackby] (usually)
+ *
+ * Arguments:
+ * * mob/living/target_mob - The mob being hit by this item
+ * * mob/living/user - The mob hitting with this item
+ * * target_zone - The target zone aimed at, **THIS DIFFERS FROM TG WHERE IT TAKES THE CLICK PARAMS**
+ */
+/obj/item/proc/attack(mob/living/target_mob, mob/living/user, target_zone = BP_CHEST)
+ var/signal_return = SEND_SIGNAL(src, COMSIG_ITEM_ATTACK, target_mob, user) || SEND_SIGNAL(user, COMSIG_MOB_ITEM_ATTACK, target_mob, user)
+ if(signal_return & COMPONENT_CANCEL_ATTACK_CHAIN)
+ return TRUE
+ if(signal_return & COMPONENT_SKIP_ATTACK)
+ return FALSE
+
if(item_flags & ITEM_FLAG_NO_BLUDGEON)
return 0
- if(M == user && user.a_intent != I_HURT)
+ if(target_mob == user && user.a_intent != I_HURT)
return 0
if(user.incapacitated(INCAPACITATION_STUNNED|INCAPACITATION_KNOCKOUT|INCAPACITATION_KNOCKDOWN|INCAPACITATION_FORCELYING))
@@ -104,11 +124,11 @@ avoid code duplication. This includes items that may sometimes act as a standard
return 0
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
- user.do_attack_animation(M, src)
+ user.do_attack_animation(target_mob, src)
if(!user.aura_check(AURA_TYPE_WEAPON, src, user))
return FALSE
- var/mob/living/victim = M.get_attack_victim(src, user, target_zone)
+ var/mob/living/victim = target_mob.get_attack_victim(src, user, target_zone)
var/hit_zone
if(victim)
hit_zone = victim.resolve_item_attack(src, user, target_zone)
@@ -118,20 +138,23 @@ avoid code duplication. This includes items that may sometimes act as a standard
// Null hitzone means a miss.
if(hit_zone)
if(!force)
- playsound(loc, 'sound/weapons/tap.ogg', get_clamped_volume(), 1, -1)
+ playsound(src, 'sound/weapons/tap.ogg', get_clamped_volume(), TRUE, -1)
else if(hitsound)
- playsound(loc, hitsound, get_clamped_volume(), 1, -1)
+ playsound(src, hitsound, get_clamped_volume(), TRUE, -1, falloff_distance = 0)
else
- playsound(loc, 'sound/weapons/punchmiss2.ogg', get_clamped_volume(), 1, -1)
+ playsound(src, 'sound/weapons/punchmiss2.ogg', get_clamped_volume(), TRUE, -1)
/////////////////////////
- user.lastattacked = M
- M.lastattacker = user
+ user.lastattacked = target_mob
+ target_mob.lastattacker = user
+
+ SEND_SIGNAL(src, COMSIG_ITEM_AFTERATTACK, target_mob, user)
+ SEND_SIGNAL(target_mob, COMSIG_ATOM_AFTER_ATTACKEDBY, src, user)
if(!no_attack_log)
- user.attack_log += "\[[time_stamp()]\] [hit_zone ? "Attacked" : "Missed"] [M.name] ([M.ckey]) with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])"
- M.attack_log += "\[[time_stamp()]\] [hit_zone ? "Attacked" : "Missed"] by [user.name] ([user.ckey]) with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])"
- msg_admin_attack("[key_name(user, highlight_special = 1)] [hit_zone ? "attacked" : "missed"] [key_name(M, highlight_special = 1)] with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)]) (JMP)",ckey=key_name(user),ckey_target=key_name(M) )
+ user.attack_log += "\[[time_stamp()]\] [hit_zone ? "Attacked" : "Missed"] [target_mob.name] ([target_mob.ckey]) with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])"
+ target_mob.attack_log += "\[[time_stamp()]\] [hit_zone ? "Attacked" : "Missed"] by [user.name] ([user.ckey]) with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])"
+ msg_admin_attack("[key_name(user, highlight_special = 1)] [hit_zone ? "attacked" : "missed"] [key_name(target_mob, highlight_special = 1)] with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)]) (JMP)",ckey=key_name(user),ckey_target=key_name(target_mob) )
/////////////////////////
return 1
diff --git a/code/defines/obj/weapon.dm b/code/defines/obj/weapon.dm
index 27d2a2ad668..5a8e2ab73a1 100644
--- a/code/defines/obj/weapon.dm
+++ b/code/defines/obj/weapon.dm
@@ -58,13 +58,13 @@
attack_verb = list("bludgeoned", "whacked", "disciplined", "thrashed")
var/can_support = TRUE
-/obj/item/cane/attack(mob/living/target, mob/living/carbon/human/user, target_zone = BP_CHEST)
+/obj/item/cane/attack(mob/living/target_mob, mob/living/user, target_zone)
- if(!(istype(target) && istype(user)))
+ if(!(istype(target_mob) && istype(user)))
return ..()
- var/targetIsHuman = ishuman(target)
- var/mob/living/carbon/human/targetashuman = target
+ var/targetIsHuman = ishuman(target_mob)
+ var/mob/living/carbon/human/targetashuman = target_mob
var/wasselfattack = 0
var/verbtouse = pick(attack_verb)
var/punct = "!"
@@ -80,11 +80,11 @@
wasselfattack = 1
if (user.a_intent == I_HURT)
- target_zone = get_zone_with_miss_chance(target_zone, target) //Vary the attack
+ target_zone = get_zone_with_miss_chance(target_zone, target_mob) //Vary the attack
damagetype = DAMAGE_BRUTE
if (targetIsHuman)
- var/mob/living/carbon/human/targethuman = target
+ var/mob/living/carbon/human/targethuman = target_mob
armorpercent = targethuman.get_blocked_ratio(target_zone, DAMAGE_BRUTE, damage = force)*100
wasblocked = (targethuman.check_shields(force, src, user, target_zone, null) in list(BULLET_ACT_BLOCK, BULLET_ACT_FORCE_PIERCE))
@@ -105,19 +105,19 @@
soundname = "punch"
if(targetIsHuman)
user.visible_message("[user] flips [user.get_pronoun("his")] [name]...", "You flip [src], preparing a disarm...")
- if (do_mob(user,target,chargedelay,display_progress=0))
+ if (do_mob(user,target_mob,chargedelay,display_progress=0))
if(!wasblocked && damageamount)
var/chancemod = (100 - armorpercent)*0.05*damageamount // Lower chance if lower damage + high armor. Base chance is 50% at 10 damage.
if(target_zone == BP_L_HAND || target_zone == BP_L_ARM)
- if (prob(chancemod) && target.l_hand && target.l_hand != src)
+ if (prob(chancemod) && target_mob.l_hand && target_mob.l_hand != src)
shoulddisarm = 1
else if(target_zone == BP_R_HAND || target_zone == BP_R_ARM)
- if (prob(chancemod) && target.r_hand && target.r_hand != src)
+ if (prob(chancemod) && target_mob.r_hand && target_mob.r_hand != src)
shoulddisarm = 2
else
- if (prob(chancemod*0.5) && target.l_hand && target.l_hand != src)
+ if (prob(chancemod*0.5) && target_mob.l_hand && target_mob.l_hand != src)
shoulddisarm = 1
- if (prob(chancemod*0.5) && target.r_hand && target.r_hand != src)
+ if (prob(chancemod*0.5) && target_mob.r_hand && target_mob.r_hand != src)
shoulddisarm += 2
else
user.visible_message("[user] flips [user.get_pronoun("his")] [name] back to its original position.", "You flip [src] back to its original position.")
@@ -128,9 +128,9 @@
soundname = "punch"
if(targetIsHuman)
user.visible_message("[user] flips [user.get_pronoun("his")] [name]...", "You flip [src], preparing a grab...")
- if (do_mob(user,target,chargedelay,display_progress=0))
+ if (do_mob(user,target_mob,chargedelay,display_progress=0))
if(!wasblocked && damageamount)
- user.start_pulling(target)
+ user.start_pulling(target_mob)
else
verbtouse = pick("awkwardly tries to hook","fails to grab")
else
@@ -142,80 +142,80 @@
// Damage Logs
/////////////////////////
- user.lastattacked = target
- target.lastattacker = user
+ user.lastattacked = target_mob
+ target_mob.lastattacker = user
if(!no_attack_log)
- user.attack_log += "\[[time_stamp()]\] Attacked [target.name] ([target.ckey]) with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damagetype)])"
- target.attack_log += "\[[time_stamp()]\] Attacked by [user.name] ([user.ckey]) with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damagetype)])"
- msg_admin_attack("[key_name(user, highlight_special = 1)] attacked [key_name(target, highlight_special = 1)] with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damagetype)]) (JMP)",ckey=key_name(user),ckey_target=key_name(target) )
+ user.attack_log += "\[[time_stamp()]\] Attacked [target_mob.name] ([target_mob.ckey]) with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damagetype)])"
+ target_mob.attack_log += "\[[time_stamp()]\] Attacked by [user.name] ([user.ckey]) with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damagetype)])"
+ msg_admin_attack("[key_name(user, highlight_special = 1)] attacked [key_name(target_mob, highlight_special = 1)] with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damagetype)]) (JMP)",ckey=key_name(user),ckey_target=key_name(target_mob) )
/////////////////////////
var/washit = 0
var/endmessage1st
var/endmessage3rd
- if(!target_zone || get_dist(user,target) > 1) //Dodged
- endmessage1st = "Your [name] was dodged by [target]"
- endmessage3rd = "[target] dodged the [name]"
+ if(!target_zone || get_dist(user,target_mob) > 1) //Dodged
+ endmessage1st = "Your [name] was dodged by [target_mob]"
+ endmessage3rd = "[target_mob] dodged the [name]"
soundname = "punchmiss"
else if(wasblocked) // Blocked by Shield
- endmessage1st = "Your [name] was blocked by [target]"
- endmessage3rd = "[target] blocks the [name]"
+ endmessage1st = "Your [name] was blocked by [target_mob]"
+ endmessage3rd = "[target_mob] blocks the [name]"
soundname = "punchmiss"
else
washit = 1
- var/noun = "[target]"
+ var/noun = "[target_mob]"
var/selfnoun = "your"
if(shoulddisarm)
if(wasselfattack)
selfnoun = "your grip"
- noun = "[target.get_pronoun("his")] grip"
+ noun = "[target_mob.get_pronoun("his")] grip"
else
- noun = "[target]'s grip"
+ noun = "[target_mob]'s grip"
selfnoun = noun
if (targetIsHuman && shoulddisarm != 3) // Query: Can non-humans hold objects in hands?
- var/mob/living/carbon/human/targethuman = target
+ var/mob/living/carbon/human/targethuman = target_mob
var/obj/item/organ/external/O = targethuman.get_organ(target_zone)
if (O.is_stump())
if(wasselfattack)
selfnoun = "your missing [O.name]"
- noun = "[target.get_pronoun("his")] missing [O.name]"
+ noun = "[target_mob.get_pronoun("his")] missing [O.name]"
else
- noun = "[target]'s missing [O.name]"
+ noun = "[target_mob]'s missing [O.name]"
selfnoun = noun
else
if(wasselfattack)
selfnoun = "your [O.name]"
- noun = "[target.get_pronoun("his")] [O.name]"
+ noun = "[target_mob.get_pronoun("his")] [O.name]"
else
- noun = "[target]'s [O.name]"
+ noun = "[target_mob]'s [O.name]"
selfnoun = noun
switch(shoulddisarm)
if(1)
- endmessage1st = "You [verbtouse] the [target.l_hand.name] out of [selfnoun]"
- endmessage3rd = "[user] [verbtouse] the [target.l_hand.name] out of [noun]"
- target.drop_l_hand()
+ endmessage1st = "You [verbtouse] the [target_mob.l_hand.name] out of [selfnoun]"
+ endmessage3rd = "[user] [verbtouse] the [target_mob.l_hand.name] out of [noun]"
+ target_mob.drop_l_hand()
if(2)
- endmessage1st = "You [verbtouse] the [target.r_hand.name] out of [selfnoun]"
- endmessage3rd = "[user] [verbtouse] the [target.r_hand.name] out of [noun]"
- target.drop_r_hand()
+ endmessage1st = "You [verbtouse] the [target_mob.r_hand.name] out of [selfnoun]"
+ endmessage3rd = "[user] [verbtouse] the [target_mob.r_hand.name] out of [noun]"
+ target_mob.drop_r_hand()
if(3)
- endmessage1st = "You [verbtouse] both the [target.r_hand.name] and the [target.l_hand.name] out of [selfnoun]"
- endmessage3rd = "[user] [verbtouse] both the [target.r_hand.name] and the [target.l_hand.name] out of [noun]"
- target.drop_l_hand()
- target.drop_r_hand()
+ endmessage1st = "You [verbtouse] both the [target_mob.r_hand.name] and the [target_mob.l_hand.name] out of [selfnoun]"
+ endmessage3rd = "[user] [verbtouse] both the [target_mob.r_hand.name] and the [target_mob.l_hand.name] out of [noun]"
+ target_mob.drop_l_hand()
+ target_mob.drop_r_hand()
else
endmessage1st = "You [verbtouse] [selfnoun] with the [name]"
endmessage3rd = "[user] [verbtouse] [noun] with the [name]"
if(damageamount > 0) // Poking will no longer do damage until there is some fix that makes it so that 0.0001 HALLOS doesn't cause bleed.
- target.standard_weapon_hit_effects(src, user, damageamount, armorpercent, target_zone)
+ target_mob.standard_weapon_hit_effects(src, user, damageamount, armorpercent, target_zone)
user.visible_message("[endmessage3rd][punct]", "[endmessage1st][punct]")
- user.do_attack_animation(target)
+ user.do_attack_animation(target_mob)
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
if(soundname)
diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm
index 85d69ef1009..0ab9e42db4f 100644
--- a/code/game/atoms_movable.dm
+++ b/code/game/atoms_movable.dm
@@ -397,9 +397,9 @@
master = null
. = ..()
-/atom/movable/overlay/attackby(a, b)
+/atom/movable/overlay/attackby(obj/item/attacking_item, mob/user, params)
if (src.master)
- return src.master.attackby(a, b)
+ return src.master.attackby(arglist(args))
return
/atom/movable/overlay/attack_hand(a, b, c)
diff --git a/code/game/gamemodes/cult/items/sword.dm b/code/game/gamemodes/cult/items/sword.dm
index e4779da10eb..2d231eaa744 100644
--- a/code/game/gamemodes/cult/items/sword.dm
+++ b/code/game/gamemodes/cult/items/sword.dm
@@ -27,7 +27,7 @@
/obj/item/melee/cultblade/cultify()
return
-/obj/item/melee/cultblade/attack(mob/living/M, mob/living/user, var/target_zone)
+/obj/item/melee/cultblade/attack(mob/living/target_mob, mob/living/user, target_zone)
if(iscultist(user) || !does_cult_check)
return ..()
diff --git a/code/game/gamemodes/cult/items/tome.dm b/code/game/gamemodes/cult/items/tome.dm
index 14fa58e2785..ea0758d22dd 100644
--- a/code/game/gamemodes/cult/items/tome.dm
+++ b/code/game/gamemodes/cult/items/tome.dm
@@ -9,32 +9,32 @@
unique = TRUE
slot_flags = SLOT_BELT
-/obj/item/book/tome/attack(mob/living/M, mob/living/user)
- if(isobserver(M))
- var/mob/abstract/observer/D = M
+/obj/item/book/tome/attack(mob/living/target_mob, mob/living/user, target_zone)
+ if(isobserver(target_mob))
+ var/mob/abstract/observer/D = target_mob
D.manifest(user)
attack_admins(D, user)
return
- if(!istype(M))
+ if(!istype(target_mob))
return
if(!iscultist(user))
return ..()
- if(iscultist(M))
+ if(iscultist(target_mob))
return
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
- M.take_organ_damage(0, rand(5,20)) //really lucky - 5 hits for a crit
- visible_message(SPAN_WARNING("\The [user] beats \the [M] with \the [src]!"))
- to_chat(M, SPAN_DANGER("You feel searing heat inside!"))
- attack_admins(M, user)
+ target_mob.take_organ_damage(0, rand(5,20)) //really lucky - 5 hits for a crit
+ visible_message(SPAN_WARNING("\The [user] beats \the [target_mob] with \the [src]!"))
+ to_chat(target_mob, SPAN_DANGER("You feel searing heat inside!"))
+ attack_admins(target_mob, user)
-/obj/item/book/tome/proc/attack_admins(var/mob/living/M, var/mob/living/user)
- M.attack_log += "\[[time_stamp()]\] Has had the [name] used on them by [user.name] ([user.ckey])"
- user.attack_log += "\[[time_stamp()]\] Used [name] on [M.name] ([M.ckey])"
- msg_admin_attack("[key_name_admin(user)] used [name] on [M.name] ([M.ckey]) (JMP)",ckey=key_name(user),ckey_target=key_name(M))
+/obj/item/book/tome/proc/attack_admins(var/mob/living/target_mob, var/mob/living/user)
+ target_mob.attack_log += "\[[time_stamp()]\] Has had the [name] used on them by [user.name] ([user.ckey])"
+ user.attack_log += "\[[time_stamp()]\] Used [name] on [target_mob.name] ([target_mob.ckey])"
+ msg_admin_attack("[key_name_admin(user)] used [name] on [target_mob.name] ([target_mob.ckey]) (JMP)",ckey=key_name(user),ckey_target=key_name(target_mob))
/obj/item/book/tome/afterattack(atom/target, mob/user, proximity_flag, click_parameters)
diff --git a/code/game/gamemodes/endgame/supermatter_cascade/blob.dm b/code/game/gamemodes/endgame/supermatter_cascade/blob.dm
index 7f050dde86a..7ab817234d9 100644
--- a/code/game/gamemodes/endgame/supermatter_cascade/blob.dm
+++ b/code/game/gamemodes/endgame/supermatter_cascade/blob.dm
@@ -88,7 +88,7 @@
Consume(user)
-/turf/unsimulated/wall/supermatter/attackby(obj/item/attacking_item, mob/living/user)
+/turf/unsimulated/wall/supermatter/attackby(obj/item/attacking_item, mob/user)
user.visible_message("\The [user] touches \a [attacking_item] to \the [src] as a silence fills the room...",\
"You touch \the [attacking_item] to \the [src] when everything suddenly goes silent.\"\n\The [attacking_item] flashes into dust as you flinch away from \the [src].",\
"Everything suddenly goes silent.")
diff --git a/code/game/gamemodes/technomancer/spells/targeting_matrix.dm b/code/game/gamemodes/technomancer/spells/targeting_matrix.dm
index db39d54e577..afd2fa01efd 100644
--- a/code/game/gamemodes/technomancer/spells/targeting_matrix.dm
+++ b/code/game/gamemodes/technomancer/spells/targeting_matrix.dm
@@ -27,7 +27,7 @@
if(I && pay_energy(200))
var/prox = user.Adjacent(chosen_target)
if(prox) // Needed or else they can attack with melee from afar.
- I.attack(chosen_target,owner)
+ I.attack(chosen_target, owner)
I.afterattack(chosen_target,owner, prox)
adjust_instability(2)
diff --git a/code/game/machinery/OpTable.dm b/code/game/machinery/OpTable.dm
index 97874902637..b42d69a3bb0 100644
--- a/code/game/machinery/OpTable.dm
+++ b/code/game/machinery/OpTable.dm
@@ -299,9 +299,9 @@
else
return ..()
-/obj/machinery/optable/attackby(obj/item/W, mob/living/carbon/user)
- if(istype(W, /obj/item/grab))
- var/obj/item/grab/G = W
+/obj/machinery/optable/attackby(obj/item/attacking_item, mob/user, params)
+ if(istype(attacking_item, /obj/item/grab))
+ var/obj/item/grab/G = attacking_item
var/mob/living/carbon/human/occupant_resolved = occupant?.resolve()
if(occupant_resolved)
@@ -319,11 +319,11 @@
user.visible_message(SPAN_NOTICE("\The [user] starts putting \the [L] onto \the [src]."), SPAN_NOTICE("You start putting \the [L] onto \the [src]."), range = 3)
if(do_mob(user, L, 10, needhand = FALSE))
take_occupant(G.affecting,usr)
- qdel(W)
+ qdel(attacking_item)
return TRUE
- if(default_deconstruction_screwdriver(user, W))
+ if(default_deconstruction_screwdriver(user, attacking_item))
return TRUE
- if(default_deconstruction_crowbar(user, W))
+ if(default_deconstruction_crowbar(user, attacking_item))
return TRUE
- if(default_part_replacement(user, W))
+ if(default_part_replacement(user, attacking_item))
return TRUE
diff --git a/code/game/machinery/telecomms/computers/message.dm b/code/game/machinery/telecomms/computers/message.dm
index b836c3b72be..5436fa198c5 100644
--- a/code/game/machinery/telecomms/computers/message.dm
+++ b/code/game/machinery/telecomms/computers/message.dm
@@ -52,7 +52,7 @@
linkedServer = null
return ..()
-/obj/machinery/computer/message_monitor/attackby(obj/item/attacking_item, mob/living/user)
+/obj/machinery/computer/message_monitor/attackby(obj/item/attacking_item, mob/user, params)
if(stat & (NOPOWER|BROKEN))
return ..()
if(!istype(user))
diff --git a/code/game/objects/items/crayons.dm b/code/game/objects/items/crayons.dm
index 92876c2d0c9..f535df3cd1c 100644
--- a/code/game/objects/items/crayons.dm
+++ b/code/game/objects/items/crayons.dm
@@ -137,21 +137,21 @@
qdel(src)
return
-/obj/item/pen/crayon/attack(mob/user, var/target_zone)
- if(ishuman(user))
- var/mob/living/carbon/human/H = user
+/obj/item/pen/crayon/attack(mob/living/target_mob, mob/living/user, target_zone)
+ if(ishuman(target_mob))
+ var/mob/living/carbon/human/H = target_mob
if(H.check_has_mouth())
- user.visible_message(SPAN_NOTICE("[user] takes a bite of their crayon and swallows it."),
+ target_mob.visible_message(SPAN_NOTICE("[target_mob] takes a bite of their crayon and swallows it."),
SPAN_NOTICE("You take a bite of your crayon and swallow it."))
- user.adjustNutritionLoss(-1)
- reagents.trans_to_mob(user, 2, CHEM_INGEST)
+ target_mob.adjustNutritionLoss(-1)
+ reagents.trans_to_mob(target_mob, 2, CHEM_INGEST)
if(reagents.total_volume <= 0)
- user.visible_message(SPAN_NOTICE("[user] finished their crayon!"), SPAN_WARNING("You ate your crayon!"))
+ target_mob.visible_message(SPAN_NOTICE("[target_mob] finished their crayon!"), SPAN_WARNING("You ate your crayon!"))
qdel(src)
return TRUE
else
- ..(user, target_zone)
+ return ..()
/obj/item/pen/crayon/attack_self(var/mob/user)
return
diff --git a/code/game/objects/items/defib.dm b/code/game/objects/items/defib.dm
index 05c20e33497..18a19c86e85 100644
--- a/code/game/objects/items/defib.dm
+++ b/code/game/objects/items/defib.dm
@@ -342,8 +342,8 @@
/obj/item/shockpaddles/proc/checked_use(charge_amt)
return 0
-/obj/item/shockpaddles/attack(mob/living/M, mob/living/user, target_zone)
- var/mob/living/carbon/human/H = M
+/obj/item/shockpaddles/attack(mob/living/target_mob, mob/living/user, target_zone)
+ var/mob/living/carbon/human/H = target_mob
if(!istype(H) || user.a_intent == I_HURT)
return ..() //Do a regular attack. Harm intent shocking happens as a hit effect
diff --git a/code/game/objects/items/devices/aicard.dm b/code/game/objects/items/devices/aicard.dm
index 8825fce8103..6f1726eeb33 100644
--- a/code/game/objects/items/devices/aicard.dm
+++ b/code/game/objects/items/devices/aicard.dm
@@ -22,8 +22,9 @@
message += SPAN_WARNING("inactive.")
. += message
-/obj/item/aicard/attack(mob/living/silicon/decoy/M as mob, mob/user as mob, var/target_zone)
- if (!istype (M, /mob/living/silicon/decoy))
+/obj/item/aicard/attack(mob/living/target_mob, mob/living/user, target_zone)
+ var/mob/living/silicon/decoy/M = target_mob
+ if (!istype(M))
return ..()
else
M.death()
diff --git a/code/game/objects/items/devices/auto_cpr.dm b/code/game/objects/items/devices/auto_cpr.dm
index f7983655c3f..7e1fa0c44c1 100644
--- a/code/game/objects/items/devices/auto_cpr.dm
+++ b/code/game/objects/items/devices/auto_cpr.dm
@@ -140,7 +140,8 @@
else
return FALSE
-/obj/item/auto_cpr/attack(mob/living/carbon/human/H, mob/living/user, var/target_zone)
+/obj/item/auto_cpr/attack(mob/living/target_mob, mob/living/user, target_zone)
+ var/mob/living/carbon/human/H = target_mob
if(istype(H) && user.a_intent == I_HELP)
if(panel_open)
to_chat(user, SPAN_WARNING("You must screw \the [src]'s panel closed before fitting it onto anyone!"))
diff --git a/code/game/objects/items/devices/drop_targeter/_droptargeter.dm b/code/game/objects/items/devices/drop_targeter/_droptargeter.dm
index c8dec43e375..58492417cb2 100644
--- a/code/game/objects/items/devices/drop_targeter/_droptargeter.dm
+++ b/code/game/objects/items/devices/drop_targeter/_droptargeter.dm
@@ -28,8 +28,8 @@
/obj/item/device/orbital_dropper/attack_self(mob/user)
zoom(user, tileoffset, viewsize)
-/obj/item/device/orbital_dropper/attack(mob/living/M, mob/user)
- laser_act(M, user)
+/obj/item/device/orbital_dropper/attack(mob/living/target_mob, mob/living/user, target_zone)
+ laser_act(target_mob, user)
/obj/item/device/orbital_dropper/afterattack(var/atom/target, var/mob/living/user, flag, params)
if(flag) //we're placing the targetter on a table or in backpack
diff --git a/code/game/objects/items/devices/flash.dm b/code/game/objects/items/devices/flash.dm
index ad651bb6a36..a470d19664a 100644
--- a/code/game/objects/items/devices/flash.dm
+++ b/code/game/objects/items/devices/flash.dm
@@ -87,22 +87,22 @@
QDEL_IN(animation, 5)
//attack_as_weapon
-/obj/item/device/flash/attack(mob/living/L, mob/living/user, target_zone)
+/obj/item/device/flash/attack(mob/living/target_mob, mob/living/user, target_zone)
// Single-target flash
- if(!L || !user || !clumsy_check(user) || !cooldown())
+ if(!target_mob || !user || !clumsy_check(user) || !cooldown())
return
- if(L == user)
+ if(target_mob == user)
if(user.a_intent == I_HURT)
attack_self(user)
return
- L.attack_log += "\[[time_stamp()]\] Has been flashed (attempt) with [src.name] by [user.name] ([user.ckey])"
- user.attack_log += "\[[time_stamp()]\] Used the [src.name] to flash [L.name] ([L.ckey])"
- msg_admin_attack("[user.name] ([user.ckey]) Used the [src.name] to flash [L.name] ([L.ckey]) (JMP)",ckey=key_name(user),ckey_target=key_name(L))
+ target_mob.attack_log += "\[[time_stamp()]\] Has been flashed (attempt) with [src.name] by [user.name] ([user.ckey])"
+ user.attack_log += "\[[time_stamp()]\] Used the [src.name] to flash [target_mob.name] ([target_mob.ckey])"
+ msg_admin_attack("[user.name] ([user.ckey]) Used the [src.name] to flash [target_mob.name] ([target_mob.ckey]) (JMP)",ckey=key_name(user),ckey_target=key_name(target_mob))
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
- user.do_attack_animation(L)
+ user.do_attack_animation(target_mob)
if(broken)
to_chat(user, SPAN_WARNING("\The [src] is broken."))
return
@@ -115,13 +115,13 @@
if(isrobot(user))
robot_flash(user)
- if(flash(L))
- if(issilicon(L))
- user.visible_message(SPAN_WARNING("[user] overloads [L]'s sensors with \the [src]!"))
+ if(flash(target_mob))
+ if(issilicon(target_mob))
+ user.visible_message(SPAN_WARNING("[user] overloads [target_mob]'s sensors with \the [src]!"))
else
- user.visible_message(SPAN_WARNING("[user] blinds [L] with \the [src]!"))
+ user.visible_message(SPAN_WARNING("[user] blinds [target_mob] with \the [src]!"))
else
- user.visible_message(SPAN_NOTICE("[user] fails to blind [L] with \the [src]."))
+ user.visible_message(SPAN_NOTICE("[user] fails to blind [target_mob] with \the [src]."))
/obj/item/device/flash/attack_self(mob/living/carbon/user as mob, flag = 0, emp = 0)
// AOE flash
diff --git a/code/game/objects/items/devices/holowarrant.dm b/code/game/objects/items/devices/holowarrant.dm
index 14f05d2db58..99b49d01bd0 100644
--- a/code/game/objects/items/devices/holowarrant.dm
+++ b/code/game/objects/items/devices/holowarrant.dm
@@ -86,13 +86,13 @@
play_message(SPAN_NOTICE("\The [src] pings, \"Active warrant modified.\""))
-/obj/item/device/holowarrant/attack(mob/living/victim, mob/living/user)
+/obj/item/device/holowarrant/attack(mob/living/target_mob, mob/living/user, target_zone)
if(!selected_warrant)
to_chat(user, SPAN_WARNING("There are no warrants loaded!"))
return
- user.visible_message("[user] holds \the [src] up to \the [victim].", SPAN_NOTICE("You hold up \the [src] to \the [victim]."))
- show_content(victim)
+ user.visible_message("[user] holds \the [src] up to \the [target_mob].", SPAN_NOTICE("You hold up \the [src] to \the [target_mob]."))
+ show_content(target_mob)
/obj/item/device/holowarrant/update_icon()
if(selected_warrant)
diff --git a/code/game/objects/items/devices/laserpointer.dm b/code/game/objects/items/devices/laserpointer.dm
index 2af81e2de2d..9c8b4d64bc4 100644
--- a/code/game/objects/items/devices/laserpointer.dm
+++ b/code/game/objects/items/devices/laserpointer.dm
@@ -38,8 +38,8 @@
-/obj/item/device/laser_pointer/attack(mob/living/M, mob/user)
- laser_act(M, user)
+/obj/item/device/laser_pointer/attack(mob/living/target_mob, mob/living/user, target_zone)
+ laser_act(target_mob, user)
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
/obj/item/device/laser_pointer/attackby(obj/item/attacking_item, mob/user)
diff --git a/code/game/objects/items/devices/lighting/flashlight.dm b/code/game/objects/items/devices/lighting/flashlight.dm
index abd1b98b609..23ffb96af47 100644
--- a/code/game/objects/items/devices/lighting/flashlight.dm
+++ b/code/game/objects/items/devices/lighting/flashlight.dm
@@ -220,7 +220,7 @@
for(var/obj/O in contents)
O.emp_act(severity)
-/obj/item/device/flashlight/attack(mob/living/M as mob, mob/living/user as mob)
+/obj/item/device/flashlight/attack(mob/living/target_mob, mob/living/user, target_zone)
add_fingerprint(user)
if(on && user.zone_sel.selecting == BP_EYES)
@@ -231,10 +231,10 @@
to_chat(user, SPAN_WARNING("This light is too dim to see anything with!"))
return
- var/mob/living/carbon/human/H = M //mob has protective eyewear
+ var/mob/living/carbon/human/H = target_mob //mob has protective eyewear
if(istype(H))
if(H.get_flash_protection())
- to_chat(user, SPAN_WARNING("You're going to need to remove \the [M]'s eye protection first."))
+ to_chat(user, SPAN_WARNING("You're going to need to remove \the [H]'s eye protection first."))
return
var/obj/item/organ/vision
@@ -244,8 +244,8 @@
to_chat(user, SPAN_WARNING("You can't find any [H.species.vision_organ ? H.species.vision_organ : "eyes"] on [H]!"))
user.visible_message(
- SPAN_NOTICE("\The [user] directs [src] to [M]'s eyes."),
- SPAN_NOTICE("You direct [src] to [M]'s eyes.")
+ SPAN_NOTICE("\The [user] directs [src] to [H]'s eyes."),
+ SPAN_NOTICE("You direct [src] to [H]'s eyes.")
)
inspect_vision(vision, user)
diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm
index bab2bccc414..cf741294f8e 100644
--- a/code/game/objects/items/devices/scanners.dm
+++ b/code/game/objects/items/devices/scanners.dm
@@ -24,7 +24,7 @@ BREATH ANALYZER
var/mode = 1
var/sound_scan = FALSE
-/obj/item/device/healthanalyzer/attack(mob/living/M, mob/living/user)
+/obj/item/device/healthanalyzer/attack(mob/living/target_mob, mob/living/user, target_zone)
sound_scan = FALSE
if(last_scan <= world.time - 20) //Spam limiter.
last_scan = world.time
@@ -32,7 +32,7 @@ BREATH ANALYZER
user.setClickCooldown(DEFAULT_QUICK_COOLDOWN)
user.do_attack_animation(src)
flick("[icon_state]-scan", src) //makes it so that it plays the scan animation on a successful scan
- health_scan_mob(M, user, mode, sound_scan = sound_scan)
+ health_scan_mob(target_mob, user, mode, sound_scan = sound_scan)
add_fingerprint(user)
/obj/item/device/healthanalyzer/attack_self(mob/user)
@@ -533,11 +533,12 @@ BREATH ANALYZER
throw_range = 7
matter = list(MATERIAL_ALUMINIUM = 30, MATERIAL_GLASS = 20)
-/obj/item/device/slime_scanner/attack(mob/living/M, mob/living/user)
- if(!isslime(M))
+/obj/item/device/slime_scanner/attack(mob/living/target_mob, mob/living/user, target_zone)
+ if(!isslime(target_mob))
to_chat(user, SPAN_WARNING("This device can only scan slimes!"))
return
- var/mob/living/carbon/slime/T = M
+
+ var/mob/living/carbon/slime/T = target_mob
to_chat(user, SPAN_NOTICE("**************************"))
to_chat(user, SPAN_NOTICE("Slime scan results:"))
to_chat(user, SPAN_NOTICE(capitalize_first_letters("[T.colour] [T.is_adult ? "adult" : "baby"] slime")))
@@ -599,7 +600,9 @@ BREATH ANALYZER
matter = list(MATERIAL_ALUMINIUM = 30, MATERIAL_GLASS = 20)
origin_tech = list(TECH_MAGNET = 2, TECH_BIO = 2)
-/obj/item/device/breath_analyzer/attack(mob/living/carbon/human/H, mob/living/user as mob)
+/obj/item/device/breath_analyzer/attack(mob/living/target_mob, mob/living/user, target_zone)
+
+ var/mob/living/carbon/human/H = target_mob
if (!istype(H))
to_chat(user,SPAN_WARNING("You can't find a way to use \the [src] on [H]!"))
@@ -716,14 +719,14 @@ BREATH ANALYZER
QDEL_NULL(connected)
return ..()
-/obj/item/device/advanced_healthanalyzer/attack(mob/living/M, mob/living/user)
+/obj/item/device/advanced_healthanalyzer/attack(mob/living/target_mob, mob/living/user, target_zone)
if(!connected)
return
user.setClickCooldown(DEFAULT_QUICK_COOLDOWN)
user.do_attack_animation(src)
- user.visible_message("[user] starts scanning \the [M] with \the [src].", SPAN_NOTICE("You start scanning \the [M] with \the [src]."))
- if(do_after(user, 7 SECONDS, M, DO_UNIQUE))
- print_scan(M, user)
+ user.visible_message("[user] starts scanning \the [target_mob] with \the [src].", SPAN_NOTICE("You start scanning \the [target_mob] with \the [src]."))
+ if(do_after(user, 7 SECONDS, target_mob, DO_UNIQUE))
+ print_scan(target_mob, user)
add_fingerprint(user)
/obj/item/device/advanced_healthanalyzer/proc/print_scan(var/mob/M, var/mob/living/user)
diff --git a/code/game/objects/items/devices/tagger.dm b/code/game/objects/items/devices/tagger.dm
index 71cb887d338..21ea8f54ab3 100644
--- a/code/game/objects/items/devices/tagger.dm
+++ b/code/game/objects/items/devices/tagger.dm
@@ -20,7 +20,7 @@
return ..()
-/obj/item/device/animaltagger/attack()
+/obj/item/device/animaltagger/attack(mob/living/target_mob, mob/living/user, target_zone)
return
/obj/item/device/animaltagger/afterattack(atom/A as mob|obj, mob/user as mob)
diff --git a/code/game/objects/items/devices/traitordevices.dm b/code/game/objects/items/devices/traitordevices.dm
index 26c32d1069a..beeb6a12f3b 100644
--- a/code/game/objects/items/devices/traitordevices.dm
+++ b/code/game/objects/items/devices/traitordevices.dm
@@ -57,7 +57,7 @@ effective or pretty fucking useless.
desc = "Use this single-use injector on a Vaurca to grant them access to the Lii'dra Hivenet. Use it on an organic non-Vaurca to infect them with black k'ois. This is an OOC item, do not let anyone see it!"
icon_state = "animal_tagger1"
-/obj/item/device/liidrafier/attack()
+/obj/item/device/liidrafier/attack(mob/living/target_mob, mob/living/user, target_zone)
return
/obj/item/device/liidrafier/afterattack(atom/A as mob, mob/user as mob)
diff --git a/code/game/objects/items/science_sampler.dm b/code/game/objects/items/science_sampler.dm
index 418f1c827a6..63c16bb9ca6 100644
--- a/code/game/objects/items/science_sampler.dm
+++ b/code/game/objects/items/science_sampler.dm
@@ -75,7 +75,7 @@
if(I)
AddOverlays(I)
-/obj/item/sampler/attack(atom/target, mob/user, proximity_flag, click_parameters)
+/obj/item/sampler/attack(mob/living/target_mob, mob/living/user, target_zone)
if(!vial || vial.reagents.total_volume)
return ..()
else
diff --git a/code/game/objects/items/stacks/medical.dm b/code/game/objects/items/stacks/medical.dm
index b6c54aa7e61..9ea50eb2c19 100644
--- a/code/game/objects/items/stacks/medical.dm
+++ b/code/game/objects/items/stacks/medical.dm
@@ -29,9 +29,9 @@ Contains:
var/apply_sounds
var/applied_sounds
-/obj/item/stack/medical/attack(mob/living/M as mob, mob/user as mob)
- if (!istype(M) || istype(M, /mob/living/silicon) || istype(M, /mob/living/simple_animal/spiderbot))
- to_chat(user, SPAN_WARNING("\The [src] cannot be applied to [M]!"))
+/obj/item/stack/medical/attack(mob/living/target_mob, mob/living/user, target_zone)
+ if (!istype(target_mob) || istype(target_mob, /mob/living/silicon) || istype(target_mob, /mob/living/simple_animal/spiderbot))
+ to_chat(user, SPAN_WARNING("\The [src] cannot be applied to [target_mob]!"))
return 1
if ( ! (istype(user, /mob/living/carbon/human) || \
@@ -39,8 +39,8 @@ Contains:
to_chat(user, SPAN_WARNING("You don't have the dexterity to do this!"))
return 1
- if (istype(M, /mob/living/carbon/human))
- var/mob/living/carbon/human/H = M
+ if (istype(target_mob, /mob/living/carbon/human))
+ var/mob/living/carbon/human/H = target_mob
var/obj/item/organ/external/affecting = H.get_organ(user.zone_sel.selecting)
if(affecting.name == BP_HEAD)
@@ -54,17 +54,17 @@ Contains:
if(affecting.status & ORGAN_LIFELIKE)
if(!(affecting.brute_dam || affecting.burn_dam))
- to_chat(user, SPAN_NOTICE("[M] seems healthy, there are no wounds to treat! "))
+ to_chat(user, SPAN_NOTICE("[target_mob] seems healthy, there are no wounds to treat! "))
return 1
user.visible_message( \
- SPAN_NOTICE("[user] starts applying \the [src] to [M]."), \
- SPAN_NOTICE("You start applying \the [src] to [M].")\
+ SPAN_NOTICE("[user] starts applying \the [src] to [target_mob]."), \
+ SPAN_NOTICE("You start applying \the [src] to [target_mob].")\
)
- if (do_mob(user, M, 30))
+ if (do_mob(user, target_mob, 30))
user.visible_message( \
- SPAN_NOTICE("[M] has been applied with [src] by [user]."), \
- SPAN_NOTICE("You apply \the [src] to [M].")\
+ SPAN_NOTICE("[target_mob] has been applied with [src] by [user]."), \
+ SPAN_NOTICE("You apply \the [src] to [target_mob].")\
)
use(1)
return 1
@@ -76,23 +76,23 @@ Contains:
H.UpdateDamageIcon()
else
- if (!M.getBruteLoss() && !M.getFireLoss())
- to_chat(user, SPAN_NOTICE("[M] seems healthy, there are no wounds to treat! "))
+ if (!target_mob.getBruteLoss() && !target_mob.getFireLoss())
+ to_chat(user, SPAN_NOTICE("[target_mob] seems healthy, there are no wounds to treat! "))
return 1
user.visible_message( \
- SPAN_NOTICE("[user] starts applying \the [src] to [M]."), \
- SPAN_NOTICE("You start applying \the [src] to [M].")\
+ SPAN_NOTICE("[user] starts applying \the [src] to [target_mob]."), \
+ SPAN_NOTICE("You start applying \the [src] to [target_mob].")\
)
- if (do_mob(user, M, 30))
- M.heal_organ_damage((src.heal_brute/2), (src.heal_burn/2))
+ if (do_mob(user, target_mob, 30))
+ target_mob.heal_organ_damage((src.heal_brute/2), (src.heal_burn/2))
user.visible_message( \
- SPAN_NOTICE("[M] has been applied with [src] by [user]."), \
- SPAN_NOTICE("You apply \the [src] to [M].")\
+ SPAN_NOTICE("[target_mob] has been applied with [src] by [user]."), \
+ SPAN_NOTICE("You apply \the [src] to [target_mob].")\
)
use(1)
- M.updatehealth()
+ target_mob.updatehealth()
/obj/item/stack/medical/use()
. = ..()
@@ -134,44 +134,44 @@ Contains:
amount = max_amount
update_icon()
-/obj/item/stack/medical/bruise_pack/attack(mob/living/carbon/M as mob, mob/user as mob)
+/obj/item/stack/medical/bruise_pack/attack(mob/living/target_mob, mob/living/user, target_zone)
if(..())
return 1
if (!can_use(1, user))
return 0
- if (istype(M, /mob/living/carbon/human))
- var/mob/living/carbon/human/H = M
+ if (istype(target_mob, /mob/living/carbon/human))
+ var/mob/living/carbon/human/H = target_mob
var/obj/item/organ/external/affecting = H.get_organ(user.zone_sel.selecting)
if(affecting.open == 0)
if(affecting.is_bandaged())
- to_chat(user, SPAN_WARNING("The wounds on [M]'s [affecting.name] have already been bandaged."))
+ to_chat(user, SPAN_WARNING("The wounds on [target_mob]'s [affecting.name] have already been bandaged."))
return 1
else
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
- user.visible_message(SPAN_NOTICE("\The [user] starts treating [M]'s [affecting.name]."), \
- SPAN_NOTICE("You start treating [M]'s [affecting.name]."))
+ user.visible_message(SPAN_NOTICE("\The [user] starts treating [target_mob]'s [affecting.name]."), \
+ SPAN_NOTICE("You start treating [target_mob]'s [affecting.name]."))
var/used = 0
for (var/datum/wound/W in affecting.wounds)
if(W.bandaged)
continue
if(used == amount)
break
- if(!do_mob(user, M, W.damage/5))
+ if(!do_mob(user, target_mob, W.damage/5))
to_chat(user, SPAN_NOTICE("You must stand still to bandage wounds."))
break
if (W.current_stage <= W.max_bleeding_stage)
- user.visible_message(SPAN_NOTICE("\The [user] bandages \a [W.desc] on [M]'s [affecting.name]."), \
- SPAN_NOTICE("You bandage \a [W.desc] on [M]'s [affecting.name]."))
+ user.visible_message(SPAN_NOTICE("\The [user] bandages \a [W.desc] on [target_mob]'s [affecting.name]."), \
+ SPAN_NOTICE("You bandage \a [W.desc] on [target_mob]'s [affecting.name]."))
//H.add_side_effect("Itch")
else if (W.damage_type == BRUISE)
- user.visible_message(SPAN_NOTICE("\The [user] places a bruise patch over \a [W.desc] on [M]'s [affecting.name]."), \
- SPAN_NOTICE("You place a bruise patch over \a [W.desc] on [M]'s [affecting.name]."))
+ user.visible_message(SPAN_NOTICE("\The [user] places a bruise patch over \a [W.desc] on [target_mob]'s [affecting.name]."), \
+ SPAN_NOTICE("You place a bruise patch over \a [W.desc] on [target_mob]'s [affecting.name]."))
else
- user.visible_message(SPAN_NOTICE("\The [user] places a bandaid over \a [W.desc] on [M]'s [affecting.name]."), \
- SPAN_NOTICE("You place a bandaid over \a [W.desc] on [M]'s [affecting.name]."))
+ user.visible_message(SPAN_NOTICE("\The [user] places a bandaid over \a [W.desc] on [target_mob]'s [affecting.name]."), \
+ SPAN_NOTICE("You place a bandaid over \a [W.desc] on [target_mob]'s [affecting.name]."))
W.bandage()
playsound(src, apply_sounds, 25)
used++
@@ -209,31 +209,31 @@ Contains:
amount = max_amount
update_icon()
-/obj/item/stack/medical/ointment/attack(mob/living/carbon/M as mob, mob/user as mob)
+/obj/item/stack/medical/ointment/attack(mob/living/target_mob, mob/living/user, target_zone)
if(..())
return 1
if (!can_use(1, user))
return 0
- if (istype(M, /mob/living/carbon/human))
- var/mob/living/carbon/human/H = M
+ if (istype(target_mob, /mob/living/carbon/human))
+ var/mob/living/carbon/human/H = target_mob
var/obj/item/organ/external/affecting = H.get_organ(user.zone_sel.selecting)
if(affecting.open == 0)
if(affecting.is_salved())
- to_chat(user, SPAN_WARNING("The wounds on [M]'s [affecting.name] have already been salved."))
+ to_chat(user, SPAN_WARNING("The wounds on [target_mob]'s [affecting.name] have already been salved."))
return 1
else
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
- user.visible_message(SPAN_NOTICE("\The [user] starts salving wounds on [M]'s [affecting.name]."), \
- SPAN_NOTICE("You start salving the wounds on [M]'s [affecting.name]."))
+ user.visible_message(SPAN_NOTICE("\The [user] starts salving wounds on [target_mob]'s [affecting.name]."), \
+ SPAN_NOTICE("You start salving the wounds on [target_mob]'s [affecting.name]."))
playsound(src, pick(apply_sounds), 25)
- if(!do_mob(user, M, 10))
+ if(!do_mob(user, target_mob, 10))
to_chat(user, SPAN_NOTICE("You must stand still to salve wounds."))
return 1
- user.visible_message(SPAN_NOTICE("[user] salved wounds on [M]'s [affecting.name]."), \
- SPAN_NOTICE("You salved wounds on [M]'s [affecting.name]."))
+ user.visible_message(SPAN_NOTICE("[user] salved wounds on [target_mob]'s [affecting.name]."), \
+ SPAN_NOTICE("You salved wounds on [target_mob]'s [affecting.name]."))
use(1)
affecting.salve()
else
@@ -260,44 +260,44 @@ Contains:
amount = max_amount
update_icon()
-/obj/item/stack/medical/advanced/bruise_pack/attack(mob/living/carbon/M as mob, mob/user as mob)
+/obj/item/stack/medical/advanced/bruise_pack/attack(mob/living/target_mob, mob/living/user, target_zone)
if(..())
return 1
if (!can_use(1, user))
return 0
- if (ishuman(M))
- var/mob/living/carbon/human/H = M
+ if (ishuman(target_mob))
+ var/mob/living/carbon/human/H = target_mob
var/obj/item/organ/external/affecting = H.get_organ(user.zone_sel.selecting)
if(affecting.open == 0)
if(affecting.is_bandaged() && affecting.is_disinfected())
- to_chat(user, SPAN_WARNING("The wounds on [M]'s [affecting.name] have already been treated."))
+ to_chat(user, SPAN_WARNING("The wounds on [target_mob]'s [affecting.name] have already been treated."))
return 1
else
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
- user.visible_message(SPAN_NOTICE("\The [user] starts treating [M]'s [affecting.name]."), \
- SPAN_NOTICE("You start treating [M]'s [affecting.name]."))
+ user.visible_message(SPAN_NOTICE("\The [user] starts treating [target_mob]'s [affecting.name]."), \
+ SPAN_NOTICE("You start treating [target_mob]'s [affecting.name]."))
var/used = 0
for (var/datum/wound/W in affecting.wounds)
if (W.bandaged && W.disinfected)
continue
if(used == amount)
break
- if(!do_mob(user, M, W.damage/5))
+ if(!do_mob(user, target_mob, W.damage/5))
to_chat(user, SPAN_NOTICE("You must stand still to bandage wounds."))
break
if (W.current_stage <= W.max_bleeding_stage)
- user.visible_message(SPAN_NOTICE("\The [user] cleans \a [W.desc] on [M]'s [affecting.name] and seals the edges with bioglue."), \
- SPAN_NOTICE("You clean and seal \a [W.desc] on [M]'s [affecting.name]."))
+ user.visible_message(SPAN_NOTICE("\The [user] cleans \a [W.desc] on [target_mob]'s [affecting.name] and seals the edges with bioglue."), \
+ SPAN_NOTICE("You clean and seal \a [W.desc] on [target_mob]'s [affecting.name]."))
//H.add_side_effect("Itch")
else if (W.damage_type == BRUISE)
- user.visible_message(SPAN_NOTICE("\The [user] places a medical patch over \a [W.desc] on [M]'s [affecting.name]."), \
- SPAN_NOTICE("You place a medical patch over \a [W.desc] on [M]'s [affecting.name]."))
+ user.visible_message(SPAN_NOTICE("\The [user] places a medical patch over \a [W.desc] on [target_mob]'s [affecting.name]."), \
+ SPAN_NOTICE("You place a medical patch over \a [W.desc] on [target_mob]'s [affecting.name]."))
else
- user.visible_message(SPAN_NOTICE("\The [user] smears some bioglue over \a [W.desc] on [M]'s [affecting.name]."), \
- SPAN_NOTICE("You smear some bioglue over \a [W.desc] on [M]'s [affecting.name]."))
+ user.visible_message(SPAN_NOTICE("\The [user] smears some bioglue over \a [W.desc] on [target_mob]'s [affecting.name]."), \
+ SPAN_NOTICE("You smear some bioglue over \a [W.desc] on [target_mob]'s [affecting.name]."))
playsound(src, pick(apply_sounds), 25)
W.bandage()
W.disinfect()
@@ -335,28 +335,28 @@ Contains:
amount = max_amount
update_icon()
-/obj/item/stack/medical/advanced/ointment/attack(mob/living/carbon/M as mob, mob/user as mob)
+/obj/item/stack/medical/advanced/ointment/attack(mob/living/target_mob, mob/living/user, target_zone)
if(..())
return 1
- if (istype(M, /mob/living/carbon/human))
- var/mob/living/carbon/human/H = M
+ if (istype(target_mob, /mob/living/carbon/human))
+ var/mob/living/carbon/human/H = target_mob
var/obj/item/organ/external/affecting = H.get_organ(user.zone_sel.selecting)
if(affecting.open == 0)
if(affecting.is_salved())
- to_chat(user, SPAN_WARNING("The wounds on [M]'s [affecting.name] have already been salved."))
+ to_chat(user, SPAN_WARNING("The wounds on [target_mob]'s [affecting.name] have already been salved."))
return 1
else
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
- user.visible_message(SPAN_NOTICE("\The [user] starts salving wounds on [M]'s [affecting.name]."), \
- SPAN_NOTICE("You start salving the wounds on [M]'s [affecting.name]."))
+ user.visible_message(SPAN_NOTICE("\The [user] starts salving wounds on [target_mob]'s [affecting.name]."), \
+ SPAN_NOTICE("You start salving the wounds on [target_mob]'s [affecting.name]."))
playsound(src, pick(apply_sounds), 25)
- if(!do_mob(user, M, 10))
+ if(!do_mob(user, target_mob, 10))
to_chat(user, SPAN_NOTICE("You must stand still to salve wounds."))
return 1
- user.visible_message(SPAN_NOTICE("[user] covers wounds on [M]'s [affecting.name] with regenerative membrane."), \
- SPAN_NOTICE("You cover wounds on [M]'s [affecting.name] with regenerative membrane."))
+ user.visible_message(SPAN_NOTICE("[user] covers wounds on [target_mob]'s [affecting.name] with regenerative membrane."), \
+ SPAN_NOTICE("You cover wounds on [target_mob]'s [affecting.name] with regenerative membrane."))
affecting.heal_damage(0,heal_burn)
use(1)
affecting.salve()
@@ -383,33 +383,33 @@ Contains:
amount = max_amount
update_icon()
-/obj/item/stack/medical/splint/attack(mob/living/carbon/M as mob, mob/user as mob)
+/obj/item/stack/medical/splint/attack(mob/living/target_mob, mob/living/user, target_zone)
if(..())
return 1
if (!can_use(1, user))
return 0
- if (istype(M, /mob/living/carbon/human))
- var/mob/living/carbon/human/H = M
+ if (istype(target_mob, /mob/living/carbon/human))
+ var/mob/living/carbon/human/H = target_mob
var/obj/item/organ/external/affecting = H.get_organ(user.zone_sel.selecting)
var/limb = affecting.name
if(!(affecting.limb_name in splintable_organs))
to_chat(user, SPAN_DANGER("You can't apply a splint there!"))
return
if(affecting.status & ORGAN_SPLINTED)
- to_chat(user, SPAN_DANGER("[M]'s [limb] is already splinted!"))
+ to_chat(user, SPAN_DANGER("[target_mob]'s [limb] is already splinted!"))
return
- if (M != user)
- user.visible_message(SPAN_DANGER("[user] starts to apply \the [src] to [M]'s [limb]."), SPAN_DANGER("You start to apply \the [src] to [M]'s [limb]."), SPAN_DANGER("You hear something being wrapped."))
+ if (target_mob != user)
+ user.visible_message(SPAN_DANGER("[user] starts to apply \the [src] to [target_mob]'s [limb]."), SPAN_DANGER("You start to apply \the [src] to [target_mob]'s [limb]."), SPAN_DANGER("You hear something being wrapped."))
else
if((!user.hand && affecting.limb_name == BP_R_ARM) || (user.hand && affecting.limb_name == BP_L_ARM))
to_chat(user, SPAN_DANGER("You can't apply a splint to the arm you're using!"))
return
user.visible_message(SPAN_DANGER("[user] starts to apply \the [src] to their [limb]."), SPAN_DANGER("You start to apply \the [src] to your [limb]."), SPAN_DANGER("You hear something being wrapped."))
- if(do_after(user, 5 SECONDS, M))
- if (M != user)
- user.visible_message(SPAN_DANGER("[user] finishes applying \the [src] to [M]'s [limb]."), SPAN_DANGER("You finish applying \the [src] to [M]'s [limb]."), SPAN_DANGER("You hear something being wrapped."))
+ if(do_after(user, 5 SECONDS, target_mob))
+ if (target_mob != user)
+ user.visible_message(SPAN_DANGER("[user] finishes applying \the [src] to [target_mob]'s [limb]."), SPAN_DANGER("You finish applying \the [src] to [target_mob]'s [limb]."), SPAN_DANGER("You hear something being wrapped."))
else
if(prob(25))
user.visible_message(SPAN_DANGER("[user] successfully applies \the [src] to their [limb]."), SPAN_DANGER("You successfully apply \the [src] to your [limb]."), SPAN_DANGER("You hear something being wrapped."))
diff --git a/code/game/objects/items/stacks/nanopaste.dm b/code/game/objects/items/stacks/nanopaste.dm
index 4c11d0aefc0..78f11baa352 100644
--- a/code/game/objects/items/stacks/nanopaste.dm
+++ b/code/game/objects/items/stacks/nanopaste.dm
@@ -24,17 +24,17 @@
icon_state = "[initial(icon_state)]-empty"
check_maptext(SMALL_FONTS(7, amount))
-/obj/item/stack/nanopaste/attack(atom/M, mob/user, var/target_zone)
- if(!ismob(M) || !istype(user))
+/obj/item/stack/nanopaste/attack(mob/living/target_mob, mob/living/user, target_zone)
+ if(!ismob(target_mob) || !istype(user))
return 0
if (!can_use(1, user))
return 0
- if (isrobot(M)) //Repairing cyborgs
- var/mob/living/silicon/robot/R = M
+ if (isrobot(target_mob)) //Repairing cyborgs
+ var/mob/living/silicon/robot/R = target_mob
if (R.getBruteLoss() || R.getFireLoss() )
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
- if(do_mob(user, M, 7))
+ if(do_mob(user, target_mob, 7))
R.adjustBruteLoss(-15)
R.adjustFireLoss(-15)
R.updatehealth()
@@ -44,8 +44,8 @@
else
to_chat(user, SPAN_NOTICE("All [R]'s systems are nominal."))
- else if(ishuman(M)) //Repairing robolimbs
- var/mob/living/carbon/human/H = M
+ else if(ishuman(target_mob)) //Repairing robolimbs
+ var/mob/living/carbon/human/H = target_mob
var/obj/item/organ/external/S = H.get_organ(target_zone)
if (S && (S.status & ORGAN_ASSISTED))
@@ -61,12 +61,12 @@
to_chat(user, SPAN_WARNING("You can't apply [src] through [H.wear_suit]!"))
return
- if(do_mob(user, M, 7))
+ if(do_mob(user, target_mob, 7))
S.heal_damage(15, 15, robo_repair = 1)
H.updatehealth()
use(1)
- user.visible_message(SPAN_NOTICE("\The [user] applies some nanite paste at[user != M ? " \the [M]'s" : " \the [user]"] [S.name] with \the [src]."),\
- SPAN_NOTICE("You apply some nanite paste at [user == M ? "your" : "[M]'s"] [S.name]."))
+ user.visible_message(SPAN_NOTICE("\The [user] applies some nanite paste at[user != target_mob ? " \the [target_mob]'s" : " \the [user]"] [S.name] with \the [src]."),\
+ SPAN_NOTICE("You apply some nanite paste at [user == target_mob ? "your" : "[target_mob]'s"] [S.name]."))
else
to_chat(user, SPAN_NOTICE("Nothing to fix here."))
else
@@ -87,7 +87,8 @@
var/used = FALSE
construction_cost = null
-/obj/item/stack/nanopaste/surge/attack(mob/living/carbon/human/M as mob, mob/user as mob, var/target_zone)
+/obj/item/stack/nanopaste/surge/attack(mob/living/target_mob, mob/living/user, target_zone)
+ var/mob/living/carbon/human/M = target_mob
if (!istype(M) || !istype(user))
return 0
diff --git a/code/game/objects/items/stacks/wrap.dm b/code/game/objects/items/stacks/wrap.dm
index 01f9d2abaac..98f4d417534 100644
--- a/code/game/objects/items/stacks/wrap.dm
+++ b/code/game/objects/items/stacks/wrap.dm
@@ -66,11 +66,11 @@
if(distance <= 1)
. += "There [amount == 1 ? "is" : "are"] about [amount] [singular_name]\s of paper left!"
-/obj/item/stack/wrapping_paper/attack(mob/target, mob/user)
- if(!ishuman(target))
+/obj/item/stack/wrapping_paper/attack(mob/living/target_mob, mob/living/user, target_zone)
+ if(!ishuman(target_mob))
return
- var/mob/living/carbon/human/H = target
+ var/mob/living/carbon/human/H = target_mob
if(istype(H.wear_suit, /obj/item/clothing/suit/straight_jacket) || H.stat)
if(src.amount >= 2)
var/obj/effect/spresent/present = new /obj/effect/spresent (H.loc)
diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm
index f5b4a762a0e..c52a4cab177 100644
--- a/code/game/objects/items/toys.dm
+++ b/code/game/objects/items/toys.dm
@@ -51,7 +51,7 @@
reagents = R
R.my_atom = src
-/obj/item/toy/waterballoon/attack(mob/living/carbon/human/M as mob, mob/user as mob)
+/obj/item/toy/waterballoon/attack(mob/living/target_mob, mob/living/user, target_zone)
return
/obj/item/toy/waterballoon/afterattack(atom/A as mob|obj, mob/user as mob, proximity)
@@ -486,17 +486,17 @@
return
-/obj/item/toy/crossbow/attack(mob/M, mob/user)
+/obj/item/toy/crossbow/attack(mob/living/target_mob, mob/living/user, target_zone)
src.add_fingerprint(user)
- if (src.dart_count > 0 && M.lying) // Check
- for(var/mob/O in viewers(M, null))
+ if (src.dart_count > 0 && target_mob.lying) // Check
+ for(var/mob/O in viewers(target_mob, null))
if(O.client)
- O.show_message(SPAN_NOTICE("\The [user] casually lines up a shot with [M]'s head and pulls the trigger."), 1)
- O.show_message(SPAN_WARNING("\The [M] was hit in the head by the foam dart!"), 1)
+ O.show_message(SPAN_NOTICE("\The [user] casually lines up a shot with [target_mob]'s head and pulls the trigger."), 1)
+ O.show_message(SPAN_WARNING("\The [target_mob] was hit in the head by the foam dart!"), 1)
playsound(src, 'sound/items/syringeproj.ogg', 50, TRUE)
- new /obj/item/toy/ammo/crossbow(M.loc)
+ new /obj/item/toy/ammo/crossbow(target_mob.loc)
src.dart_count--
return
diff --git a/code/game/objects/items/trash.dm b/code/game/objects/items/trash.dm
index 18d2346cf58..a8e6c153cfd 100644
--- a/code/game/objects/items/trash.dm
+++ b/code/game/objects/items/trash.dm
@@ -11,7 +11,7 @@
drop_sound = 'sound/items/drop/wrapper.ogg'
pickup_sound = 'sound/items/pickup/wrapper.ogg'
-/obj/item/trash/attack(mob/M as mob, mob/living/user as mob)
+/obj/item/trash/attack(mob/living/target_mob, mob/living/user, target_zone)
return
/obj/item/trash/koisbar
diff --git a/code/game/objects/items/weapons/RFD.dm b/code/game/objects/items/weapons/RFD.dm
index 3464d69afdf..87ef208beb4 100644
--- a/code/game/objects/items/weapons/RFD.dm
+++ b/code/game/objects/items/weapons/RFD.dm
@@ -62,7 +62,7 @@ ABSTRACT_TYPE(/obj/item/rfd)
. = ..()
update_icon()
-/obj/item/rfd/attack()
+/obj/item/rfd/attack(mob/living/target_mob, mob/living/user, target_zone)
return FALSE
/obj/item/rfd/proc/can_use(var/mob/user,var/turf/T)
diff --git a/code/game/objects/items/weapons/autopsy.dm b/code/game/objects/items/weapons/autopsy.dm
index 37a579fbf13..cae7b1fcd49 100644
--- a/code/game/objects/items/weapons/autopsy.dm
+++ b/code/game/objects/items/weapons/autopsy.dm
@@ -151,7 +151,8 @@
usr.put_in_hands(P)
-/obj/item/autopsy_scanner/attack(mob/living/carbon/human/M as mob, mob/living/carbon/user as mob)
+/obj/item/autopsy_scanner/attack(mob/living/target_mob, mob/living/user, target_zone)
+ var/mob/living/carbon/human/M = target_mob
if(!istype(M))
return
diff --git a/code/game/objects/items/weapons/cards_ids.dm b/code/game/objects/items/weapons/cards_ids.dm
index b99351148a7..83625aa7900 100644
--- a/code/game/objects/items/weapons/cards_ids.dm
+++ b/code/game/objects/items/weapons/cards_ids.dm
@@ -234,22 +234,22 @@ var/const/NO_EMAG_ACT = -50
blind_message += " [blind_add_text]"
user.visible_message(message, blind_message)
-/obj/item/card/id/attack(var/mob/living/M, var/mob/user, proximity)
+/obj/item/card/id/attack(mob/living/target_mob, mob/living/user, target_zone)
if(user.zone_sel.selecting == BP_R_HAND || user.zone_sel.selecting == BP_L_HAND)
- if(!ishuman(M))
+ if(!ishuman(target_mob))
return ..()
if (dna_hash == ID_CARD_UNSET && ishuman(user))
- var/response = alert(user, "This ID card has not been imprinted with biometric data. Would you like to imprint [M]'s now?", "Biometric Imprinting", "Yes", "No")
+ var/response = alert(user, "This ID card has not been imprinted with biometric data. Would you like to imprint [target_mob]'s now?", "Biometric Imprinting", "Yes", "No")
if (response == "Yes")
- if (!user.Adjacent(M) || user.restrained() || user.lying || user.stat)
- to_chat(user, SPAN_WARNING("You must remain adjacent to [M] to scan their biometric data."))
+ if (!user.Adjacent(target_mob) || user.restrained() || user.lying || user.stat)
+ to_chat(user, SPAN_WARNING("You must remain adjacent to [target_mob] to scan their biometric data."))
return
- var/mob/living/carbon/human/H = M
+ var/mob/living/carbon/human/H = target_mob
if(H.gloves)
to_chat(user, SPAN_WARNING("\The [H] is wearing gloves."))
diff --git a/code/game/objects/items/weapons/chaplain_items.dm b/code/game/objects/items/weapons/chaplain_items.dm
index 5a7c8e3c672..1ab12e328bb 100644
--- a/code/game/objects/items/weapons/chaplain_items.dm
+++ b/code/game/objects/items/weapons/chaplain_items.dm
@@ -254,10 +254,10 @@
qdel(src)
user.put_in_hands(chosenitem)
-/obj/item/nullrod/attack(mob/M as mob, mob/living/user as mob)
+/obj/item/nullrod/attack(mob/living/target_mob, mob/living/user, target_zone)
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
- user.do_attack_animation(M)
+ user.do_attack_animation(target_mob)
if(LAZYLEN(user.spell_list))
user.silence_spells(300) //30 seconds
@@ -275,8 +275,8 @@
user.Paralyse(20)
return
- if(M.stat != DEAD && ishuman(M) && user.a_intent != I_HURT)
- var/mob/living/K = M
+ if(target_mob.stat != DEAD && ishuman(target_mob) && user.a_intent != I_HURT)
+ var/mob/living/K = target_mob
var/datum/vampire/vampire = K.mind.antag_datums[MODE_VAMPIRE]
if(vampire)
if(vampire.status & VAMP_ISTHRALL)
@@ -288,12 +288,12 @@
K.visible_message(SPAN_WARNING("The gaze in [K]'s eyes remains determined."), SPAN_NOTICE("You turn away from the light, remaining true to your vampiric master!"))
K.say("*scream")
K.take_overall_damage(5, 15)
- admin_attack_log(user, M, "attempted to deconvert", "was unsuccessfully deconverted by", "attempted to deconvert")
+ admin_attack_log(user, target_mob, "attempted to deconvert", "was unsuccessfully deconverted by", "attempted to deconvert")
if("Give in")
K.visible_message(SPAN_NOTICE("[K]'s eyes become clearer, the evil gone, but not without leaving scars."))
K.take_overall_damage(10, 20)
thralls.remove_antagonist(K.mind)
- admin_attack_log(user, M, "successfully deconverted", "was successfully deconverted by", "successfully deconverted")
+ admin_attack_log(user, target_mob, "successfully deconverted", "was successfully deconverted by", "successfully deconverted")
else if (vampire.status & VAMP_FRENZIED)
K.visible_message(SPAN_DANGER("[user] thrusts \the [src] towards [K], who recoils in horror as they erupt into flames!"), SPAN_DANGER("[user] thrusts \the [src] towards you, its holy light scorching your corrupted flesh!"))
K.adjust_fire_stacks(10)
@@ -307,19 +307,19 @@
K.visible_message(SPAN_WARNING("The gaze in [K]'s eyes remains determined."), SPAN_NOTICE("You turn away from the light, remaining true to the Geometer!"))
K.say("*scream")
K.take_overall_damage(5, 15)
- admin_attack_log(user, M, "attempted to deconvert", "was unsuccessfully deconverted by", "attempted to deconvert")
+ admin_attack_log(user, target_mob, "attempted to deconvert", "was unsuccessfully deconverted by", "attempted to deconvert")
if("Give in")
K.visible_message(SPAN_NOTICE("[K]'s eyes become clearer, the evil gone, but not without leaving scars."))
K.take_overall_damage(10, 20)
cult.remove_antagonist(K.mind)
- admin_attack_log(user, M, "successfully deconverted", "was successfully deconverted by", "successfully deconverted")
+ admin_attack_log(user, target_mob, "successfully deconverted", "was successfully deconverted by", "successfully deconverted")
else
user.visible_message(SPAN_WARNING("[user]'s concentration is broken!"), SPAN_WARNING("Your concentration is broken! You and your target need to stay uninterrupted for longer!"))
return
else
to_chat(user, SPAN_DANGER("The [src] appears to do nothing."))
- M.visible_message(SPAN_DANGER("\The [user] waves \the [src] over \the [M]'s head."))
+ target_mob.visible_message(SPAN_DANGER("\The [user] waves \the [src] over \the [target_mob]'s head."))
return
else if(user.a_intent != I_HURT) // to prevent the chaplain from hurting peoples accidentally
to_chat(user, SPAN_NOTICE("The [src] appears to do nothing."))
diff --git a/code/game/objects/items/weapons/cigs_lighters.dm b/code/game/objects/items/weapons/cigs_lighters.dm
index d579c7d5810..a8040b3c2e3 100644
--- a/code/game/objects/items/weapons/cigs_lighters.dm
+++ b/code/game/objects/items/weapons/cigs_lighters.dm
@@ -333,7 +333,9 @@ ABSTRACT_TYPE(/obj/item/clothing/mask/smokable)
if(lit)
die(TRUE)
-/obj/item/clothing/mask/smokable/cigarette/attack(mob/living/carbon/human/H, mob/user, def_zone)
+/obj/item/clothing/mask/smokable/cigarette/attack(mob/living/target_mob, mob/living/user, target_zone)
+ var/mob/living/carbon/human/H = target_mob
+
if(lit && H == user && istype(H))
var/obj/item/blocked = H.check_mouth_coverage()
if(blocked)
@@ -972,8 +974,10 @@ ABSTRACT_TYPE(/obj/item/clothing/mask/smokable)
/obj/item/flame/lighter/vendor_action(var/obj/machinery/vending/V)
handle_lighting()
-/obj/item/flame/lighter/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
- if(!istype(M, /mob))
+/obj/item/flame/lighter/attack(mob/living/target_mob, mob/living/user, target_zone)
+ var/mob/living/carbon/M = target_mob
+
+ if(!istype(M))
return
if(lit && M.IgniteMob())
diff --git a/code/game/objects/items/weapons/cosmetics.dm b/code/game/objects/items/weapons/cosmetics.dm
index cd11791489e..5e451d032e8 100644
--- a/code/game/objects/items/weapons/cosmetics.dm
+++ b/code/game/objects/items/weapons/cosmetics.dm
@@ -111,13 +111,15 @@
open = !open
update_icon()
-/obj/item/lipstick/attack(mob/M as mob, mob/user as mob)
- if(!open) return
+/obj/item/lipstick/attack(mob/living/target_mob, mob/living/user, target_zone)
+ if(!open)
+ return
- if(!istype(M, /mob)) return
+ if(!istype(target_mob))
+ return
- if(ishuman(M))
- var/mob/living/carbon/human/H = M
+ if(ishuman(target_mob))
+ var/mob/living/carbon/human/H = target_mob
if(H.lipstick_color) //if they already have lipstick on
to_chat(user, SPAN_NOTICE("You need to wipe off the old lipstick first!"))
return
@@ -173,11 +175,11 @@
playsound(H, 'sound/items/welder_pry.ogg', 20, 1)
-/obj/item/razor/attack(mob/M, mob/user, var/target_zone)
- if(!ishuman(M))
+/obj/item/razor/attack(mob/living/target_mob, mob/living/user, target_zone)
+ if(!ishuman(target_mob))
return ..()
- var/mob/living/carbon/human/H = M
+ var/mob/living/carbon/human/H = target_mob
var/obj/item/organ/external/E = H.get_organ(target_zone)
if(!E || E.is_stump())
diff --git a/code/game/objects/items/weapons/dna_injector.dm b/code/game/objects/items/weapons/dna_injector.dm
index 214e8428254..f66444daf73 100644
--- a/code/game/objects/items/weapons/dna_injector.dm
+++ b/code/game/objects/items/weapons/dna_injector.dm
@@ -97,15 +97,16 @@
qdel(src)
return uses
-/obj/item/dnainjector/attack(mob/M as mob, mob/user as mob)
- if (!istype(M, /mob))
+/obj/item/dnainjector/attack(mob/living/target_mob, mob/living/user, target_zone)
+ if (!istype(target_mob))
return
+
if (!usr.IsAdvancedToolUser())
return
if(inuse)
return 0
- user.visible_message(SPAN_DANGER("\The [user] is trying to inject \the [M] with \the [src]!"))
+ user.visible_message(SPAN_DANGER("\The [user] is trying to inject \the [target_mob] with \the [src]!"))
inuse = 1
s_time = world.time
spawn(50)
@@ -115,11 +116,11 @@
return
user.setClickCooldown(DEFAULT_QUICK_COOLDOWN)
- user.do_attack_animation(M)
+ user.do_attack_animation(target_mob)
- M.visible_message(SPAN_DANGER("\The [M] has been injected with \the [src] by \the [user]."))
+ target_mob.visible_message(SPAN_DANGER("\The [target_mob] has been injected with \the [src] by \the [user]."))
- var/mob/living/carbon/human/H = M
+ var/mob/living/carbon/human/H = target_mob
if(!istype(H))
to_chat(user, SPAN_WARNING("Apparently it didn't work..."))
return
@@ -132,13 +133,13 @@
if((buf.types & DNA2_BUF_SE) && (block ? (GetState() && block == MONKEYBLOCK) : GetState(MONKEYBLOCK)))
injected_with_monkey = SPAN_DANGER(" (MONKEY)")
- M.attack_log += "\[[time_stamp()]\] Has been injected with [name] by [user.name] ([user.ckey])"
- user.attack_log += "\[[time_stamp()]\] Used the [name] to inject [M.name] ([M.ckey])"
- log_attack("[user.name] ([user.ckey]) used the [name] to inject [M.name] ([M.ckey])")
- message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with \the [src][injected_with_monkey]")
+ target_mob.attack_log += "\[[time_stamp()]\] Has been injected with [name] by [user.name] ([user.ckey])"
+ user.attack_log += "\[[time_stamp()]\] Used the [name] to inject [target_mob.name] ([target_mob.ckey])"
+ log_attack("[user.name] ([user.ckey]) used the [name] to inject [target_mob.name] ([target_mob.ckey])")
+ message_admins("[key_name_admin(user)] injected [key_name_admin(target_mob)] with \the [src][injected_with_monkey]")
// Apply the DNA shit.
- inject(M, user)
+ inject(target_mob, user)
return
/obj/item/dnainjector/hulkmut
diff --git a/code/game/objects/items/weapons/ecigs.dm b/code/game/objects/items/weapons/ecigs.dm
index b1e29ff8370..8865dedce00 100644
--- a/code/game/objects/items/weapons/ecigs.dm
+++ b/code/game/objects/items/weapons/ecigs.dm
@@ -173,7 +173,9 @@
else
to_chat(user, SPAN_WARNING("\The [src] needs to be in one of your hands."))
-/obj/item/clothing/mask/smokable/ecig/attack(mob/living/carbon/human/C, mob/user, def_zone)
+/obj/item/clothing/mask/smokable/ecig/attack(mob/living/target_mob, mob/living/user, target_zone)
+ var/mob/living/carbon/human/C = target_mob
+
if(active && C == user && istype(C))
var/obj/item/blocked = C.check_mouth_coverage()
if(blocked)
diff --git a/code/game/objects/items/weapons/explosives.dm b/code/game/objects/items/weapons/explosives.dm
index edaa57e9f57..192d38d0ed7 100644
--- a/code/game/objects/items/weapons/explosives.dm
+++ b/code/game/objects/items/weapons/explosives.dm
@@ -90,7 +90,7 @@
qdel(src)
-/obj/item/plastique/attack(mob/M as mob, mob/user as mob, def_zone)
+/obj/item/plastique/attack(mob/living/target_mob, mob/living/user, target_zone)
return
/obj/item/plastique/cyborg
diff --git a/code/game/objects/items/weapons/extinguisher.dm b/code/game/objects/items/weapons/extinguisher.dm
index feaaecf90a8..2dcd91e19e2 100644
--- a/code/game/objects/items/weapons/extinguisher.dm
+++ b/code/game/objects/items/weapons/extinguisher.dm
@@ -137,8 +137,8 @@
. += SPAN_NOTICE("The safety is [safety ? "on" : "off"].")
return
-/obj/item/extinguisher/attack(mob/living/M, mob/living/user, target_zone)
- if(ismob(M) && user.a_intent != I_HURT)
+/obj/item/extinguisher/attack(mob/living/target_mob, mob/living/user, target_zone)
+ if(ismob(target_mob) && user.a_intent != I_HURT)
return FALSE
return ..()
diff --git a/code/game/objects/items/weapons/handcuffs.dm b/code/game/objects/items/weapons/handcuffs.dm
index ab957793934..8c46a1edcb4 100644
--- a/code/game/objects/items/weapons/handcuffs.dm
+++ b/code/game/objects/items/weapons/handcuffs.dm
@@ -25,7 +25,11 @@
drop_sound = 'sound/items/drop/accessory.ogg'
pickup_sound = 'sound/items/pickup/accessory.ogg'
-/obj/item/handcuffs/attack(var/mob/living/carbon/C, var/mob/living/user)
+/obj/item/handcuffs/attack(mob/living/target_mob, mob/living/user, target_zone)
+ var/mob/living/carbon/C = target_mob
+ if(!istype(C))
+ return
+
if(!user.IsAdvancedToolUser())
return
diff --git a/code/game/objects/items/weapons/implants/implanter.dm b/code/game/objects/items/weapons/implants/implanter.dm
index 0d4edee4f07..889b45e335e 100644
--- a/code/game/objects/items/weapons/implants/implanter.dm
+++ b/code/game/objects/items/weapons/implants/implanter.dm
@@ -32,7 +32,8 @@
else
..()
-/obj/item/implanter/attack(mob/living/carbon/human/M, mob/user, var/target_zone)
+/obj/item/implanter/attack(mob/living/target_mob, mob/living/user, target_zone)
+ var/mob/living/carbon/human/M = target_mob
if(!istype(M))
return
@@ -81,15 +82,15 @@
icon_state = "cimplanter0"
return
-/obj/item/implanter/ipc_tag/attack(mob/M, mob/user)
- if(!ishuman(M))
+/obj/item/implanter/ipc_tag/attack(mob/living/target_mob, mob/living/user, target_zone)
+ if(!ishuman(target_mob))
return
if(!ipc_tag)
to_chat(user, SPAN_WARNING("\The [src] doesn't have an IPC tag loaded!"))
return
- var/mob/living/carbon/human/H = M
+ var/mob/living/carbon/human/H = target_mob
if(!H.species || !isipc(H) || !H.organs_by_name[BP_HEAD])
to_chat(user, SPAN_WARNING("You cannot use \the [src] on a non-IPC!"))
return
@@ -98,16 +99,16 @@
to_chat(user, SPAN_WARNING("\The [H] is already tagged!"))
return
- user.visible_message(SPAN_WARNING("\The [user] tags \the [M] with \the [src]!"), SPAN_NOTICE("You tag \the [M] with \the [src]."), range = 3)
+ user.visible_message(SPAN_WARNING("\The [user] tags \the [target_mob] with \the [src]!"), SPAN_NOTICE("You tag \the [target_mob] with \the [src]."), range = 3)
- M.attack_log += "\[[time_stamp()]\] Implanted with [name] ([ipc_tag.name]) by [user.name] ([user.ckey])"
- user.attack_log += "\[[time_stamp()]\] Used the [name] ([ipc_tag.name]) to implant [M.name] ([M.ckey])"
- msg_admin_attack("[key_name_admin(user)] implanted [key_name_admin(M)] with [name] (INTENT: [uppertext(user.a_intent)]) (JMP)",ckey=key_name(user),ckey_target=key_name(M))
+ target_mob.attack_log += "\[[time_stamp()]\] Implanted with [name] ([ipc_tag.name]) by [user.name] ([user.ckey])"
+ user.attack_log += "\[[time_stamp()]\] Used the [name] ([ipc_tag.name]) to implant [target_mob.name] ([target_mob.ckey])"
+ msg_admin_attack("[key_name_admin(user)] implanted [key_name_admin(target_mob)] with [name] (INTENT: [uppertext(user.a_intent)]) (JMP)",ckey=key_name(user),ckey_target=key_name(target_mob))
ipc_tag.replaced(H, H.organs_by_name[BP_HEAD])
- ipc_tag.forceMove(M)
+ ipc_tag.forceMove(target_mob)
if(ipc_tag.auto_generate)
- ipc_tag.serial_number = uppertext(dd_limittext(md5(M.real_name), 12))
+ ipc_tag.serial_number = uppertext(dd_limittext(md5(target_mob.real_name), 12))
ipc_tag = null
update_icon()
diff --git a/code/game/objects/items/weapons/ipc_scanner.dm b/code/game/objects/items/weapons/ipc_scanner.dm
index caedd5bcf68..f1c86faa6be 100644
--- a/code/game/objects/items/weapons/ipc_scanner.dm
+++ b/code/game/objects/items/weapons/ipc_scanner.dm
@@ -29,17 +29,17 @@
QDEL_NULL(wires)
return ..()
-/obj/item/ipc_tag_scanner/attack(mob/living/M, mob/living/user)
+/obj/item/ipc_tag_scanner/attack(mob/living/target_mob, mob/living/user, target_zone)
add_fingerprint(user)
if(!powered)
to_chat(user, SPAN_WARNING("\The [src] reads, \"Scanning failure, please submit scanner for repairs.\""))
return
- user.visible_message(SPAN_NOTICE("\The [user] starts analyzing \the [M] with \the [src]..."), SPAN_NOTICE("You start analyzing \the [M] with \the [src]..."))
+ user.visible_message(SPAN_NOTICE("\The [user] starts analyzing \the [target_mob] with \the [src]..."), SPAN_NOTICE("You start analyzing \the [target_mob] with \the [src]..."))
if(do_after(user, 5 SECONDS, src, DO_UNIQUE))
- if(!isipc(M))
- to_chat(user, SPAN_WARNING("You analyze \the [M], but find that they're not an IPC at all!"))
+ if(!isipc(target_mob))
+ to_chat(user, SPAN_WARNING("You analyze \the [target_mob], but find that they're not an IPC at all!"))
return
- var/mob/living/carbon/human/IPC = M
+ var/mob/living/carbon/human/IPC = target_mob
var/obj/item/organ/internal/ipc_tag/tag = IPC.internal_organs_by_name[BP_IPCTAG]
if(isnull(tag) || !tag)
to_chat(user, SPAN_WARNING("Error: Serial Identification Missing."))
diff --git a/code/game/objects/items/weapons/material/kitchen.dm b/code/game/objects/items/weapons/material/kitchen.dm
index 8618026da0a..0596541f0ee 100644
--- a/code/game/objects/items/weapons/material/kitchen.dm
+++ b/code/game/objects/items/weapons/material/kitchen.dm
@@ -31,7 +31,9 @@
src.pixel_y = rand(0, 4)
create_reagents(5)
-/obj/item/material/kitchen/utensil/attack(mob/living/carbon/M, mob/user, var/target_zone)
+/obj/item/material/kitchen/utensil/attack(mob/living/target_mob, mob/living/user, target_zone)
+ var/mob/living/carbon/M = target_mob
+
if(!istype(M))
return ..()
@@ -154,7 +156,7 @@
applies_material_colour = 0
unbreakable = 1
-/obj/item/material/kitchen/utensil/knife/attack(mob/target, mob/living/user, var/target_zone)
+/obj/item/material/kitchen/utensil/knife/attack(mob/living/target_mob, mob/living/user, target_zone)
if ((user.is_clumsy()) && prob(50))
to_chat(user, SPAN_WARNING("You accidentally cut yourself with \the [src]."))
user.take_organ_damage(20)
@@ -182,7 +184,7 @@
use_material_name = TRUE
applies_material_colour = TRUE
-/obj/item/material/kitchen/rollingpin/attack(mob/living/M, mob/living/user, var/target_zone)
+/obj/item/material/kitchen/rollingpin/attack(mob/living/target_mob, mob/living/user, target_zone)
if ((user.is_clumsy()) && prob(50))
to_chat(user, SPAN_WARNING("\The [src] slips out of your hand and hits your head."))
user.drop_from_inventory(src)
diff --git a/code/game/objects/items/weapons/material/knives.dm b/code/game/objects/items/weapons/material/knives.dm
index 2deae652d73..d7138951f61 100644
--- a/code/game/objects/items/weapons/material/knives.dm
+++ b/code/game/objects/items/weapons/material/knives.dm
@@ -25,13 +25,13 @@
. = ..()
src.add_blood()
-/obj/item/material/knife/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob, var/target_zone)
+/obj/item/material/knife/attack(mob/living/target_mob, mob/living/user, target_zone)
if(active == 1)
- if((target_zone != BP_EYES && target_zone != BP_HEAD) || M.eyes_protected(src, FALSE))
+ if((target_zone != BP_EYES && target_zone != BP_HEAD) || target_mob.eyes_protected(src, FALSE))
return ..()
if((user.is_clumsy()) && prob(50))
- M = user
- return eyestab(M,user)
+ target_mob = user
+ return eyestab(target_mob,user)
/obj/item/material/knife/verb/extract_embedded(var/mob/living/carbon/human/H as mob in view(1))
set name = "Extract Embedded Item"
diff --git a/code/game/objects/items/weapons/material/twohanded.dm b/code/game/objects/items/weapons/material/twohanded.dm
index daa46381aaf..bdfd42d2828 100644
--- a/code/game/objects/items/weapons/material/twohanded.dm
+++ b/code/game/objects/items/weapons/material/twohanded.dm
@@ -302,7 +302,7 @@
icon_state = "spearglass[wielded]"
item_state = "spearglass[wielded]"
-/obj/item/material/twohanded/spear/attack(mob/living/target, mob/living/user, var/target_zone)
+/obj/item/material/twohanded/spear/attack(mob/living/target_mob, mob/living/user, target_zone)
..()
if(wielded && explosive)
@@ -481,7 +481,7 @@
if(powered)
. += SPAN_NOTICE("It is currently powered on.")
-/obj/item/material/twohanded/chainsaw/attack(mob/M as mob, mob/living/user as mob)
+/obj/item/material/twohanded/chainsaw/attack(mob/living/target_mob, mob/living/user, target_zone)
. = ..()
if(powered)
playsound(loc, 'sound/weapons/saw/chainsword.ogg', 25, 0, 30)
diff --git a/code/game/objects/items/weapons/melee/energy.dm b/code/game/objects/items/weapons/melee/energy.dm
index 98c40d8e224..8d06c7cb5f4 100644
--- a/code/game/objects/items/weapons/melee/energy.dm
+++ b/code/game/objects/items/weapons/melee/energy.dm
@@ -163,7 +163,7 @@
icon_state = initial(icon_state)
to_chat(user, SPAN_NOTICE("\The [src] is de-energised."))
-/obj/item/melee/energy/glaive/attack(mob/living/carbon/human/M as mob, mob/living/carbon/user as mob)
+/obj/item/melee/energy/glaive/attack(mob/living/target_mob, mob/living/user, target_zone)
user.setClickCooldown(16)
..()
diff --git a/code/game/objects/items/weapons/melee/misc.dm b/code/game/objects/items/weapons/melee/misc.dm
index b665322570b..a6e1dd99782 100644
--- a/code/game/objects/items/weapons/melee/misc.dm
+++ b/code/game/objects/items/weapons/melee/misc.dm
@@ -109,26 +109,26 @@
icon_state = "hammeroff"
item_state = "hammeroff"
-/obj/item/melee/hammer/powered/attack(var/mob/target, var/mob/living/user, var/target_zone)
+/obj/item/melee/hammer/powered/attack(mob/living/target_mob, mob/living/user, target_zone)
..()
if(prob(trigger_chance))
if(!on)
to_chat(user, SPAN_WARNING("\The [src] buzzes!"))
return
playsound(user, 'sound/weapons/beartrap_shut.ogg', 50, 1, -1)
- user.visible_message(SPAN_DANGER("\The [user] slams \the [target] away with \the [src]!"))
+ user.visible_message(SPAN_DANGER("\The [user] slams \the [target_mob] away with \the [src]!"))
var/T = get_turf(user)
spark(T, 3, GLOB.alldirs)
- step_away(target,user,15)
+ step_away(target_mob,user,15)
sleep(1)
- step_away(target,user,15)
+ step_away(target_mob,user,15)
sleep(1)
- step_away(target,user,15)
+ step_away(target_mob,user,15)
sleep(1)
- step_away(target,user,15)
+ step_away(target_mob,user,15)
sleep(1)
- if(ishuman(target))
- var/mob/living/carbon/human/H = target
+ if(ishuman(target_mob))
+ var/mob/living/carbon/human/H = target_mob
H.apply_effect(2, WEAKEN)
on = FALSE
update_icon()
@@ -163,17 +163,17 @@
attack_verb = list("flogged", "whipped", "lashed", "disciplined")
hitsound = 'sound/weapons/whip.ogg'
-/obj/item/melee/whip/attack(mob/target as mob, mob/living/user as mob, var/target_zone)
+/obj/item/melee/whip/attack(mob/living/target_mob, mob/living/user, target_zone)
..()
- if(ishuman(target))
+ if(ishuman(target_mob))
if(prob(25))
if(target_zone == BP_L_HAND || target_zone == BP_L_ARM)
- if (target.l_hand && target.l_hand != src)
- target.drop_l_hand()
+ if (target_mob.l_hand && target_mob.l_hand != src)
+ target_mob.drop_l_hand()
else if(target_zone == BP_R_HAND || target_zone == BP_R_ARM)
- if (target.r_hand && target.r_hand != src)
- target.drop_r_hand()
- user.visible_message(SPAN_DANGER("\The [user] disarms \the [target] with \the [src]!"))
+ if (target_mob.r_hand && target_mob.r_hand != src)
+ target_mob.drop_r_hand()
+ user.visible_message(SPAN_DANGER("\The [user] disarms \the [target_mob] with \the [src]!"))
return
/obj/item/melee/ceremonial_sword
diff --git a/code/game/objects/items/weapons/paiwire.dm b/code/game/objects/items/weapons/paiwire.dm
index ffdd818de0e..5f72a03d0b0 100644
--- a/code/game/objects/items/weapons/paiwire.dm
+++ b/code/game/objects/items/weapons/paiwire.dm
@@ -5,6 +5,3 @@
src.machine = M
else
user.visible_message("[user] dumbly fumbles to find a place on [M] to plug in [src].", "There aren't any ports on [M] that match the jack belonging to [src].")
-
-/obj/item/pai_cable/attack(obj/machinery/M as obj, mob/user as mob)
- src.plugin(M, user)
diff --git a/code/game/objects/items/weapons/soap.dm b/code/game/objects/items/weapons/soap.dm
index 4993bc6d515..021687130bb 100644
--- a/code/game/objects/items/weapons/soap.dm
+++ b/code/game/objects/items/weapons/soap.dm
@@ -98,9 +98,9 @@
return
//attack_as_weapon
-/obj/item/soap/attack(mob/living/target, mob/living/user, var/target_zone)
- if(target && user && ishuman(target) && ishuman(user) && !target.stat && !user.stat && user.zone_sel &&user.zone_sel.selecting == BP_MOUTH )
- user.visible_message(SPAN_DANGER("\The [user] washes \the [target]'s mouth out with soap!"))
+/obj/item/soap/attack(mob/living/target_mob, mob/living/user, target_zone)
+ if(target_mob && user && ishuman(target_mob) && ishuman(user) && !target_mob.stat && !user.stat && user.zone_sel &&user.zone_sel.selecting == BP_MOUTH )
+ user.visible_message(SPAN_DANGER("\The [user] washes \the [target_mob]'s mouth out with soap!"))
user.setClickCooldown(DEFAULT_QUICK_COOLDOWN) //prevent spam
return
..()
diff --git a/code/game/objects/items/weapons/storage/fancy.dm b/code/game/objects/items/weapons/storage/fancy.dm
index ce9122240c0..53233afe922 100644
--- a/code/game/objects/items/weapons/storage/fancy.dm
+++ b/code/game/objects/items/weapons/storage/fancy.dm
@@ -326,39 +326,39 @@
reagents.trans_to_obj(C, (reagents.total_volume/contents.len))
return ..()
-/obj/item/storage/box/fancy/cigarettes/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob, target_zone)
- if(!ismob(M))
+/obj/item/storage/box/fancy/cigarettes/attack(mob/living/target_mob, mob/living/user, target_zone)
+ if(!ismob(target_mob))
return
if(!opened)
to_chat(user, SPAN_WARNING("\The [src] is closed."))
return
if(target_zone == BP_MOUTH && contents.len > 0)
- if(M.wear_mask)
- to_chat(user, SPAN_WARNING("\The [M.wear_mask] is in the way."))
+ if(target_mob.wear_mask)
+ to_chat(user, SPAN_WARNING("\The [target_mob.wear_mask] is in the way."))
return
var/obj/item/clothing/mask/smokable/cigarette/cig = locate() in src
if(!istype(cig))
to_chat(user, SPAN_WARNING("There isn't a cigarette in \the [src]!"))
return
- if(M != user)
- if(!use_check(M))
- to_chat(user, SPAN_WARNING("[M.name] is in no condition to handle items!"))
+ if(target_mob != user)
+ if(!use_check(target_mob))
+ to_chat(user, SPAN_WARNING("[target_mob.name] is in no condition to handle items!"))
return
- user.visible_message(SPAN_NOTICE("\The [user] holds up the open [src.name] to \the [M]'s mouth."), SPAN_NOTICE("You hold up the open [src.name] to \the [M]'s mouth, waiting for them to accept."))
- var/response = alert(M, "\The [user] offers you \a [cig.name]. Do you accept?", "Smokable Offer", "Accept", "Decline")
+ user.visible_message(SPAN_NOTICE("\The [user] holds up the open [src.name] to \the [target_mob]'s mouth."), SPAN_NOTICE("You hold up the open [src.name] to \the [target_mob]'s mouth, waiting for them to accept."))
+ var/response = alert(target_mob, "\The [user] offers you \a [cig.name]. Do you accept?", "Smokable Offer", "Accept", "Decline")
if(response != "Accept")
- M.visible_message(SPAN_NOTICE("[M] pushes [user]'s [src.name] away."))
+ target_mob.visible_message(SPAN_NOTICE("[target_mob] pushes [user]'s [src.name] away."))
return
- if(!M.Adjacent(user))
+ if(!target_mob.Adjacent(user))
to_chat(user, SPAN_WARNING("You need to stay in reaching distance while giving an object."))
- to_chat(M, SPAN_WARNING("\The [user] moved too far away."))
+ to_chat(target_mob, SPAN_WARNING("\The [user] moved too far away."))
return
- remove_from_storage(cig, get_turf(M))
- M.equip_to_slot_if_possible(cig, slot_wear_mask)
- M.visible_message(SPAN_NOTICE("[M] casually pulls out a [icon_type] from \the [src] with [M.get_pronoun("his")] mouth."), SPAN_NOTICE("You casually pull out a [icon_type] from \the [src] with your mouth."), range = 3)
+ remove_from_storage(cig, get_turf(target_mob))
+ target_mob.equip_to_slot_if_possible(cig, slot_wear_mask)
+ target_mob.visible_message(SPAN_NOTICE("[target_mob] casually pulls out a [icon_type] from \the [src] with [target_mob.get_pronoun("his")] mouth."), SPAN_NOTICE("You casually pull out a [icon_type] from \the [src] with your mouth."), range = 3)
update_icon()
return
- if(M == user && target_zone == BP_R_HAND || target_zone == BP_L_HAND) // Cig packing. Because obsessive smokers do it.
+ if(target_mob == user && target_zone == BP_R_HAND || target_zone == BP_L_HAND) // Cig packing. Because obsessive smokers do it.
user.visible_message(SPAN_NOTICE("[user] taps \the [src] against [user.get_pronoun("his")] palm."), SPAN_NOTICE("You tap \the [src] against your palm."))
else
..()
@@ -475,7 +475,7 @@
else
AddOverlays("ledb")
-/obj/item/storage/lockbox/vials/attackby(attacking_item, mob/user)
+/obj/item/storage/lockbox/vials/attackby(obj/item/attacking_item, mob/user, params)
..()
update_icon()
diff --git a/code/game/objects/items/weapons/storage/lockbox.dm b/code/game/objects/items/weapons/storage/lockbox.dm
index bc14b5fff6c..e2858551933 100644
--- a/code/game/objects/items/weapons/storage/lockbox.dm
+++ b/code/game/objects/items/weapons/storage/lockbox.dm
@@ -18,7 +18,7 @@
var/icon_broken = "lockbox+b"
-/obj/item/storage/lockbox/attackby(attacking_item, mob/user)
+/obj/item/storage/lockbox/attackby(obj/item/attacking_item, mob/user, params)
if(istype(attacking_item, /obj/item/card/id))
if(src.broken)
to_chat(user, SPAN_WARNING("It appears to be broken."))
diff --git a/code/game/objects/items/weapons/storage/toolbox.dm b/code/game/objects/items/weapons/storage/toolbox.dm
index ed243ce5c02..cfadb6c2322 100644
--- a/code/game/objects/items/weapons/storage/toolbox.dm
+++ b/code/game/objects/items/weapons/storage/toolbox.dm
@@ -131,14 +131,14 @@
update_force()
-/obj/item/storage/toolbox/attack(mob/living/M as mob, mob/user as mob, var/target_zone)
+/obj/item/storage/toolbox/attack(mob/living/target_mob, mob/living/user, target_zone)
update_force()
if (..())
if (contents.len)
- spill(3, get_turf(M))
- playsound(M, /singleton/sound_category/tray_hit_sound, 100, 1) //sound playin' again
+ spill(3, get_turf(target_mob))
+ playsound(target_mob, /singleton/sound_category/tray_hit_sound, 100, 1) //sound playin' again
update_force()
- user.visible_message(SPAN_DANGER("[user] smashes the [src] into [M], causing it to break open and strew its contents across the area"))
+ user.visible_message(SPAN_DANGER("[user] smashes the [src] into [target_mob], causing it to break open and strew its contents across the area"))
/obj/item/storage/toolbox/lunchbox
name = "rainbow lunchbox"
diff --git a/code/game/objects/items/weapons/stunbaton.dm b/code/game/objects/items/weapons/stunbaton.dm
index f73c056f20e..5a246f97797 100644
--- a/code/game/objects/items/weapons/stunbaton.dm
+++ b/code/game/objects/items/weapons/stunbaton.dm
@@ -107,8 +107,9 @@
to_chat(user, SPAN_WARNING("[src] is out of charge."))
add_fingerprint(user)
-/obj/item/melee/baton/attack(mob/living/L, mob/user, var/hit_zone)
- if(!L) return
+/obj/item/melee/baton/attack(mob/living/target_mob, mob/living/user, target_zone)
+ if(!target_mob)
+ return
if(status && (user.is_clumsy()) && prob(50))
to_chat(user, SPAN_DANGER("You accidentally hit yourself with the [src]!"))
@@ -116,7 +117,7 @@
deductcharge(hitcost)
return
- if(isrobot(L))
+ if(isrobot(target_mob))
..()
return
@@ -124,18 +125,18 @@
var/stun = stunforce
if(user.is_pacified())
- to_chat(user, SPAN_NOTICE("You don't want to risk hurting [L]!"))
+ to_chat(user, SPAN_NOTICE("You don't want to risk hurting [target_mob]!"))
return 0
- var/target_zone = check_zone(hit_zone)
+ target_zone = check_zone(target_zone)
if(user.a_intent == I_HURT)
if (!..()) //item/attack() does it's own messaging and logs
return 0 // item/attack() will return 1 if they hit, 0 if they missed.
stun *= 0.5
if(status) //Checks to see if the stunbaton is on.
agony *= 0.5 //whacking someone causes a much poorer contact than prodding them.
- if(iscarbon(L))
- var/mob/living/carbon/C = L
+ if(iscarbon(target_mob))
+ var/mob/living/carbon/C = target_mob
if(sheathed) //however breaking the skin results in a more potent electric shock or some bullshit. im a coder, not a doctor
C.electrocute_act(force * 2, src, def_zone = target_zone)
else
@@ -145,38 +146,38 @@
//we can't really extract the actual hit zone from ..(), unfortunately. Just act like they attacked the area they intended to.
else
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
- user.do_attack_animation(L)
+ user.do_attack_animation(target_mob)
//copied from human_defense.dm - human defence code should really be refactored some time.
- if (ishuman(L))
- user.lastattacked = L //are these used at all, if we have logs?
- L.lastattacker = user
+ if (ishuman(target_mob))
+ user.lastattacked = target_mob //are these used at all, if we have logs?
+ target_mob.lastattacker = user
- if (user != L) // Attacking yourself can't miss
- target_zone = get_zone_with_miss_chance(user.zone_sel.selecting, L)
+ if (user != target_mob) // Attacking yourself can't miss
+ target_zone = get_zone_with_miss_chance(user.zone_sel.selecting, target_mob)
if(!target_zone)
- L.visible_message(SPAN_WARNING("[user] misses [L] with \the [src]!"))
+ target_mob.visible_message(SPAN_WARNING("[user] misses [target_mob] with \the [src]!"))
return 0
- var/mob/living/carbon/human/H = L
+ var/mob/living/carbon/human/H = target_mob
var/obj/item/organ/external/affecting = H.get_organ(target_zone)
if (affecting)
if(!status)
- L.visible_message(SPAN_WARNING("[L] has been prodded in the [affecting.name] with \the [src] by [user]. Luckily it was off."))
+ target_mob.visible_message(SPAN_WARNING("[target_mob] has been prodded in the [affecting.name] with \the [src] by [user]. Luckily it was off."))
return 1
else
- H.visible_message(SPAN_DANGER("[L] has been prodded in the [affecting.name] with \the [src] by [user]!"))
+ H.visible_message(SPAN_DANGER("[target_mob] has been prodded in the [affecting.name] with \the [src] by [user]!"))
var/intent = "(INTENT: [user? uppertext(user.a_intent) : "N/A"])"
- admin_attack_log(user, L, "was stunned by this mob with [src] [intent]", "stunned this mob with [src] [intent]", "stunned with [src]")
+ admin_attack_log(user, target_mob, "was stunned by this mob with [src] [intent]", "stunned this mob with [src] [intent]", "stunned with [src]")
if(!sheathed)
H.electrocute_act(force * 2, src, ground_zero = target_zone)
- if(isslime(L))
- var/mob/living/carbon/slime/S = L
+ if(isslime(target_mob))
+ var/mob/living/carbon/slime/S = target_mob
if(!status)
- L.visible_message(SPAN_WARNING("[S] has been prodded with \the [src] by [user]. Too bad it was off."))
+ target_mob.visible_message(SPAN_WARNING("[S] has been prodded with \the [src] by [user]. Too bad it was off."))
return TRUE
else
- L.visible_message(SPAN_DANGER("[S] has been prodded with \the [src] by [user]!"))
+ target_mob.visible_message(SPAN_DANGER("[S] has been prodded with \the [src] by [user]!"))
S.discipline++
if(prob(1))
@@ -185,13 +186,13 @@
else
if(!status)
- L.visible_message(SPAN_WARNING("[L] has been prodded with \the [src] by [user]. Luckily it was off."))
+ target_mob.visible_message(SPAN_WARNING("[target_mob] has been prodded with \the [src] by [user]. Luckily it was off."))
return TRUE
else
- L.visible_message(SPAN_DANGER("[L] has been prodded with \the [src] by [user]!"))
+ target_mob.visible_message(SPAN_DANGER("[target_mob] has been prodded with \the [src] by [user]!"))
//stun effects
- L.stun_effect_act(stun, agony, target_zone, src)
+ target_mob.stun_effect_act(stun, agony, target_zone, src)
playsound(loc, 'sound/weapons/Egloves.ogg', 50, 1, -1)
diff --git a/code/game/objects/items/weapons/surgery_tools.dm b/code/game/objects/items/weapons/surgery_tools.dm
index 4af219b209d..89d218c1b3e 100644
--- a/code/game/objects/items/weapons/surgery_tools.dm
+++ b/code/game/objects/items/weapons/surgery_tools.dm
@@ -287,11 +287,11 @@
return
-/obj/item/storage/box/fancy/tray/attack(mob/living/M as mob, mob/user as mob, var/target_zone)
+/obj/item/storage/box/fancy/tray/attack(mob/living/target_mob, mob/living/user, target_zone)
if(..() && contents.len)
- spill(3, get_turf(M))
- playsound(M, /singleton/sound_category/tray_hit_sound, 50, 1) //sound playin' again
- user.visible_message(SPAN_DANGER("[user] smashes \the [src] into [M], causing it to spill its contents across the area!"))
+ spill(3, get_turf(target_mob))
+ playsound(target_mob, /singleton/sound_category/tray_hit_sound, 50, 1) //sound playin' again
+ user.visible_message(SPAN_DANGER("[user] smashes \the [src] into [target_mob], causing it to spill its contents across the area!"))
/obj/item/storage/box/fancy/tray/throw_impact(atom/hit_atom)
..()
diff --git a/code/game/objects/items/weapons/swords_axes_etc.dm b/code/game/objects/items/weapons/swords_axes_etc.dm
index cb8332bcbff..34abdc005ca 100644
--- a/code/game/objects/items/weapons/swords_axes_etc.dm
+++ b/code/game/objects/items/weapons/swords_axes_etc.dm
@@ -20,7 +20,7 @@
drop_sound = 'sound/items/drop/crowbar.ogg'
pickup_sound = 'sound/items/pickup/crowbar.ogg'
-/obj/item/melee/classic_baton/attack(mob/M as mob, mob/living/user as mob, var/target_zone)
+/obj/item/melee/classic_baton/attack(mob/living/target_mob, mob/living/user, target_zone)
if ((user.is_clumsy()) && prob(50))
to_chat(user, SPAN_WARNING("You club yourself over the head."))
user.Weaken(3 * force)
@@ -88,9 +88,9 @@
return
-/obj/item/melee/telebaton/attack(mob/target, mob/living/user, var/target_zone)
+/obj/item/melee/telebaton/attack(mob/living/target_mob, mob/living/user, target_zone)
if(on)
- do_special_effects(target)
+ do_special_effects(target_mob)
if(user.is_clumsy() && prob(50))
to_chat(user, SPAN_WARNING("You club yourself over the head."))
user.Weaken(3 * force)
@@ -101,8 +101,8 @@
user.take_organ_damage(2 * force)
return
if(..() && user.a_intent == I_DISARM)
- if(ishuman(target))
- var/mob/living/carbon/human/T = target
+ if(ishuman(target_mob))
+ var/mob/living/carbon/human/T = target_mob
T.apply_damage(40, DAMAGE_PAIN, target_zone)
return
return ..()
diff --git a/code/game/objects/items/weapons/syndie.dm b/code/game/objects/items/weapons/syndie.dm
index d6c5d2fe70c..d4716feb13a 100644
--- a/code/game/objects/items/weapons/syndie.dm
+++ b/code/game/objects/items/weapons/syndie.dm
@@ -128,7 +128,7 @@
/obj/item/syndie/teleporter/set_initial_maptext()
held_maptext = SMALL_FONTS(7, "Ready")
-/obj/item/syndie/teleporter/attack()
+/obj/item/syndie/teleporter/attack(mob/living/target_mob, mob/living/user, target_zone)
return
/obj/item/syndie/teleporter/afterattack(atom/target, mob/user, proximity_flag, click_parameters)
diff --git a/code/game/objects/items/weapons/tape.dm b/code/game/objects/items/weapons/tape.dm
index 95621387af1..1f0fcd7560e 100644
--- a/code/game/objects/items/weapons/tape.dm
+++ b/code/game/objects/items/weapons/tape.dm
@@ -8,7 +8,8 @@
pickup_sound = 'sound/items/pickup/cardboardbox.ogg'
surgerysound = /singleton/sound_category/rip_sound
-/obj/item/tape_roll/attack(var/mob/living/carbon/human/H, var/mob/user, var/target_zone)
+/obj/item/tape_roll/attack(mob/living/target_mob, mob/living/user, target_zone)
+ var/mob/living/carbon/human/H = target_mob
if(istype(H))
if(target_zone == BP_EYES)
diff --git a/code/game/objects/items/weapons/tools.dm b/code/game/objects/items/weapons/tools.dm
index 0a98bfed6f2..1bc0a6f0825 100644
--- a/code/game/objects/items/weapons/tools.dm
+++ b/code/game/objects/items/weapons/tools.dm
@@ -103,7 +103,9 @@
..()
update_icon()
-/obj/item/screwdriver/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob, var/target_zone)
+/obj/item/screwdriver/attack(mob/living/target_mob, mob/living/user, target_zone)
+ var/mob/living/carbon/M = target_mob
+
if(!istype(M) || user.a_intent == "help")
return ..()
if((target_zone != BP_EYES && target_zone != BP_HEAD) || M.eyes_protected(src, FALSE))
@@ -181,7 +183,11 @@
..()
update_icon()
-/obj/item/wirecutters/attack(mob/living/carbon/C, mob/user, var/target_zone)
+/obj/item/wirecutters/attack(mob/living/target_mob, mob/living/user, target_zone)
+ var/mob/living/carbon/C = target_mob
+ if(!istype(C))
+ return
+
if(user.a_intent == I_HELP && (C.handcuffed) && (istype(C.handcuffed, /obj/item/handcuffs/cable)))
user.visible_message(SPAN_NOTICE("\The [user] cuts \the [C]'s restraints with \the [src]!"),\
SPAN_NOTICE("You cut \the [C]'s restraints with \the [src]!"),\
@@ -390,9 +396,9 @@
if (istype(location, /turf))
location.hotspot_expose(700, 5)
-/obj/item/weldingtool/attack(mob/living/M, mob/user, var/target_zone)
- if(ishuman(M))
- var/mob/living/carbon/human/H = M
+/obj/item/weldingtool/attack(mob/living/target_mob, mob/living/user, target_zone)
+ if(ishuman(target_mob))
+ var/mob/living/carbon/human/H = target_mob
var/obj/item/organ/external/S = H.organs_by_name[target_zone]
if(!S)
diff --git a/code/game/objects/items/weapons/towel.dm b/code/game/objects/items/weapons/towel.dm
index 5d66bc0e658..723519025cf 100644
--- a/code/game/objects/items/weapons/towel.dm
+++ b/code/game/objects/items/weapons/towel.dm
@@ -14,10 +14,12 @@
drop_sound = 'sound/items/drop/cloth.ogg'
pickup_sound = 'sound/items/pickup/cloth.ogg'
-/obj/item/towel/attack_self(mob/living/user as mob)
- attack(user,user)
+/obj/item/towel/attack_self(mob/living/user)
+ attack(user, user)
+
+/obj/item/towel/attack(mob/living/target_mob, mob/living/user, target_zone)
+ var/mob/living/carbon/human/M = target_mob
-/obj/item/towel/attack(mob/living/carbon/human/M as mob, mob/living/carbon/user as mob)
if(istype(M) && user.a_intent == I_HELP)
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
if(user.on_fire)
diff --git a/code/game/objects/items/weapons/traps.dm b/code/game/objects/items/weapons/traps.dm
index ce79bd92699..291d2fc7a9e 100644
--- a/code/game/objects/items/weapons/traps.dm
+++ b/code/game/objects/items/weapons/traps.dm
@@ -726,15 +726,15 @@
if(captured)
release(user, user.loc)
-/obj/item/trap/animal/attack(var/target, mob/living/user)
+/obj/item/trap/animal/attack(mob/living/target_mob, mob/living/user, target_zone)
if(!deployed)
return
if(captured) // It is full
return
- if(isliving(target))
- var/mob/living/capturing_mob = target
+ if(isliving(target_mob))
+ var/mob/living/capturing_mob = target_mob
if(capturing_mob.mob_size > max_mob_size)
to_chat(user, SPAN_WARNING("\The [capturing_mob] doesn't fit in \the [src]!"))
return
diff --git a/code/game/objects/items/weapons/vaurca_items.dm b/code/game/objects/items/weapons/vaurca_items.dm
index dd0296703b6..95e555300cd 100644
--- a/code/game/objects/items/weapons/vaurca_items.dm
+++ b/code/game/objects/items/weapons/vaurca_items.dm
@@ -400,7 +400,7 @@
base_block_chance = 60
shield_power = 150
-/obj/item/melee/energy/vaurca_zweihander/attack(mob/living/carbon/human/M as mob, mob/living/carbon/user as mob)
+/obj/item/melee/energy/vaurca_zweihander/attack(mob/living/target_mob, mob/living/user, target_zone)
user.setClickCooldown(16)
..()
diff --git a/code/game/objects/items/weapons/weaponry.dm b/code/game/objects/items/weapons/weaponry.dm
index 3abaa590fee..f99d61646f9 100644
--- a/code/game/objects/items/weapons/weaponry.dm
+++ b/code/game/objects/items/weapons/weaponry.dm
@@ -145,7 +145,7 @@
throw_range = 15
attack_verb = list("banned")
-/obj/item/banhammer/attack(mob/M as mob, mob/user as mob)
- to_chat(M, SPAN_WARNING(" You have been banned FOR NO REISIN by [user]"))
- to_chat(user, SPAN_WARNING(" You have BANNED [M]"))
+/obj/item/banhammer/attack(mob/living/target_mob, mob/living/user, target_zone)
+ to_chat(target_mob, SPAN_WARNING(" You have been banned FOR NO REISIN by [user]"))
+ to_chat(user, SPAN_WARNING(" You have BANNED [target_mob]"))
playsound(loc, 'sound/effects/adminhelp.ogg', 15)
diff --git a/code/game/objects/structures/ECD.dm b/code/game/objects/structures/ECD.dm
index ef8289b31c3..9b0164234a1 100644
--- a/code/game/objects/structures/ECD.dm
+++ b/code/game/objects/structures/ECD.dm
@@ -25,19 +25,19 @@
if(user.isSynthetic())
to_chat(user, SPAN_NOTICE("\The [src] does not seem to be doing anything, but you can feel it. A signal, beyond anything you can consciously understand, weaving and scratching a shield around the back of your mind."))
-/obj/structure/ecd/attackby(obj/item/W, mob/user)
- if(W.iswrench())
+/obj/structure/ecd/attackby(obj/item/attacking_item, mob/user, params)
+ if(attacking_item.iswrench())
switch(state)
if(ECD_LOOSE)
state = ECD_BOLTED
- W.play_tool_sound(get_turf(src), 75)
+ attacking_item.play_tool_sound(get_turf(src), 75)
user.visible_message(SPAN_NOTICE("\The [user] secures \the [src] to the floor."), \
SPAN_NOTICE("You secure \the [src]'s external reinforcing bolts to the floor."), \
SPAN_WARNING("You hear a ratcheting noise."))
anchored = TRUE
if(ECD_BOLTED)
state = ECD_LOOSE
- W.play_tool_sound(get_turf(src), 75)
+ attacking_item.play_tool_sound(get_turf(src), 75)
user.visible_message(SPAN_NOTICE("\The [user] unsecures \the [src]'s reinforcing bolts from the floor."), \
SPAN_NOTICE("You undo \the [src]'s external reinforcing bolts."), \
SPAN_WARNING("You hear a ratcheting noise."))
@@ -46,8 +46,8 @@
to_chat(user, SPAN_WARNING("\The [src] needs to be unwelded from the floor."))
return
- if(W.iswelder())
- var/obj/item/weldingtool/WT = W
+ if(attacking_item.iswelder())
+ var/obj/item/weldingtool/WT = attacking_item
switch(state)
if(ECD_LOOSE)
to_chat(user, SPAN_WARNING("\The [src] needs to be wrenched to the floor."))
@@ -57,7 +57,7 @@
user.visible_message(SPAN_NOTICE("\The [user] starts to weld \the [src] to the floor."), \
SPAN_NOTICE("You start to weld \the [src] to the floor."), \
SPAN_WARNING("You hear the sound of metal being welded."))
- if(W.use_tool(src, user, 20, volume = 50))
+ if(attacking_item.use_tool(src, user, 20, volume = 50))
if(!src || !WT.isOn())
return
state = ECD_WELDED
@@ -70,14 +70,13 @@
user.visible_message(SPAN_NOTICE("\The [user] starts to cut \the [src] free from the floor."), \
SPAN_NOTICE("You start to cut \the [src] free from the floor."), \
SPAN_WARNING("You hear the sound of metal being welded."))
- if(W.use_tool(src, user, 20, volume = 50))
+ if(attacking_item.use_tool(src, user, 20, volume = 50))
if(!src || !WT.isOn())
return
state = ECD_BOLTED
to_chat(user, SPAN_NOTICE("You cut \the [src] free from the floor."))
else
to_chat(user, SPAN_WARNING("You need more welding fuel to complete this task."))
- return
#undef ECD_LOOSE
#undef ECD_BOLTED
diff --git a/code/game/objects/structures/survey_probe.dm b/code/game/objects/structures/survey_probe.dm
index 8a29e05e8e2..655aa3f5b8c 100644
--- a/code/game/objects/structures/survey_probe.dm
+++ b/code/game/objects/structures/survey_probe.dm
@@ -33,21 +33,21 @@
if(start_deployed)
deploy()
-/obj/structure/survey_probe/attackby(obj/item/item, mob/living/user)
- if(!timer_id && item.iswrench())
+/obj/structure/survey_probe/attackby(obj/item/attacking_item, mob/user, params)
+ if(!timer_id && attacking_item.iswrench())
if(!anchored)
user.visible_message(
SPAN_NOTICE("\The [user] unfastens the locking bolts on \the [src], deploying it."),
SPAN_NOTICE("You unfasten the locking bolts on \the [src], and it deploys, lowering its devices and drill bits to the ground. It is ready to survey."),
)
- item.play_tool_sound(user, 30)
+ attacking_item.play_tool_sound(user, 30)
deploy()
else
user.visible_message(
SPAN_NOTICE("\The [user] fastens the locking bolts on \the [src], stowing it."),
SPAN_NOTICE("You fasten the locking bolts \the [src], stowing it. It retracts its devices and drill bits."),
)
- item.play_tool_sound(user, 30)
+ attacking_item.play_tool_sound(user, 30)
undeploy()
/obj/structure/survey_probe/attack_hand(mob/user as mob)
diff --git a/code/modules/clothing/shoes/miscellaneous.dm b/code/modules/clothing/shoes/miscellaneous.dm
index d21a2ca5a85..b30d568ee21 100644
--- a/code/modules/clothing/shoes/miscellaneous.dm
+++ b/code/modules/clothing/shoes/miscellaneous.dm
@@ -44,7 +44,9 @@
force = 2
sharp = TRUE
-/obj/item/clothing/shoes/heels/attack(mob/living/carbon/M, mob/living/carbon/user, var/target_zone)
+/obj/item/clothing/shoes/heels/attack(mob/living/target_mob, mob/living/user, target_zone)
+ var/mob/living/carbon/M = target_mob
+
if(!istype(M) || user.a_intent == "help")
return ..()
if((target_zone != BP_EYES && target_zone != BP_HEAD) || M.eyes_protected(src, FALSE))
diff --git a/code/modules/clothing/under/accessories/accessory.dm b/code/modules/clothing/under/accessories/accessory.dm
index 14176932ff1..89a7ede2ad6 100644
--- a/code/modules/clothing/under/accessories/accessory.dm
+++ b/code/modules/clothing/under/accessories/accessory.dm
@@ -266,7 +266,9 @@
flippable = 1
var/auto_examine = FALSE
-/obj/item/clothing/accessory/stethoscope/attack(mob/living/carbon/human/M, mob/user)
+/obj/item/clothing/accessory/stethoscope/attack(mob/living/target_mob, mob/living/user, target_zone)
+ var/mob/living/carbon/human/M = target_mob
+
if(ishuman(M) && isliving(user))
if(user.a_intent == I_HELP)
var/obj/item/organ/organ = M.get_organ(user.zone_sel.selecting)
diff --git a/code/modules/clothing/under/accessories/badges.dm b/code/modules/clothing/under/accessories/badges.dm
index 63f387b97db..e135077b528 100644
--- a/code/modules/clothing/under/accessories/badges.dm
+++ b/code/modules/clothing/under/accessories/badges.dm
@@ -79,10 +79,10 @@
user.visible_message(SPAN_NOTICE("[user] displays their [src.name]."),
SPAN_NOTICE("You display your [src.name]."))
-/obj/item/clothing/accessory/badge/attack(mob/living/carbon/human/M, mob/living/user)
+/obj/item/clothing/accessory/badge/attack(mob/living/target_mob, mob/living/user, target_zone)
if(isliving(user))
- user.visible_message(SPAN_DANGER("[user] invades [M]'s personal space, thrusting [src] into their face insistently."),
- SPAN_DANGER("You invade [M]'s personal space, thrusting [src] into their face insistently."))
+ user.visible_message(SPAN_DANGER("[user] invades [target_mob]'s personal space, thrusting [src] into their face insistently."),
+ SPAN_DANGER("You invade [target_mob]'s personal space, thrusting [src] into their face insistently."))
/obj/item/clothing/accessory/badge/verb/flip_side()
set category = "Object"
diff --git a/code/modules/clothing/under/accessories/xeno/tajara.dm b/code/modules/clothing/under/accessories/xeno/tajara.dm
index 639ead66e04..0c29b164f46 100644
--- a/code/modules/clothing/under/accessories/xeno/tajara.dm
+++ b/code/modules/clothing/under/accessories/xeno/tajara.dm
@@ -349,14 +349,14 @@
/obj/item/clothing/accessory/tajaran/charm/get_mask_examine_text(mob/user)
return "around [user.get_pronoun("his")] neck"
-/obj/item/clothing/accessory/tajaran/charm/attack(mob/M as mob, mob/living/user as mob, target_zone = BP_CHEST)
- if(user.a_intent != I_HURT && M != user)
- if(target_zone == BP_HEAD | M.lying)
- user.visible_message("\The [user] holds \the [src] above \the [M]")
+/obj/item/clothing/accessory/tajaran/charm/attack(mob/living/target_mob, mob/living/user, target_zone)
+ if(user.a_intent != I_HURT && target_mob != user)
+ if(target_zone == BP_HEAD | target_mob.lying)
+ user.visible_message("\The [user] holds \the [src] above \the [target_mob]")
else if(target_zone == BP_CHEST)
- user.visible_message("\The [user] holds \the [src] out in front of \the [M]")
+ user.visible_message("\The [user] holds \the [src] out in front of \the [target_mob]")
else
- user.visible_message("\The [user] holds \the [src] up near \the [M]")
+ user.visible_message("\The [user] holds \the [src] up near \the [target_mob]")
else
return ..()
diff --git a/code/modules/cooking/plates.dm b/code/modules/cooking/plates.dm
index 0fd732f9b49..083ff573b3a 100644
--- a/code/modules/cooking/plates.dm
+++ b/code/modules/cooking/plates.dm
@@ -60,11 +60,11 @@ Plates that can hold your cooking stuff
update_icon()
return ..()
-/obj/item/reagent_containers/bowl/attack(mob/living/M, mob/living/user, target_zone)
+/obj/item/reagent_containers/bowl/attack(mob/living/target_mob, mob/living/user, target_zone)
if(isipc(user))
to_chat(user, SPAN_NOTICE("You don't have a mouth, so you can't lick \the [src] clean."))
return
- if(grease && !reagents.total_volume && (M == user))
+ if(grease && !reagents.total_volume && (target_mob == user))
user.visible_message(
SPAN_NOTICE("[user] starts to lick \the [src] clean."),
SPAN_NOTICE("You start to lick \the [src] clean.")
@@ -157,11 +157,11 @@ Plates that can hold your cooking stuff
to_chat(user, SPAN_NOTICE("You take \the [F.name] from \the [name]."))
return
-/obj/item/reagent_containers/bowl/plate/attack(mob/living/M, mob/living/user, target_zone)
+/obj/item/reagent_containers/bowl/plate/attack(mob/living/target_mob, mob/living/user, target_zone)
if(istype(holding, /obj/item/reagent_containers/food/snacks))
var/obj/item/reagent_containers/food/snacks/S = holding
- S.standard_feed_mob(user, M)
- else if(grease && !holding && (M == user))
+ S.standard_feed_mob(user, target_mob)
+ else if(grease && !holding && (target_mob == user))
user.visible_message(SPAN_NOTICE("[user] starts to lick \the [src] clean."), SPAN_NOTICE("You start to lick \the [src] clean."))
if(do_after(user, 5))
grease = FALSE
diff --git a/code/modules/customitems/item_defines.dm b/code/modules/customitems/item_defines.dm
index 7572273b4aa..fab6fd39906 100644
--- a/code/modules/customitems/item_defines.dm
+++ b/code/modules/customitems/item_defines.dm
@@ -27,8 +27,8 @@ All custom items with worn sprites must follow the contained sprite system: http
return
-/obj/item/implanter/fluff/attack(mob/M as mob, mob/user as mob, var/target_zone)
- if (!M.ckey || M.ckey != allowed_ckey)
+/obj/item/implanter/fluff/attack(mob/living/target_mob, mob/living/user, target_zone)
+ if (!target_mob.ckey || target_mob.ckey != allowed_ckey)
return
..()
@@ -415,11 +415,11 @@ All custom items with worn sprites must follow the contained sprite system: http
has_spear = FALSE
update_icon()
-/obj/item/fluff/tokash_spear/attackby(var/obj/item/W, var/mob/user)
- if(!has_spear && istype(W, /obj/item/fluff/tokash_spearhead))
- to_chat(user, SPAN_NOTICE("You place \the [W] on the [src]."))
- user.drop_from_inventory(W,src)
- qdel(W)
+/obj/item/fluff/tokash_spear/attackby(obj/item/attacking_item, mob/user, params)
+ if(!has_spear && istype(attacking_item, /obj/item/fluff/tokash_spearhead))
+ to_chat(user, SPAN_NOTICE("You place \the [attacking_item] on the [src]."))
+ user.drop_from_inventory(attacking_item,src)
+ qdel(attacking_item)
has_spear = TRUE
update_icon()
else
@@ -821,13 +821,13 @@ All custom items with worn sprites must follow the contained sprite system: http
var/obj/item/device/megaphone/fluff/akinyi_mic/mic
var/collapsed = TRUE
-/obj/item/fluff/akinyi_stand/attackby(obj/item/O, mob/user)
- if(istype(O, /obj/item/device/megaphone/fluff/akinyi_mic))
+/obj/item/fluff/akinyi_stand/attackby(obj/item/attacking_item, mob/user, params)
+ if(istype(attacking_item, /obj/item/device/megaphone/fluff/akinyi_mic))
if(!mic && !collapsed)
- user.unEquip(O)
- O.forceMove(src)
- mic = O
- to_chat(user, SPAN_NOTICE("You place \the [O] on \the [src]."))
+ user.unEquip(attacking_item)
+ attacking_item.forceMove(src)
+ mic = attacking_item
+ to_chat(user, SPAN_NOTICE("You place \the [attacking_item] on \the [src]."))
update_icon()
/obj/item/fluff/akinyi_stand/MouseDrop(mob/user as mob)
@@ -994,15 +994,15 @@ All custom items with worn sprites must follow the contained sprite system: http
return
return ..()
-/obj/item/fluff/holoconsole/attackby(obj/item/I, mob/user)
- switch(I.type)
+/obj/item/fluff/holoconsole/attackby(obj/item/attacking_item, mob/user, params)
+ switch(attacking_item.type)
if(/obj/item/fluff/holoconsole_controller)
if(left_controller)
to_chat(user, SPAN_WARNING("\The [src] already has its left controller connected!"))
return
- user.visible_message("[user] slots \the [I] back into to \the [src].", SPAN_NOTICE("You slot \the [I] back into \the [src]."))
- user.drop_from_inventory(I, src)
- left_controller = I
+ user.visible_message("[user] slots \the [attacking_item] back into to \the [src].", SPAN_NOTICE("You slot \the [attacking_item] back into \the [src]."))
+ user.drop_from_inventory(attacking_item, src)
+ left_controller = attacking_item
left_controller.parent_console = null
verbs += /obj/item/fluff/holoconsole/proc/remove_left
update_icon()
@@ -1011,9 +1011,9 @@ All custom items with worn sprites must follow the contained sprite system: http
if(right_controller)
to_chat(user, SPAN_WARNING("\The [src] already has its right controller connected!"))
return
- user.visible_message("[user] slots \the [I] back into to \the [src].", SPAN_NOTICE("You slot \the [I] back into \the [src]."))
- user.drop_from_inventory(I, src)
- right_controller = I
+ user.visible_message("[user] slots \the [attacking_item] back into to \the [src].", SPAN_NOTICE("You slot \the [attacking_item] back into \the [src]."))
+ user.drop_from_inventory(attacking_item, src)
+ right_controller = attacking_item
right_controller.parent_console = null
verbs += /obj/item/fluff/holoconsole/proc/remove_right
update_icon()
@@ -1123,13 +1123,13 @@ All custom items with worn sprites must follow the contained sprite system: http
return
return ..()
-/obj/item/fluff/holocase/attackby(obj/item/I, mob/user)
- if(istype(I, /obj/item/fluff/holoconsole))
+/obj/item/fluff/holocase/attackby(obj/item/attacking_item, mob/user, params)
+ if(istype(attacking_item, /obj/item/fluff/holoconsole))
if(contained_console)
to_chat(user, SPAN_WARNING("\The [src] already contains a holoconsole!"))
return
- user.drop_from_inventory(I, src)
- contained_console = I
+ user.drop_from_inventory(attacking_item, src)
+ contained_console = attacking_item
user.visible_message("[usr] puts \the [contained_console] into \the [src], zipping it back up.", SPAN_NOTICE("You put \the [contained_console] into \the [src], zipping it back up."))
update_icon()
return
@@ -1547,25 +1547,25 @@ All custom items with worn sprites must follow the contained sprite system: http
icon_state = initial(icon_state)
STOP_PROCESSING(SSprocessing, src)
-/obj/item/fluff/nasira_burner/attackby(obj/item/W as obj, mob/user as mob)
+/obj/item/fluff/nasira_burner/attackby(obj/item/attacking_item, mob/user, params)
..()
- if(W.isFlameSource())
+ if(attacking_item.isFlameSource())
var/text = matchmsg
- if(istype(W, /obj/item/flame/match))
+ if(istype(attacking_item, /obj/item/flame/match))
text = matchmsg
- else if(istype(W, /obj/item/flame/lighter/zippo))
+ else if(istype(attacking_item, /obj/item/flame/lighter/zippo))
text = zippomsg
- else if(istype(W, /obj/item/flame/lighter))
+ else if(istype(attacking_item, /obj/item/flame/lighter))
text = lightermsg
- else if(W.iswelder())
+ else if(attacking_item.iswelder())
text = weldermsg
- else if(istype(W, /obj/item/device/assembly/igniter))
+ else if(istype(attacking_item, /obj/item/device/assembly/igniter))
text = ignitermsg
else
text = genericmsg
text = replacetext(text, "USER", "\the [user]")
text = replacetext(text, "NAME", "\the [name]")
- text = replacetext(text, "FLAME", "\the [W.name]")
+ text = replacetext(text, "FLAME", "\the [attacking_item.name]")
light(text)
/obj/item/fluff/nasira_burner/process()
diff --git a/code/modules/detectivework/tools/rag.dm b/code/modules/detectivework/tools/rag.dm
index a6f99bad07b..0e0adf5cdf5 100644
--- a/code/modules/detectivework/tools/rag.dm
+++ b/code/modules/detectivework/tools/rag.dm
@@ -125,11 +125,11 @@
user.visible_message("[user] finishes wiping [A].")
A.on_rag_wipe(src)
-/obj/item/reagent_containers/glass/rag/attack(atom/target as obj|turf|area, mob/user as mob , flag)
- if(isliving(target))
- var/mob/living/M = target
+/obj/item/reagent_containers/glass/rag/attack(mob/living/target_mob, mob/living/user, target_zone)
+ if(isliving(target_mob))
+ var/mob/living/M = target_mob
if(on_fire)
- user.visible_message(SPAN_DANGER("\The [user] hits \the [target] with \the [src]!"))
+ user.visible_message(SPAN_DANGER("\The [user] hits \the [target_mob] with \the [src]!"))
user.do_attack_animation(src)
M.IgniteMob()
else if(ishuman(M))
@@ -164,18 +164,18 @@
if(user.zone_sel.selecting == BP_MOUTH && !(M.wear_mask && M.wear_mask.item_flags & ITEM_FLAG_AIRTIGHT))
user.do_attack_animation(src)
user.visible_message(
- SPAN_DANGER("\The [user] smothers [target] with [src]!"),
- SPAN_WARNING("You smother [target] with [src]!"),
+ SPAN_DANGER("\The [user] smothers [target_mob] with [src]!"),
+ SPAN_WARNING("You smother [target_mob] with [src]!"),
"You hear some struggling and muffled cries of surprise."
)
//it's inhaled, so... maybe CHEM_BLOOD doesn't make a whole lot of sense but it's the best we can do for now
//^HA HA HA
- reagents.trans_to_mob(target, amount_per_transfer_from_this, CHEM_BREATHE)
+ reagents.trans_to_mob(target_mob, amount_per_transfer_from_this, CHEM_BREATHE)
update_name()
update_icon()
else
- wipe_down(target, user)
+ wipe_down(target_mob, user)
return
return ..()
diff --git a/code/modules/detectivework/tools/sample_kits.dm b/code/modules/detectivework/tools/sample_kits.dm
index 2fe0dfeda42..0d3822b7a87 100644
--- a/code/modules/detectivework/tools/sample_kits.dm
+++ b/code/modules/detectivework/tools/sample_kits.dm
@@ -45,7 +45,7 @@
to_chat(user, SPAN_NOTICE("You overlay \the [src] and \the [initial(supplied.name)], combining the print records."))
return 1
-/obj/item/sample/attackby(obj/item/attacking_item, var/mob/user)
+/obj/item/sample/attackby(obj/item/attacking_item, mob/user, params)
if(attacking_item.type == src.type)
user.unEquip(attacking_item)
if(merge_evidence(attacking_item, user))
@@ -110,15 +110,15 @@
name = "[initial(name)] (\the [H])"
icon_state = "fingerprint1"
-/obj/item/sample/print/attack(var/mob/living/M, var/mob/user, var/target_zone)
+/obj/item/sample/print/attack(mob/living/target_mob, mob/living/user, target_zone)
- if(!ishuman(M))
+ var/mob/living/carbon/human/H = target_mob
+ if(!istype(H))
return ..()
if(LAZYLEN(evidence))
return 0
- var/mob/living/carbon/human/H = M
if(H.gloves)
to_chat(user, SPAN_WARNING("\The [H] is wearing gloves."))
diff --git a/code/modules/detectivework/tools/swabs.dm b/code/modules/detectivework/tools/swabs.dm
index 531575a5bf0..2e516624bc7 100644
--- a/code/modules/detectivework/tools/swabs.dm
+++ b/code/modules/detectivework/tools/swabs.dm
@@ -18,15 +18,15 @@
/obj/item/forensics/swab/proc/is_used()
return used
-/obj/item/forensics/swab/attack(var/mob/living/M, var/mob/user, var/target_zone)
+/obj/item/forensics/swab/attack(mob/living/target_mob, mob/living/user, target_zone)
- if(!ishuman(M))
+ var/mob/living/carbon/human/H = target_mob
+ if(!istype(H))
return ..()
if(is_used())
return
- var/mob/living/carbon/human/H = M
var/sample_type
if(!H.dna || !H.dna.unique_enzymes)
diff --git a/code/modules/heavy_vehicle/equipment/_equipment.dm b/code/modules/heavy_vehicle/equipment/_equipment.dm
index f7ad42b91f5..3cb74af92e0 100644
--- a/code/modules/heavy_vehicle/equipment/_equipment.dm
+++ b/code/modules/heavy_vehicle/equipment/_equipment.dm
@@ -26,7 +26,7 @@
var/software = english_list(restricted_software, and_text = ", ")
. += SPAN_NOTICE("Exosuit Software Requirement: [software]")
-/obj/item/mecha_equipment/attack() //Generally it's not desired to be able to attack with items
+/obj/item/mecha_equipment/attack(mob/living/target_mob, mob/living/user, target_zone) //Generally it's not desired to be able to attack with items
return 0
/obj/item/mecha_equipment/proc/get_effective_obj()
diff --git a/code/modules/heavy_vehicle/equipment/cult.dm b/code/modules/heavy_vehicle/equipment/cult.dm
index 1bca134589a..8542df6d587 100644
--- a/code/modules/heavy_vehicle/equipment/cult.dm
+++ b/code/modules/heavy_vehicle/equipment/cult.dm
@@ -21,7 +21,7 @@
. = ..()
doomblade = new /obj/item/melee/cultblade/mounted(src)
-/obj/item/mecha_equipment/doomblade/attack(mob/living/M, mob/living/user)
+/obj/item/mecha_equipment/doomblade/attack(mob/living/target_mob, mob/living/user, target_zone)
if(!owner)
return
- doomblade.attack(M, user, user.zone_sel.selecting)
+ doomblade.attack(target_mob, user, user.zone_sel.selecting)
diff --git a/code/modules/heavy_vehicle/equipment/medical.dm b/code/modules/heavy_vehicle/equipment/medical.dm
index 5e069b3762c..55265dc5fbc 100644
--- a/code/modules/heavy_vehicle/equipment/medical.dm
+++ b/code/modules/heavy_vehicle/equipment/medical.dm
@@ -29,7 +29,7 @@
if(.)
sleeper.ui_interact(user)
-/obj/item/mecha_equipment/sleeper/attack()
+/obj/item/mecha_equipment/sleeper/attack(mob/living/target_mob, mob/living/user, target_zone)
return
/obj/item/mecha_equipment/sleeper/attackby(obj/item/attacking_item, mob/user)
@@ -302,16 +302,19 @@
HA.fullScan = !HA.fullScan
to_chat(user, SPAN_NOTICE("You switch to \the [src]'s [HA.fullScan ? "full body" : "basic"] scan mode."))
-/obj/item/device/healthanalyzer/mech/attack(mob/living/M, var/mob/living/heavy_vehicle/user)
+/obj/item/device/healthanalyzer/mech/attack(mob/living/target_mob, mob/living/user, target_zone)
user.setClickCooldown(DEFAULT_QUICK_COOLDOWN)
user.do_attack_animation(src)
if(!fullScan)
- for(var/mob/pilot in user.pilots)
- health_scan_mob(M, pilot, TRUE, TRUE, sound_scan = TRUE)
+ var/mob/living/heavy_vehicle/user_vehicle = user
+ if(istype(user_vehicle))
+ for(var/mob/pilot in user_vehicle.pilots)
+ health_scan_mob(target_mob, pilot, TRUE, TRUE, sound_scan = TRUE)
else
- user.visible_message("[user] starts scanning \the [M] with \the [src].", SPAN_NOTICE("You start scanning \the [M] with \the [src]."))
+ user.visible_message("[user] starts scanning \the [target_mob] with \the [src].",
+ SPAN_NOTICE("You start scanning \the [target_mob] with \the [src]."))
if(do_after(user, 7 SECONDS))
- print_scan(M, user)
+ print_scan(target_mob, user)
add_fingerprint(user)
/obj/item/device/healthanalyzer/mech/proc/print_scan(var/mob/M, var/mob/living/user)
diff --git a/code/modules/holidays/christmas/props.dm b/code/modules/holidays/christmas/props.dm
index 6f7b920ff47..7e4c3bd61dc 100644
--- a/code/modules/holidays/christmas/props.dm
+++ b/code/modules/holidays/christmas/props.dm
@@ -8,10 +8,10 @@
desc = "Directions for use: Requires two people, one to pull each end."
var/cracked = 0
-/obj/item/toy/xmas_cracker/attack(mob/target, mob/user, var/target_zone)
- if( !cracked && istype(target,/mob/living/carbon/human) && (target.stat == CONSCIOUS) && !target.get_active_hand() )
- target.visible_message(SPAN_NOTICE("[user] and [target] pop \an [src]! *pop*"),
- SPAN_NOTICE("You pull \an [src] with [target]! *pop*"),
+/obj/item/toy/xmas_cracker/attack(mob/living/target_mob, mob/living/user, target_zone)
+ if( !cracked && istype(target_mob,/mob/living/carbon/human) && (target_mob.stat == CONSCIOUS) && !target_mob.get_active_hand() )
+ target_mob.visible_message(SPAN_NOTICE("[user] and [target_mob] pop \an [src]! *pop*"),
+ SPAN_NOTICE("You pull \an [src] with [target_mob]! *pop*"),
SPAN_NOTICE("You hear a *pop*."))
var/obj/item/paper/Joke = new /obj/item/paper(user.loc)
@@ -27,14 +27,14 @@
"Why is Christmas just like life in NanoTrasen?\n\nYou do all the work and the fat guy gets all the credit.",
"Why doesn't Santa have any children?\n\nBecause he only comes down the chimney.")
Joke.set_content_unsafe(title, content)
- new /obj/item/clothing/head/festive(target.loc)
+ new /obj/item/clothing/head/festive(target_mob.loc)
user.update_icon()
cracked = 1
icon_state = "cracker1"
- var/obj/item/toy/xmas_cracker/other_half = new /obj/item/toy/xmas_cracker(target)
+ var/obj/item/toy/xmas_cracker/other_half = new /obj/item/toy/xmas_cracker(target_mob)
other_half.cracked = 1
other_half.icon_state = "cracker2"
- target.put_in_active_hand(other_half)
+ target_mob.put_in_active_hand(other_half)
playsound(user, 'sound/effects/snap.ogg', 50, 1)
return 1
return ..()
diff --git a/code/modules/library/lib_items.dm b/code/modules/library/lib_items.dm
index 2db8fc5d6bc..565efbf545d 100644
--- a/code/modules/library/lib_items.dm
+++ b/code/modules/library/lib_items.dm
@@ -310,11 +310,11 @@
else
..()
-/obj/item/book/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob, var/target_zone)
+/obj/item/book/attack(mob/living/target_mob, mob/living/user, target_zone)
if(target_zone == BP_EYES)
- user.visible_message(SPAN_NOTICE("You open up the book and show it to [M]. "), \
- SPAN_NOTICE(" [user] opens up a book and shows it to [M]. "))
- M << browse("Penned by [author].
" + "[dat]", "window=book")
+ user.visible_message(SPAN_NOTICE("You open up the book and show it to [target_mob]. "), \
+ SPAN_NOTICE(" [user] opens up a book and shows it to [target_mob]. "))
+ target_mob << browse("Penned by [author].
" + "[dat]", "window=book")
user.setClickCooldown(DEFAULT_QUICK_COOLDOWN) //to prevent spam
diff --git a/code/modules/mob/living/carbon/slime/items.dm b/code/modules/mob/living/carbon/slime/items.dm
index 35fe4997f7c..31a189fddc7 100644
--- a/code/modules/mob/living/carbon/slime/items.dm
+++ b/code/modules/mob/living/carbon/slime/items.dm
@@ -137,10 +137,13 @@
filling.color = COLOR_PINK
AddOverlays(filling)
-/obj/item/docility_serum/attack(mob/living/carbon/slime/M as mob, mob/user as mob)
- if(!istype(M, /mob/living/carbon/slime/))//If target is not a slime.
+/obj/item/docility_serum/attack(mob/living/target_mob, mob/living/user, target_zone)
+ var/mob/living/carbon/slime/M = target_mob
+
+ if(!istype(M))//If target is not a slime.
to_chat(user, SPAN_WARNING("The docility serum only works on slimes!"))
return ..()
+
if(M.stat)
to_chat(user, SPAN_WARNING("The slime is dead!"))
return ..()
@@ -180,10 +183,13 @@
filling.color = COLOR_PALE_PINK
AddOverlays(filling)
-/obj/item/advanced_docility_serum/attack(mob/living/carbon/slime/M as mob, mob/user as mob)
- if(!istype(M, /mob/living/carbon/slime/))//If target is not a slime.
+/obj/item/advanced_docility_serum/attack(mob/living/target_mob, mob/living/user, target_zone)
+ var/mob/living/carbon/slime/M = target_mob
+
+ if(!istype(M))//If target is not a slime.
to_chat(user, SPAN_WARNING("The docility serum only works on slimes!"))
return ..()
+
if(M.stat)
to_chat(user, SPAN_WARNING("The slime is dead!"))
return ..()
@@ -230,10 +236,13 @@
return INITIALIZE_HINT_NORMAL
-/obj/item/slimesteroid/attack(mob/living/carbon/slime/M as mob, mob/user as mob)
- if(!istype(M, /mob/living/carbon/slime)) //If target is not a slime.
+/obj/item/slimesteroid/attack(mob/living/target_mob, mob/living/user, target_zone)
+ var/mob/living/carbon/slime/M = target_mob
+
+ if(!istype(M)) //If target is not a slime.
to_chat(user, SPAN_WARNING("The steroid only works on baby slimes!"))
return ..()
+
if(M.is_adult) //Can't tame adults
to_chat(user, SPAN_WARNING("Only baby slimes can use the steroid!"))
return ..()
diff --git a/code/modules/mob/living/silicon/ai/ai_remote_control.dm b/code/modules/mob/living/silicon/ai/ai_remote_control.dm
index bc20236850a..f8086ff1ebe 100644
--- a/code/modules/mob/living/silicon/ai/ai_remote_control.dm
+++ b/code/modules/mob/living/silicon/ai/ai_remote_control.dm
@@ -69,6 +69,6 @@
sharp = FALSE
edge = FALSE
-/obj/item/crowbar/robotic/jawsoflife/attack(mob/living/carbon/M, mob/living/carbon/user)
- user.visible_message("\The [user] [pick("boops", "squeezes", "pokes", "prods", "strokes", "bonks")] \the [M] with \the [src]")
+/obj/item/crowbar/robotic/jawsoflife/attack(mob/living/target_mob, mob/living/user, target_zone)
+ user.visible_message("\The [user] [pick("boops", "squeezes", "pokes", "prods", "strokes", "bonks")] \the [target_mob] with \the [src]")
return FALSE
diff --git a/code/modules/mob/living/silicon/robot/analyzer.dm b/code/modules/mob/living/silicon/robot/analyzer.dm
index f61ff917e6b..f9fbcd23d81 100644
--- a/code/modules/mob/living/silicon/robot/analyzer.dm
+++ b/code/modules/mob/living/silicon/robot/analyzer.dm
@@ -15,8 +15,8 @@
origin_tech = list(TECH_MAGNET = 2, TECH_BIO = 1, TECH_ENGINEERING = 2)
matter = list(DEFAULT_WALL_MATERIAL = 500, MATERIAL_GLASS = 200)
-/obj/item/device/robotanalyzer/attack(mob/living/M, mob/living/user)
- robotic_analyze_mob(M, user)
+/obj/item/device/robotanalyzer/attack(mob/living/target_mob, mob/living/user, target_zone)
+ robotic_analyze_mob(target_mob, user)
add_fingerprint(user)
diff --git a/code/modules/mob/living/silicon/robot/drone/drone_items.dm b/code/modules/mob/living/silicon/robot/drone/drone_items.dm
index 98b205cd672..92798332a7c 100644
--- a/code/modules/mob/living/silicon/robot/drone/drone_items.dm
+++ b/code/modules/mob/living/silicon/robot/drone/drone_items.dm
@@ -13,7 +13,7 @@
var/datum/matter_synth/wood
var/datum/matter_synth/plastic
-/obj/item/matter_decompiler/attack(mob/living/M, mob/living/user)
+/obj/item/matter_decompiler/attack(mob/living/target_mob, mob/living/user, target_zone)
return
/obj/item/matter_decompiler/afterattack(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, proximity, params)
diff --git a/code/modules/mob/living/silicon/robot/items/form_printer.dm b/code/modules/mob/living/silicon/robot/items/form_printer.dm
index 8ecb455a45c..4720c4236a4 100644
--- a/code/modules/mob/living/silicon/robot/items/form_printer.dm
+++ b/code/modules/mob/living/silicon/robot/items/form_printer.dm
@@ -5,7 +5,7 @@
icon_state = "paper_bin1"
item_state = "sheet-metal"
-/obj/item/form_printer/attack(mob/living/carbon/M, mob/living/carbon/user)
+/obj/item/form_printer/attack(mob/living/target_mob, mob/living/user, target_zone)
return
/obj/item/form_printer/afterattack(atom/target, mob/living/user, flag, params)
diff --git a/code/modules/mob/living/silicon/robot/items/gripper.dm b/code/modules/mob/living/silicon/robot/items/gripper.dm
index 169e40dab5f..b4d1ec2a7b9 100644
--- a/code/modules/mob/living/silicon/robot/items/gripper.dm
+++ b/code/modules/mob/living/silicon/robot/items/gripper.dm
@@ -147,20 +147,20 @@
update_icon()
return TRUE
-/obj/item/gripper/attack(mob/M, mob/user)
+/obj/item/gripper/attack(mob/living/target_mob, mob/living/user, target_zone)
if(wrapped) //The force of the wrapped obj gets set to zero during the attack() and afterattack().
force_holder = wrapped.force
wrapped.force = 0
- var/resolved = wrapped.attack(M,user)
+ var/resolved = wrapped.attack(target_mob, user)
if(QDELETED(wrapped))
drop(get_turf(src), user, FALSE)
return resolved
else // mob interactions
switch(user.a_intent)
if(I_HELP)
- user.visible_message("\The [user] [pick("boops", "squeezes", "pokes", "prods", "strokes", "bonks")] \the [M] with \the [src]")
+ user.visible_message("\The [user] [pick("boops", "squeezes", "pokes", "prods", "strokes", "bonks")] \the [target_mob] with \the [src]")
if(I_HURT)
- M.attack_generic(user, user.mob_size, "crushed")//about 16 dmg for a cyborg
+ target_mob.attack_generic(user, user.mob_size, "crushed")//about 16 dmg for a cyborg
//Attack generic does a visible message so we dont need one here
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN * 3)
playsound(user, 'sound/effects/attackblob.ogg', 60, 1)
diff --git a/code/modules/mob/living/silicon/robot/items/inductive_charger.dm b/code/modules/mob/living/silicon/robot/items/inductive_charger.dm
index 5ed3252cb4f..8b5f852702d 100644
--- a/code/modules/mob/living/silicon/robot/items/inductive_charger.dm
+++ b/code/modules/mob/living/silicon/robot/items/inductive_charger.dm
@@ -35,7 +35,7 @@
return R.get_cell()
return null
-/obj/item/inductive_charger/attack(mob/living/M, mob/living/user, target_zone)
+/obj/item/inductive_charger/attack(mob/living/target_mob, mob/living/user, target_zone)
return
/obj/item/inductive_charger/afterattack(atom/target, mob/user, proximity_flag, click_parameters)
diff --git a/code/modules/mob/living/simple_animal/constructs/soulstone.dm b/code/modules/mob/living/simple_animal/constructs/soulstone.dm
index 8df9e54e3eb..78326b14343 100644
--- a/code/modules/mob/living/simple_animal/constructs/soulstone.dm
+++ b/code/modules/mob/living/simple_animal/constructs/soulstone.dm
@@ -15,8 +15,11 @@
//////////////////////////////Capturing////////////////////////////////////////////////////////
-/obj/item/device/soulstone/attack(mob/living/carbon/human/M as mob, mob/user as mob)
+/obj/item/device/soulstone/attack(mob/living/target_mob, mob/living/user, target_zone)
user.setClickCooldown(20)
+
+ var/mob/living/carbon/human/M = target_mob
+
if(!istype(M, /mob/living/carbon/human))//If target is not a human.
return ..()
if(istype(M, /mob/living/carbon/human/apparition))
diff --git a/code/modules/mob/mob_grab.dm b/code/modules/mob/mob_grab.dm
index 5f30f355afb..9675a79461c 100644
--- a/code/modules/mob/mob_grab.dm
+++ b/code/modules/mob/mob_grab.dm
@@ -345,7 +345,7 @@
return 1
-/obj/item/grab/attack(mob/M, mob/living/user, var/target_zone)
+/obj/item/grab/attack(mob/living/target_mob, mob/living/user, target_zone)
if(!affecting)
return
@@ -355,7 +355,7 @@
last_action = world.time
reset_kill_state() //using special grab moves will interrupt choking them
- if(M == affecting) //clicking on the victim while grabbing them
+ if(target_mob == affecting) //clicking on the victim while grabbing them
if(ishuman(affecting))
var/hit_zone = target_zone
flick(hud.icon_state, hud)
@@ -385,7 +385,7 @@
hair_pull(affecting, assailant)
//clicking on yourself while grabbing them
- else if(M == assailant && assailant.a_intent == I_GRAB && state >= GRAB_AGGRESSIVE)
+ else if(target_mob == assailant && assailant.a_intent == I_GRAB && state >= GRAB_AGGRESSIVE)
devour(affecting, assailant)
/obj/item/grab/dropped()
diff --git a/code/modules/modular_computers/computers/modular_computer/interaction.dm b/code/modules/modular_computers/computers/modular_computer/interaction.dm
index c33fb6b2298..b0a856f99d2 100644
--- a/code/modules/modular_computers/computers/modular_computer/interaction.dm
+++ b/code/modules/modular_computers/computers/modular_computer/interaction.dm
@@ -146,13 +146,13 @@
else
to_chat(user, SPAN_WARNING("\The [src] does not have a card or item stored in the card slot."))
-/obj/item/modular_computer/attack(mob/living/M, mob/living/user, var/sound_scan)
- sound_scan = FALSE
+/obj/item/modular_computer/attack(mob/living/target_mob, mob/living/user, target_zone)
+ var/sound_scan = FALSE
if(last_scan <= world.time - 20) //Spam limiter.
last_scan = world.time
sound_scan = TRUE
if(scan_mode == SCANNER_MEDICAL)
- health_scan_mob(M, user, TRUE, sound_scan = sound_scan)
+ health_scan_mob(target_mob, user, TRUE, sound_scan = sound_scan)
/obj/item/modular_computer/afterattack(atom/A, mob/user, proximity_flag, click_parameters)
. = ..()
diff --git a/code/modules/organs/organ.dm b/code/modules/organs/organ.dm
index 8bcdb3e4086..114f4584828 100644
--- a/code/modules/organs/organ.dm
+++ b/code/modules/organs/organ.dm
@@ -474,9 +474,9 @@ INITIALIZE_IMMEDIATE(/obj/item/organ)
target.update_eyes()
..()
-/obj/item/organ/attack(var/mob/target, var/mob/user)
+/obj/item/organ/attack(mob/living/target_mob, mob/living/user, target_zone)
- if(robotic || !istype(target) || !istype(user) || (user != target && user.a_intent == I_HELP))
+ if(robotic || !istype(target_mob) || !istype(user) || (user != target_mob && user.a_intent == I_HELP))
return ..()
if(alert("Do you really want to use this organ as food? It will be useless for anything else afterwards.",,"No.","Yes.") == "No.")
@@ -496,7 +496,7 @@ INITIALIZE_IMMEDIATE(/obj/item/organ)
O.fingerprintslast = fingerprintslast
user.put_in_active_hand(O)
qdel(src)
- target.attackby(O, user)
+ target_mob.attackby(O, user)
//used by stethoscope
/obj/item/organ/proc/listen()
diff --git a/code/modules/overmap/ships/computers/helm.dm b/code/modules/overmap/ships/computers/helm.dm
index 7991b8d0b4d..5e0f1fab226 100644
--- a/code/modules/overmap/ships/computers/helm.dm
+++ b/code/modules/overmap/ships/computers/helm.dm
@@ -45,7 +45,7 @@
PH.linked_helm = null
return ..()
-/obj/machinery/computer/ship/helm/attackby(obj/item/attacking_item, user)
+/obj/machinery/computer/ship/helm/attackby(obj/item/attacking_item, mob/user, params)
if(istype(attacking_item, /obj/item/clothing/head/helmet/pilot))
if(!connected)
to_chat(user, SPAN_WARNING("\The [src] isn't linked to any vessels!"))
diff --git a/code/modules/paperwork/handlabeler.dm b/code/modules/paperwork/handlabeler.dm
index 30086a8aefc..91a31665609 100644
--- a/code/modules/paperwork/handlabeler.dm
+++ b/code/modules/paperwork/handlabeler.dm
@@ -37,7 +37,7 @@
var/mode = 0 //off or on.
matter = list(DEFAULT_WALL_MATERIAL = 120, MATERIAL_GLASS = 80)
-/obj/item/device/hand_labeler/attack()
+/obj/item/device/hand_labeler/attack(mob/living/target_mob, mob/living/user, target_zone)
return
/obj/item/device/hand_labeler/afterattack(atom/A, mob/user as mob, proximity)
diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm
index 943f836d75b..df54e3d461d 100644
--- a/code/modules/paperwork/paper.dm
+++ b/code/modules/paperwork/paper.dm
@@ -234,7 +234,11 @@
/obj/item/paper/attack_ai(var/mob/living/silicon/ai/user)
show_content(user)
-/obj/item/paper/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob, var/target_zone)
+/obj/item/paper/attack(mob/living/target_mob, mob/living/user, target_zone)
+ var/mob/living/carbon/M = target_mob
+ if(!istype(M))
+ return ..()
+
if(target_zone == BP_EYES)
user.visible_message(SPAN_NOTICE("You show \the [src] to [M]."), \
SPAN_NOTICE("[user] holds up \the [src] and shows it to [M]."))
diff --git a/code/modules/paperwork/pen.dm b/code/modules/paperwork/pen.dm
index 06a84e73560..59e0607f01c 100644
--- a/code/modules/paperwork/pen.dm
+++ b/code/modules/paperwork/pen.dm
@@ -176,21 +176,21 @@
. = ..()
create_reagents(30)
-/obj/item/pen/reagent/attack(mob/living/M, mob/user)
+/obj/item/pen/reagent/attack(mob/living/target_mob, mob/living/user, target_zone)
. = ..()
- if(!ismob(M))
+ if(!ismob(target_mob))
return
- if(M.can_inject(user, 1))
+ if(target_mob.can_inject(user, 1))
if(reagents.total_volume)
- if(M.reagents)
+ if(target_mob.reagents)
var/contained_reagents = reagents.get_reagents()
- var/trans = reagents.trans_to_mob(M, 30, CHEM_BLOOD)
- to_chat(user, SPAN_ALERT("You stab \the [M] with \the [src], injecting all of its contents.")) // To the stabber.
- to_chat(M, SPAN_WARNING("You feel a small pinch!")) // To the stabbed.
- M.attack_log += "\[[time_stamp()]\] Has been stabbed with [name] by [user.name] ([user.ckey])"
- user.attack_log += "\[[time_stamp()]\] Used the [name] to stab [M.name] ([M.ckey])"
- msg_admin_attack("[user.name] ([user.ckey]) Used the [name] to stab [M.name] ([M.ckey]) (JMP)",ckey=key_name(user),ckey_target=key_name(M))
- admin_inject_log(user, M, src, contained_reagents, reagents.get_temperature(), trans) // Admin log.
+ var/trans = reagents.trans_to_mob(target_mob, 30, CHEM_BLOOD)
+ to_chat(user, SPAN_ALERT("You stab \the [target_mob] with \the [src], injecting all of its contents.")) // To the stabber.
+ to_chat(target_mob, SPAN_WARNING("You feel a small pinch!")) // To the stabbed.
+ target_mob.attack_log += "\[[time_stamp()]\] Has been stabbed with [name] by [user.name] ([user.ckey])"
+ user.attack_log += "\[[time_stamp()]\] Used the [name] to stab [target_mob.name] ([target_mob.ckey])"
+ msg_admin_attack("[user.name] ([user.ckey]) Used the [name] to stab [target_mob.name] ([target_mob.ckey]) (JMP)",ckey=key_name(user),ckey_target=key_name(target_mob))
+ admin_inject_log(user, target_mob, src, contained_reagents, reagents.get_temperature(), trans) // Admin log.
/*
* Sleepy Pens
diff --git a/code/modules/paperwork/photography.dm b/code/modules/paperwork/photography.dm
index 38d09e1ff85..9af03f2b15e 100644
--- a/code/modules/paperwork/photography.dm
+++ b/code/modules/paperwork/photography.dm
@@ -169,7 +169,7 @@ var/global/photo_count = 0
size = nsize
to_chat(usr, SPAN_NOTICE("Camera will now take [size]x[size] photos."))
-/obj/item/device/camera/attack(mob/living/carbon/human/M as mob, mob/user as mob)
+/obj/item/device/camera/attack(mob/living/target_mob, mob/living/user, target_zone)
return
/obj/item/device/camera/attack_self(mob/user as mob)
diff --git a/code/modules/paperwork/typewriter.dm b/code/modules/paperwork/typewriter.dm
index 2c92b869092..1dd6f343046 100644
--- a/code/modules/paperwork/typewriter.dm
+++ b/code/modules/paperwork/typewriter.dm
@@ -100,8 +100,14 @@
to_chat(user, SPAN_ALERT("\The [src] already has a paper in it."))
. = ..()
-/obj/item/portable_typewriter/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
+/obj/item/portable_typewriter/attack(mob/living/target_mob, mob/living/user, target_zone)
..()
+
+ var/mob/living/carbon/M = target_mob
+
+ if(!istype(M))
+ return
+
user.visible_message(SPAN_ALERT("\The [src] shatters into metal pieces!"))
M.Weaken(2)
playsound(loc, 'sound/effects/metalhit.ogg', 50, 1)
diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm
index 9feea09a0ef..92e11a2b567 100644
--- a/code/modules/power/cable.dm
+++ b/code/modules/power/cable.dm
@@ -546,9 +546,9 @@ By design, d1 is the smallest direction and d2 is the highest
else
. += "You have enough charge to produce [get_amount()]."
-/obj/item/stack/cable_coil/attack(mob/living/carbon/M, mob/user)
- if(ishuman(M) && user.a_intent == I_HELP)
- var/mob/living/carbon/human/H = M
+/obj/item/stack/cable_coil/attack(mob/living/target_mob, mob/living/user, target_zone)
+ if(ishuman(target_mob) && user.a_intent == I_HELP)
+ var/mob/living/carbon/human/H = target_mob
var/obj/item/organ/external/affecting = H.get_organ(user.zone_sel.selecting)
if(affecting.open != 0)
@@ -558,7 +558,7 @@ By design, d1 is the smallest direction and d2 is the highest
else
if(!BP_IS_ROBOTIC(affecting))
if(affecting.is_bandaged())
- to_chat(user, SPAN_WARNING("The wounds on [M]'s [affecting.name] have already been closed."))
+ to_chat(user, SPAN_WARNING("The wounds on [H]'s [affecting.name] have already been closed."))
return
else
if(!can_use(10, user))
@@ -569,15 +569,15 @@ By design, d1 is the smallest direction and d2 is the highest
if(W.bandaged)
continue
if(W.current_stage <= W.max_bleeding_stage)
- user.visible_message(SPAN_NOTICE("\The [user] starts carefully suturing the open wound on [M]'s [affecting.name]..."), \
- SPAN_NOTICE("You start carefully suturing the open wound on [M]'s [affecting.name]... This will take a while."))
- if(!do_mob(user, M, 200))
- user.visible_message(SPAN_DANGER("[user]'s hand slips and tears open the wound on [M]'s [affecting.name]!"), \
+ user.visible_message(SPAN_NOTICE("\The [user] starts carefully suturing the open wound on [target_mob]'s [affecting.name]..."), \
+ SPAN_NOTICE("You start carefully suturing the open wound on [target_mob]'s [affecting.name]... This will take a while."))
+ if(!do_mob(user, target_mob, 200))
+ user.visible_message(SPAN_DANGER("[user]'s hand slips and tears open the wound on [target_mob]'s [affecting.name]!"), \
SPAN_DANGER("The wound on your [affecting.name] is torn open!"))
- M.apply_damage(rand(1,10), DAMAGE_BRUTE)
+ target_mob.apply_damage(rand(1,10), DAMAGE_BRUTE)
break
- user.visible_message(SPAN_NOTICE("\The [user] barely manages to stitch \a [W.desc] on [M]'s [affecting.name]."), \
- SPAN_NOTICE("You barely manage to stitch \a [W.desc] on [M]'s [affecting.name].") )
+ user.visible_message(SPAN_NOTICE("\The [user] barely manages to stitch \a [W.desc] on [target_mob]'s [affecting.name]."), \
+ SPAN_NOTICE("You barely manage to stitch \a [W.desc] on [target_mob]'s [affecting.name].") )
W.bandage("cable-stitched")
use(10)
affecting.add_pain(25)
diff --git a/code/modules/projectiles/ammunition/ammo_pile.dm b/code/modules/projectiles/ammunition/ammo_pile.dm
index 0485de8ab71..974d141cb5a 100644
--- a/code/modules/projectiles/ammunition/ammo_pile.dm
+++ b/code/modules/projectiles/ammunition/ammo_pile.dm
@@ -31,7 +31,7 @@
if(is_adjacent)
. += SPAN_NOTICE("It contains [length(ammo)] rounds.")
-/obj/item/ammo_pile/attack()
+/obj/item/ammo_pile/attack(mob/living/target_mob, mob/living/user, target_zone)
return
/obj/item/ammo_pile/afterattack(atom/A, mob/living/user, proximity_flag)
diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm
index e0a57eff649..a46a77c228d 100644
--- a/code/modules/projectiles/gun.dm
+++ b/code/modules/projectiles/gun.dm
@@ -302,18 +302,18 @@
else
Fire(A,user,params) //Otherwise, fire normally.
-/obj/item/gun/attack(atom/A, mob/living/user, def_zone)
- if (A == user && user.zone_sel.selecting == BP_MOUTH && !mouthshoot)
+/obj/item/gun/attack(mob/living/target_mob, mob/living/user, target_zone)
+ if (target_mob == user && user.zone_sel.selecting == BP_MOUTH && !mouthshoot)
handle_suicide(user)
else if(user.a_intent != I_HURT && user.aiming && user.aiming.active) //if aim mode, don't pistol whip
- if (user.aiming.aiming_at != A)
- PreFire(A, user)
+ if (user.aiming.aiming_at != target_mob)
+ PreFire(target_mob, user)
else
- Fire(A, user, pointblank=1)
+ Fire(target_mob, user, pointblank=1)
else if(user.a_intent == I_HURT) //point blank shooting
- Fire(A, user, pointblank=1)
+ Fire(target_mob, user, pointblank=1)
else if(bayonet)
- bayonet.attack(A, user, def_zone)
+ bayonet.attack(target_mob, user, target_zone)
else
return ..() //Pistolwhippin'
diff --git a/code/modules/projectiles/guns/energy/special.dm b/code/modules/projectiles/guns/energy/special.dm
index b2674e18441..3d6b21fe674 100644
--- a/code/modules/projectiles/guns/energy/special.dm
+++ b/code/modules/projectiles/guns/energy/special.dm
@@ -328,7 +328,7 @@
is_wieldable = TRUE
-/obj/item/gun/energy/vaurca/typec/attack(mob/living/carbon/human/M as mob, mob/living/carbon/user as mob)
+/obj/item/gun/energy/vaurca/typec/attack(mob/living/target_mob, mob/living/user, target_zone)
user.setClickCooldown(16)
..()
diff --git a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Other.dm b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Other.dm
index 9cd09998468..6e26b4fa428 100644
--- a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Other.dm
+++ b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Other.dm
@@ -836,7 +836,7 @@
w_class = WEIGHT_CLASS_TINY
icon_state = "ore_glass"
-/obj/item/shapesand/attack() //can't be used to actually bludgeon things
+/obj/item/shapesand/attack(mob/living/target_mob, mob/living/user, target_zone) //can't be used to actually bludgeon things
return 1
/obj/item/shapesand/afterattack(atom/A, mob/living/user)
diff --git a/code/modules/reagents/reagent_containers.dm b/code/modules/reagents/reagent_containers.dm
index 1ec438a54c1..e07917b9e74 100644
--- a/code/modules/reagents/reagent_containers.dm
+++ b/code/modules/reagents/reagent_containers.dm
@@ -108,8 +108,8 @@
return TRUE
return ..()
-/obj/item/reagent_containers/attack(mob/M, mob/user, def_zone)
- if(can_operate(M) && do_surgery(M, user, src))
+/obj/item/reagent_containers/attack(mob/living/target_mob, mob/living/user, target_zone)
+ if(can_operate(target_mob) && do_surgery(target_mob, user, src))
return
if(!reagents.total_volume && user.a_intent == I_HURT)
return ..()
diff --git a/code/modules/reagents/reagent_containers/blood_pack.dm b/code/modules/reagents/reagent_containers/blood_pack.dm
index d1086d8a713..5c1ba8e909d 100644
--- a/code/modules/reagents/reagent_containers/blood_pack.dm
+++ b/code/modules/reagents/reagent_containers/blood_pack.dm
@@ -66,8 +66,8 @@
if(reagents && reagents.total_volume)
AddOverlays(overlay_image('icons/obj/bloodpack.dmi', "[icon_state][get_filling_state()]", color = reagents.get_color()))
-/obj/item/reagent_containers/blood/attack(mob/living/carbon/human/M as mob, mob/living/carbon/human/user as mob, var/target_zone)
- if(user == M && (MODE_VAMPIRE in user.mind?.antag_datums))
+/obj/item/reagent_containers/blood/attack(mob/living/target_mob, mob/living/user, target_zone)
+ if(user == target_mob && (MODE_VAMPIRE in user.mind?.antag_datums))
var/datum/vampire/vampire = user.mind.antag_datums[MODE_VAMPIRE]
if (being_feed)
to_chat(user, SPAN_NOTICE("You are already feeding on \the [src]."))
@@ -77,7 +77,7 @@
being_feed = TRUE
vampire_marks = TRUE
if (!LAZYLEN(src.other_DNA))
- LAZYADD(src.other_DNA, M.dna.unique_enzymes)
+ LAZYADD(src.other_DNA, target_mob.dna.unique_enzymes)
src.other_DNA_type = "saliva"
while (do_after(user, 25, 5))
diff --git a/code/modules/reagents/reagent_containers/borghydro.dm b/code/modules/reagents/reagent_containers/borghydro.dm
index 81a6b9f7781..cc3e8ead687 100644
--- a/code/modules/reagents/reagent_containers/borghydro.dm
+++ b/code/modules/reagents/reagent_containers/borghydro.dm
@@ -165,7 +165,7 @@
filling.color = R.get_color()
AddOverlays(filling)
-/obj/item/reagent_containers/hypospray/borghypo/service/attack(var/mob/M, var/mob/user)
+/obj/item/reagent_containers/hypospray/borghypo/service/attack(mob/living/target_mob, mob/living/user, target_zone)
return
/obj/item/reagent_containers/hypospray/borghypo/service/afterattack(var/obj/target, var/mob/user, var/proximity)
diff --git a/code/modules/reagents/reagent_containers/food/cans.dm b/code/modules/reagents/reagent_containers/food/cans.dm
index 27220a2b6c4..78da8c770ed 100644
--- a/code/modules/reagents/reagent_containers/food/cans.dm
+++ b/code/modules/reagents/reagent_containers/food/cans.dm
@@ -24,15 +24,15 @@
If it's empty, you can crush it on your forehead by selecting your head and clicking on yourself with harm intent. \
You can also crush cans on other people's foreheads as well."
-/obj/item/reagent_containers/food/drinks/cans/attack(mob/living/M, mob/user, var/target_zone)
- if(iscarbon(M) && !reagents.total_volume && user.a_intent == I_HURT && target_zone == BP_HEAD)
- if(M == user)
+/obj/item/reagent_containers/food/drinks/cans/attack(mob/living/target_mob, mob/living/user, target_zone)
+ if(iscarbon(target_mob) && !reagents.total_volume && user.a_intent == I_HURT && target_zone == BP_HEAD)
+ if(target_mob == user)
user.visible_message(SPAN_WARNING("[user] crushes the can of [src.name] on [user.get_pronoun("his")] forehead!"), SPAN_NOTICE("You crush the can of [src.name] on your forehead."))
else
- user.visible_message(SPAN_WARNING("[user] crushes the can of [src.name] on [M]'s forehead!"), SPAN_NOTICE("You crush the can of [src.name] on [M]'s forehead."))
- M.apply_damage(2,DAMAGE_BRUTE,BP_HEAD) // ouch.
- playsound(M,'sound/items/soda_crush.ogg', rand(10,50), TRUE)
- var/obj/item/trash/can/crushed_can = new /obj/item/trash/can(M.loc)
+ user.visible_message(SPAN_WARNING("[user] crushes the can of [src.name] on [target_mob]'s forehead!"), SPAN_NOTICE("You crush the can of [src.name] on [target_mob]'s forehead."))
+ target_mob.apply_damage(2,DAMAGE_BRUTE,BP_HEAD) // ouch.
+ playsound(target_mob,'sound/items/soda_crush.ogg', rand(10,50), TRUE)
+ var/obj/item/trash/can/crushed_can = new /obj/item/trash/can(target_mob.loc)
crushed_can.icon_state = icon_state
qdel(src)
user.put_in_hands(crushed_can)
@@ -596,13 +596,13 @@
pickup_sound = 'sound/items/pickup/shoes.ogg'
reagents_to_add = list(/singleton/reagent/drink/bochbrew = 30)
-/obj/item/reagent_containers/food/drinks/cans/boch/attack(mob/living/M, mob/user, var/target_zone) // modified can reaction; have you ever seen someone crush a plastic bottle on their head?
- if(iscarbon(M) && !reagents.total_volume && user.a_intent == I_HURT && target_zone == BP_HEAD)
- if(M == user)
+/obj/item/reagent_containers/food/drinks/cans/boch/attack(mob/living/target_mob, mob/living/user, target_zone) // modified can reaction; have you ever seen someone crush a plastic bottle on their head?
+ if(iscarbon(target_mob) && !reagents.total_volume && user.a_intent == I_HURT && target_zone == BP_HEAD)
+ if(target_mob == user)
user.visible_message(SPAN_WARNING("[user] smacks the bottle of [src.name] against [user.get_pronoun("his")] forehead!"), SPAN_NOTICE("You smack the bottle of [src.name] on your forehead."))
else
- user.visible_message(SPAN_WARNING("[user] smacks the bottle of [src.name] against [M]'s forehead!"), SPAN_NOTICE("You whack the bottle of [src.name] on [M]'s forehead."))
- M.apply_damage(2,DAMAGE_BRUTE,BP_HEAD) // quoth the copy-paste code, 'ouch.'
+ user.visible_message(SPAN_WARNING("[user] smacks the bottle of [src.name] against [target_mob]'s forehead!"), SPAN_NOTICE("You whack the bottle of [src.name] on [target_mob]'s forehead."))
+ target_mob.apply_damage(2,DAMAGE_BRUTE,BP_HEAD) // quoth the copy-paste code, 'ouch.'
return TRUE
. = ..()
diff --git a/code/modules/reagents/reagent_containers/food/drinks.dm b/code/modules/reagents/reagent_containers/food/drinks.dm
index 35844b3dec4..3e9b12b4302 100644
--- a/code/modules/reagents/reagent_containers/food/drinks.dm
+++ b/code/modules/reagents/reagent_containers/food/drinks.dm
@@ -76,7 +76,7 @@ If you add a drink with an empty icon sprite, ensure it is in the same folder, e
atom_flags |= ATOM_FLAG_OPEN_CONTAINER
shaken = 0
-/obj/item/reagent_containers/food/drinks/attack(mob/M as mob, mob/user as mob, def_zone)
+/obj/item/reagent_containers/food/drinks/attack(mob/living/target_mob, mob/living/user, target_zone)
if(force && !(atom_flags & ITEM_FLAG_NO_BLUDGEON) && user.a_intent == I_HURT)
return ..()
return 0
diff --git a/code/modules/reagents/reagent_containers/food/drinks/bottle.dm b/code/modules/reagents/reagent_containers/food/drinks/bottle.dm
index 02ac8dd89a8..5e480adb718 100644
--- a/code/modules/reagents/reagent_containers/food/drinks/bottle.dm
+++ b/code/modules/reagents/reagent_containers/food/drinks/bottle.dm
@@ -148,12 +148,12 @@
return
..()
-/obj/item/reagent_containers/food/drinks/bottle/attack(mob/living/target, mob/living/user, var/hit_zone)
+/obj/item/reagent_containers/food/drinks/bottle/attack(mob/living/target_mob, mob/living/user, target_zone)
var/blocked = ..()
if(user.a_intent != I_HURT)
return
- if(target == user) //A check so you don't accidentally smash your brains out while trying to get your drink on.
+ if(target_mob == user) //A check so you don't accidentally smash your brains out while trying to get your drink on.
var/confirm = alert("Do you want to smash the bottle on yourself?","Hit yourself?","No", "Yeah!", "Splash Reagents")
if(confirm == "No")
return 1 //prevents standard_splash_mob on return
@@ -165,24 +165,24 @@
// You are going to knock someone out for longer if they are not wearing a helmet.
var/weaken_duration = 0
if(blocked < 100)
- weaken_duration = smash_duration + min(0, force - target.get_blocked_ratio(hit_zone, DAMAGE_BRUTE) * 100 + 10)
+ weaken_duration = smash_duration + min(0, force - target_mob.get_blocked_ratio(target_zone, DAMAGE_BRUTE) * 100 + 10)
- var/mob/living/carbon/human/H = target
- if(istype(H) && H.headcheck(hit_zone))
- var/obj/item/organ/affecting = H.get_organ(hit_zone) //headcheck should ensure that affecting is not null
+ var/mob/living/carbon/human/H = target_mob
+ if(istype(H) && H.headcheck(target_zone))
+ var/obj/item/organ/affecting = H.get_organ(target_zone) //headcheck should ensure that affecting is not null
user.visible_message(SPAN_DANGER("[user] smashes [src] into [H]'s [affecting.name]!"))
if(weaken_duration)
- target.apply_effect(min(weaken_duration, 5), WEAKEN, blocked) // Never weaken more than a flash!
+ target_mob.apply_effect(min(weaken_duration, 5), WEAKEN, blocked) // Never weaken more than a flash!
else
- user.visible_message(SPAN_DANGER("\The [user] smashes [src] into [target]!"))
+ user.visible_message(SPAN_DANGER("\The [user] smashes [src] into [target_mob]!"))
- //The reagents in the bottle splash all over the target, thanks for the idea Nodrak
+ //The reagents in the bottle splash all over the target_mob, thanks for the idea Nodrak
if(reagents)
- user.visible_message(SPAN_NOTICE("The contents of \the [src] splash all over [target]!"))
- reagents.splash(target, reagents.total_volume)
+ user.visible_message(SPAN_NOTICE("The contents of \the [src] splash all over [target_mob]!"))
+ reagents.splash(target_mob, reagents.total_volume)
//Finally, smash the bottle. This kills (qdel) the bottle.
- var/obj/item/broken_bottle/B = smash(target.loc, target)
+ var/obj/item/broken_bottle/B = smash(target_mob.loc, target_mob)
user.put_in_active_hand(B)
return blocked
diff --git a/code/modules/reagents/reagent_containers/food/sandwich.dm b/code/modules/reagents/reagent_containers/food/sandwich.dm
index fb3f79ca3d0..736950f18b3 100644
--- a/code/modules/reagents/reagent_containers/food/sandwich.dm
+++ b/code/modules/reagents/reagent_containers/food/sandwich.dm
@@ -1,8 +1,8 @@
-/obj/item/reagent_containers/food/snacks/breadslice/attackby(obj/item/W as obj, mob/user)
+/obj/item/reagent_containers/food/snacks/breadslice/attackby(obj/item/attacking_item, mob/user, params)
- if(istype(W,/obj/item/reagent_containers/food/snacks))
+ if(istype(attacking_item,/obj/item/reagent_containers/food/snacks))
var/obj/item/reagent_containers/food/snacks/csandwich/S = new(get_turf(src))
- S.attackby(W,user)
+ S.attackby(attacking_item,user)
qdel(src)
..()
diff --git a/code/modules/reagents/reagent_containers/food/snacks/confections.dm b/code/modules/reagents/reagent_containers/food/snacks/confections.dm
index 83a52f0fa15..fb2db526f96 100644
--- a/code/modules/reagents/reagent_containers/food/snacks/confections.dm
+++ b/code/modules/reagents/reagent_containers/food/snacks/confections.dm
@@ -214,10 +214,10 @@
is_liquid = TRUE
//Custard + blowtorch = creme brulee
-/obj/item/reagent_containers/food/snacks/custard/attackby(obj/item/W, mob/living/user)
+/obj/item/reagent_containers/food/snacks/custard/attackby(obj/item/attacking_item, mob/user, params)
. = ..()
- if(W.iswelder())
- var/obj/item/weldingtool/welder = W
+ if(attacking_item.iswelder())
+ var/obj/item/weldingtool/welder = attacking_item
if(welder.isOn())
new /obj/item/reagent_containers/food/snacks/creme_brulee(src)
to_chat(user, "You apply the flame to the sugary custard, caramelizing it.")
diff --git a/code/modules/reagents/reagent_containers/food/snacks/cultural/vaurca.dm b/code/modules/reagents/reagent_containers/food/snacks/cultural/vaurca.dm
index 65a444da747..36b0ad10193 100644
--- a/code/modules/reagents/reagent_containers/food/snacks/cultural/vaurca.dm
+++ b/code/modules/reagents/reagent_containers/food/snacks/cultural/vaurca.dm
@@ -46,12 +46,12 @@
bitesize = 6
reagents_to_add = list(/singleton/reagent/kois = 12, /singleton/reagent/toxin/phoron = 16)
-/obj/item/reagent_containers/food/snacks/koiskebab2/attackby(obj/item/W as obj, mob/user as mob)
- if(istype(W,/obj/item/reagent_containers/food/snacks/friedkois))
+/obj/item/reagent_containers/food/snacks/koiskebab2/attackby(obj/item/attacking_item, mob/user, params)
+ if(istype(attacking_item,/obj/item/reagent_containers/food/snacks/friedkois))
new /obj/item/reagent_containers/food/snacks/koiskebab3(src)
to_chat(user, "You add fried K'ois to the kebab.")
qdel(src)
- qdel(W)
+ qdel(attacking_item)
/obj/item/reagent_containers/food/snacks/koiskebab3
name = "k'ois on a stick"
diff --git a/code/modules/reagents/reagent_containers/food/snacks/sushi.dm b/code/modules/reagents/reagent_containers/food/snacks/sushi.dm
index e7018bf72d1..b9471cc8230 100644
--- a/code/modules/reagents/reagent_containers/food/snacks/sushi.dm
+++ b/code/modules/reagents/reagent_containers/food/snacks/sushi.dm
@@ -131,22 +131,22 @@
return
. = ..()
// Used for turning other food into sushi.
-/obj/item/reagent_containers/food/snacks/friedegg/attackby(obj/item/attacking_item, var/mob/user)
+/obj/item/reagent_containers/food/snacks/friedegg/attackby(obj/item/attacking_item, mob/user, params)
if((locate(/obj/structure/table) in loc) && istype(attacking_item, /obj/item/reagent_containers/food/snacks/boiledrice))
new /obj/item/reagent_containers/food/snacks/sushi(get_turf(src), attacking_item, src)
return
. = ..()
-/obj/item/reagent_containers/food/snacks/tofu/attackby(obj/item/attacking_item, var/mob/user)
+/obj/item/reagent_containers/food/snacks/tofu/attackby(obj/item/attacking_item, mob/user, params)
if((locate(/obj/structure/table) in loc) && istype(attacking_item, /obj/item/reagent_containers/food/snacks/boiledrice))
new /obj/item/reagent_containers/food/snacks/sushi(get_turf(src), attacking_item, src)
return
. = ..()
-/obj/item/reagent_containers/food/snacks/rawcutlet/attackby(obj/item/attacking_item, var/mob/user)
+/obj/item/reagent_containers/food/snacks/rawcutlet/attackby(obj/item/attacking_item, mob/user, params)
if((locate(/obj/structure/table) in loc) && istype(attacking_item, /obj/item/reagent_containers/food/snacks/boiledrice))
new /obj/item/reagent_containers/food/snacks/sushi(get_turf(src), attacking_item, src)
return
. = ..()
-/obj/item/reagent_containers/food/snacks/cutlet/attackby(obj/item/attacking_item, var/mob/user)
+/obj/item/reagent_containers/food/snacks/cutlet/attackby(obj/item/attacking_item, mob/user, params)
if((locate(/obj/structure/table) in loc) && istype(attacking_item, /obj/item/reagent_containers/food/snacks/boiledrice))
new /obj/item/reagent_containers/food/snacks/sushi(get_turf(src), attacking_item, src)
return
diff --git a/code/modules/reagents/reagent_containers/hypospray.dm b/code/modules/reagents/reagent_containers/hypospray.dm
index 392ae6eb457..82c5ebf7a49 100644
--- a/code/modules/reagents/reagent_containers/hypospray.dm
+++ b/code/modules/reagents/reagent_containers/hypospray.dm
@@ -46,10 +46,10 @@
possible_transfer_amounts = list(5, 10, 15, 30)
time = 0
-/obj/item/reagent_containers/hypospray/attack(var/mob/M, var/mob/user, target_zone)
+/obj/item/reagent_containers/hypospray/attack(mob/living/target_mob, mob/living/user, target_zone)
. = ..()
- if(isliving(M))
- var/mob/living/L = M
+ if(isliving(target_mob))
+ var/mob/living/L = target_mob
var/inj_time = time
var/mod_time = L.can_inject(user, TRUE, target_zone, armorcheck)
if(!mod_time)
@@ -60,7 +60,7 @@
inj_time *= mod_time
user.visible_message(SPAN_WARNING("\The [user] is trying to inject \the [L] with \the [src]!"), SPAN_NOTICE("You are trying to inject \the [L] with \the [src]."))
if(do_mob(user, L, inj_time))
- inject(M, user, M.Adjacent(user))
+ inject(target_mob, user, target_mob.Adjacent(user))
/obj/item/reagent_containers/hypospray/update_icon()
ClearOverlays()
@@ -133,7 +133,7 @@
spent = FALSE
update_icon()
-/obj/item/reagent_containers/hypospray/autoinjector/attack(var/mob/M, var/mob/user, target_zone)
+/obj/item/reagent_containers/hypospray/autoinjector/attack(mob/living/target_mob, mob/living/user, target_zone)
if(is_open_container())
to_chat(user, SPAN_NOTICE("You must secure the reagents inside \the [src] before using it!"))
return FALSE
diff --git a/code/modules/reagents/reagent_containers/inhaler.dm b/code/modules/reagents/reagent_containers/inhaler.dm
index 0da44310365..3bf6ee81239 100644
--- a/code/modules/reagents/reagent_containers/inhaler.dm
+++ b/code/modules/reagents/reagent_containers/inhaler.dm
@@ -107,13 +107,13 @@
if(!proximity)
return
-/obj/item/reagent_containers/inhaler/attack(mob/M as mob, mob/user as mob)
+/obj/item/reagent_containers/inhaler/attack(mob/living/target_mob, mob/living/user, target_zone)
if(is_open_container())
to_chat(user,SPAN_NOTICE("You must secure the reagents inside \the [src] before using it!"))
return FALSE
else
- inject(M, user, M.Adjacent(user))
+ inject(target_mob, user, target_mob.Adjacent(user))
. = ..()
/obj/item/reagent_containers/inhaler/attack_self(mob/user as mob)
diff --git a/code/modules/reagents/reagent_containers/inhaler_advanced.dm b/code/modules/reagents/reagent_containers/inhaler_advanced.dm
index 22f6294851c..75f57b04e0d 100644
--- a/code/modules/reagents/reagent_containers/inhaler_advanced.dm
+++ b/code/modules/reagents/reagent_containers/inhaler_advanced.dm
@@ -126,12 +126,12 @@
stored_cartridge = null
update_icon()
-/obj/item/personal_inhaler/attack(mob/living/M as mob, mob/user as mob)
+/obj/item/personal_inhaler/attack(mob/living/target_mob, mob/living/user, target_zone)
- var/mob/living/carbon/human/H = M
+ var/mob/living/carbon/human/H = target_mob
if (!istype(H))
- to_chat(user,SPAN_WARNING("You can't find a way to use \the [src] on \the [M]!"))
+ to_chat(user,SPAN_WARNING("You can't find a way to use \the [src] on \the [H]!"))
return
if(!stored_cartridge)
@@ -144,10 +144,10 @@
if (((user.is_clumsy()) || (user.mutations & DUMB)) && prob(10))
to_chat(user,SPAN_DANGER("Your hand slips from clumsiness!"))
- if(M.eyes_protected(src, FALSE))
- eyestab(M,user)
- user.visible_message(SPAN_NOTICE("[user] accidentally sticks \the [src] in [M]'s eye!"),
- SPAN_NOTICE("You accidentally stick the [src] in [M]'s eye!"))
+ if(H.eyes_protected(src, FALSE))
+ eyestab(H,user)
+ user.visible_message(SPAN_NOTICE("[user] accidentally sticks \the [src] in [H]'s eye!"),
+ SPAN_NOTICE("You accidentally stick the [src] in [H]'s eye!"))
return
@@ -161,29 +161,29 @@
return
user.setClickCooldown(DEFAULT_QUICK_COOLDOWN)
- user.do_attack_animation(M)
+ user.do_attack_animation(H)
- if(user == M)
+ if(user == H)
user.visible_message(SPAN_NOTICE("[user] sticks \the [src] in their mouth and presses the injection button."),
SPAN_NOTICE("You stick \the [src] in your mouth and press the injection button."))
else
- user.visible_message(SPAN_WARNING("[user] attempts to administer \the [src] to [M]..."),
- SPAN_NOTICE("You attempt to administer \the [src] to [M]..."))
- if (!do_after(user, 1 SECONDS, M))
- to_chat(user,SPAN_NOTICE("You and \the [M] need to be standing still in order to inject \the [src]."))
+ user.visible_message(SPAN_WARNING("[user] attempts to administer \the [src] to [H]..."),
+ SPAN_NOTICE("You attempt to administer \the [src] to [H]..."))
+ if (!do_after(user, 1 SECONDS, H))
+ to_chat(user,SPAN_NOTICE("You and \the [H] need to be standing still in order to inject \the [src]."))
return
- user.visible_message(SPAN_NOTICE("[user] sticks \the [src] in [M]'s mouth and presses the injection button."),
- SPAN_NOTICE("You stick \the [src] in [M]'s mouth and press the injection button."))
+ user.visible_message(SPAN_NOTICE("[user] sticks \the [src] in [H]'s mouth and presses the injection button."),
+ SPAN_NOTICE("You stick \the [src] in [H]'s mouth and press the injection button."))
- if(M.reagents)
+ if(H.reagents)
var/contained = stored_cartridge.reagentlist()
var/temp = stored_cartridge.reagents.get_temperature()
- var/trans = stored_cartridge.reagents.trans_to_mob(M, transfer_amount, CHEM_BREATHE, bypass_checks = TRUE)
- admin_inject_log(user, M, src, contained, temp, trans)
- playsound(M.loc, 'sound/items/stimpack.ogg', 50, 1)
+ var/trans = stored_cartridge.reagents.trans_to_mob(H, transfer_amount, CHEM_BREATHE, bypass_checks = TRUE)
+ admin_inject_log(user, H, src, contained, temp, trans)
+ playsound(H.loc, 'sound/items/stimpack.ogg', 50, 1)
if(eject_when_empty)
to_chat(user,SPAN_NOTICE("\The [stored_cartridge] automatically ejects from \the [src]."))
stored_cartridge.forceMove(user.loc)
diff --git a/code/modules/reagents/reagent_containers/pill.dm b/code/modules/reagents/reagent_containers/pill.dm
index d95286d6ce0..0e709a0e5ea 100644
--- a/code/modules/reagents/reagent_containers/pill.dm
+++ b/code/modules/reagents/reagent_containers/pill.dm
@@ -23,38 +23,38 @@
if(!icon_state)
icon_state = "pill[rand(1, 20)]"
-/obj/item/reagent_containers/pill/attack(mob/M as mob, mob/user as mob, def_zone)
+/obj/item/reagent_containers/pill/attack(mob/living/target_mob, mob/living/user, target_zone)
//TODO: replace with standard_feed_mob() call.
- if(M == user)
- if(!M.can_eat(src))
+ if(target_mob == user)
+ if(!target_mob.can_eat(src))
return
- M.visible_message("[M] swallows a pill.", SPAN_NOTICE("You swallow \the [src]."), null, 2)
+ target_mob.visible_message("[target_mob] swallows a pill.", SPAN_NOTICE("You swallow \the [src]."), null, 2)
if(reagents.total_volume)
- reagents.trans_to_mob(M, reagents.total_volume, CHEM_INGEST)
+ reagents.trans_to_mob(target_mob, reagents.total_volume, CHEM_INGEST)
qdel(src)
return 1
- else if(istype(M, /mob/living/carbon/human))
- if(!M.can_force_feed(user, src))
+ else if(istype(target_mob, /mob/living/carbon/human))
+ if(!target_mob.can_force_feed(user, src))
return
- user.visible_message(SPAN_WARNING("[user] attempts to force [M] to swallow \the [src]!"))
+ user.visible_message(SPAN_WARNING("[user] attempts to force [target_mob] to swallow \the [src]!"))
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
- if(!do_mob(user, M))
+ if(!do_mob(user, target_mob))
return
- user.visible_message(SPAN_WARNING("[user] forces [M] to swallow \the [src]."))
+ user.visible_message(SPAN_WARNING("[user] forces [target_mob] to swallow \the [src]."))
var/contained = reagentlist()
- M.attack_log +="\[[time_stamp()]\] Has been fed [name] by [key_name(user)] Reagents: [contained]"
- user.attack_log += "\[[time_stamp()]\] Fed [name] to [key_name(M)] Reagents: [contained]"
- msg_admin_attack("[key_name_admin(user)] fed [key_name_admin(M)] with [name] Reagents: [contained] (INTENT: [uppertext(user.a_intent)]) (JMP)",ckey=key_name(user),ckey_target=key_name(M))
+ target_mob.attack_log +="\[[time_stamp()]\] Has been fed [name] by [key_name(user)] Reagents: [contained]"
+ user.attack_log += "\[[time_stamp()]\] Fed [name] to [key_name(target_mob)] Reagents: [contained]"
+ msg_admin_attack("[key_name_admin(user)] fed [key_name_admin(target_mob)] with [name] Reagents: [contained] (INTENT: [uppertext(user.a_intent)]) (JMP)",ckey=key_name(user),ckey_target=key_name(target_mob))
if(reagents.total_volume)
- reagents.trans_to_mob(M, reagents.total_volume, CHEM_INGEST)
+ reagents.trans_to_mob(target_mob, reagents.total_volume, CHEM_INGEST)
qdel(src)
return 1
diff --git a/code/modules/reagents/reagent_containers/tooth_paste.dm b/code/modules/reagents/reagent_containers/tooth_paste.dm
index 541d5e7bfb3..bff0e3c683c 100644
--- a/code/modules/reagents/reagent_containers/tooth_paste.dm
+++ b/code/modules/reagents/reagent_containers/tooth_paste.dm
@@ -61,24 +61,24 @@
if(!trans_dest && !user.loc)
return
-/obj/item/reagent_containers/toothbrush/attack(atom/target as obj|turf|area, mob/user as mob , flag)
- if(isliving(target))
- var/mob/living/M = target
+/obj/item/reagent_containers/toothbrush/attack(mob/living/target_mob, mob/living/user, target_zone)
+ if(isliving(target_mob))
+ var/mob/living/M = target_mob
if(ishuman(M))
if(!reagents.total_volume)
to_chat(user, SPAN_WARNING("The [initial(name)] is dry!"))
else if(reagents.total_volume)
if(user.zone_sel.selecting == BP_MOUTH && !(M.wear_mask && M.wear_mask.item_flags & ITEM_FLAG_AIRTIGHT))
user.do_attack_animation(src)
- user.visible_message(SPAN_WARNING("[user] is trying to brush \the [target]'s teeth \the [src]!"))
+ user.visible_message(SPAN_WARNING("[user] is trying to brush \the [target_mob]'s teeth \the [src]!"))
playsound(loc, 'sound/effects/toothbrush.ogg', 15, 1)
if(do_after(user, 30))
- user.visible_message(SPAN_WARNING("[user] has brushed \the [target]'s teeth with \the [src]!"))
+ user.visible_message(SPAN_WARNING("[user] has brushed \the [target_mob]'s teeth with \the [src]!"))
- reagents.trans_to_mob(target, amount_per_transfer_from_this, CHEM_BREATHE)
+ reagents.trans_to_mob(target_mob, amount_per_transfer_from_this, CHEM_BREATHE)
update_icon()
else
- wipe_down(target, user)
+ wipe_down(target_mob, user)
return
return ..()
diff --git a/code/modules/research/xenoarchaeology/chemistry.dm b/code/modules/research/xenoarchaeology/chemistry.dm
index d19b940afdd..849418107b9 100644
--- a/code/modules/research/xenoarchaeology/chemistry.dm
+++ b/code/modules/research/xenoarchaeology/chemistry.dm
@@ -13,7 +13,7 @@
volume = 2
atom_flags = ATOM_FLAG_OPEN_CONTAINER
-/obj/item/reagent_containers/glass/solution_tray/attackby(obj/item/attacking_item, mob/living/user)
+/obj/item/reagent_containers/glass/solution_tray/attackby(obj/item/attacking_item, mob/user, params)
if(attacking_item.ispen())
var/new_label = sanitizeSafe( tgui_input_text(user, "What should the new label be?", "Label solution tray", max_length = MAX_NAME_LEN), MAX_NAME_LEN )
if(new_label)
diff --git a/code/modules/research/xenoarchaeology/tools/ano_device_battery.dm b/code/modules/research/xenoarchaeology/tools/ano_device_battery.dm
index f4d09e96fc7..12459ac0319 100644
--- a/code/modules/research/xenoarchaeology/tools/ano_device_battery.dm
+++ b/code/modules/research/xenoarchaeology/tools/ano_device_battery.dm
@@ -202,22 +202,22 @@
STOP_PROCESSING(SSprocessing, src)
return ..()
-/obj/item/anodevice/attack(mob/living/M as mob, mob/living/user as mob, def_zone)
- if (!istype(M))
+/obj/item/anodevice/attack(mob/living/target_mob, mob/living/user, target_zone)
+ if (!istype(target_mob))
return
if(activated && inserted_battery.battery_effect.effect == EFFECT_TOUCH && !isnull(inserted_battery))
- inserted_battery.battery_effect.DoEffectTouch(M)
+ inserted_battery.battery_effect.DoEffectTouch(target_mob)
inserted_battery.use_power(energy_consumed_on_touch)
- user.visible_message(SPAN_NOTICE("[user] taps [M] with [src], and it shudders on contact."))
+ user.visible_message(SPAN_NOTICE("[user] taps [target_mob] with [src], and it shudders on contact."))
else
- user.visible_message(SPAN_NOTICE("[user] taps [M] with [src], but nothing happens."))
+ user.visible_message(SPAN_NOTICE("[user] taps [target_mob] with [src], but nothing happens."))
//admin logging
- user.lastattacked = M
- M.lastattacker = user
+ user.lastattacked = target_mob
+ target_mob.lastattacker = user
if(inserted_battery.battery_effect)
- user.attack_log += "\[[time_stamp()]\] Tapped [M.name] ([M.ckey]) with [name] (EFFECT: [inserted_battery.battery_effect.effecttype])"
- M.attack_log += "\[[time_stamp()]\] Tapped by [user.name] ([user.ckey]) with [name] (EFFECT: [inserted_battery.battery_effect.effecttype])"
- msg_admin_attack("[key_name_admin(user)] tapped [key_name_admin(M)] with [name] (EFFECT: [inserted_battery.battery_effect.effecttype]) (JMP)",ckey=key_name(user),ckey_target=key_name(M) )
+ user.attack_log += "\[[time_stamp()]\] Tapped [target_mob.name] ([target_mob.ckey]) with [name] (EFFECT: [inserted_battery.battery_effect.effecttype])"
+ target_mob.attack_log += "\[[time_stamp()]\] Tapped by [user.name] ([user.ckey]) with [name] (EFFECT: [inserted_battery.battery_effect.effecttype])"
+ msg_admin_attack("[key_name_admin(user)] tapped [key_name_admin(target_mob)] with [name] (EFFECT: [inserted_battery.battery_effect.effecttype]) (JMP)",ckey=key_name(user),ckey_target=key_name(target_mob) )
diff --git a/html/changelogs/fluffyghost-attackrefactor.yml b/html/changelogs/fluffyghost-attackrefactor.yml
new file mode 100644
index 00000000000..c9efbd8df67
--- /dev/null
+++ b/html/changelogs/fluffyghost-attackrefactor.yml
@@ -0,0 +1,62 @@
+################################
+# Example Changelog File
+#
+# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
+#
+# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
+# When it is, any changes listed below will disappear.
+#
+# Valid Prefixes:
+# bugfix
+# - (fixes bugs)
+# wip
+# - (work in progress)
+# qol
+# - (quality of life)
+# soundadd
+# - (adds a sound)
+# sounddel
+# - (removes a sound)
+# rscadd
+# - (adds a feature)
+# rscdel
+# - (removes a feature)
+# imageadd
+# - (adds an image or sprite)
+# imagedel
+# - (removes an image or sprite)
+# spellcheck
+# - (fixes spelling or grammar)
+# experiment
+# - (experimental change)
+# balance
+# - (balance changes)
+# code_imp
+# - (misc internal code change)
+# refactor
+# - (refactors code)
+# config
+# - (makes a change to the config files)
+# admin
+# - (makes changes to administrator tools)
+# server
+# - (miscellaneous changes to server)
+#################################
+
+# Your name.
+author: FluffyGhost
+
+# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
+delete-after: True
+
+# Any changes you've made. See valid prefix list above.
+# INDENT WITH TWO SPACES. NOT TABS. SPACES.
+# SCREW THIS UP AND IT WON'T WORK.
+# Also, this gets changed to [] after reading. Just remove the brackets when you add new shit.
+# Please surround your changes in double quotes ("). It works without them, but if you use certain characters it screws up compiling. The quotes will not show up in the changelog.
+changes:
+ - refactor: "Refactored the attack proc signature."
+ - code_imp: "Added signals and components for the attack proc."
+ - code_imp: "Added signals and components for the attackby proc."
+ - code_imp: "Adjusted some leftover attackby procs signatures."
+ - server: "Added grep test to ensure people don't keep adding attack/attackby procs with the wrong signature."
diff --git a/tools/ci/check_grep.sh b/tools/ci/check_grep.sh
index 16c59db6299..c5e629646fe 100755
--- a/tools/ci/check_grep.sh
+++ b/tools/ci/check_grep.sh
@@ -153,6 +153,51 @@ else
echo "PASS: No builtin calls to the text proc were found" >> code_error.log
fi
+# Check that only the expected amount of raw ref proc calls are present
+echo "Verifying no raw ref proc calls are being added" >> code_error.log
+RAW_REF_BUILTIN_PROCS=`grep -r --include \*.dm -P --regexp='[^\w_]ref[\(\[]' | wc -l`
+if [[ $RAW_REF_BUILTIN_PROCS -ne 3 ]]; then
+ ERROR_COUNT=$(($ERROR_COUNT+1))
+ echo "FAIL: Found new raw ref proc calls in code" >> code_error.log
+else
+ echo "PASS: Only the expected number of raw ref proc calls were found" >> code_error.log
+fi
+
+# Check that the text proc is not being used
+echo "Verifying no built in text proc calls are being added" >> code_error.log
+BUILTIN_TEXT_PROC_CALLS=`grep -r --include \*.dm -P --regexp='[^\w_\/\.]text\('`
+if [[ $BUILTIN_TEXT_PROC_CALLS != '' ]]; then
+ ERROR_COUNT=$(($ERROR_COUNT+1))
+ echo "FAIL: Found builtin calls to the text proc, use string interpolation instead:" >> code_error.log
+ echo $BUILTIN_TEXT_PROC_CALLS >> code_error.log
+else
+ echo "PASS: No builtin calls to the text proc were found" >> code_error.log
+fi
+
+##########################################################
+# Proc signatures are respected, for general procs
+##########################################################
+echo "Verifying proc signatures are respected" >> code_error.log
+
+SIGNATURES_TO_LOOK_FOR='\/attackby\((?!\))(?!obj\/item\/attacking_item,\s*mob\/user(?!,(?!\s*params))).*\)'
+
+# Append the signatures like this after the first one: SIGNATURES_TO_LOOK_FOR+='|/proc/ref2'
+SIGNATURES_TO_LOOK_FOR+='|\/attack\((?!\))(?!mob\/living\/target_mob,\s*mob\/living\/user(?!,(?!\s*target_zone))).*\)'
+
+PROC_SIGNATURES_NOT_RESPECTED=`grep -r --include \*.dm -P --regexp=$SIGNATURES_TO_LOOK_FOR`
+PROC_SIGNATURES_NOT_RESPECTED_COUNT=`echo -n $PROC_SIGNATURES_NOT_RESPECTED | wc -l`
+if [[ $PROC_SIGNATURES_NOT_RESPECTED_COUNT -ne 0 ]]; then
+ ERROR_COUNT=$(($ERROR_COUNT+1))
+ echo "FAIL: Proc signatures are not respected in code!" >> code_error.log
+ echo $PROC_SIGNATURES_NOT_RESPECTED >> code_error.log
+else
+ echo "PASS: All proc signatures are respected in code" >> code_error.log
+fi
+
+
+#######################################
+# Output the result of the checks
+#######################################
echo "Found $ERROR_COUNT errors while performing code check"
if [ $ERROR_COUNT -ne 0 ]; then