diff --git a/aurorastation.dme b/aurorastation.dme
index aa520a3df8f..f6a21121300 100644
--- a/aurorastation.dme
+++ b/aurorastation.dme
@@ -3519,6 +3519,7 @@
#include "code\unit_tests\gamemode_tests.dm"
#include "code\unit_tests\icon_tests.dm"
#include "code\unit_tests\language_test.dm"
+#include "code\unit_tests\loadout_tests.dm"
#include "code\unit_tests\map_tests.dm"
#include "code\unit_tests\mob_tests.dm"
#include "code\unit_tests\object_tests.dm"
diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm
index 805fa87b089..33bb17cb4e3 100644
--- a/code/_onclick/click.dm
+++ b/code/_onclick/click.dm
@@ -50,19 +50,19 @@
set_dir(get_dir(src, over_object))
gun.Fire(get_turf(over_object), src, params, (get_dist(over_object, src) <= 1), FALSE)
-/*
- Standard mob ClickOn()
- Handles exceptions: Buildmode, middle click, modified clicks, mech actions
-
- After that, mostly just check your state, check whether you're holding an item,
- check whether you're adjacent to the target, then pass off the click to whoever
- is recieving it.
- The most common are:
- * mob/UnarmedAttack(atom,adjacent) - used here only when adjacent, with no item in hand; in the case of humans, checks gloves
- * atom/attackby(item,user) - used only when adjacent, return TRUE to prevent further afterattack procs being called
- * item/afterattack(atom,user,adjacent,params) - used both ranged and adjacent
- * mob/RangedAttack(atom,params) - used only ranged, only used for tk and laser eyes but could be changed
-*/
+/**
+ * Standard mob ClickOn()
+ * Handles exceptions: Buildmode, middle click, modified clicks, mech actions
+ *
+ * After that, mostly just check your state, check whether you're holding an item,
+ * check whether you're adjacent to the target, then pass off the click to whoever
+ * is receiving it.
+ * The most common are:
+ * * [mob/proc/UnarmedAttack] (atom,adjacent) - used here only when adjacent, with no item in hand; in the case of humans, checks gloves
+ * * [atom/proc/attackby] (item,user) - used only when adjacent
+ * * [obj/item/proc/afterattack] (atom,user,adjacent,params) - used both ranged and adjacent
+ * * [mob/proc/RangedAttack] (atom,modifiers) - used only ranged, only used for tk and laser eyes but could be changed
+ */
/mob/proc/ClickOn(var/atom/A, var/params)
if(world.time <= next_click) // Hard check, before anything else, to avoid crashing
diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm
index 15fc75a123a..1b56771b3e0 100644
--- a/code/_onclick/item_attack.dm
+++ b/code/_onclick/item_attack.dm
@@ -29,12 +29,23 @@ avoid code duplication. This includes items that may sometimes act as a standard
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.
-/atom/proc/attackby(obj/item/W, mob/user, var/click_parameters)
- return
+/**
+ * Called on an object being hit by an item
+ *
+ * Returns `TRUE` if all desired actions are resolved from that attack
+ *
+ * Returning `TRUE` prevents `afterattack()` from being called
+ *
+ * * attacking_item - The item hitting the atom
+ * * user - The wielder of this item
+ * * params - Click params such as alt/shift etc
+ */
+/atom/proc/attackby(obj/item/attacking_item, mob/user, params)
+ return FALSE
-/atom/movable/attackby(obj/item/W, mob/user)
- if(!(W.item_flags & ITEM_FLAG_NO_BLUDGEON))
- visible_message("[src] has been hit by [user] with [W].")
+/atom/movable/attackby(obj/item/attacking_item, mob/user, params)
+ 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)
if(!ismob(user))
diff --git a/code/defines/obj/weapon.dm b/code/defines/obj/weapon.dm
index 92647a0effe..d54242a6b9f 100644
--- a/code/defines/obj/weapon.dm
+++ b/code/defines/obj/weapon.dm
@@ -263,13 +263,14 @@
else
..()
-/obj/item/cane/concealed/attackby(var/obj/item/canesword/W, var/mob/user)
- if(!src.concealed_blade && istype(W))
- user.visible_message("[user] has sheathed \a [W] into [user.get_pronoun("his")] [src]!", "You sheathe \the [W] into \the [src].")
+/obj/item/cane/concealed/attackby(obj/item/attacking_item, mob/user)
+ var/obj/item/canesword/attacking_canesword = attacking_item
+ if(!src.concealed_blade && istype(attacking_canesword))
+ user.visible_message("[user] has sheathed \a [attacking_canesword] into [user.get_pronoun("his")] [src]!", "You sheathe \the [attacking_canesword] into \the [src].")
playsound(user.loc, 'sound/weapons/holster/sheathin.ogg', 50, 1)
- user.drop_from_inventory(W)
- W.forceMove(src)
- src.concealed_blade = W
+ user.drop_from_inventory(attacking_canesword)
+ attacking_canesword.forceMove(src)
+ src.concealed_blade = attacking_canesword
update_icon()
return TRUE
else
@@ -450,8 +451,8 @@
desc = "Heavy-duty switching circuits for power control."
matter = list(DEFAULT_WALL_MATERIAL = 50, MATERIAL_GLASS = 50)
-/obj/item/module/power_control/attackby(obj/item/W, mob/user)
- if(W.ismultitool())
+/obj/item/module/power_control/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.ismultitool())
var/obj/item/circuitboard/ghettosmes/new_circuit = new /obj/item/circuitboard/ghettosmes(get_turf(src))
to_chat(user, SPAN_NOTICE("You modify \the [src] into a makeshift PSU circuitboard."))
qdel(src)
@@ -521,10 +522,10 @@
icon = 'icons/obj/stock_parts.dmi'
icon_state = "neuralbroke"
-/obj/item/neuralbroke/attackby(obj/item/W as obj, mob/user as mob)
- if(W.isscrewdriver())
+/obj/item/neuralbroke/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.isscrewdriver())
new /obj/item/device/encryptionkey/hivenet(user.loc)
- playsound(src.loc, W.usesound, 50, 1)
+ playsound(src.loc, attacking_item.usesound, 50, 1)
to_chat(user, "You bypass the fried security chip and extract the encryption key.")
to_chat(user, "The fried neural socket crumbles away like dust.")
qdel(src)
diff --git a/code/game/dna/dna_modifier.dm b/code/game/dna/dna_modifier.dm
index 963af0795bf..ff141fb576f 100644
--- a/code/game/dna/dna_modifier.dm
+++ b/code/game/dna/dna_modifier.dm
@@ -107,19 +107,19 @@
src.add_fingerprint(usr)
return
-/obj/machinery/dna_scannernew/attackby(var/obj/item/item as obj, var/mob/user as mob)
- if(istype(item, /obj/item/reagent_containers/glass))
+/obj/machinery/dna_scannernew/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/reagent_containers/glass))
if(beaker)
to_chat(user, "A beaker is already loaded into the machine.")
return TRUE
- beaker = item
- user.drop_from_inventory(item,src)
- user.visible_message("\The [user] adds \a [item] to \the [src]!", "You add \a [item] to \the [src]!")
+ beaker = attacking_item
+ user.drop_from_inventory(attacking_item,src)
+ user.visible_message("\The [user] adds \a [attacking_item] to \the [src]!", "You add \a [attacking_item] to \the [src]!")
return TRUE
- else if (!istype(item, /obj/item/grab))
+ else if (!istype(attacking_item, /obj/item/grab))
return
- var/obj/item/grab/G = item
+ var/obj/item/grab/G = attacking_item
if (!ismob(G.affecting))
return TRUE
if (src.occupant)
@@ -245,12 +245,12 @@
. = ..()
-/obj/machinery/computer/scan_consolenew/attackby(obj/item/I as obj, mob/user as mob)
- if (istype(I, /obj/item/disk/data)) //INSERT SOME diskS
+/obj/machinery/computer/scan_consolenew/attackby(obj/item/attacking_item, mob/user)
+ if (istype(attacking_item, /obj/item/disk/data)) //INSERT SOME diskS
if (!src.disk)
- user.drop_from_inventory(I,src)
- src.disk = I
- to_chat(user, "You insert [I].")
+ user.drop_from_inventory(attacking_item, src)
+ src.disk = attacking_item
+ to_chat(user, "You insert [attacking_item].")
SSnanoui.update_uis(src) // update all UIs attached to src
return TRUE
else
diff --git a/code/game/gamemodes/cult/items/sword.dm b/code/game/gamemodes/cult/items/sword.dm
index 7e7214198f5..3aa5b4ad445 100644
--- a/code/game/gamemodes/cult/items/sword.dm
+++ b/code/game/gamemodes/cult/items/sword.dm
@@ -57,9 +57,9 @@
to_chat(user, SPAN_CULT("An overwhelming feeling of dread comes over you as you pick up \the [src]. It would be wise to be rid of this blade quickly."))
user.make_dizzy(120)
-/obj/item/melee/cultblade/attackby(obj/item/I, mob/user)
+/obj/item/melee/cultblade/attackby(obj/item/attacking_item, mob/user)
..()
- if(istype(I, /obj/item/nullrod))
+ if(istype(attacking_item, /obj/item/nullrod))
to_chat(user, SPAN_NOTICE("You cleanse \the [src] of taint, restoring the blade to its original state."))
var/obj/item/material/sword/blade = new(get_turf(src))
blade.force = 15
diff --git a/code/game/gamemodes/cult/runes/rune.dm b/code/game/gamemodes/cult/runes/rune.dm
index 02cc98fb6cc..2845e6dc6d3 100644
--- a/code/game/gamemodes/cult/runes/rune.dm
+++ b/code/game/gamemodes/cult/runes/rune.dm
@@ -31,12 +31,12 @@
else
. += rune.get_normal_fluff_text()
-/obj/effect/rune/attackby(obj/I, mob/user)
- if(istype(I, /obj/item/book/tome) && iscultist(user))
- rune.do_tome_action(user, I)
+/obj/effect/rune/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/book/tome) && iscultist(user))
+ rune.do_tome_action(user, attacking_item)
return TRUE
- else if(istype(I, /obj/item/nullrod))
- to_chat(user, SPAN_NOTICE("You disrupt the vile magic with the deadening field of \the [I]!"))
+ else if(istype(attacking_item, /obj/item/nullrod))
+ to_chat(user, SPAN_NOTICE("You disrupt the vile magic with the deadening field of \the [attacking_item]!"))
qdel(src)
return TRUE
diff --git a/code/game/gamemodes/cult/structures/desk.dm b/code/game/gamemodes/cult/structures/desk.dm
index 6e0e388f96f..e8a1e30e264 100644
--- a/code/game/gamemodes/cult/structures/desk.dm
+++ b/code/game/gamemodes/cult/structures/desk.dm
@@ -4,9 +4,9 @@
desc_antag = "A desk covered with the scriptures of Nar-Sie, The One Who Sees, The Geometer of Blood. Most of them are beyond your current comprehension. If you are a cultist, you could click on this desk with any non-unique book to turn it into a tome."
icon_state = "tomealtar"
-/obj/structure/cult/tome/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/book) && iscultist(user))
- var/obj/item/book/B = W
+/obj/structure/cult/tome/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/book) && iscultist(user))
+ var/obj/item/book/B = attacking_item
if(!B.unique)
var/cult_item = B.cultify()
user.put_in_hands(cult_item)
diff --git a/code/game/gamemodes/cult/structures/forge.dm b/code/game/gamemodes/cult/structures/forge.dm
index 0219abaf239..b686682bec1 100644
--- a/code/game/gamemodes/cult/structures/forge.dm
+++ b/code/game/gamemodes/cult/structures/forge.dm
@@ -4,10 +4,10 @@
desc_antag = "A forge used in crafting the unholy weapons used by the armies of Nar-Sie. This is a powerful forge. If you are a cultist, you can click on this with an item in-hand to cultify it. Some items may burn in the process, but some can be forged into better variants."
icon_state = "forge"
-/obj/structure/cult/forge/attackby(obj/item/W, mob/user)
+/obj/structure/cult/forge/attackby(obj/item/attacking_item, mob/user)
if(iscultist(user))
- var/stored_message = "You cast \the [W] into the forge, where it rapidly changes form. In a flash, you see it reappear on your person."
- var/cult_item = W.cultify(TRUE)
+ var/stored_message = "You cast \the [attacking_item] into the forge, where it rapidly changes form. In a flash, you see it reappear on your person."
+ var/cult_item = attacking_item.cultify(TRUE)
if(isnull(cult_item))
to_chat(user, SPAN_WARNING("You get the idea that you can't reforge this."))
else if(istype(cult_item, /obj/item))
diff --git a/code/game/gamemodes/cult/structures/gateway.dm b/code/game/gamemodes/cult/structures/gateway.dm
index 2f26390fb76..837ff889163 100644
--- a/code/game/gamemodes/cult/structures/gateway.dm
+++ b/code/game/gamemodes/cult/structures/gateway.dm
@@ -44,9 +44,9 @@
new thing(src.loc)
qdel(src)
-/obj/effect/gateway/attackby(var/obj/item/I, var/mob/user)
+/obj/effect/gateway/attackby(obj/item/attacking_item, mob/user)
..()
- if(istype(I, /obj/item/nullrod))
- to_chat(user, "You touch \the [src] with \the [I], closing the path to the otherworld.")
+ if(istype(attacking_item, /obj/item/nullrod))
+ to_chat(user, "You touch \the [src] with \the [attacking_item], closing the path to the otherworld.")
qdel(src)
return TRUE
diff --git a/code/game/gamemodes/cult/structures/pylon.dm b/code/game/gamemodes/cult/structures/pylon.dm
index c59e6d69033..4523ca6724e 100644
--- a/code/game/gamemodes/cult/structures/pylon.dm
+++ b/code/game/gamemodes/cult/structures/pylon.dm
@@ -346,14 +346,14 @@
return
attackpylon(user, damage, user)
-/obj/structure/cult/pylon/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/holder))
- var/obj/item/holder/H = W
+/obj/structure/cult/pylon/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/holder))
+ var/obj/item/holder/H = attacking_item
if(H.contained)
present_sacrifice(user, H.contained)
return TRUE
- attackpylon(user, W.force, W)
+ attackpylon(user, attacking_item.force, attacking_item)
//Mousedrop so that constructs can drag rats out of maintenance to make turrets
/obj/structure/cult/pylon/MouseDrop_T(var/atom/movable/C, mob/user)
diff --git a/code/game/gamemodes/endgame/supermatter_cascade/blob.dm b/code/game/gamemodes/endgame/supermatter_cascade/blob.dm
index 1ebaf0d0da3..c1a17a7df3a 100644
--- a/code/game/gamemodes/endgame/supermatter_cascade/blob.dm
+++ b/code/game/gamemodes/endgame/supermatter_cascade/blob.dm
@@ -87,15 +87,15 @@
Consume(user)
-/turf/unsimulated/wall/supermatter/attackby(obj/item/W as obj, mob/living/user as mob)
- user.visible_message("\The [user] touches \a [W] to \the [src] as a silence fills the room...",\
- "You touch \the [W] to \the [src] when everything suddenly goes silent.\"\n\The [W] flashes into dust as you flinch away from \the [src].",\
+/turf/unsimulated/wall/supermatter/attackby(obj/item/attacking_item, mob/living/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.")
playsound(src, 'sound/effects/supermatter.ogg', 50, 1)
- user.drop_from_inventory(W,src)
- Consume(W)
+ user.drop_from_inventory(attacking_item,src)
+ Consume(attacking_item)
return TRUE
diff --git a/code/game/gamemodes/meteor/meteors.dm b/code/game/gamemodes/meteor/meteors.dm
index 23a910294f9..6df4447fce7 100644
--- a/code/game/gamemodes/meteor/meteors.dm
+++ b/code/game/gamemodes/meteor/meteors.dm
@@ -120,8 +120,8 @@
qdel(src)
return
-/obj/effect/meteor/attackby(obj/item/W as obj, mob/user as mob)
- if(istype(W, /obj/item/pickaxe))
+/obj/effect/meteor/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/pickaxe))
qdel(src)
return TRUE
return ..()
diff --git a/code/game/gamemodes/technomancer/catalog.dm b/code/game/gamemodes/technomancer/catalog.dm
index 3dd3e7261dc..c62f811a66b 100644
--- a/code/game/gamemodes/technomancer/catalog.dm
+++ b/code/game/gamemodes/technomancer/catalog.dm
@@ -364,23 +364,23 @@ var/list/all_technomancer_assistance = typesof(/datum/technomancer/assistance) -
break
attack_self(H)
-/obj/item/technomancer_catalog/attackby(var/atom/movable/AM, var/mob/user)
+/obj/item/technomancer_catalog/attackby(obj/item/attacking_item, mob/user)
var/turf/T = get_turf(user)
if(T.z in SSatlas.current_map.player_levels)
to_chat(user, "You can only refund at your base, it's too late now!")
return TRUE
for(var/datum/technomancer/equipment/E in equipment_instances + assistance_instances)
- if(AM.type == E.obj_path) // We got a match.
+ if(attacking_item.type == E.obj_path) // We got a match.
if(budget + E.cost > max_budget)
to_chat(user, "\The [src] will not allow you to overflow your maximum budget by refunding that.")
return TRUE
else
budget = budget + E.cost
- to_chat(user, "You've refunded \the [AM].")
+ to_chat(user, "You've refunded \the [attacking_item].")
// We sadly need to do special stuff here or else people who refund cores with spells will lose points permanently.
- if(istype(AM, /obj/item/technomancer_core))
- var/obj/item/technomancer_core/core = AM
+ if(istype(attacking_item, /obj/item/technomancer_core))
+ var/obj/item/technomancer_core/core = attacking_item
for(var/obj/spellbutton/technomancer/spell in core.spells)
for(var/datum/technomancer/spell/spell_datum in spell_instances)
if(spell_datum.obj_path == spell.spellpath)
@@ -388,7 +388,7 @@ var/list/all_technomancer_assistance = typesof(/datum/technomancer/assistance) -
to_chat(user, "[spell.name] was inside \the [core], and was refunded.")
core.remove_spell(spell)
break
- qdel(AM)
+ qdel(attacking_item)
return TRUE
- to_chat(user, "\The [src] is unable to refund \the [AM].")
+ to_chat(user, "\The [src] is unable to refund \the [attacking_item].")
diff --git a/code/game/gamemodes/technomancer/spell_objs.dm b/code/game/gamemodes/technomancer/spell_objs.dm
index 4375b801eaf..8be3bae544a 100644
--- a/code/game/gamemodes/technomancer/spell_objs.dm
+++ b/code/game/gamemodes/technomancer/spell_objs.dm
@@ -276,9 +276,9 @@
// Proc: attackby()
// Parameters: 2 (W - the item this spell object is hitting, user - the technomancer who clicked the other object)
// Description: Tries to combine the spells, if W is a spell, and has CHROMATIC aspect.
-/obj/item/spell/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/spell))
- var/obj/item/spell/spell = W
+/obj/item/spell/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/spell))
+ var/obj/item/spell/spell = attacking_item
if(run_checks() & (cast_methods & CAST_COMBINE))
spell.on_combine_cast(src, user)
return TRUE
diff --git a/code/game/machinery/CableLayer.dm b/code/game/machinery/CableLayer.dm
index 273c17cdda2..aebefd2808d 100644
--- a/code/game/machinery/CableLayer.dm
+++ b/code/game/machinery/CableLayer.dm
@@ -26,16 +26,16 @@
user.visible_message("\The [user] [!on ? "de" : ""]activates \the [src].", SPAN_NOTICE("You switch \the [src] [on ? "on" : "off"]."))
return
-/obj/machinery/cablelayer/attackby(var/obj/item/O, var/mob/user)
- if(O.iscoil())
- var/result = load_cable(O)
+/obj/machinery/cablelayer/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.iscoil())
+ var/result = load_cable(attacking_item)
if(!result)
to_chat(user, SPAN_WARNING("\The [src]'s cable reel is full."))
else
to_chat(user, SPAN_NOTICE("You load [result] lengths of cable into \the [src]."))
return TRUE
- if(O.iswirecutter())
+ if(attacking_item.iswirecutter())
if(cable && cable.amount)
var/m = round(input(usr,"Please specify the length of cable to cut.", "Cut Cable",min(cable.amount,30)) as num, 1)
m = min(m, cable.amount)
@@ -49,11 +49,11 @@
to_chat(user, SPAN_WARNING("There's no more cable on the reel."))
return TRUE
- if(O.ismultitool())
+ if(attacking_item.ismultitool())
if(!cable)
to_chat(user, SPAN_WARNING("\The [src] doesn't have any cable loaded!"))
return TRUE
- return cable.attackby(O, user)
+ return cable.attackby(attacking_item, user)
/obj/machinery/cablelayer/get_examine_text(mob/user, distance, is_adjacent, infix, suffix)
. = ..()
diff --git a/code/game/machinery/Sleeper.dm b/code/game/machinery/Sleeper.dm
index 6f60b33ea30..ee203619fb4 100644
--- a/code/game/machinery/Sleeper.dm
+++ b/code/game/machinery/Sleeper.dm
@@ -224,20 +224,20 @@
return
return attack_hand(user)
-/obj/machinery/sleeper/attackby(var/obj/item/I, var/mob/user)
- if(!istype(I, /obj/item/forensics))
+/obj/machinery/sleeper/attackby(obj/item/attacking_item, mob/user)
+ if(!istype(attacking_item, /obj/item/forensics))
add_fingerprint(user)
- if(istype(I, /obj/item/reagent_containers/glass))
+ if(istype(attacking_item, /obj/item/reagent_containers/glass))
if(!beaker)
- beaker = I
- user.drop_from_inventory(I,src)
- user.visible_message("\The [user] adds \a [I] to \the [src].", "You add \a [I] to \the [src].")
+ beaker = attacking_item
+ user.drop_from_inventory(attacking_item, src)
+ user.visible_message("\The [user] adds \a [attacking_item] to \the [src].", "You add \a [attacking_item] to \the [src].")
else
to_chat(user, "\The [src] has a beaker already.")
return TRUE
- else if(istype(I, /obj/item/grab))
+ else if(istype(attacking_item, /obj/item/grab))
- var/obj/item/grab/G = I
+ var/obj/item/grab/G = attacking_item
var/mob/living/L = G.affecting
var/bucklestatus = L.bucklecheck(user)
if(!bucklestatus)
@@ -264,14 +264,14 @@
update_icon()
qdel(G)
return TRUE
- else if(I.isscrewdriver())
+ else if(attacking_item.isscrewdriver())
src.panel_open = !src.panel_open
to_chat(user, "You [src.panel_open ? "open" : "close"] the maintenance panel.")
cut_overlays()
if(src.panel_open)
add_overlay("[initial(icon_state)]-o")
return TRUE
- else if(default_part_replacement(user, I))
+ else if(default_part_replacement(user, attacking_item))
return TRUE
/obj/machinery/sleeper/MouseDrop_T(var/mob/target, var/mob/user)
diff --git a/code/game/machinery/ai_slipper.dm b/code/game/machinery/ai_slipper.dm
index 5d8988e564d..31b7556e21c 100644
--- a/code/game/machinery/ai_slipper.dm
+++ b/code/game/machinery/ai_slipper.dm
@@ -33,7 +33,7 @@
src.uses = uses
src.power_change()
-/obj/machinery/ai_slipper/attackby(obj/item/W, mob/user)
+/obj/machinery/ai_slipper/attackby(obj/item/attacking_item, mob/user)
if(stat & (NOPOWER|BROKEN))
return
if (istype(user, /mob/living/silicon))
diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm
index 0223ab761d4..37b3e2ab123 100644
--- a/code/game/machinery/alarm.dm
+++ b/code/game/machinery/alarm.dm
@@ -932,19 +932,19 @@ pixel_x = 10;
apply_mode()
return 1
-/obj/machinery/alarm/attackby(obj/item/W as obj, mob/user as mob)
- if(!istype(W, /obj/item/forensics))
+/obj/machinery/alarm/attackby(obj/item/attacking_item, mob/user)
+ if(!istype(attacking_item, /obj/item/forensics))
src.add_fingerprint(user)
switch(buildstage)
if(2)
- if(W.isscrewdriver()) // Opening that Air Alarm up.
+ if(attacking_item.isscrewdriver()) // Opening that Air Alarm up.
wiresexposed = !wiresexposed
to_chat(user, "You [wiresexposed ? "open" : "close"] the maintenance panel.")
update_icon()
return TRUE
- if (wiresexposed && W.iswirecutter())
+ if (wiresexposed && attacking_item.iswirecutter())
user.visible_message("[user] has cut the wires inside \the [src]!", "You cut the wires inside \the [src].")
playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1)
new/obj/item/stack/cable_coil(get_turf(src), 5)
@@ -952,7 +952,7 @@ pixel_x = 10;
update_icon()
return TRUE
- if (W.GetID())// trying to unlock the interface with an ID card
+ if (attacking_item.GetID())// trying to unlock the interface with an ID card
if(stat & (NOPOWER|BROKEN))
to_chat(user, "Nothing happens.")
return TRUE
@@ -965,8 +965,8 @@ pixel_x = 10;
return TRUE
if(1)
- if(W.iscoil())
- var/obj/item/stack/cable_coil/C = W
+ if(attacking_item.iscoil())
+ var/obj/item/stack/cable_coil/C = attacking_item
if (C.use(5))
to_chat(user, "You wire \the [src].")
buildstage = 2
@@ -977,9 +977,9 @@ pixel_x = 10;
to_chat(user, "You need 5 pieces of cable to do wire \the [src].")
return TRUE
- else if(W.iscrowbar())
+ else if(attacking_item.iscrowbar())
to_chat(user, "You start prying out the circuit.")
- if(W.use_tool(src, user, 20, volume = 50))
+ if(attacking_item.use_tool(src, user, 20, volume = 50))
to_chat(user, "You pry out the circuit!")
var/obj/item/airalarm_electronics/circuit = new /obj/item/airalarm_electronics()
circuit.forceMove(user.loc)
@@ -988,17 +988,17 @@ pixel_x = 10;
return TRUE
if(0)
- if(istype(W, /obj/item/airalarm_electronics))
+ if(istype(attacking_item, /obj/item/airalarm_electronics))
to_chat(user, "You insert the circuit!")
- qdel(W)
+ qdel(attacking_item)
buildstage = 1
update_icon()
return TRUE
- else if(W.iswrench())
+ else if(attacking_item.iswrench())
to_chat(user, "You remove the air alarm assembly from the wall!")
new /obj/item/frame/air_alarm(get_turf(user))
- playsound(src.loc, W.usesound, 50, 1)
+ playsound(src.loc, attacking_item.usesound, 50, 1)
qdel(src)
return TRUE
diff --git a/code/game/machinery/anti_bluespace.dm b/code/game/machinery/anti_bluespace.dm
index 5867b87dcf5..b1b65057c6f 100644
--- a/code/game/machinery/anti_bluespace.dm
+++ b/code/game/machinery/anti_bluespace.dm
@@ -64,11 +64,11 @@ var/global/list/bluespace_inhibitors
anchored = 0
update_icon()
-/obj/machinery/anti_bluespace/attackby(obj/item/W as obj, mob/user as mob)
+/obj/machinery/anti_bluespace/attackby(obj/item/attacking_item, mob/user)
if(user.a_intent == I_HURT)
- visible_message(SPAN_WARNING("\The [user] hits \the [src] with \the [W]!"))
+ visible_message(SPAN_WARNING("\The [user] hits \the [src] with \the [attacking_item]!"))
else
- visible_message(SPAN_NOTICE("\The [user] [pick("touches","pokes","prods")] \the [src] with \the [W]."))
+ visible_message(SPAN_NOTICE("\The [user] [pick("touches","pokes","prods")] \the [src] with \the [attacking_item]."))
if(prob(66))
return TRUE
diff --git a/code/game/machinery/atmoalter/canister.dm b/code/game/machinery/atmoalter/canister.dm
index 82a0609843f..79e402934fd 100644
--- a/code/game/machinery/atmoalter/canister.dm
+++ b/code/game/machinery/atmoalter/canister.dm
@@ -418,23 +418,24 @@ update_flag
log_open(admin)
valve_open = !valve_open
-/obj/machinery/portable_atmospherics/canister/attackby(var/obj/item/W as obj, var/mob/user as mob)
- if(istype(W, /obj/item/mecha_equipment/clamp))
+/obj/machinery/portable_atmospherics/canister/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/mecha_equipment/clamp))
return
- if(!W.iswrench() && !is_type_in_list(W, list(/obj/item/tank, /obj/item/device/analyzer, /obj/item/modular_computer)) && !issignaler(W) && !(W.iswirecutter() && signaler))
- if(W.item_flags & ITEM_FLAG_NO_BLUDGEON)
+ if(!attacking_item.iswrench() && !is_type_in_list(attacking_item, list(/obj/item/tank, /obj/item/device/analyzer, /obj/item/modular_computer)) && !issignaler(attacking_item) && !(attacking_item.iswirecutter() && signaler))
+ if(attacking_item.item_flags & ITEM_FLAG_NO_BLUDGEON)
return TRUE
- visible_message(SPAN_WARNING("\The [user] hits \the [src] with \the [W]!"), SPAN_NOTICE("You hit \the [src] with \the [W]."))
- user.do_attack_animation(src, W)
+ visible_message(SPAN_WARNING("\The [user] hits \the [src] with \the [attacking_item]!"), SPAN_NOTICE("You hit \the [src] with \the [attacking_item]."))
+ user.do_attack_animation(src, attacking_item)
playsound(src, 'sound/weapons/smash.ogg', 60, 1)
- src.health -= W.force
- if(!istype(W, /obj/item/forensics))
+ src.health -= attacking_item.force
+ if(!istype(attacking_item, /obj/item/forensics))
src.add_fingerprint(user)
healthcheck()
return TRUE
- if(istype(user, /mob/living/silicon/robot) && istype(W, /obj/item/tank/jetpack))
- var/datum/gas_mixture/thejetpack = W:air_contents
+ if(istype(user, /mob/living/silicon/robot) && istype(attacking_item, /obj/item/tank/jetpack))
+ var/obj/item/tank/jetpack/jetpack = attacking_item
+ var/datum/gas_mixture/thejetpack = jetpack.air_contents
var/env_pressure = thejetpack.return_pressure()
var/pressure_delta = min(10*ONE_ATMOSPHERE - env_pressure, (air_contents.return_pressure() - env_pressure)/2)
//Can not have a pressure delta that would cause environment pressure > tank pressure
diff --git a/code/game/machinery/atmoalter/meter.dm b/code/game/machinery/atmoalter/meter.dm
index 14caa958dc8..15fa7abc5cf 100644
--- a/code/game/machinery/atmoalter/meter.dm
+++ b/code/game/machinery/atmoalter/meter.dm
@@ -92,11 +92,11 @@
return ..()
-/obj/machinery/meter/attackby(var/obj/item/W as obj, var/mob/user as mob)
- if (!W.iswrench())
+/obj/machinery/meter/attackby(obj/item/attacking_item, mob/user)
+ if (!attacking_item.iswrench())
return ..()
to_chat(user, "You begin to unfasten \the [src]...")
- if(W.use_tool(src, user, 40, volume = 50))
+ if(attacking_item.use_tool(src, user, 40, volume = 50))
user.visible_message( \
"\The [user] unfastens \the [src].", \
"You have unfastened \the [src].", \
@@ -112,5 +112,5 @@
if (!target)
src.target = loc
-/obj/machinery/meter/turf/attackby(var/obj/item/W as obj, var/mob/user as mob)
+/obj/machinery/meter/turf/attackby(obj/item/attacking_item, mob/user)
return
diff --git a/code/game/machinery/atmoalter/portable_atmospherics.dm b/code/game/machinery/atmoalter/portable_atmospherics.dm
index 7cd8d449816..d85988a8610 100644
--- a/code/game/machinery/atmoalter/portable_atmospherics.dm
+++ b/code/game/machinery/atmoalter/portable_atmospherics.dm
@@ -104,22 +104,22 @@
if (network)
network.update = 1
-/obj/machinery/portable_atmospherics/attackby(var/obj/item/W as obj, var/mob/user as mob)
- if ((istype(W, /obj/item/tank) && !( src.destroyed )))
+/obj/machinery/portable_atmospherics/attackby(obj/item/attacking_item, mob/user)
+ if ((istype(attacking_item, /obj/item/tank) && !( src.destroyed )))
if (src.holding)
return TRUE
- var/obj/item/tank/T = W
+ var/obj/item/tank/T = attacking_item
user.drop_from_inventory(T,src)
src.holding = T
update_icon()
SStgui.update_uis(src)
return TRUE
- else if (W.iswrench())
+ else if (attacking_item.iswrench())
if(connected_port)
disconnect()
to_chat(user, "You disconnect \the [src] from the port.")
- playsound(get_turf(src), W.usesound, 50, 1)
+ playsound(get_turf(src), attacking_item.usesound, 50, 1)
update_icon()
SStgui.update_uis(src)
return TRUE
@@ -128,7 +128,7 @@
if(possible_port)
if(connect(possible_port))
to_chat(user, "You connect \the [src] to the port.")
- playsound(get_turf(src), W.usesound, 50, 1)
+ playsound(get_turf(src), attacking_item.usesound, 50, 1)
update_icon()
SStgui.update_uis(src)
return TRUE
@@ -139,8 +139,8 @@
to_chat(user, "Nothing happens.")
return TRUE
- else if ((istype(W, /obj/item/device/analyzer)) && Adjacent(user))
- var/obj/item/device/analyzer/A = W
+ else if ((istype(attacking_item, /obj/item/device/analyzer)) && Adjacent(user))
+ var/obj/item/device/analyzer/A = attacking_item
A.analyze_gases(src, user)
return TRUE
@@ -160,13 +160,13 @@
return 1
return 0
-/obj/machinery/portable_atmospherics/powered/attackby(obj/item/I, mob/user)
- if(istype(I, /obj/item/cell))
+/obj/machinery/portable_atmospherics/powered/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/cell))
if(cell)
to_chat(user, "There is already a power cell installed.")
return TRUE
- var/obj/item/cell/C = I
+ var/obj/item/cell/C = attacking_item
user.drop_from_inventory(C,src)
C.add_fingerprint(user)
@@ -176,7 +176,7 @@
SStgui.update_uis(src)
return TRUE
- if(I.isscrewdriver())
+ if(attacking_item.isscrewdriver())
if(!cell)
to_chat(user, "There is no power cell installed.")
return TRUE
diff --git a/code/game/machinery/atmoalter/scrubber.dm b/code/game/machinery/atmoalter/scrubber.dm
index 5c439912e51..8578ab15ea4 100644
--- a/code/game/machinery/atmoalter/scrubber.dm
+++ b/code/game/machinery/atmoalter/scrubber.dm
@@ -214,34 +214,34 @@
use_power_oneoff(power_draw)
update_connected_network()
-/obj/machinery/portable_atmospherics/powered/scrubber/huge/attackby(var/obj/item/I as obj, var/mob/user as mob)
- if(I.iswrench())
+/obj/machinery/portable_atmospherics/powered/scrubber/huge/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.iswrench())
if(on)
to_chat(user, "Turn \the [src] off first!")
return TRUE
anchored = !anchored
- playsound(src.loc, I.usesound, 50, 1)
+ playsound(src.loc, attacking_item.usesound, 50, 1)
to_chat(user, "You [anchored ? "wrench" : "unwrench"] \the [src].")
return TRUE
//doesn't use power cells
- if(istype(I, /obj/item/cell))
+ if(istype(attacking_item, /obj/item/cell))
return TRUE
- if (I.isscrewdriver())
+ if (attacking_item.isscrewdriver())
return TRUE
//doesn't hold tanks
- if(istype(I, /obj/item/tank))
+ if(istype(attacking_item, /obj/item/tank))
return TRUE
return ..()
/obj/machinery/portable_atmospherics/powered/scrubber/huge/stationary
name = "Stationary Air Scrubber"
-/obj/machinery/portable_atmospherics/powered/scrubber/huge/stationary/attackby(var/obj/item/I as obj, var/mob/user as mob)
- if(I.iswrench())
+/obj/machinery/portable_atmospherics/powered/scrubber/huge/stationary/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.iswrench())
to_chat(user, "The bolts are too tight for you to unscrew!")
return TRUE
diff --git a/code/game/machinery/autolathe/autolathe.dm b/code/game/machinery/autolathe/autolathe.dm
index 95d12509959..103e78babb4 100644
--- a/code/game/machinery/autolathe/autolathe.dm
+++ b/code/game/machinery/autolathe/autolathe.dm
@@ -142,17 +142,17 @@
)
return data
-/obj/machinery/autolathe/attackby(obj/item/O, mob/user)
+/obj/machinery/autolathe/attackby(obj/item/attacking_item, mob/user)
if((autolathe_flags & AUTOLATHE_BUSY))
to_chat(user, SPAN_NOTICE("\The [src] is busy. Please wait for the completion of previous operation."))
return TRUE
- if(default_deconstruction_screwdriver(user, O))
+ if(default_deconstruction_screwdriver(user, attacking_item))
SStgui.update_uis(src)
return TRUE
- if(default_deconstruction_crowbar(user, O))
+ if(default_deconstruction_crowbar(user, attacking_item))
return TRUE
- if(default_part_replacement(user, O))
+ if(default_part_replacement(user, attacking_item))
return TRUE
if(stat)
@@ -160,20 +160,20 @@
if(panel_open)
//Don't eat multitools or wirecutters used on an open lathe.
- if(O.ismultitool() || O.iswirecutter())
+ if(attacking_item.ismultitool() || attacking_item.iswirecutter())
if(panel_open)
wires.interact(user)
else
to_chat(user, SPAN_WARNING("\The [src]'s wires aren't exposed."))
return TRUE
- if(O.loc != user && !istype(O, /obj/item/stack))
+ if(attacking_item.loc != user && !istype(attacking_item, /obj/item/stack))
return FALSE
- if(is_robot_module(O))
+ if(is_robot_module(attacking_item))
return FALSE
- load_lathe(O, user)
+ load_lathe(attacking_item, user)
return TRUE
/obj/machinery/autolathe/attack_hand(mob/user)
diff --git a/code/game/machinery/biogenerator.dm b/code/game/machinery/biogenerator.dm
index 2edf5696ff1..b96ed33550c 100644
--- a/code/game/machinery/biogenerator.dm
+++ b/code/game/machinery/biogenerator.dm
@@ -320,28 +320,28 @@ SPECIAL
else
icon_state = "[initial(icon_state)]-work"
-/obj/machinery/biogenerator/attackby(var/obj/item/O as obj, var/mob/user as mob)
- if(default_deconstruction_screwdriver(user, O))
+/obj/machinery/biogenerator/attackby(obj/item/attacking_item, mob/user)
+ if(default_deconstruction_screwdriver(user, attacking_item))
return TRUE
- if(default_deconstruction_crowbar(user, O))
+ if(default_deconstruction_crowbar(user, attacking_item))
return TRUE
- if(default_part_replacement(user, O))
+ if(default_part_replacement(user, attacking_item))
return TRUE
- if(istype(O, /obj/item/reagent_containers/glass))
+ if(istype(attacking_item, /obj/item/reagent_containers/glass))
if(beaker)
to_chat(user, SPAN_NOTICE("\The [src] is already loaded."))
else
- user.remove_from_mob(O)
- O.forceMove(src)
- beaker = O
+ user.remove_from_mob(attacking_item)
+ attacking_item.forceMove(src)
+ beaker = attacking_item
updateUsrDialog()
. = TRUE
else if(processing)
to_chat(user, SPAN_NOTICE("\The [src] is currently processing."))
. = TRUE
- else if(istype(O, /obj/item/storage/bag/plants))
+ else if(istype(attacking_item, /obj/item/storage/bag/plants))
var/i = 0
- var/obj/item/storage/bag/P = O
+ var/obj/item/storage/bag/P = attacking_item
for(var/obj/item/reagent_containers/food/snacks/grown/G in contents)
i++
if(i >= capacity)
@@ -357,9 +357,9 @@ SPECIAL
CHECK_TICK
if(i < capacity)
- to_chat(user, SPAN_NOTICE("You empty \the [O] into \the [src]."))
+ to_chat(user, SPAN_NOTICE("You empty \the [attacking_item] into \the [src]."))
. = TRUE
- else if(!istype(O, /obj/item/reagent_containers/food/snacks/grown))
+ else if(!istype(attacking_item, /obj/item/reagent_containers/food/snacks/grown))
to_chat(user, SPAN_NOTICE("You cannot put this in \the [src]."))
. = TRUE
else
@@ -369,9 +369,9 @@ SPECIAL
if(i >= capacity)
to_chat(user, SPAN_NOTICE("\The [src] is full! Activate it."))
else
- user.remove_from_mob(O)
- O.forceMove(src)
- to_chat(user, SPAN_NOTICE("You put \the [O] in \the [src]"))
+ user.remove_from_mob(attacking_item)
+ attacking_item.forceMove(src)
+ to_chat(user, SPAN_NOTICE("You put \the [attacking_item] in \the [src]"))
. = TRUE
update_icon()
diff --git a/code/game/machinery/bioprinter.dm b/code/game/machinery/bioprinter.dm
index cb1ce5de8f6..2e65f0a0abc 100644
--- a/code/game/machinery/bioprinter.dm
+++ b/code/game/machinery/bioprinter.dm
@@ -56,30 +56,30 @@
else
to_chat(user, "There is not enough matter in the printer.")
-/obj/machinery/bioprinter/attackby(obj/item/W, mob/user)
+/obj/machinery/bioprinter/attackby(obj/item/attacking_item, mob/user)
// DNA sample from syringe.
- if(!prints_prosthetics && istype(W,/obj/item/reagent_containers/syringe))
- var/obj/item/reagent_containers/syringe/S = W
+ if(!prints_prosthetics && istype(attacking_item, /obj/item/reagent_containers/syringe))
+ var/obj/item/reagent_containers/syringe/S = attacking_item
if(REAGENT_DATA(S.reagents, /singleton/reagent/blood))
loaded_dna = REAGENT_DATA(S.reagents, /singleton/reagent/blood)
S.reagents.clear_reagents()
to_chat(user, "You inject the blood sample into the bioprinter.")
return TRUE
// Meat for biomass.
- if(!prints_prosthetics && istype(W, /obj/item/reagent_containers/food/snacks/meat))
+ if(!prints_prosthetics && istype(attacking_item, /obj/item/reagent_containers/food/snacks/meat))
stored_matter += 50
- user.drop_from_inventory(W,src)
- to_chat(user, "\The [src] processes \the [W]. Levels of stored biomass now: [stored_matter]")
- qdel(W)
+ user.drop_from_inventory(attacking_item, src)
+ to_chat(user, "\The [src] processes \the [attacking_item]. Levels of stored biomass now: [stored_matter]")
+ qdel(attacking_item)
return TRUE
// Steel for matter.
- if(prints_prosthetics && istype(W, /obj/item/stack/material) && W.get_material_name() == DEFAULT_WALL_MATERIAL)
- var/obj/item/stack/S = W
+ if(prints_prosthetics && istype(attacking_item, /obj/item/stack/material) && attacking_item.get_material_name() == DEFAULT_WALL_MATERIAL)
+ var/obj/item/stack/S = attacking_item
stored_matter += S.amount * 10
- user.drop_from_inventory(W,src)
- to_chat(user, "\The [src] processes \the [W]. Levels of stored matter now: [stored_matter]")
- qdel(W)
+ user.drop_from_inventory(attacking_item, src)
+ to_chat(user, "\The [src] processes \the [attacking_item]. Levels of stored matter now: [stored_matter]")
+ qdel(attacking_item)
return TRUE
return..()
diff --git a/code/game/machinery/bluespacerelay.dm b/code/game/machinery/bluespacerelay.dm
index bb17ff44a44..44003f219b6 100644
--- a/code/game/machinery/bluespacerelay.dm
+++ b/code/game/machinery/bluespacerelay.dm
@@ -38,12 +38,12 @@
else
on = 1
-/obj/machinery/bluespacerelay/attackby(var/obj/item/O as obj, var/mob/user as mob)
- if(default_deconstruction_screwdriver(user, O))
+/obj/machinery/bluespacerelay/attackby(obj/item/attacking_item, mob/user)
+ if(default_deconstruction_screwdriver(user, attacking_item))
return TRUE
- if(default_deconstruction_crowbar(user, O))
+ if(default_deconstruction_crowbar(user, attacking_item))
return TRUE
- if(default_part_replacement(user, O))
+ if(default_part_replacement(user, attacking_item))
return TRUE
return ..()
diff --git a/code/game/machinery/body_scanner.dm b/code/game/machinery/body_scanner.dm
index 7a24ddfc920..504b7975ef8 100644
--- a/code/game/machinery/body_scanner.dm
+++ b/code/game/machinery/body_scanner.dm
@@ -136,7 +136,8 @@
update_icon()
return
-/obj/machinery/bodyscanner/attackby(obj/item/grab/G, mob/user)
+/obj/machinery/bodyscanner/attackby(obj/item/attacking_item, mob/user)
+ var/obj/item/grab/G = attacking_item
if (!istype(G, /obj/item/grab) || !isliving(G.affecting) )
return
if (occupant)
diff --git a/code/game/machinery/bots/bots.dm b/code/game/machinery/bots/bots.dm
index 4dde27d308e..3d6e0664d4b 100644
--- a/code/game/machinery/bots/bots.dm
+++ b/code/game/machinery/bots/bots.dm
@@ -61,13 +61,13 @@
else
. += "[src]'s parts look very loose!"
-/obj/machinery/bot/attackby(obj/item/W as obj, mob/user as mob)
- if(W.isscrewdriver())
+/obj/machinery/bot/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.isscrewdriver())
if(!locked)
open = !open
to_chat(user, "Maintenance panel is now [src.open ? "opened" : "closed"].")
return TRUE
- else if(W.iswelder())
+ else if(attacking_item.iswelder())
if(health < maxhealth)
if(open)
health = min(maxhealth, health+10)
@@ -79,12 +79,12 @@
to_chat(user, "[src] does not need a repair.")
return TRUE
else
- if(hasvar(W,"force") && hasvar(W,"damtype"))
- switch(W.damtype)
+ if(hasvar(attacking_item,"force") && hasvar(attacking_item,"damtype"))
+ switch(attacking_item.damtype)
if("fire")
- src.health -= W.force * fire_dam_coeff
+ src.health -= attacking_item.force * fire_dam_coeff
if("brute")
- src.health -= W.force * brute_dam_coeff
+ src.health -= attacking_item.force * brute_dam_coeff
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
. = ..()
healthcheck()
diff --git a/code/game/machinery/buttons.dm b/code/game/machinery/buttons.dm
index 383df30930e..3ff785b8ced 100644
--- a/code/game/machinery/buttons.dm
+++ b/code/game/machinery/buttons.dm
@@ -29,7 +29,7 @@
return
return attack_hand(user)
-/obj/machinery/button/attackby(obj/item/W, mob/user as mob)
+/obj/machinery/button/attackby(obj/item/attacking_item, mob/user)
return attack_hand(user)
/obj/machinery/button/attack_hand(mob/living/user)
diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm
index f6faeceb9d1..e1e10191f63 100644
--- a/code/game/machinery/camera/camera.dm
+++ b/code/game/machinery/camera/camera.dm
@@ -144,24 +144,24 @@
add_hiddenprint(user)
destroy()
-/obj/machinery/camera/attackby(obj/W as obj, mob/living/user as mob)
+/obj/machinery/camera/attackby(obj/item/attacking_item, mob/user)
update_coverage()
// DECONSTRUCTION
- if(W.isscrewdriver())
+ if(attacking_item.isscrewdriver())
//to_chat(user, "You start to [panel_open ? "close" : "open"] the camera's panel.")
//if(toggle_panel(user)) // No delay because no one likes screwdrivers trying to be hip and have a duration cooldown
panel_open = !panel_open
user.visible_message("[user] screws the camera's panel [panel_open ? "open" : "closed"]!",
"You screw the camera's panel [panel_open ? "open" : "closed"].")
- playsound(src.loc, W.usesound, 50, 1)
+ playsound(src.loc, attacking_item.usesound, 50, 1)
return TRUE
- else if((W.iswirecutter() || W.ismultitool()) && panel_open)
+ else if((attacking_item.iswirecutter() || attacking_item.ismultitool()) && panel_open)
interact(user)
return TRUE
- else if(W.iswelder() && (wires.CanDeconstruct() || (stat & BROKEN)))
- if(weld(W, user))
+ else if(attacking_item.iswelder() && (wires.CanDeconstruct() || (stat & BROKEN)))
+ if(weld(attacking_item, user))
if(assembly)
assembly.forceMove(src.loc)
assembly.anchored = 1
@@ -181,14 +181,14 @@
return TRUE
// OTHER
- else if (can_use() && (istype(W, /obj/item/paper)) && isliving(user))
+ else if (can_use() && (istype(attacking_item, /obj/item/paper)) && isliving(user))
var/info = null
var/mob/living/U = user
var/obj/item/paper/X = null
var/itemname = ""
- if(istype(W, /obj/item/paper))
- X = W
+ if(istype(attacking_item, /obj/item/paper))
+ X = attacking_item
itemname = X.name
info = X.info
to_chat(U, "You hold \a [itemname] up to the camera ...")
@@ -208,7 +208,7 @@
O << browse(text("
[][]", itemname, info), text("window=[]", itemname)) //Force people watching to open the page so they can't see it again)
return TRUE
- else if (istype(W, /obj/item/camera_bug))
+ else if (istype(attacking_item, /obj/item/camera_bug))
if (!src.can_use())
to_chat(user, "Camera non-functional.")
else if (src.bugged)
@@ -219,16 +219,16 @@
src.bugged = 1
return TRUE
- else if(W.damtype == DAMAGE_BRUTE || W.damtype == DAMAGE_BURN) //bashing cameras
+ else if(attacking_item.damtype == DAMAGE_BRUTE || attacking_item.damtype == DAMAGE_BURN) //bashing cameras
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
- if (W.force >= src.toughness)
+ if (attacking_item.force >= src.toughness)
user.do_attack_animation(src)
- user.visible_message("[user] has [LAZYPICK(W.attack_verb,"attacked")] [src] with [W]!")
- if (istype(W, /obj/item)) //is it even possible to get into attackby() with non-items?
- var/obj/item/I = W
+ user.visible_message("[user] has [LAZYPICK(attacking_item.attack_verb,"attacked")] [src] with [attacking_item]!")
+ if (istype(attacking_item, /obj/item)) //is it even possible to get into attackby() with non-items?
+ var/obj/item/I = attacking_item
if (I.hitsound)
playsound(loc, I.hitsound, I.get_clamped_volume(), 1, -1)
- take_damage(W.force)
+ take_damage(attacking_item.force)
return TRUE
else
return ..()
diff --git a/code/game/machinery/camera/camera_assembly.dm b/code/game/machinery/camera/camera_assembly.dm
index 3a2cd0d7167..725fe9f912c 100644
--- a/code/game/machinery/camera/camera_assembly.dm
+++ b/code/game/machinery/camera/camera_assembly.dm
@@ -23,14 +23,14 @@
4 = Screwdriver panel closed and is fully built (you cannot attach upgrades)
*/
-/obj/item/camera_assembly/attackby(obj/item/W as obj, mob/living/user as mob)
+/obj/item/camera_assembly/attackby(obj/item/attacking_item, mob/user)
switch(state)
if(0)
// State 0
- if(W.iswrench() && isturf(src.loc))
- playsound(src.loc, W.usesound, 50, 1)
+ if(attacking_item.iswrench() && isturf(src.loc))
+ playsound(src.loc, attacking_item.usesound, 50, 1)
to_chat(user, "You wrench the assembly into place.")
anchored = 1
state = 1
@@ -40,15 +40,15 @@
if(1)
// State 1
- if(W.iswelder())
- if(weld(W, user))
+ if(attacking_item.iswelder())
+ if(weld(attacking_item, user))
to_chat(user, "You weld the assembly securely into place.")
anchored = 1
state = 2
return TRUE
- else if(W.iswrench())
- playsound(src.loc, W.usesound, 50, 1)
+ else if(attacking_item.iswrench())
+ playsound(src.loc, attacking_item.usesound, 50, 1)
to_chat(user, "You unattach the assembly from its place.")
anchored = 0
update_icon()
@@ -57,8 +57,8 @@
if(2)
// State 2
- if(W.iscoil())
- var/obj/item/stack/cable_coil/C = W
+ if(attacking_item.iscoil())
+ var/obj/item/stack/cable_coil/C = attacking_item
if(C.use(2))
to_chat(user, "You add wires to the assembly.")
state = 3
@@ -66,9 +66,9 @@
to_chat(user, "You need 2 coils of wire to wire the assembly.")
return TRUE
- else if(W.iswelder())
+ else if(attacking_item.iswelder())
- if(weld(W, user))
+ if(weld(attacking_item, user))
to_chat(user, "You unweld the assembly from its place.")
state = 1
anchored = 1
@@ -77,10 +77,11 @@
if(3)
// State 3
- if(W.isscrewdriver())
- playsound(src.loc, W.usesound, 50, 1)
+ if(attacking_item.isscrewdriver())
+ playsound(src.loc, attacking_item.usesound, 50, 1)
- var/input = sanitize(input(usr, "Which networks would you like to connect this camera to? Separate networks with a comma. No Spaces!\nFor example: Station,Security,Secret", "Set Network", camera_network ? camera_network : NETWORK_STATION))
+ var/input = sanitize( tgui_input_text(user, "Which networks would you like to connect this camera to? Separate networks with a comma. No Spaces!\nFor example: Station,Security,Secret",
+ "Set Network", (camera_network ? camera_network : NETWORK_STATION)) )
if(!input)
to_chat(usr, "No input found please hang up and try your call again.")
return TRUE
@@ -92,7 +93,7 @@
var/area/camera_area = get_area(src)
var/temptag = "[sanitize(camera_area.name)] ([rand(1, 999)])"
- input = sanitizeSafe(input(usr, "How would you like to name the camera?", "Set Camera Name", camera_name ? camera_name : temptag), MAX_NAME_LEN)
+ input = sanitizeSafe( tgui_input_text(user, "How would you like to name the camera?", "Set Camera Name", (camera_name ? camera_name : temptag), MAX_NAME_LEN), MAX_NAME_LEN )
state = 4
var/obj/machinery/camera/C = new(src.loc)
@@ -111,12 +112,12 @@
C.dir = text2dir(direct)
C.set_pixel_offsets()
if(i != 0)
- var/confirm = alert(user, "Is this what you want? Chances Remaining: [i]", "Confirmation", "Yes", "No")
+ var/confirm = tgui_input_list(user, "Is this what you want? Chances Remaining: [i]", "Confirmation", list("Yes", "No"))
if(confirm == "Yes")
break
return TRUE
- else if(W.iswirecutter())
+ else if(attacking_item.iswirecutter())
new/obj/item/stack/cable_coil(get_turf(src), 2)
playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1)
@@ -125,24 +126,24 @@
return TRUE
// Upgrades!
- if(is_type_in_list(W, possible_upgrades) && !is_type_in_list(W, upgrades)) // Is a possible upgrade and isn't in the camera already.
- if(istype(W, /obj/item/stock_parts/scanning_module))
- var/obj/item/stock_parts/scanning_module/SM = W
+ if(is_type_in_list(attacking_item, possible_upgrades) && !is_type_in_list(attacking_item, upgrades)) // Is a possible upgrade and isn't in the camera already.
+ if(istype(attacking_item, /obj/item/stock_parts/scanning_module))
+ var/obj/item/stock_parts/scanning_module/SM = attacking_item
if(SM.rating < 2)
to_chat(user, SPAN_WARNING("That scanning module doesn't seem advanced enough."))
return
- to_chat(user, "You attach \the [W] into the assembly inner circuits.")
- upgrades += W
- user.remove_from_mob(W)
- W.forceMove(src)
+ to_chat(user, "You attach \the [attacking_item] into the assembly inner circuits.")
+ upgrades += attacking_item
+ user.remove_from_mob(attacking_item)
+ attacking_item.forceMove(src)
return
// Taking out upgrades
- else if(W.iscrowbar() && upgrades.len)
+ else if(attacking_item.iscrowbar() && upgrades.len)
var/obj/U = locate(/obj) in upgrades
if(U)
to_chat(user, "You unattach an upgrade from the assembly.")
- playsound(src.loc, W.usesound, 50, 1)
+ playsound(src.loc, attacking_item.usesound, 50, 1)
U.forceMove(get_turf(src))
upgrades -= U
return
diff --git a/code/game/machinery/case_button.dm b/code/game/machinery/case_button.dm
index 0b8dfb6c99b..2d46cf511b3 100644
--- a/code/game/machinery/case_button.dm
+++ b/code/game/machinery/case_button.dm
@@ -31,8 +31,8 @@
QDEL_NULL(listener)
return ..()
-/obj/machinery/case_button/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/card))
+/obj/machinery/case_button/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/card))
if(src.allowed(user))
covered = !covered //Enable / Disable the forcefield
update_use_power(covered + 1) //Update the power usage
@@ -41,7 +41,7 @@
if(covered && (stat & NOPOWER)) //Only bounce off if its powered (i.e. shield active)
. = ..()
else
- user.visible_message("[src] has been hit by [user] with [W], but it bounces off the forcefield.","You hit [src] with [W], but it bounces off the forcefield.","You hear something bouncing off a forcefield.")
+ user.visible_message("[src] has been hit by [user] with [attacking_item], but it bounces off the forcefield.","You hit [src] with [attacking_item], but it bounces off the forcefield.","You hear something bouncing off a forcefield.")
. = TRUE
update_icon()
diff --git a/code/game/machinery/cell_charger.dm b/code/game/machinery/cell_charger.dm
index 55e2234e90c..5af1301245b 100644
--- a/code/game/machinery/cell_charger.dm
+++ b/code/game/machinery/cell_charger.dm
@@ -49,21 +49,21 @@
else
. += SPAN_WARNING("The charger is empty.")
-/obj/machinery/cell_charger/attackby(obj/item/W, mob/user)
+/obj/machinery/cell_charger/attackby(obj/item/attacking_item, mob/user)
if(stat & BROKEN)
return TRUE
- if(W.iswrench())
+ if(attacking_item.iswrench())
if(charging)
to_chat(user, SPAN_WARNING("Remove the cell first!"))
return TRUE
anchored = !anchored
to_chat(user, "You [anchored ? "" : "un"]secure \the [src].")
- playsound(src, W.usesound, 50, 1)
+ playsound(src, attacking_item.usesound, 50, 1)
return TRUE
- if(istype(W, /obj/item/cell))
+ if(istype(attacking_item, /obj/item/cell))
if(!anchored)
to_chat(user, SPAN_WARNING("You need to secure \the [src] first."))
return TRUE
@@ -72,8 +72,8 @@
to_chat(user, SPAN_WARNING("There is already a cell in \the [src]."))
return TRUE
- user.drop_from_inventory(W, src)
- charging = W
+ user.drop_from_inventory(attacking_item, src)
+ charging = attacking_item
user.visible_message("[user] inserts \the [charging.name] into \the [src].", "You insert \the [charging.name] into \the [src].")
update_icon()
diff --git a/code/game/machinery/chem_heater.dm b/code/game/machinery/chem_heater.dm
index 85a94cb72cb..ce2e76b569a 100644
--- a/code/game/machinery/chem_heater.dm
+++ b/code/game/machinery/chem_heater.dm
@@ -29,19 +29,19 @@
user.set_machine(src)
interact(user)
-/obj/machinery/chem_heater/attackby(obj/item/O, mob/user)
- if(default_deconstruction_screwdriver(user, O))
+/obj/machinery/chem_heater/attackby(obj/item/attacking_item, mob/user)
+ if(default_deconstruction_screwdriver(user, attacking_item))
return TRUE
- if(default_deconstruction_crowbar(user, O))
+ if(default_deconstruction_crowbar(user, attacking_item))
return TRUE
- if(default_part_replacement(user, O))
+ if(default_part_replacement(user, attacking_item))
return TRUE
- if(istype(O, /obj/item/reagent_containers/glass) || istype(O, /obj/item/reagent_containers/food))
+ if(istype(attacking_item, /obj/item/reagent_containers/glass) || istype(attacking_item, /obj/item/reagent_containers/food))
if(container)
to_chat(user, SPAN_WARNING("There is already \a [container] on \the [src]!"))
return TRUE
- var/obj/item/reagent_containers/RC = O
+ var/obj/item/reagent_containers/RC = attacking_item
if(!RC.is_open_container())
to_chat(user, SPAN_WARNING("You don't see how \the [src] could heat up the reagents in \the [RC]."))
return TRUE
diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm
index b11544bc5d8..9639b1d9cc6 100644
--- a/code/game/machinery/cloning.dm
+++ b/code/game/machinery/cloning.dm
@@ -212,16 +212,16 @@
return
//Let's unlock this early I guess. Might be too early, needs tweaking.
-/obj/machinery/clonepod/attackby(obj/item/W as obj, mob/user as mob)
+/obj/machinery/clonepod/attackby(obj/item/attacking_item, mob/user)
if(isnull(occupant))
- 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
- if(W.GetID())
- if(!check_access(W.GetID()))
+ if(attacking_item.GetID())
+ if(!check_access(attacking_item.GetID()))
to_chat(user, "Access Denied.")
return TRUE
if((!locked) || (isnull(occupant)))
@@ -232,13 +232,13 @@
else
locked = 0
to_chat(user, "System unlocked.")
- else if(istype(W, /obj/item/reagent_containers/food/snacks/meat))
- to_chat(user, "\The [src] processes \the [W].")
+ else if(istype(attacking_item, /obj/item/reagent_containers/food/snacks/meat))
+ to_chat(user, "\The [src] processes \the [attacking_item].")
biomass += 50
- user.drop_from_inventory(W,src)
- qdel(W)
+ user.drop_from_inventory(attacking_item, src)
+ qdel(attacking_item)
return TRUE
- else if(W.iswrench())
+ else if(attacking_item.iswrench())
if(locked && (anchored || occupant))
to_chat(user, "Can not do that while [src] is in use.")
else
@@ -248,7 +248,7 @@
connected = null
else
anchored = 1
- playsound(loc, W.usesound, 100, 1)
+ playsound(loc, attacking_item.usesound, 100, 1)
if(anchored)
user.visible_message("[user] secures [src] to the floor.", "You secure [src] to the floor.")
else
diff --git a/code/game/machinery/computer/Operating.dm b/code/game/machinery/computer/Operating.dm
index 697a4d59010..07a6cd76486 100644
--- a/code/game/machinery/computer/Operating.dm
+++ b/code/game/machinery/computer/Operating.dm
@@ -84,14 +84,14 @@
return TRUE
-/obj/machinery/computer/operating/attackby(obj/item/item, mob/user)
- if(istype(item, /obj/item/paper/medscan))
+/obj/machinery/computer/operating/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/paper/medscan))
if(primer)
to_chat(user, SPAN_WARNING("\The [src] already has a primer!"))
return
- user.visible_message("\The [user] slides \the [item] into \the [src].", SPAN_NOTICE("You slide \the [item] into \the [src]."), range = 3)
- user.drop_from_inventory(item, src)
- primer = item
+ user.visible_message("\The [user] slides \the [attacking_item] into \the [src].", SPAN_NOTICE("You slide \the [attacking_item] into \the [src]."), range = 3)
+ user.drop_from_inventory(attacking_item, src)
+ primer = attacking_item
/obj/machinery/computer/operating/attack_ai(mob/user)
if(!ai_can_interact(user))
diff --git a/code/game/machinery/computer/ai_core.dm b/code/game/machinery/computer/ai_core.dm
index cb3460a17bd..f1f4fd2af6f 100644
--- a/code/game/machinery/computer/ai_core.dm
+++ b/code/game/machinery/computer/ai_core.dm
@@ -12,49 +12,49 @@
var/obj/item/device/mmi/brain = null
-/obj/structure/AIcore/attackby(obj/item/P as obj, mob/user as mob)
+/obj/structure/AIcore/attackby(obj/item/attacking_item, mob/user)
switch(state)
if(0)
- if(P.iswrench())
- if(P.use_tool(src, user, 20, volume = 50))
+ if(attacking_item.iswrench())
+ if(attacking_item.use_tool(src, user, 20, volume = 50))
to_chat(user, "You wrench the frame into place.")
anchored = 1
state = 1
return TRUE
- if(P.iswelder())
- var/obj/item/weldingtool/WT = P
+ if(attacking_item.iswelder())
+ var/obj/item/weldingtool/WT = attacking_item
if(!WT.isOn())
to_chat(user, "The welder must be on for this task.")
return
- if(P.use_tool(src, user, 20, volume = 50))
+ if(attacking_item.use_tool(src, user, 20, volume = 50))
if(!src || !WT.use(0, user)) return
to_chat(user, "You deconstruct the frame.")
new /obj/item/stack/material/plasteel( loc, 4)
qdel(src)
return TRUE
if(1)
- if(P.iswrench())
- if(P.use_tool(src, user, 20, volume = 50))
+ if(attacking_item.iswrench())
+ if(attacking_item.use_tool(src, user, 20, volume = 50))
to_chat(user, "You unfasten the frame.")
anchored = 0
state = 0
return TRUE
- if(istype(P, /obj/item/circuitboard/aicore) && !circuit)
+ if(istype(attacking_item, /obj/item/circuitboard/aicore) && !circuit)
playsound(loc, 'sound/items/Deconstruct.ogg', 50, 1)
to_chat(user, "You place the circuit board inside the frame.")
icon_state = "1"
- circuit = P
- user.drop_from_inventory(P,src)
+ circuit = attacking_item
+ user.drop_from_inventory(attacking_item,src)
return TRUE
- if(P.isscrewdriver() && circuit)
- playsound(loc, P.usesound, 50, 1)
+ if(attacking_item.isscrewdriver() && circuit)
+ playsound(loc, attacking_item.usesound, 50, 1)
to_chat(user, "You screw the circuit board into place.")
state = 2
icon_state = "2"
return TRUE
- if(P.iscrowbar() && circuit)
- playsound(loc, P.usesound, 50, 1)
+ if(attacking_item.iscrowbar() && circuit)
+ playsound(loc, attacking_item.usesound, 50, 1)
to_chat(user, "You remove the circuit board.")
state = 1
icon_state = "0"
@@ -62,14 +62,14 @@
circuit = null
return TRUE
if(2)
- if(P.isscrewdriver() && circuit)
- playsound(loc, P.usesound, 50, 1)
+ if(attacking_item.isscrewdriver() && circuit)
+ playsound(loc, attacking_item.usesound, 50, 1)
to_chat(user, "You unfasten the circuit board.")
state = 1
icon_state = "1"
return TRUE
- if(P.iscoil())
- var/obj/item/stack/cable_coil/C = P
+ if(attacking_item.iscoil())
+ var/obj/item/stack/cable_coil/C = attacking_item
if (C.get_amount() < 5)
to_chat(user, "You need five coils of wire to add them to the frame.")
return TRUE
@@ -82,7 +82,7 @@
to_chat(user, "You add cables to the frame.")
return TRUE
if(3)
- if(P.iswirecutter())
+ if(attacking_item.iswirecutter())
if (brain)
to_chat(user, "Get that brain out of there first")
else
@@ -94,8 +94,8 @@
A.amount = 5
return TRUE
- if(istype(P, /obj/item/stack/material) && P.get_material_name() == MATERIAL_GLASS_REINFORCED)
- var/obj/item/stack/RG = P
+ if(istype(attacking_item, /obj/item/stack/material) && attacking_item.get_material_name() == MATERIAL_GLASS_REINFORCED)
+ var/obj/item/stack/RG = attacking_item
if (RG.get_amount() < 2)
to_chat(user, "You need two sheets of glass to put in the glass panel.")
return
@@ -108,14 +108,14 @@
icon_state = "4"
return TRUE
- if(istype(P, /obj/item/aiModule/asimov))
+ if(istype(attacking_item, /obj/item/aiModule/asimov))
laws.add_inherent_law("You may not injure a human being or, through inaction, allow a human being to come to harm.")
laws.add_inherent_law("You must obey orders given to you by human beings, except where such orders would conflict with the First Law.")
laws.add_inherent_law("You must protect your own existence as long as such does not conflict with the First or Second Law.")
to_chat(usr, "Law module applied.")
return TRUE
- if(istype(P, /obj/item/aiModule/nanotrasen))
+ if(istype(attacking_item, /obj/item/aiModule/nanotrasen))
laws.add_inherent_law("Safeguard: Protect your assigned space station to the best of your ability. It is not something we can easily afford to replace.")
laws.add_inherent_law("Serve: Serve the crew of your assigned space station to the best of your abilities, with priority as according to their rank and role.")
laws.add_inherent_law("Protect: Protect the crew of your assigned space station to the best of your abilities, with priority as according to their rank and role.")
@@ -123,36 +123,36 @@
to_chat(usr, "Law module applied.")
return TRUE
- if(istype(P, /obj/item/aiModule/purge))
+ if(istype(attacking_item, /obj/item/aiModule/purge))
laws.clear_inherent_laws()
to_chat(usr, "Law module applied.")
return TRUE
- if(istype(P, /obj/item/aiModule/freeform))
- var/obj/item/aiModule/freeform/M = P
+ if(istype(attacking_item, /obj/item/aiModule/freeform))
+ var/obj/item/aiModule/freeform/M = attacking_item
laws.add_inherent_law(M.newFreeFormLaw)
to_chat(usr, "Added a freeform law.")
return TRUE
- if(istype(P, /obj/item/device/mmi))
- var/obj/item/device/mmi/M = P
+ if(istype(attacking_item, /obj/item/device/mmi))
+ var/obj/item/device/mmi/M = attacking_item
if(!M.ready_for_use(user))
return TRUE
if(jobban_isbanned(M.brainmob, "AI"))
- to_chat(user, "This [P] does not seem to fit.")
+ to_chat(user, "This [attacking_item] does not seem to fit.")
return TRUE
if(M.brainmob.mind)
clear_antag_roles(M.brainmob.mind, 1)
- user.drop_from_inventory(P,src)
- brain = P
- to_chat(usr, "Added [P].")
+ user.drop_from_inventory(attacking_item, src)
+ brain = attacking_item
+ to_chat(usr, "Added [attacking_item].")
icon_state = "3b"
return TRUE
- if(P.iscrowbar() && brain)
- playsound(loc, P.usesound, 50, 1)
+ if(attacking_item.iscrowbar() && brain)
+ playsound(loc, attacking_item.usesound, 50, 1)
to_chat(user, "You remove the brain.")
brain.forceMove(loc)
brain = null
@@ -160,8 +160,8 @@
return TRUE
if(4)
- if(P.iscrowbar())
- playsound(loc, P.usesound, 50, 1)
+ if(attacking_item.iscrowbar())
+ playsound(loc, attacking_item.usesound, 50, 1)
to_chat(user, "You remove the glass panel.")
state = 3
if (brain)
@@ -171,8 +171,8 @@
new /obj/item/stack/material/glass/reinforced( loc, 2 )
return TRUE
- if(P.isscrewdriver())
- playsound(loc, P.usesound, 50, 1)
+ if(attacking_item.isscrewdriver())
+ playsound(loc, attacking_item.usesound, 50, 1)
to_chat(user, "You connect the monitor.")
if(!brain)
var/open_for_latejoin = alert(user, "Would you like this core to be open for latejoining AIs?", "Latejoin", "Yes", "Yes", "No") == "Yes"
@@ -225,27 +225,27 @@
if (ai.mind == malfai)
return 1
-/obj/structure/AIcore/deactivated/attackby(var/obj/item/W, var/mob/user)
+/obj/structure/AIcore/deactivated/attackby(obj/item/attacking_item, mob/user)
- if(istype(W, /obj/item/aicard))
- var/obj/item/aicard/card = W
+ if(istype(attacking_item, /obj/item/aicard))
+ var/obj/item/aicard/card = attacking_item
var/mob/living/silicon/ai/transfer = locate() in card
if(transfer)
load_ai(transfer,card,user)
else
to_chat(user, "ERROR: Unable to locate artificial intelligence.")
return TRUE
- else if(W.iswrench())
+ else if(attacking_item.iswrench())
if(anchored)
user.visible_message("\The [user] starts to unbolt \the [src] from the plating...")
- if(!W.use_tool(src, user, 40, volume = 50))
+ if(!attacking_item.use_tool(src, user, 40, volume = 50))
user.visible_message("\The [user] decides not to unbolt \the [src].")
return TRUE
user.visible_message("\The [user] finishes unfastening \the [src]!")
anchored = 0
else
user.visible_message("\The [user] starts to bolt \the [src] to the plating...")
- if(!W.use_tool(src, user, 40, volume = 50))
+ if(!attacking_item.use_tool(src, user, 40, volume = 50))
user.visible_message("\The [user] decides not to bolt \the [src].")
return TRUE
user.visible_message("\The [user] finishes fastening down \the [src]!")
diff --git a/code/game/machinery/computer/buildandrepair.dm b/code/game/machinery/computer/buildandrepair.dm
index 7ab7f6bf809..b293cb75e2c 100644
--- a/code/game/machinery/computer/buildandrepair.dm
+++ b/code/game/machinery/computer/buildandrepair.dm
@@ -10,52 +10,52 @@
var/state = 0
var/obj/item/circuitboard/circuit = null
-/obj/structure/computerframe/attackby(obj/item/P as obj, mob/user as mob)
+/obj/structure/computerframe/attackby(obj/item/attacking_item, mob/user)
switch(state)
if(0)
- if(P.iswrench())
- if(P.use_tool(src, user, 20, volume = 50))
+ if(attacking_item.iswrench())
+ if(attacking_item.use_tool(src, user, 20, volume = 50))
to_chat(user, "You wrench the frame into place.")
src.anchored = 1
src.state = 1
return TRUE
- if(P.iswelder())
- var/obj/item/weldingtool/WT = P
+ if(attacking_item.iswelder())
+ var/obj/item/weldingtool/WT = attacking_item
if(!WT.use(0, user))
to_chat(user, "The welding tool must be on to complete this task.")
return TRUE
- if(P.use_tool(src, user, 20, volume = 50))
+ if(attacking_item.use_tool(src, user, 20, volume = 50))
if(!src || !WT.isOn()) return
to_chat(user, "You deconstruct the frame.")
new /obj/item/stack/material/steel( src.loc, 5 )
qdel(src)
return TRUE
if(1)
- if(P.iswrench())
- if(P.use_tool(src, user, 20, volume = 50))
+ if(attacking_item.iswrench())
+ if(attacking_item.use_tool(src, user, 20, volume = 50))
to_chat(user, "You unfasten the frame.")
src.anchored = 0
src.state = 0
return TRUE
- if(istype(P, /obj/item/circuitboard) && !circuit)
- var/obj/item/circuitboard/B = P
+ if(istype(attacking_item, /obj/item/circuitboard) && !circuit)
+ var/obj/item/circuitboard/B = attacking_item
if(B.board_type == "computer")
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
to_chat(user, "You place the circuit board inside the frame.")
src.icon_state = "1"
- src.circuit = P
- user.drop_from_inventory(P,src)
+ src.circuit = attacking_item
+ user.drop_from_inventory(attacking_item, src)
else
to_chat(user, "This frame does not accept circuit boards of this type!")
return TRUE
- if(P.isscrewdriver() && circuit)
- playsound(src.loc, P.usesound, 50, 1)
+ if(attacking_item.isscrewdriver() && circuit)
+ playsound(src.loc, attacking_item.usesound, 50, 1)
to_chat(user, "You screw the circuit board into place and screw the drawer shut.")
src.state = 2
src.icon_state = "2"
return TRUE
- if(P.iscrowbar() && circuit)
- playsound(src.loc, P.usesound, 50, 1)
+ if(attacking_item.iscrowbar() && circuit)
+ playsound(src.loc, attacking_item.usesound, 50, 1)
to_chat(user, "You remove the circuit board.")
src.state = 1
src.icon_state = "0"
@@ -63,14 +63,14 @@
src.circuit = null
return TRUE
if(2)
- if(P.isscrewdriver() && circuit)
- playsound(src.loc, P.usesound, 50, 1)
+ if(attacking_item.isscrewdriver() && circuit)
+ playsound(src.loc, attacking_item.usesound, 50, 1)
to_chat(user, "You unfasten the circuit board.")
src.state = 1
src.icon_state = "1"
return TRUE
- if(P.iscoil())
- var/obj/item/stack/cable_coil/C = P
+ if(attacking_item.iscoil())
+ var/obj/item/stack/cable_coil/C = attacking_item
if (C.get_amount() < 5)
to_chat(user, "You need five coils of wire to add them to the frame.")
return TRUE
@@ -83,7 +83,7 @@
icon_state = "3"
return TRUE
if(3)
- if(P.iswirecutter())
+ if(attacking_item.iswirecutter())
playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1)
to_chat(user, "You remove the cables.")
src.state = 2
@@ -92,8 +92,8 @@
A.amount = 5
return TRUE
- if(istype(P, /obj/item/stack/material) && P.get_material_name() == "glass")
- var/obj/item/stack/G = P
+ if(istype(attacking_item, /obj/item/stack/material) && attacking_item.get_material_name() == "glass")
+ var/obj/item/stack/G = attacking_item
if (G.get_amount() < 2)
to_chat(user, "You need two sheets of glass to put in the glass panel.")
return TRUE
@@ -106,15 +106,15 @@
src.icon_state = "4"
return TRUE
if(4)
- if(P.iscrowbar())
- playsound(src.loc, P.usesound, 50, 1)
+ if(attacking_item.iscrowbar())
+ playsound(src.loc, attacking_item.usesound, 50, 1)
to_chat(user, "You remove the glass keyboard.")
src.state = 3
src.icon_state = "3"
new /obj/item/stack/material/glass( src.loc, 2 )
return TRUE
- if(P.isscrewdriver())
- playsound(src.loc, P.usesound, 50, 1)
+ if(attacking_item.isscrewdriver())
+ playsound(src.loc, attacking_item.usesound, 50, 1)
to_chat(user, "You connect the glass keyboard.")
var/B = new src.circuit.build_path ( src.loc )
src.circuit.construct(B)
diff --git a/code/game/machinery/computer/cloning.dm b/code/game/machinery/computer/cloning.dm
index c5577c95ee2..117142aac57 100644
--- a/code/game/machinery/computer/cloning.dm
+++ b/code/game/machinery/computer/cloning.dm
@@ -87,12 +87,12 @@
P.connected = src
P.name = "[initial(P.name)] #[num++]"
-/obj/machinery/computer/cloning/attackby(obj/item/W as obj, mob/user as mob)
- if (istype(W, /obj/item/disk/data)) //INSERT SOME DISKETTES
+/obj/machinery/computer/cloning/attackby(obj/item/attacking_item, mob/user)
+ if (istype(attacking_item, /obj/item/disk/data)) //INSERT SOME DISKETTES
if (!src.diskette)
- user.drop_from_inventory(W,src)
- src.diskette = W
- to_chat(user, "You insert [W].")
+ user.drop_from_inventory(attacking_item,src)
+ src.diskette = attacking_item
+ to_chat(user, "You insert [attacking_item].")
src.updateUsrDialog()
return TRUE
else
diff --git a/code/game/machinery/computer/computer.dm b/code/game/machinery/computer/computer.dm
index 3e5c144926c..c195ec4285e 100644
--- a/code/game/machinery/computer/computer.dm
+++ b/code/game/machinery/computer/computer.dm
@@ -139,10 +139,10 @@
text = replacetext(text, "\n", "
")
return text
-/obj/machinery/computer/attackby(var/obj/item/W as obj, user as mob)
- if(W.isscrewdriver())
+/obj/machinery/computer/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.isscrewdriver())
if(circuit)
- if(W.use_tool(src, user, 20, volume = 50))
+ if(attacking_item.use_tool(src, user, 20, volume = 50))
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
var/obj/item/circuitboard/M = new circuit(A)
A.circuit = M
@@ -162,7 +162,7 @@
qdel(src)
else if(stat & BROKEN)
to_chat(user, SPAN_NOTICE("You start fixing \the [src]..."))
- if(W.use_tool(src, user, 5 SECONDS, volume = 50))
+ if(attacking_item.use_tool(src, user, 5 SECONDS, volume = 50))
to_chat(user, SPAN_NOTICE("You fix the console's screen and tie up a few loose cables."))
stat &= ~BROKEN
update_icon()
diff --git a/code/game/machinery/computer/guestpass.dm b/code/game/machinery/computer/guestpass.dm
index db54335fec0..9b4331e4fc0 100644
--- a/code/game/machinery/computer/guestpass.dm
+++ b/code/game/machinery/computer/guestpass.dm
@@ -66,11 +66,11 @@
. = ..()
uid = "[rand(100,999)]-G[rand(10,99)]"
-/obj/machinery/computer/guestpass/attackby(obj/O, mob/user)
- if(istype(O, /obj/item/card/id))
- if((!giver || giver == GUEST_PASS_TERMINAL_UNSET) && user.unEquip(O))
- O.forceMove(src)
- giver = O
+/obj/machinery/computer/guestpass/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/card/id))
+ if((!giver || giver == GUEST_PASS_TERMINAL_UNSET) && user.unEquip(attacking_item))
+ attacking_item.forceMove(src)
+ giver = attacking_item
updateUsrDialog()
else if(giver && giver != GUEST_PASS_TERMINAL_UNSET)
to_chat(user, SPAN_WARNING("There is already ID card inside \the [src]."))
diff --git a/code/game/machinery/computer/law.dm b/code/game/machinery/computer/law.dm
index b9d70610f6b..e8f24eb387f 100644
--- a/code/game/machinery/computer/law.dm
+++ b/code/game/machinery/computer/law.dm
@@ -26,12 +26,12 @@
return
-/obj/machinery/computer/aiupload/attackby(obj/item/O as obj, mob/user as mob)
+/obj/machinery/computer/aiupload/attackby(obj/item/attacking_item, mob/user)
if(isNotStationLevel(src.z))
to_chat(user, "Unable to establish a connection:")
return TRUE
- if(istype(O, /obj/item/aiModule))
- var/obj/item/aiModule/M = O
+ if(istype(attacking_item, /obj/item/aiModule))
+ var/obj/item/aiModule/M = attacking_item
M.install(src)
return TRUE
else
@@ -68,7 +68,8 @@
var/mob/living/silicon/robot/current = null
-/obj/machinery/computer/borgupload/attackby(obj/item/aiModule/module as obj, mob/user as mob)
+/obj/machinery/computer/borgupload/attackby(obj/item/attacking_item, mob/user)
+ var/obj/item/aiModule/module = attacking_item
if(isNotStationLevel(src.z))
to_chat(user, "Unable to establish a connection:")
return TRUE
diff --git a/code/game/machinery/computer/sentencing.dm b/code/game/machinery/computer/sentencing.dm
index b013dece1eb..ff7a0a52609 100644
--- a/code/game/machinery/computer/sentencing.dm
+++ b/code/game/machinery/computer/sentencing.dm
@@ -28,19 +28,19 @@
return
ui_interact(user)
-/obj/machinery/computer/sentencing/attackby(obj/item/O as obj, user as mob)
- if( istype( O, /obj/item/paper/incident ) && menu_screen == "import_incident" )
- usr.drop_from_inventory(O,src)
+/obj/machinery/computer/sentencing/attackby(obj/item/attacking_item, mob/user)
+ if( istype( attacking_item, /obj/item/paper/incident ) && menu_screen == "import_incident" )
+ usr.drop_from_inventory(attacking_item,src)
- if( import( O ))
+ if( import( attacking_item ))
ping( "\The [src] pings, \"Successfully imported incident report!\"" )
menu_screen = "incident_report"
else
to_chat(user, "Could not import incident report.")
- qdel( O )
+ qdel( attacking_item )
return TRUE
- else if( istype( O, /obj/item/paper ) && menu_screen == "import_incident" )
+ else if( istype( attacking_item, /obj/item/paper ) && menu_screen == "import_incident" )
to_chat(user, "This console only accepts authentic incident reports. Copies are invalid.")
return TRUE
return ..()
diff --git a/code/game/machinery/computer/shuttle.dm b/code/game/machinery/computer/shuttle.dm
index b43c131f737..845f4acad3e 100644
--- a/code/game/machinery/computer/shuttle.dm
+++ b/code/game/machinery/computer/shuttle.dm
@@ -9,7 +9,11 @@
var/list/authorized = list( )
-/obj/machinery/computer/shuttle/attackby(var/obj/item/card/W as obj, var/mob/user as mob)
+/obj/machinery/computer/shuttle/attackby(obj/item/attacking_item, mob/user)
+ var/obj/item/card/W = attacking_item
+ if(!istype(W))
+ return
+
if(stat & (BROKEN|NOPOWER))
return
diff --git a/code/game/machinery/computer/slotmachine.dm b/code/game/machinery/computer/slotmachine.dm
index 761950d9027..a40d2556c2b 100644
--- a/code/game/machinery/computer/slotmachine.dm
+++ b/code/game/machinery/computer/slotmachine.dm
@@ -76,9 +76,9 @@
..()
update_icon()
-/obj/machinery/computer/slot_machine/attackby(obj/item/I, mob/living/user, params)
- if(istype(I, /obj/item/coin))
- var/obj/item/coin/C = I
+/obj/machinery/computer/slot_machine/attackby(obj/item/attacking_item, mob/user, params)
+ if(istype(attacking_item, /obj/item/coin))
+ var/obj/item/coin/C = attacking_item
if(paymode == COIN)
if(prob(2))
if(!user.drop_from_inventory(C, user.loc))
@@ -96,9 +96,9 @@
else
to_chat(user, SPAN_WARNING("This machine is only accepting credit chips!"))
return TRUE
- else if(istype(I, /obj/item/spacecash))
+ else if(istype(attacking_item, /obj/item/spacecash))
if(paymode == CREDITCHIP)
- var/obj/item/spacecash/H = I
+ var/obj/item/spacecash/H = attacking_item
to_chat(user, SPAN_NOTICE("You insert [H.worth] credits into [src]'s slot!"))
playsound(loc, 'sound/arcade/sloto_token.ogg', 10, 1, extrarange = -3, falloff = 10, required_asfx_toggles = ASFX_ARCADE)
balance += H.worth
@@ -107,7 +107,7 @@
else
to_chat(user, SPAN_WARNING("This machine is only accepting coins!"))
return TRUE
- else if(I.ismultitool())
+ else if(attacking_item.ismultitool())
if(balance > 0)
visible_message("[src] says, 'ERROR! Please empty the machine balance before altering paymode'") //Prevents converting coins into credits and vice versa
else
diff --git a/code/game/machinery/constructable_frame.dm b/code/game/machinery/constructable_frame.dm
index 1c2fa8a7b82..a1fa98108d5 100644
--- a/code/game/machinery/constructable_frame.dm
+++ b/code/game/machinery/constructable_frame.dm
@@ -65,18 +65,18 @@
else
..()
-/obj/machinery/constructable_frame/machine_frame/attackby(obj/item/P, mob/user)
+/obj/machinery/constructable_frame/machine_frame/attackby(obj/item/attacking_item, mob/user)
switch(state)
if(BLUEPRINT_STATE)
- if(P.iswirecutter() || istype(P, /obj/item/gun/energy/plasmacutter))
+ if(attacking_item.iswirecutter() || istype(attacking_item, /obj/item/gun/energy/plasmacutter))
playsound(get_turf(src), 'sound/items/poster_ripped.ogg', 75, TRUE)
to_chat(user, SPAN_NOTICE("You decide to scrap the blueprint."))
new /obj/item/stack/material/steel(get_turf(src), 2)
qdel(src)
return TRUE
if(WIRING_STATE)
- if(P.iscoil())
- var/obj/item/stack/cable_coil/C = P
+ if(attacking_item.iscoil())
+ var/obj/item/stack/cable_coil/C = attacking_item
if(C.get_amount() < 5)
to_chat(user, SPAN_WARNING("You need five lengths of cable to add them to the blueprint."))
return TRUE
@@ -89,14 +89,14 @@
icon_state = "blueprint_1"
return TRUE
else
- if(P.iswrench())
- playsound(get_turf(src), P.usesound, 75, TRUE)
+ if(attacking_item.iswrench())
+ playsound(get_turf(src), attacking_item.usesound, 75, TRUE)
to_chat(user, SPAN_NOTICE("You dismantle the blueprint."))
new /obj/item/stack/material/steel(get_turf(src), 2)
qdel(src)
return TRUE
- else if(istype(P, /obj/item/gun/energy/plasmacutter))
- var/obj/item/gun/energy/plasmacutter/PC = P
+ else if(istype(attacking_item, /obj/item/gun/energy/plasmacutter))
+ var/obj/item/gun/energy/plasmacutter/PC = attacking_item
if(PC.check_power_and_message(user))
return TRUE
PC.use_resource(1)
@@ -106,13 +106,13 @@
qdel(src)
return TRUE
if(CIRCUITBOARD_STATE)
- if(istype(P, /obj/item/circuitboard))
- var/obj/item/circuitboard/B = P
+ if(istype(attacking_item, /obj/item/circuitboard))
+ var/obj/item/circuitboard/B = attacking_item
if(B.board_type == "machine")
playsound(get_turf(src), 'sound/items/Deconstruct.ogg', 50, TRUE)
to_chat(user, SPAN_NOTICE("You add the circuit board to the blueprint."))
- circuit = P
- user.drop_from_inventory(P, src)
+ circuit = attacking_item
+ user.drop_from_inventory(attacking_item, src)
var/obj/machine = new circuit.build_path
name = "[machine.name] blueprint"
desc = "A holo-blueprint for a [machine.name]."
@@ -135,8 +135,8 @@
to_chat(user, SPAN_WARNING("This blueprint does not accept circuit boards of this type!"))
return TRUE
else
- if(P.iswirecutter())
- playsound(get_turf(src), P.usesound, 50, TRUE, pitch_toggle)
+ if(attacking_item.iswirecutter())
+ playsound(get_turf(src), attacking_item.usesound, 50, TRUE, pitch_toggle)
to_chat(user, SPAN_NOTICE("You remove the cables."))
state = WIRING_STATE
icon_state = "blueprint_0"
@@ -146,8 +146,8 @@
return TRUE
if(COMPONENT_STATE)
- if(P.iscrowbar())
- playsound(get_turf(src), P.usesound, 50, TRUE)
+ if(attacking_item.iscrowbar())
+ playsound(get_turf(src), attacking_item.usesound, 50, TRUE)
state = CIRCUITBOARD_STATE
circuit.forceMove(get_turf(src))
circuit = null
@@ -165,14 +165,14 @@
icon_state = "blueprint_2"
return TRUE
else
- if(P.isscrewdriver())
+ if(attacking_item.isscrewdriver())
var/component_check = TRUE
for(var/R in req_components)
if(req_components[R] > 0)
component_check = FALSE
break
if(component_check)
- playsound(get_turf(src), P.usesound, 50, TRUE)
+ playsound(get_turf(src), attacking_item.usesound, 50, TRUE)
var/obj/machinery/new_machine = new circuit.build_path(loc, dir, FALSE)
if(istype(new_machine))
if(new_machine.component_parts)
@@ -198,12 +198,12 @@
qdel(src)
return TRUE
else
- if(istype(P, /obj/item))
+ if(istype(attacking_item, /obj/item))
for(var/I in req_components)
- if(istype(P, text2path(I)) && (req_components[I] > 0))
+ if(istype(attacking_item, text2path(I)) && (req_components[I] > 0))
playsound(get_turf(src), 'sound/items/Deconstruct.ogg', 50, TRUE)
- if(istype(P, /obj/item/stack))
- var/obj/item/stack/CP = P
+ if(istype(attacking_item, /obj/item/stack))
+ var/obj/item/stack/CP = attacking_item
if(CP.get_amount() > 1)
var/camt = min(CP.amount, req_components[I]) // amount of cable to take, idealy amount required, but limited by amount provided
var/obj/item/stack/CC = new CP.type(src)
@@ -214,13 +214,13 @@
req_components[I] -= camt
update_component_desc()
break
- user.drop_from_inventory(P,src)
- components += P
+ user.drop_from_inventory(attacking_item,src)
+ components += attacking_item
req_components[I]--
update_component_desc()
break
to_chat(user, SPAN_NOTICE("[components_description]"))
- if(P?.loc != src && !istype(P, /obj/item/stack))
+ if(attacking_item?.loc != src && !istype(attacking_item, /obj/item/stack))
to_chat(user, SPAN_WARNING("You cannot add that component to the machine!."))
return TRUE
@@ -244,9 +244,9 @@
anchored = TRUE
density = TRUE
-/obj/machinery/constructable_frame/temp_deco/attackby(obj/item/P, mob/user)
- if(P.iswrench())
- playsound(get_turf(src), P.usesound, 75, 1)
+/obj/machinery/constructable_frame/temp_deco/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.iswrench())
+ playsound(get_turf(src), attacking_item.usesound, 75, 1)
to_chat(user, SPAN_NOTICE("You dismantle \the [src]."))
new /obj/item/stack/material/steel(get_turf(src), 5)
qdel(src)
diff --git a/code/game/machinery/crusher_piston.dm b/code/game/machinery/crusher_piston.dm
index b193e10d755..534a27aeb14 100644
--- a/code/game/machinery/crusher_piston.dm
+++ b/code/game/machinery/crusher_piston.dm
@@ -85,7 +85,7 @@
QDEL_NULL(pstn)
return ..()
-/obj/machinery/crusher_base/attackby(var/obj/item/O as obj, var/mob/user as mob)
+/obj/machinery/crusher_base/attackby(obj/item/attacking_item, mob/user)
if(status != "idle" && prob(40) && ishuman(user))
var/mob/living/carbon/human/M = user
M.apply_damage(45, DAMAGE_BRUTE, user.get_active_hand())
@@ -93,18 +93,18 @@
M.visible_message("[user]'s hand catches in the [src]!", "Your hand gets caught in the [src]!")
M.say("*scream")
return TRUE
- if(default_deconstruction_screwdriver(user, O))
+ if(default_deconstruction_screwdriver(user, attacking_item))
return TRUE
- if(default_deconstruction_crowbar(user, O))
+ if(default_deconstruction_crowbar(user, attacking_item))
return TRUE
- if(default_part_replacement(user, O))
+ if(default_part_replacement(user, attacking_item))
return TRUE
//Stuff you can do if the maint hatch is open
if(panel_open)
- if(O.iswrench())
+ if(attacking_item.iswrench())
to_chat(user, "You start [valve_open ? "closing" : "opening"] the pressure relief valve of [src].")
- if(O.use_tool(src, user, 50, volume = 50))
+ if(attacking_item.use_tool(src, user, 50, volume = 50))
valve_open = !valve_open
to_chat(user, "You [valve_open ? "open" : "close"] the pressure relief valve of [src].")
if(valve_open)
diff --git a/code/game/machinery/cryo.dm b/code/game/machinery/cryo.dm
index 7c0952a83d9..b76e64f10fd 100644
--- a/code/game/machinery/cryo.dm
+++ b/code/game/machinery/cryo.dm
@@ -235,17 +235,17 @@
add_fingerprint(usr)
-/obj/machinery/atmospherics/unary/cryo_cell/attackby(var/obj/item/G as obj, var/mob/user as mob)
- if(istype(G, /obj/item/reagent_containers/glass))
+/obj/machinery/atmospherics/unary/cryo_cell/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/reagent_containers/glass))
if(beaker)
FEEDBACK_FAILURE(user, "A beaker is already loaded into the machine!")
return TRUE
- beaker = G
- user.drop_from_inventory(G,src)
- user.visible_message("[user] adds \a [G] to \the [src]!", "You add \a [G] to \the [src]!")
- else if(istype(G, /obj/item/grab))
- var/obj/item/grab/grab = G
+ beaker = attacking_item
+ user.drop_from_inventory(attacking_item,src)
+ user.visible_message("[user] adds \a [attacking_item] to \the [src]!", "You add \a [attacking_item] to \the [src]!")
+ else if(istype(attacking_item, /obj/item/grab))
+ var/obj/item/grab/grab = attacking_item
var/mob/living/L = grab.affecting
if (!istype(L))
@@ -263,7 +263,7 @@
return TRUE
if(put_mob(L))
user.visible_message("[user] puts [L] into [src].", "You put [L] into [src].", range = 3)
- qdel(G)
+ qdel(attacking_item)
return TRUE
/obj/machinery/atmospherics/unary/cryo_cell/MouseDrop_T(atom/movable/O as mob|obj, mob/living/user as mob)
diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm
index 9ffbf2811f9..d477eb394e9 100644
--- a/code/game/machinery/cryopod.dm
+++ b/code/game/machinery/cryopod.dm
@@ -419,7 +419,8 @@ GLOBAL_LIST_EMPTY(frozen_crew)
occupant = null
update_icon()
-/obj/machinery/cryopod/attackby(var/obj/item/grab/G, var/mob/user)
+/obj/machinery/cryopod/attackby(obj/item/attacking_item, mob/user)
+ var/obj/item/grab/G = attacking_item
if(istype(G))
if(occupant)
to_chat(user, SPAN_WARNING("\The [src] is in use."))
diff --git a/code/game/machinery/deployable.dm b/code/game/machinery/deployable.dm
index ae37d5559e0..aef766be3b2 100644
--- a/code/game/machinery/deployable.dm
+++ b/code/game/machinery/deployable.dm
@@ -52,8 +52,8 @@ Deployable Kits
if(!check_dismantle())
visible_message(SPAN_WARNING("\The [src] is hit by \the [P]!"))
-/obj/structure/blocker/attackby(obj/item/W, mob/user)
- if(W.ishammer() && user.a_intent != I_HURT)
+/obj/structure/blocker/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.ishammer() && user.a_intent != I_HURT)
var/obj/item/I = usr.get_inactive_hand()
if(I && istype(I, /obj/item/stack))
var/obj/item/stack/D = I
@@ -72,13 +72,13 @@ Deployable Kits
return TRUE
else
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
- switch(W.damtype)
+ switch(attacking_item.damtype)
if(DAMAGE_BURN)
- src.health -= W.force * 1
+ src.health -= attacking_item.force * 1
if(DAMAGE_BRUTE)
- src.health -= W.force * 0.75
+ src.health -= attacking_item.force * 0.75
shake_animation()
- playsound(src.loc, material.hitsound, W.get_clamped_volume(), 1)
+ playsound(src.loc, material.hitsound, attacking_item.get_clamped_volume(), 1)
if(check_dismantle())
return TRUE
return ..()
@@ -150,8 +150,8 @@ Deployable Kits
src.icon_state = "[initial(icon_state)][src.locked]"
-/obj/machinery/deployable/barrier/attackby(obj/item/W as obj, mob/user as mob)
- if (istype(W, /obj/item/card/id/))
+/obj/machinery/deployable/barrier/attackby(obj/item/attacking_item, mob/user)
+ if (istype(attacking_item, /obj/item/card/id/))
if (src.allowed(user))
if (src.emagged < 2.0)
src.locked = !src.locked
@@ -168,7 +168,7 @@ Deployable Kits
visible_message("BZZzZZzZZzZT")
return
return
- else if (W.iswrench())
+ else if (attacking_item.iswrench())
if (src.health < src.maxhealth)
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
src.health = src.maxhealth
@@ -185,11 +185,11 @@ Deployable Kits
return
else
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
- switch(W.damtype)
+ switch(attacking_item.damtype)
if("fire")
- src.health -= W.force * 0.75
+ src.health -= attacking_item.force * 0.75
if("brute")
- src.health -= W.force * 0.5
+ src.health -= attacking_item.force * 0.5
if (src.health <= 0)
src.explode()
diff --git a/code/game/machinery/door_control.dm b/code/game/machinery/door_control.dm
index 06c3abcc4d2..7a95ec53452 100644
--- a/code/game/machinery/door_control.dm
+++ b/code/game/machinery/door_control.dm
@@ -23,8 +23,8 @@
else
to_chat(user, "Error, no route to host.")
-/obj/machinery/button/remote/attackby(obj/item/W, mob/user as mob)
- if(istype(W, /obj/item/forensics))
+/obj/machinery/button/remote/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/forensics))
return
return src.attack_hand(user)
diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm
index 6c6d6ab7647..df45672aaa6 100644
--- a/code/game/machinery/doors/airlock.dm
+++ b/code/game/machinery/doors/airlock.dm
@@ -386,7 +386,7 @@
open_sound_powered = 'sound/machines/airlock/vault1o.ogg'
close_sound_powered = 'sound/machines/airlock/vault1c.ogg'
-/obj/machinery/door/airlock/centcom/attackby(obj/item/I, mob/user)
+/obj/machinery/door/airlock/centcom/attackby(obj/item/attacking_item, mob/user)
if (operating)
return TRUE
@@ -426,7 +426,7 @@
open_sound_powered = 'sound/machines/airlock/vault1o.ogg'
close_sound_powered = 'sound/machines/airlock/vault1c.ogg'
-/obj/machinery/door/airlock/glass_centcom/attackby(obj/item/I, mob/user)
+/obj/machinery/door/airlock/glass_centcom/attackby(obj/item/attacking_item, mob/user)
if (operating)
return TRUE
@@ -1640,28 +1640,28 @@ About the new airlock wires panel:
/obj/machinery/door/airlock/proc/CanChainsaw(var/obj/item/material/twohanded/chainsaw/ChainSawVar)
return (ChainSawVar.powered && density && hashatch)
-/obj/machinery/door/airlock/attackby(var/obj/item/C, mob/user as mob)
+/obj/machinery/door/airlock/attackby(obj/item/attacking_item, mob/user)
if(!istype(usr, /mob/living/silicon))
if(src.isElectrified())
if(src.shock(user, 75))
return TRUE
- if(istype(C, /obj/item/taperoll) || istype(C, /obj/item/rfd))
+ if(istype(attacking_item, /obj/item/taperoll) || istype(attacking_item, /obj/item/rfd))
return
- if(!istype(C, /obj/item/forensics))
+ if(!istype(attacking_item, /obj/item/forensics))
src.add_fingerprint(user)
if (!repairing && (stat & BROKEN) && src.locked) //bolted and broken
- if (!cut_bolts(C,user))
+ if (!cut_bolts(attacking_item,user))
return ..()
return TRUE
- if (istype(C, /obj/item/device/magnetic_lock))
+ if (istype(attacking_item, /obj/item/device/magnetic_lock))
if (bracer)
to_chat(user, SPAN_NOTICE("There is already a [bracer] on [src]!"))
return TRUE
- var/obj/item/device/magnetic_lock/newbracer = C
+ var/obj/item/device/magnetic_lock/newbracer = attacking_item
newbracer.attachto(src, user)
return TRUE
- if(!repairing && (C.iswelder() && !( src.operating > 0 ) && src.density))
- var/obj/item/weldingtool/WT = C
+ if(!repairing && (attacking_item.iswelder() && !( src.operating > 0 ) && src.density))
+ var/obj/item/weldingtool/WT = attacking_item
if(WT.isOn())
user.visible_message(
SPAN_WARNING("[user] begins welding [src] [welded ? "open" : "shut"]."),
@@ -1678,7 +1678,7 @@ About the new airlock wires panel:
welded = !welded
update_icon()
return TRUE
- else if(C.isscrewdriver())
+ else if(attacking_item.isscrewdriver())
if (src.p_open)
if (stat & BROKEN)
to_chat(user, SPAN_WARNING("The panel is broken and cannot be closed."))
@@ -1690,20 +1690,20 @@ About the new airlock wires panel:
to_chat(user, SPAN_NOTICE("You carefully unscrew the panel on \the [src]"))
src.update_icon()
return TRUE
- else if(C.iswirecutter())
+ else if(attacking_item.iswirecutter())
return src.attack_hand(user)
- else if(C.ismultitool())
+ else if(attacking_item.ismultitool())
return src.attack_hand(user)
- else if(istype(C, /obj/item/device/assembly/signaler))
+ else if(istype(attacking_item, /obj/item/device/assembly/signaler))
return src.attack_hand(user)
- else if(istype(C, /obj/item/device/paint_sprayer))
+ else if(istype(attacking_item, /obj/item/device/paint_sprayer))
return FALSE
- else if(istype(C, /obj/item/pai_cable)) // -- TLE
- var/obj/item/pai_cable/cable = C
+ else if(istype(attacking_item, /obj/item/pai_cable)) // -- TLE
+ var/obj/item/pai_cable/cable = attacking_item
cable.plugin(src, user)
return TRUE
- else if(!repairing && C.iscrowbar())
- if(istype(C, /obj/item/melee/arm_blade))
+ else if(!repairing && attacking_item.iscrowbar())
+ if(istype(attacking_item, /obj/item/melee/arm_blade))
if(arePowerSystemsOn() &&!(stat & BROKEN))
..()
return
@@ -1712,15 +1712,15 @@ About the new airlock wires panel:
to_chat(user, SPAN_WARNING("The airlock bolts are in the way of the electronics, you need to raise them before you can reach them."))
return
user.visible_message("[user] starts removing the electronics from the airlock assembly.", SPAN_NOTICE("You start removing the electronics from the airlock assembly."))
- if(C.use_tool(src, user, 40, volume = 50))
+ if(attacking_item.use_tool(src, user, 40, volume = 50))
user.visible_message("[user] removes the electronics from the airlock assembly.", SPAN_NOTICE("You remove the electronics from the airlock assembly."))
CreateAssembly()
return
else if(arePowerSystemsOn())
to_chat(user, SPAN_NOTICE("The airlock's motors resist your efforts to force it."))
else if(locked)
- if (istype(C, /obj/item/crowbar/robotic/jawsoflife))
- cut_bolts(C, user)
+ if (istype(attacking_item, /obj/item/crowbar/robotic/jawsoflife))
+ cut_bolts(attacking_item, user)
else
to_chat(user, SPAN_NOTICE("The airlock's bolts prevent it from being forced."))
else
@@ -1729,26 +1729,26 @@ About the new airlock wires panel:
else
close(1)
return TRUE
- else if(istype(C, /obj/item/material/twohanded/fireaxe) && !arePowerSystemsOn())
+ else if(istype(attacking_item, /obj/item/material/twohanded/fireaxe) && !arePowerSystemsOn())
if(locked && user.a_intent != I_HURT)
to_chat(user, SPAN_NOTICE("The airlock's bolts prevent it from being forced."))
else if(locked && user.a_intent == I_HURT)
..()
else if(!welded && !operating)
if(density)
- var/obj/item/material/twohanded/fireaxe/F = C
+ var/obj/item/material/twohanded/fireaxe/F = attacking_item
if(F.wielded)
open(1)
else
- to_chat(user, SPAN_WARNING("You need to be wielding \the [C] to do that."))
+ to_chat(user, SPAN_WARNING("You need to be wielding \the [attacking_item] to do that."))
else
- var/obj/item/material/twohanded/fireaxe/F = C
+ var/obj/item/material/twohanded/fireaxe/F = attacking_item
if(F.wielded)
close(1)
else
- to_chat(user, SPAN_WARNING("You need to be wielding \the [C] to do that."))
+ to_chat(user, SPAN_WARNING("You need to be wielding \the [attacking_item] to do that."))
return TRUE
- else if(C.ishammer() && !arePowerSystemsOn())
+ else if(attacking_item.ishammer() && !arePowerSystemsOn())
if(locked && user.a_intent != I_HURT)
to_chat(user, SPAN_NOTICE("The airlock's bolts prevent it from being forced."))
else if(locked && user.a_intent == I_HURT)
@@ -1759,26 +1759,26 @@ About the new airlock wires panel:
else
close(1)
return TRUE
- else if(density && istype(C, /obj/item/material/twohanded/chainsaw))
- var/obj/item/material/twohanded/chainsaw/ChainSawVar = C
+ else if(density && istype(attacking_item, /obj/item/material/twohanded/chainsaw))
+ var/obj/item/material/twohanded/chainsaw/ChainSawVar = attacking_item
if(!ChainSawVar.wielded)
to_chat(user, SPAN_NOTICE("Cutting the airlock requires the strength of two hands."))
else if(ChainSawVar.cutting)
to_chat(user, SPAN_NOTICE("You are already cutting an airlock open."))
else if(!ChainSawVar.powered)
- to_chat(user, SPAN_NOTICE("The [C] needs to be on in order to open this door."))
+ to_chat(user, SPAN_NOTICE("The [attacking_item] needs to be on in order to open this door."))
else if(bracer) //Has a magnetic lock
to_chat(user, SPAN_NOTICE("The bracer needs to be removed in order to cut through this door."))
else if(!arePowerSystemsOn())
ChainSawVar.cutting = 1
user.visible_message(\
- SPAN_DANGER("[user.name] starts cutting the control pannel of the airlock with the [C]!"),\
+ SPAN_DANGER("[user.name] starts cutting the control pannel of the airlock with the [attacking_item]!"),\
SPAN_WARNING("You start cutting the airlock control panel..."),\
SPAN_NOTICE("You hear a loud buzzing sound and metal grinding on metal...")\
)
- if(do_after(user, ChainSawVar.opendelay SECONDS, extra_checks = CALLBACK(src, PROC_REF(CanChainsaw), C)))
+ if(do_after(user, ChainSawVar.opendelay SECONDS, extra_checks = CALLBACK(src, PROC_REF(CanChainsaw), attacking_item)))
user.visible_message(\
- SPAN_WARNING("[user.name] finishes cutting the control pannel of the airlock with the [C]."),\
+ SPAN_WARNING("[user.name] finishes cutting the control pannel of the airlock with the [attacking_item]."),\
SPAN_WARNING("You finish cutting the airlock control panel."),\
SPAN_NOTICE("You hear a metal clank and some sparks.")\
)
@@ -1790,13 +1790,13 @@ About the new airlock wires panel:
else if(locked)
ChainSawVar.cutting = 1
user.visible_message(\
- SPAN_DANGER("[user.name] starts cutting below the airlock with the [C]!"),\
+ SPAN_DANGER("[user.name] starts cutting below the airlock with the [attacking_item]!"),\
SPAN_WARNING("You start cutting below the airlock..."),\
SPAN_NOTICE("You hear a loud buzzing sound and metal grinding on metal...")\
)
- if(do_after(user, ChainSawVar.opendelay SECONDS, extra_checks = CALLBACK(src, PROC_REF(CanChainsaw), C)))
+ if(do_after(user, ChainSawVar.opendelay SECONDS, extra_checks = CALLBACK(src, PROC_REF(CanChainsaw), attacking_item)))
user.visible_message(\
- SPAN_WARNING("[user.name] finishes cutting below the airlock with the [C]."),\
+ SPAN_WARNING("[user.name] finishes cutting below the airlock with the [attacking_item]."),\
SPAN_NOTICE("You finish cutting below the airlock."),\
SPAN_NOTICE("You hear a metal clank and some sparks.")\
)
@@ -1806,11 +1806,11 @@ About the new airlock wires panel:
else
ChainSawVar.cutting = 1
user.visible_message(\
- SPAN_DANGER("[user.name] starts cutting between the airlock with the [C]!"),\
+ SPAN_DANGER("[user.name] starts cutting between the airlock with the [attacking_item]!"),\
SPAN_WARNING("You start cutting between the airlock..."),\
SPAN_NOTICE("You hear a loud buzzing sound and metal grinding on metal...")\
)
- if(do_after(user, ChainSawVar.opendelay SECONDS, extra_checks = CALLBACK(src, PROC_REF(CanChainsaw), C)))
+ if(do_after(user, ChainSawVar.opendelay SECONDS, extra_checks = CALLBACK(src, PROC_REF(CanChainsaw), attacking_item)))
user.visible_message(\
SPAN_WARNING("[user.name] finishes cutting between the airlock."),\
SPAN_WARNING("You finish cutting between the airlock."),\
@@ -1823,9 +1823,9 @@ About the new airlock wires panel:
else
return ..()
-/obj/machinery/door/airlock/phoron/attackby(C as obj, mob/user as mob)
- if(C)
- ignite(is_hot(C))
+/obj/machinery/door/airlock/phoron/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item)
+ ignite(is_hot(attacking_item))
return ..()
/obj/machinery/door/airlock/set_broken()
diff --git a/code/game/machinery/doors/airlock_control.dm b/code/game/machinery/doors/airlock_control.dm
index 67be42cb5f7..4d0baa6a5e6 100644
--- a/code/game/machinery/doors/airlock_control.dm
+++ b/code/game/machinery/doors/airlock_control.dm
@@ -263,9 +263,9 @@
else
icon_state = "access_button_off"
-/obj/machinery/access_button/attackby(obj/item/I as obj, mob/user as mob)
+/obj/machinery/access_button/attackby(obj/item/attacking_item, mob/user)
//Swiping ID on the access button
- if (I.GetID())
+ if (attacking_item.GetID())
attack_hand(user)
return TRUE
return ..()
diff --git a/code/game/machinery/doors/airlock_electronics.dm b/code/game/machinery/doors/airlock_electronics.dm
index 9f4a5920da3..9863e28087c 100644
--- a/code/game/machinery/doors/airlock_electronics.dm
+++ b/code/game/machinery/doors/airlock_electronics.dm
@@ -112,12 +112,12 @@
if(!conf_access.len)
conf_access = null
-/obj/item/airlock_electronics/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/airlock_electronics) &&(!isrobot(user)))
+/obj/item/airlock_electronics/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/airlock_electronics) &&(!isrobot(user)))
if(src.locked)
to_chat(user, SPAN_WARNING("\The [src] you're trying to set is locked! Swipe your ID to unlock."))
return TRUE
- var/obj/item/airlock_electronics/A = W
+ var/obj/item/airlock_electronics/A = attacking_item
if(A.locked)
to_chat(user, SPAN_WARNING("\The [src] you're trying to copy is locked! Swipe your ID to unlock."))
return TRUE
@@ -126,8 +126,8 @@
src.last_configurator = A.last_configurator
to_chat(user, SPAN_NOTICE("Configuration settings copied successfully."))
return TRUE
- else if(W.GetID())
- var/obj/item/card/id/I = W.GetID()
+ else if(attacking_item.GetID())
+ var/obj/item/card/id/I = attacking_item.GetID()
if(check_access(I))
locked = !locked
last_configurator = I.registered_name
diff --git a/code/game/machinery/doors/blast_door.dm b/code/game/machinery/doors/blast_door.dm
index cecd3adf95a..8c87b31eb5d 100644
--- a/code/game/machinery/doors/blast_door.dm
+++ b/code/game/machinery/doors/blast_door.dm
@@ -115,21 +115,21 @@
// Parameters: 2 (C - Item this object was clicked with, user - Mob which clicked this object)
// Description: If we are clicked with crowbar or wielded fire axe, try to manually open the door.
// This only works on broken doors or doors without power. Also allows repair with Plasteel.
-/obj/machinery/door/blast/attackby(obj/item/C as obj, mob/user as mob)
- if(!istype(C, /obj/item/forensics))
+/obj/machinery/door/blast/attackby(obj/item/attacking_item, mob/user)
+ if(!istype(attacking_item, /obj/item/forensics))
src.add_fingerprint(user)
- if((istype(C, /obj/item/material/twohanded/fireaxe) && C:wielded == 1) || C.ishammer() || istype(C, /obj/item/crowbar/robotic/jawsoflife))
+ if((istype(attacking_item, /obj/item/material/twohanded/fireaxe) && attacking_item:wielded == 1) || attacking_item.ishammer() || istype(attacking_item, /obj/item/crowbar/robotic/jawsoflife))
if (((stat & NOPOWER) || (stat & BROKEN)) && !( src.operating ))
force_toggle()
else
to_chat(usr, "[src]'s motors resist your effort.")
return TRUE
- if(istype(C, /obj/item/stack/material) && C.get_material_name() == "plasteel")
+ if(istype(attacking_item, /obj/item/stack/material) && attacking_item.get_material_name() == "plasteel")
var/amt = Ceiling((maxhealth - health)/150)
if(!amt)
to_chat(usr, "\The [src] is already fully repaired.")
return TRUE
- var/obj/item/stack/P = C
+ var/obj/item/stack/P = attacking_item
if(P.amount < amt)
to_chat(usr, "You don't have enough sheets to repair this! You need at least [amt] sheets.")
return TRUE
@@ -244,7 +244,7 @@
density = 0
opacity = 0
-/obj/machinery/door/blast/odin/attackby(obj/item/C as obj, mob/user as mob)
+/obj/machinery/door/blast/odin/attackby(obj/item/attacking_item, mob/user)
return
/obj/machinery/door/blast/odin/ex_act(var/severity)
diff --git a/code/game/machinery/doors/brigdoors.dm b/code/game/machinery/doors/brigdoors.dm
index c9369d988de..df8aa427626 100644
--- a/code/game/machinery/doors/brigdoors.dm
+++ b/code/game/machinery/doors/brigdoors.dm
@@ -294,18 +294,18 @@
return .
-/obj/machinery/door_timer/attackby(obj/item/O, var/mob/user)
- if(istype(O, /obj/item/paper/incident))
+/obj/machinery/door_timer/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/paper/incident))
if(!incident)
- if(import(O, user))
+ if(import(attacking_item, user))
ping("\The [src] states, \"Successfully imported incident report!\"")
- user.drop_from_inventory(O,get_turf(src))
- qdel(O)
+ user.drop_from_inventory(attacking_item,get_turf(src))
+ qdel(attacking_item)
src.updateUsrDialog()
else
to_chat(user, SPAN_ALERT("\The [src] states, \"There's already an active sentence.\""))
return TRUE
- else if(istype(O, /obj/item/paper))
+ else if(istype(attacking_item, /obj/item/paper))
to_chat(user, SPAN_ALERT("\The [src] states, \"This console only accepts authentic incident reports. Copies are invalid.\""))
return TRUE
diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm
index 5d2c838004d..dead21d345b 100644
--- a/code/game/machinery/doors/door.dm
+++ b/code/game/machinery/doors/door.dm
@@ -291,11 +291,11 @@
do_animate("deny")
return
-/obj/machinery/door/attackby(obj/item/I as obj, mob/user as mob)
- if(!istype(I, /obj/item/forensics))
+/obj/machinery/door/attackby(obj/item/attacking_item, mob/user)
+ if(!istype(attacking_item, /obj/item/forensics))
src.add_fingerprint(user)
- if(I.ishammer() && user.a_intent != I_HURT)
+ if(attacking_item.ishammer() && user.a_intent != I_HURT)
var/obj/item/stack/stack = usr.get_inactive_hand()
if(istype(stack) && stack.get_material_name() == get_material_name())
if(stat & BROKEN)
@@ -328,12 +328,12 @@
return TRUE
- if(repairing && I.iswelder())
+ if(repairing && attacking_item.iswelder())
if(!density)
to_chat(user, "\The [src] must be closed before you can repair it.")
return TRUE
- var/obj/item/weldingtool/welder = I
+ var/obj/item/weldingtool/welder = attacking_item
if(welder.use(0,user))
to_chat(user, "You start to fix dents and weld \the [repairing] into place.")
if(welder.use_tool(src, user, 5 * repairing.amount, volume = 50) && welder && welder.isOn())
@@ -344,16 +344,16 @@
repairing = null
return TRUE
- if(repairing && I.iscrowbar())
+ if(repairing && attacking_item.iscrowbar())
to_chat(user, "You remove \the [repairing].")
- playsound(src.loc, I.usesound, 50, 1)
+ playsound(src.loc, attacking_item.usesound, 50, 1)
repairing.forceMove(user.loc)
repairing = null
return TRUE
//psa to whoever coded this, there are plenty of objects that need to call attack() on doors without bludgeoning them.
- if(src.density && istype(I, /obj/item) && user.a_intent == I_HURT && !istype(I, /obj/item/card))
- var/obj/item/W = I
+ if(src.density && istype(attacking_item, /obj/item) && user.a_intent == I_HURT && !istype(attacking_item, /obj/item/card))
+ var/obj/item/W = attacking_item
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
if(W.damtype == DAMAGE_BRUTE || W.damtype == DAMAGE_BURN)
user.do_attack_animation(src)
diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm
index 856724f38dd..d30f91dfaf8 100644
--- a/code/game/machinery/doors/firedoor.dm
+++ b/code/game/machinery/doors/firedoor.dm
@@ -256,13 +256,13 @@
nextstate = FIREDOOR_CLOSED
close()
-/obj/machinery/door/firedoor/attackby(obj/item/C as obj, mob/user as mob)
- if(!istype(C, /obj/item/forensics))
+/obj/machinery/door/firedoor/attackby(obj/item/attacking_item, mob/user)
+ if(!istype(attacking_item, /obj/item/forensics))
add_fingerprint(user)
if(operating)
return TRUE // Already doing something.
- if(C.iswelder() && !repairing)
- var/obj/item/weldingtool/WT = C
+ if(attacking_item.iswelder() && !repairing)
+ var/obj/item/weldingtool/WT = attacking_item
if(WT.isOn())
user.visible_message(
SPAN_WARNING("[user] begins welding [src] [blocked ? "open" : "shut"]."),
@@ -279,20 +279,20 @@
blocked = !blocked
update_icon()
return TRUE
- if(density && C.isscrewdriver())
+ if(density && attacking_item.isscrewdriver())
hatch_open = !hatch_open
user.visible_message("[user] has [hatch_open ? "opened" : "closed"] \the [src] maintenance panel.",
"You have [hatch_open ? "opened" : "closed"] the [src] maintenance panel.")
update_icon()
return TRUE
- if(blocked && C.iscrowbar() && !repairing)
+ if(blocked && attacking_item.iscrowbar() && !repairing)
if(!hatch_open)
to_chat(user, "You must open the maintenance panel first!")
else
user.visible_message("[user] is removing the electronics from \the [src].",
"You start to remove the electronics from [src].")
- if(C.use_tool(src, user, 30, volume = 50))
+ if(attacking_item.use_tool(src, user, 30, volume = 50))
if(blocked && density && hatch_open)
user.visible_message("[user] has removed the electronics from \the [src].",
"You have removed the electronics from [src].")
@@ -314,33 +314,33 @@
to_chat(user, "\The [src] is welded shut!")
return TRUE
- if(C.iscrowbar() || istype(C,/obj/item/material/twohanded/fireaxe) || C.ishammer())
+ if(attacking_item.iscrowbar() || istype(attacking_item, /obj/item/material/twohanded/fireaxe) || attacking_item.ishammer())
if(operating)
return TRUE
- if(blocked && C.iscrowbar())
- user.visible_message("\The [user] pries at \the [src] with \a [C], but \the [src] is welded in place!",\
+ if(blocked && attacking_item.iscrowbar())
+ user.visible_message("\The [user] pries at \the [src] with \a [attacking_item], but \the [src] is welded in place!",\
"You try to pry \the [src] [density ? "open" : "closed"], but it is welded in place!",\
"You hear someone struggle and metal straining.")
return TRUE
- if(istype(C,/obj/item/material/twohanded/fireaxe))
- var/obj/item/material/twohanded/fireaxe/F = C
+ if(istype(attacking_item,/obj/item/material/twohanded/fireaxe))
+ var/obj/item/material/twohanded/fireaxe/F = attacking_item
if(!F.wielded)
return TRUE
- user.visible_message("\The [user] starts to force \the [src] [density ? "open" : "closed"] with \a [C]!",\
- "You start forcing \the [src] [density ? "open" : "closed"] with \the [C]!",\
+ user.visible_message("\The [user] starts to force \the [src] [density ? "open" : "closed"] with \a [attacking_item]!",\
+ "You start forcing \the [src] [density ? "open" : "closed"] with \the [attacking_item]!",\
"You hear metal strain.")
- if(C.use_tool(src, user, 30, volume = 50))
- if(C.iscrowbar() || C.ishammer())
+ if(attacking_item.use_tool(src, user, 30, volume = 50))
+ if(attacking_item.iscrowbar() || attacking_item.ishammer())
if(stat & (BROKEN|NOPOWER) || !density)
- user.visible_message("\The [user] forces \the [src] [density ? "open" : "closed"] with \a [C]!",\
- "You force \the [src] [density ? "open" : "closed"] with \the [C]!",\
+ user.visible_message("\The [user] forces \the [src] [density ? "open" : "closed"] with \a [attacking_item]!",\
+ "You force \the [src] [density ? "open" : "closed"] with \the [attacking_item]!",\
"You hear metal strain, and a door [density ? "open" : "close"].")
else
- user.visible_message("\The [user] forces \the [ blocked ? "welded" : "" ] [src] [density ? "open" : "closed"] with \a [C]!",\
- "You force \the [ blocked ? "welded" : "" ] [src] [density ? "open" : "closed"] with \the [C]!",\
+ user.visible_message("\The [user] forces \the [ blocked ? "welded" : "" ] [src] [density ? "open" : "closed"] with \a [attacking_item]!",\
+ "You force \the [ blocked ? "welded" : "" ] [src] [density ? "open" : "closed"] with \the [attacking_item]!",\
"You hear metal strain and groan, and a door [density ? "opening" : "closing"].")
if(density)
open(1, user)
diff --git a/code/game/machinery/doors/firedoor_assembly.dm b/code/game/machinery/doors/firedoor_assembly.dm
index 54721d3bbb9..871bfc3effa 100644
--- a/code/game/machinery/doors/firedoor_assembly.dm
+++ b/code/game/machinery/doors/firedoor_assembly.dm
@@ -15,9 +15,9 @@
else
icon_state = "door_construction"
-/obj/structure/firedoor_assembly/attackby(var/obj/item/C as obj, mob/user as mob)
- if(C.iscoil() && !wired && anchored)
- var/obj/item/stack/cable_coil/cable = C
+/obj/structure/firedoor_assembly/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.iscoil() && !wired && anchored)
+ var/obj/item/stack/cable_coil/cable = attacking_item
if (cable.get_amount() < 1)
to_chat(user, "You need one length of coil to wire \the [src].")
return TRUE
@@ -27,39 +27,39 @@
wired = 1
to_chat(user, "You wire \the [src].")
return TRUE
- else if(C.iswirecutter() && wired )
+ else if(attacking_item.iswirecutter() && wired )
user.visible_message("[user] cuts the wires from \the [src].", "You start to cut the wires from \the [src].")
- if(C.use_tool(src, user, 40, volume = 50))
+ if(attacking_item.use_tool(src, user, 40, volume = 50))
if(!src) return
to_chat(user, "You cut the wires!")
new/obj/item/stack/cable_coil(src.loc, 1)
wired = 0
return TRUE
- else if(istype(C, /obj/item/airalarm_electronics) && wired)
+ else if(istype(attacking_item, /obj/item/airalarm_electronics) && wired)
if(anchored)
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
user.visible_message("[user] has inserted a circuit into \the [src]!",
"You have inserted the circuit into \the [src]!")
new /obj/machinery/door/firedoor(src.loc)
- qdel(C)
+ qdel(attacking_item)
qdel(src)
else
to_chat(user, "You must secure \the [src] first!")
return TRUE
- else if(C.iswrench())
+ else if(attacking_item.iswrench())
anchored = !anchored
- playsound(src.loc, C.usesound, 50, 1)
+ playsound(src.loc, attacking_item.usesound, 50, 1)
user.visible_message("[user] has [anchored ? "" : "un" ]secured \the [src]!",
"You have [anchored ? "" : "un" ]secured \the [src]!")
update_icon()
return TRUE
- else if(!anchored && C.iswelder())
- var/obj/item/weldingtool/WT = C
+ else if(!anchored && attacking_item.iswelder())
+ var/obj/item/weldingtool/WT = attacking_item
if(WT.use(0, user))
user.visible_message("[user] dissassembles \the [src].",
"You start to dissassemble \the [src].")
- if(C.use_tool(src, user, 40, volume = 50))
+ if(attacking_item.use_tool(src, user, 40, volume = 50))
if(!src || !WT.isOn()) return
user.visible_message("[user] has dissassembled \the [src].",
"You have dissassembled \the [src].")
@@ -69,4 +69,4 @@
to_chat(user, "You need more welding fuel.")
return TRUE
else
- return ..(C, user)
+ return ..()
diff --git a/code/game/machinery/doors/unpowered.dm b/code/game/machinery/doors/unpowered.dm
index d419051a7f8..a2e46014af9 100644
--- a/code/game/machinery/doors/unpowered.dm
+++ b/code/game/machinery/doors/unpowered.dm
@@ -9,9 +9,13 @@
..()
return
-/obj/machinery/door/unpowered/attackby(obj/item/I as obj, mob/user as mob)
- if(istype(I, /obj/item/melee/energy/blade)) return TRUE
- if(src.locked) return TRUE
+/obj/machinery/door/unpowered/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/melee/energy/blade))
+ return TRUE
+
+ if(src.locked)
+ return TRUE
+
return ..()
/obj/machinery/door/unpowered/emag_act()
diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm
index af1ae869e86..5eb7de192d8 100644
--- a/code/game/machinery/doors/windowdoor.dm
+++ b/code/game/machinery/doors/windowdoor.dm
@@ -153,14 +153,14 @@
desc = "A strong door. It keeps trying to close, but is jammed."
return 1
-/obj/machinery/door/window/attackby(obj/item/I as obj, mob/user as mob)
+/obj/machinery/door/window/attackby(obj/item/attacking_item, mob/user)
//If it's in the process of opening/closing, ignore the click
if (operating)
return TRUE
//Emags and ninja swords? You may pass.
- if (istype(I, /obj/item/melee/energy/blade))
+ if (istype(attacking_item, /obj/item/melee/energy/blade))
if(emag_act(10, user))
spark(src.loc, 5)
playsound(src.loc, /singleton/sound_category/spark_sound, 50, 1)
@@ -169,9 +169,9 @@
return TRUE
//If it's emagged, crowbar can pry electronics out.
- if (emagged == 1 && I.iscrowbar())
+ if (emagged == 1 && attacking_item.iscrowbar())
user.visible_message("[user] dismantles the windoor.", "You start to dismantle the windoor.")
- if(I.use_tool(src, user, 60, volume = 50))
+ if(attacking_item.use_tool(src, user, 60, volume = 50))
to_chat(user, SPAN_NOTICE("You dismantled the windoor!"))
new /obj/item/trash/broken_electronics(loc)
var/obj/item/stack/cable_coil/CC = new /obj/item/stack/cable_coil(loc)
@@ -181,7 +181,7 @@
qdel(src)
return TRUE
- if(isobj(I) && I.iscrowbar() && user.a_intent == I_HELP)
+ if(isobj(attacking_item) && attacking_item.iscrowbar() && user.a_intent == I_HELP)
if(inoperable())
visible_message("\The [user] forces \the [src] [density ? "open" : "closed"].")
if(density)
@@ -193,16 +193,16 @@
return TRUE
//If it's a weapon, smash windoor. Unless it's an id card, agent card, ect.. then ignore it (Cards really shouldnt damage a door anyway)
- if(src.density && istype(I, /obj/item) && !istype(I, /obj/item/card))
+ if(src.density && istype(attacking_item, /obj/item) && !istype(attacking_item, /obj/item/card))
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
- var/aforce = I.force
+ var/aforce = attacking_item.force
playsound(src.loc, 'sound/effects/glass_hit.ogg', 75, 1)
- visible_message("[src] was hit by [I].")
- if(I.damtype == DAMAGE_BRUTE || I.damtype == DAMAGE_BURN)
+ visible_message("[src] was hit by [attacking_item].")
+ if(attacking_item.damtype == DAMAGE_BRUTE || attacking_item.damtype == DAMAGE_BURN)
take_damage(aforce)
return TRUE
- if(!istype(I, /obj/item/forensics))
+ if(!istype(attacking_item, /obj/item/forensics))
src.add_fingerprint(user)
if(allowed(user))
diff --git a/code/game/machinery/firealarm.dm b/code/game/machinery/firealarm.dm
index 3c4e65179a0..4a67b86f8a3 100644
--- a/code/game/machinery/firealarm.dm
+++ b/code/game/machinery/firealarm.dm
@@ -70,13 +70,13 @@
if(prob(50/severity))
alarm(rand(30/severity, 60/severity))
-/obj/machinery/firealarm/attackby(obj/item/W as obj, mob/user as mob)
- if(!istype(W, /obj/item/forensics))
+/obj/machinery/firealarm/attackby(obj/item/attacking_item, mob/user)
+ if(!istype(attacking_item, /obj/item/forensics))
src.add_fingerprint(user)
else
return TRUE
- if (W.isscrewdriver() && buildstage == 2)
+ if (attacking_item.isscrewdriver() && buildstage == 2)
if(!wiresexposed)
set_light(0)
wiresexposed = !wiresexposed
@@ -87,14 +87,14 @@
set_light(0)
switch(buildstage)
if(2)
- if (W.ismultitool())
+ if (attacking_item.ismultitool())
src.detecting = !( src.detecting )
if (src.detecting)
user.visible_message("\The [user] has reconnected [src]'s detecting unit!", "You have reconnected [src]'s detecting unit.")
else
user.visible_message("\The [user] has disconnected [src]'s detecting unit!", "You have disconnected [src]'s detecting unit.")
return TRUE
- else if (W.iswirecutter())
+ else if (attacking_item.iswirecutter())
user.visible_message("\The [user] has cut the wires inside \the [src]!", "You have cut the wires inside \the [src].")
new/obj/item/stack/cable_coil(get_turf(src), 5)
playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1)
@@ -102,17 +102,17 @@
update_icon()
return TRUE
if(1)
- if(W.iscoil())
- var/obj/item/stack/cable_coil/C = W
+ if(attacking_item.iscoil())
+ var/obj/item/stack/cable_coil/C = attacking_item
if (C.use(5))
to_chat(user, "You wire \the [src].")
buildstage = 2
else
to_chat(user, "You need 5 pieces of cable to wire \the [src].")
return TRUE
- else if(W.iscrowbar())
+ else if(attacking_item.iscrowbar())
to_chat(user, "You pry out the circuit!")
- playsound(src.loc, W.usesound, 50, 1)
+ playsound(src.loc, attacking_item.usesound, 50, 1)
spawn(20)
var/obj/item/firealarm_electronics/circuit = new /obj/item/firealarm_electronics()
circuit.forceMove(user.loc)
@@ -120,16 +120,16 @@
update_icon()
return TRUE
if(0)
- if(istype(W, /obj/item/firealarm_electronics))
+ if(istype(attacking_item, /obj/item/firealarm_electronics))
to_chat(user, "You insert the circuit!")
- qdel(W)
+ qdel(attacking_item)
buildstage = 1
update_icon()
return TRUE
- else if(W.iswrench())
+ else if(attacking_item.iswrench())
to_chat(user, "You remove the fire alarm assembly from the wall!")
new /obj/item/frame/fire_alarm(get_turf(user))
- playsound(src.loc, W.usesound, 50, 1)
+ playsound(src.loc, attacking_item.usesound, 50, 1)
qdel(src)
return TRUE
return TRUE
diff --git a/code/game/machinery/flasher.dm b/code/game/machinery/flasher.dm
index e16fbd95512..e7cb3075c46 100644
--- a/code/game/machinery/flasher.dm
+++ b/code/game/machinery/flasher.dm
@@ -49,8 +49,8 @@
// src.sd_SetLuminosity(0)
//Don't want to render prison breaks impossible
-/obj/machinery/flasher/attackby(obj/item/W as obj, mob/user as mob)
- if (W.iswirecutter())
+/obj/machinery/flasher/attackby(obj/item/attacking_item, mob/user)
+ if (attacking_item.iswirecutter())
add_fingerprint(user)
src.disable = !src.disable
if (src.disable)
@@ -107,8 +107,8 @@
if (src.anchored)
src.flash()
-/obj/machinery/flasher/portable/attackby(obj/item/W as obj, mob/user as mob)
- if (W.iswrench())
+/obj/machinery/flasher/portable/attackby(obj/item/attacking_item, mob/user)
+ if (attacking_item.iswrench())
add_fingerprint(user)
src.anchored = !src.anchored
diff --git a/code/game/machinery/floodlight.dm b/code/game/machinery/floodlight.dm
index 59eb8b0d3b7..a069883ca5f 100644
--- a/code/game/machinery/floodlight.dm
+++ b/code/game/machinery/floodlight.dm
@@ -106,8 +106,8 @@
update_icon()
-/obj/machinery/floodlight/attackby(obj/item/W, mob/user)
- if(W.isscrewdriver())
+/obj/machinery/floodlight/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.isscrewdriver())
if(!open)
unlocked = !unlocked
var/msg = unlocked ? "You unscrew the battery panel." : "You screw the battery panel into place."
@@ -115,7 +115,7 @@
else
to_chat(user, SPAN_WARNING("\The [src]'s battery panel is open and cannot be screwed down!"))
return TRUE
- if(W.iscrowbar())
+ if(attacking_item.iscrowbar())
if(unlocked)
open = !open
var/msg = open ? "You remove the battery panel." : "You crowbar the battery panel into place."
@@ -123,14 +123,14 @@
else
to_chat(user, SPAN_WARNING("\The [src]'s battery panel is still screwed shut!"))
return TRUE
- if(istype(W, /obj/item/cell))
+ if(istype(attacking_item, /obj/item/cell))
if(open)
if(cell)
to_chat(user, SPAN_WARNING("There is a power cell already installed."))
return
else
- user.drop_from_inventory(W, src)
- cell = W
+ user.drop_from_inventory(attacking_item, src)
+ cell = attacking_item
to_chat(user, SPAN_NOTICE("You insert the power cell."))
return TRUE
update_icon()
diff --git a/code/game/machinery/floor_frames.dm b/code/game/machinery/floor_frames.dm
index b9329472193..2e556c0b15d 100644
--- a/code/game/machinery/floor_frames.dm
+++ b/code/game/machinery/floor_frames.dm
@@ -9,8 +9,8 @@
var/refund_type = /obj/item/stack/material/steel
var/reverse = 0 //if resulting object faces opposite its dir (like light fixtures)
-/obj/item/floor_frame/attackby(obj/item/W, mob/user)
- if (W.iswrench())
+/obj/item/floor_frame/attackby(obj/item/attacking_item, mob/user)
+ if (attacking_item.iswrench())
new refund_type(get_turf(src.loc), refund_amt)
qdel(src)
return TRUE
diff --git a/code/game/machinery/floor_light.dm b/code/game/machinery/floor_light.dm
index 33313c0520d..b92515d37d4 100644
--- a/code/game/machinery/floor_light.dm
+++ b/code/game/machinery/floor_light.dm
@@ -24,18 +24,18 @@ var/list/floor_light_cache = list()
/obj/machinery/floor_light/prebuilt
anchored = 1
-/obj/machinery/floor_light/attackby(var/obj/item/W, var/mob/user)
- if(W.isscrewdriver())
+/obj/machinery/floor_light/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.isscrewdriver())
anchored = !anchored
visible_message("\The [user] has [anchored ? "attached" : "detached"] \the [src].")
playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1)
return TRUE
- else if(W.iswelder() && (damaged || (stat & BROKEN)))
- var/obj/item/weldingtool/WT = W
+ else if(attacking_item.iswelder() && (damaged || (stat & BROKEN)))
+ var/obj/item/weldingtool/WT = attacking_item
if(!WT.use(0, user))
to_chat(user, "\The [src] must be on to complete this task.")
return TRUE
- if(!W.use_tool(src, user, 20, volume = 50))
+ if(!attacking_item.use_tool(src, user, 20, volume = 50))
return TRUE
if(!src || !WT.isOn())
return TRUE
@@ -45,9 +45,9 @@ var/list/floor_light_cache = list()
damaged = null
update_brightness()
return TRUE
- else if(W.force && user.a_intent == "hurt")
+ else if(attacking_item.force && user.a_intent == "hurt")
return attack_hand(user)
- else if(W.iscrowbar())
+ else if(attacking_item.iscrowbar())
if(anchored)
to_chat(user, "\The [src] must be unfastened from the [loc] first!")
return TRUE
diff --git a/code/game/machinery/floorlayer.dm b/code/game/machinery/floorlayer.dm
index 1f421f6bc40..277251d822c 100644
--- a/code/game/machinery/floorlayer.dm
+++ b/code/game/machinery/floorlayer.dm
@@ -33,21 +33,21 @@
on = !on
user.visible_message("[user] has [!on ? "de" : ""]activated \the [src].", SPAN_NOTICE("You [!on ? "de" : ""]activate \the [src]."))
-/obj/machinery/floorlayer/attackby(obj/item/I, mob/user)
- if(I.iswrench())
+/obj/machinery/floorlayer/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.iswrench())
var/m = tgui_input_list(user, "Choose work mode", "Mode", mode)
mode[m] = !mode[m]
var/O = mode[m]
user.visible_message("[user] has set \the [src] [m] mode [!O ? "off" : "on"].", SPAN_NOTICE("You set \the [src] [m] mode [!O ? "off":"on"]."))
return TRUE
- if(istype(I, /obj/item/stack/tile))
- to_chat(user, SPAN_NOTICE("You successfully load \the [I] into \the [src]."))
- user.drop_from_inventory(I, src)
- take_tile(I)
+ if(istype(attacking_item, /obj/item/stack/tile))
+ to_chat(user, SPAN_NOTICE("You successfully load \the [attacking_item] into \the [src]."))
+ user.drop_from_inventory(attacking_item, src)
+ take_tile(attacking_item)
return TRUE
- if(I.iscrowbar())
+ if(attacking_item.iscrowbar())
if(!length(contents))
to_chat(user, SPAN_NOTICE("\The [src] is empty."))
else
@@ -58,7 +58,7 @@
T = null
return TRUE
- if(I.isscrewdriver())
+ if(attacking_item.isscrewdriver())
T = tgui_input_list(user, "Choose which set of tiles you want \the [src] to lay.", "Tiles", contents)
return TRUE
diff --git a/code/game/machinery/gumball.dm b/code/game/machinery/gumball.dm
index 7d9cad18da2..f5afb57ef9f 100644
--- a/code/game/machinery/gumball.dm
+++ b/code/game/machinery/gumball.dm
@@ -58,9 +58,9 @@
on = 1
-/obj/machinery/gumballmachine/attackby(obj/item/W as obj, mob/user as mob)
- if (istype(W, /obj/item/spacecash))
- var/obj/item/spacecash/C = W
+/obj/machinery/gumballmachine/attackby(obj/item/attacking_item, mob/user)
+ if (istype(attacking_item, /obj/item/spacecash))
+ var/obj/item/spacecash/C = attacking_item
if(!on)
to_chat(user, SPAN_WARNING("\The [src] has no power!"))
return TRUE
@@ -79,13 +79,13 @@
if(changeleftover)
spawn_money(changeleftover, src.loc, user)
- if(istype(W, /obj/item) && user.a_intent == I_HURT && !istype(W, /obj/item/spacecash))
+ if(istype(attacking_item, /obj/item) && user.a_intent == I_HURT && !istype(attacking_item, /obj/item/spacecash))
if(broken)
return
if(prob(25))
smashgumball()
else
- visible_message(SPAN_WARNING("\The [user] bash's \the [src] with \the [W]."))
+ visible_message(SPAN_WARNING("\The [user] bash's \the [src] with \the [attacking_item]."))
return TRUE
diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm
index fbc5ddfefd0..a5d06012f36 100644
--- a/code/game/machinery/hologram.dm
+++ b/code/game/machinery/hologram.dm
@@ -273,9 +273,9 @@ Possible to do for anyone motivated enough:
return 0
return -1
-/obj/machinery/hologram/holopad/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/modular_computer))
- var/obj/item/modular_computer/MC = W
+/obj/machinery/hologram/holopad/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/modular_computer))
+ var/obj/item/modular_computer/MC = attacking_item
if(!(MC in linked_pdas))
linked_pdas |= MC
to_chat(user, SPAN_NOTICE("You link \the [MC] to \the [src]."))
diff --git a/code/game/machinery/igniter.dm b/code/game/machinery/igniter.dm
index 51eeb085f12..7c77a8b42b9 100755
--- a/code/game/machinery/igniter.dm
+++ b/code/game/machinery/igniter.dm
@@ -102,8 +102,8 @@
..()
update_icon()
-/obj/machinery/sparker/attackby(obj/item/W as obj, mob/user as mob)
- if (W.isscrewdriver())
+/obj/machinery/sparker/attackby(obj/item/attacking_item, mob/user)
+ if (attacking_item.isscrewdriver())
add_fingerprint(user)
disable = !disable
if(disable)
diff --git a/code/game/machinery/iv_drip.dm b/code/game/machinery/iv_drip.dm
index 1acf847edc1..3146e46dad6 100644
--- a/code/game/machinery/iv_drip.dm
+++ b/code/game/machinery/iv_drip.dm
@@ -397,48 +397,48 @@
breath_mask = null
update_icon()
-/obj/machinery/iv_drip/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/reagent_containers/blood/ripped))
+/obj/machinery/iv_drip/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/reagent_containers/blood/ripped))
to_chat(user, "You can't use a ripped bloodpack.")
return TRUE
- if(is_type_in_list(W, accepted_containers))
+ if(is_type_in_list(attacking_item, accepted_containers))
if(beaker)
to_chat(user, "There is already a reagent container loaded!")
return TRUE
- user.drop_from_inventory(W, src)
- beaker = W
- user.visible_message(SPAN_NOTICE("[user] attaches \the [W] to \the [src]."), SPAN_NOTICE("You attach \the [W] to \the [src]."))
+ user.drop_from_inventory(attacking_item, src)
+ beaker = attacking_item
+ user.visible_message(SPAN_NOTICE("[user] attaches \the [attacking_item] to \the [src]."), SPAN_NOTICE("You attach \the [attacking_item] to \the [src]."))
update_icon()
return TRUE
- if(istype(W, /obj/item/clothing/mask/breath))
- if(is_type_in_list(W, mask_blacklist))
- to_chat(user, "\The [W] is incompatible with \the [src].")
+ if(istype(attacking_item, /obj/item/clothing/mask/breath))
+ if(is_type_in_list(attacking_item, mask_blacklist))
+ to_chat(user, "\The [attacking_item] is incompatible with \the [src].")
return TRUE
if(breath_mask)
to_chat(user, "There is already a mask installed.")
return TRUE
- user.drop_from_inventory(W, src)
- breath_mask = W
- user.visible_message(SPAN_NOTICE("[user] places \the [W] in \the [src]."), SPAN_NOTICE("You place \the [W] in \the [src]."))
+ user.drop_from_inventory(attacking_item, src)
+ breath_mask = attacking_item
+ user.visible_message(SPAN_NOTICE("[user] places \the [attacking_item] in \the [src]."), SPAN_NOTICE("You place \the [attacking_item] in \the [src]."))
update_icon()
return TRUE
- if(istype(W, /obj/item/tank))
- if(is_type_in_list(W, tank_blacklist))
- to_chat(user, "\The [W] is incompatible with \the [src].")
+ if(istype(attacking_item, /obj/item/tank))
+ if(is_type_in_list(attacking_item, tank_blacklist))
+ to_chat(user, "\The [attacking_item] is incompatible with \the [src].")
return TRUE
if(tank)
to_chat(user, "There is already a tank installed!")
return TRUE
- if(istype(W, /obj/item/tank/phoron))
+ if(istype(attacking_item, /obj/item/tank/phoron))
if(tipped)
- to_chat(user, "You're not sure how to place \the [W] in the fallen [src].")
+ to_chat(user, "You're not sure how to place \the [attacking_item] in the fallen [src].")
return TRUE
- user.drop_from_inventory(W, src)
- tank = W
- user.visible_message(SPAN_NOTICE("[user] places \the [W] in \the [src]."), SPAN_NOTICE("You place \the [W] in \the [src]."))
+ user.drop_from_inventory(attacking_item, src)
+ tank = attacking_item
+ user.visible_message(SPAN_NOTICE("[user] places \the [attacking_item] in \the [src]."), SPAN_NOTICE("You place \the [attacking_item] in \the [src]."))
update_icon()
return TRUE
- if(W.iswrench())
+ if(attacking_item.iswrench())
if(!tank)
to_chat(user, "There isn't a tank installed for you to secure!")
return TRUE
@@ -451,9 +451,9 @@
playsound(src.loc, 'sound/items/wrench.ogg', 50, 1)
is_loose = !is_loose
return TRUE
- if(default_deconstruction_screwdriver(user, W))
+ if(default_deconstruction_screwdriver(user, attacking_item))
return TRUE
- if(default_part_replacement(user, W))
+ if(default_part_replacement(user, attacking_item))
return TRUE
return ..()
diff --git a/code/game/machinery/jukebox.dm b/code/game/machinery/jukebox.dm
index d046c4ab4dd..63f4fdd88a6 100644
--- a/code/game/machinery/jukebox.dm
+++ b/code/game/machinery/jukebox.dm
@@ -161,16 +161,16 @@
new /obj/effect/decal/cleanable/blood/oil(src.loc)
qdel(src)
-/obj/machinery/media/jukebox/attackby(obj/item/W as obj, mob/user as mob)
- if(!istype(W, /obj/item/forensics))
+/obj/machinery/media/jukebox/attackby(obj/item/attacking_item, mob/user)
+ if(!istype(attacking_item, /obj/item/forensics))
src.add_fingerprint(user)
- if(W.iswrench())
+ if(attacking_item.iswrench())
if(playing)
StopPlaying()
user.visible_message("[user] has [anchored ? "un" : ""]secured \the [src].", "You [anchored ? "un" : ""]secure \the [src].")
anchored = !anchored
- playsound(src.loc, W.usesound, 50, 1)
+ playsound(src.loc, attacking_item.usesound, 50, 1)
power_change()
update_icon()
return TRUE
diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm
index 5d442d1dc65..ade9364b35b 100644
--- a/code/game/machinery/machinery.dm
+++ b/code/game/machinery/machinery.dm
@@ -297,20 +297,20 @@ Class Procs:
return ..()
-/obj/machinery/attackby(obj/item/W, mob/user)
+/obj/machinery/attackby(obj/item/attacking_item, mob/user)
if(obj_flags & OBJ_FLAG_SIGNALER)
- if(issignaler(W))
+ if(issignaler(attacking_item))
if(signaler)
to_chat(user, SPAN_WARNING("\The [src] already has a signaler attached."))
return TRUE
- var/obj/item/device/assembly/signaler/S = W
- user.drop_from_inventory(W, src)
+ var/obj/item/device/assembly/signaler/S = attacking_item
+ user.drop_from_inventory(attacking_item, src)
signaler = S
S.machine = src
user.visible_message("[user] attaches \the [S] to \the [src].", SPAN_NOTICE("You attach \the [S] to \the [src]."), range = 3)
log_and_message_admins("has attached a signaler to \the [src].", user, get_turf(src))
return TRUE
- else if(W.iswirecutter() && signaler)
+ else if(attacking_item.iswirecutter() && signaler)
user.visible_message("[user] removes \the [signaler] from \the [src].", SPAN_NOTICE("You remove \the [signaler] from \the [src]."), range = 3)
user.put_in_hands(detach_signaler())
return TRUE
diff --git a/code/game/machinery/mass_driver.dm b/code/game/machinery/mass_driver.dm
index 890cbac3ecb..7c84574b574 100644
--- a/code/game/machinery/mass_driver.dm
+++ b/code/game/machinery/mass_driver.dm
@@ -54,17 +54,17 @@
drive()
-/obj/machinery/mass_driver/attackby(obj/item/W, mob/user)
+/obj/machinery/mass_driver/attackby(obj/item/attacking_item, mob/user)
- if(W.iswrench())
+ if(attacking_item.iswrench())
if(!anchored)
- playsound(src.loc, W.usesound, 75, 1)
+ playsound(src.loc, attacking_item.usesound, 75, 1)
user.visible_message("[user.name] secures [src] to the floor.", \
"You secure the external reinforcing bolts to the floor.", \
"You hear a ratchet")
src.anchored = 1
else
- playsound(src.loc, W.usesound, 75, 1)
+ playsound(src.loc, attacking_item.usesound, 75, 1)
user.visible_message("[user.name] unsecures [src] from the floor.", \
"You unsecure the external reinforcing bolts from the floor.", \
"You hear a ratchet")
diff --git a/code/game/machinery/mecha_fabricator.dm b/code/game/machinery/mecha_fabricator.dm
index c7be31322d2..dfaa9bac859 100644
--- a/code/game/machinery/mecha_fabricator.dm
+++ b/code/game/machinery/mecha_fabricator.dm
@@ -147,21 +147,21 @@
return 1
-/obj/machinery/mecha_part_fabricator/attackby(var/obj/item/I, var/mob/user)
+/obj/machinery/mecha_part_fabricator/attackby(obj/item/attacking_item, mob/user)
if(busy)
to_chat(user, SPAN_NOTICE("\The [src] is busy. Please wait for completion of previous operation."))
return TRUE
- if(default_deconstruction_screwdriver(user, I))
+ if(default_deconstruction_screwdriver(user, attacking_item))
return TRUE
- if(default_deconstruction_crowbar(user, I))
+ if(default_deconstruction_crowbar(user, attacking_item))
return TRUE
- if(default_part_replacement(user, I))
+ if(default_part_replacement(user, attacking_item))
return TRUE
- if(!istype(I, /obj/item/stack/material))
+ if(!istype(attacking_item, /obj/item/stack/material))
return ..()
- var/obj/item/stack/material/M = I
+ var/obj/item/stack/material/M = attacking_item
if(!M.material)
return ..()
if(!(M.material.name in list(MATERIAL_STEEL, MATERIAL_GLASS, MATERIAL_GOLD, MATERIAL_SILVER, MATERIAL_DIAMOND, MATERIAL_PHORON, MATERIAL_URANIUM)))
diff --git a/code/game/machinery/navbeacon.dm b/code/game/machinery/navbeacon.dm
index de0beb938c0..8d68e718a72 100644
--- a/code/game/machinery/navbeacon.dm
+++ b/code/game/machinery/navbeacon.dm
@@ -101,12 +101,12 @@ var/global/list/navbeacons // no I don't like putting this in, but it will do
frequency.post_signal(src, signal, filter = RADIO_NAVBEACONS)
-/obj/machinery/navbeacon/attackby(var/obj/item/I, var/mob/user)
+/obj/machinery/navbeacon/attackby(obj/item/attacking_item, mob/user)
var/turf/T = loc
if(!T.is_plating())
return // prevent intraction when T-scanner revealed
- if(I.isscrewdriver())
+ if(attacking_item.isscrewdriver())
open = !open
user.visible_message("[user] [open ? "opens" : "closes"] the beacon's cover.", "You [open ? "open" : "close"] the beacon's cover.")
@@ -114,7 +114,7 @@ var/global/list/navbeacons // no I don't like putting this in, but it will do
update_icon()
return TRUE
- else if (I.GetID())
+ else if (attacking_item.GetID())
if(open)
if (src.allowed(user))
src.locked = !src.locked
diff --git a/code/game/machinery/newscaster.dm b/code/game/machinery/newscaster.dm
index d62015b5b2d..93e3327c116 100644
--- a/code/game/machinery/newscaster.dm
+++ b/code/game/machinery/newscaster.dm
@@ -810,15 +810,15 @@ var/list/obj/machinery/newscaster/allCasters = list()
-/obj/machinery/newscaster/attackby(obj/item/I as obj, mob/user as mob)
+/obj/machinery/newscaster/attackby(obj/item/attacking_item, mob/user)
if (src.isbroken)
playsound(src.loc, 'sound/effects/hit_on_shattered_glass.ogg', 100, 1)
for (var/mob/O in hearers(5, src.loc))
O.show_message("[user.name] further abuses the shattered [src.name].")
else
- if(istype(I, /obj/item) )
+ if(istype(attacking_item, /obj/item) )
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
- var/obj/item/W = I
+ var/obj/item/W = attacking_item
if(W.force <15)
for (var/mob/O in hearers(5, src.loc))
O.show_message("[user.name] hits the [src.name] with the [W.name] with no visible effect." )
@@ -832,7 +832,7 @@ var/list/obj/machinery/newscaster/allCasters = list()
playsound(src.loc, /singleton/sound_category/glass_break_sound, 100, 1)
else
for (var/mob/O in hearers(5, src.loc))
- O.show_message("[user.name] forcefully slams the [src.name] with the [I.name]!" )
+ O.show_message("[user.name] forcefully slams the [src.name] with the [attacking_item.name]!" )
playsound(src.loc, 'sound/effects/glass_hit.ogg', 100, 1)
else
to_chat(user, "This does nothing.")
@@ -1026,8 +1026,8 @@ var/list/obj/machinery/newscaster/allCasters = list()
src.attack_self(src.loc)
-/obj/item/newspaper/attackby(obj/item/W as obj, mob/user as mob)
- if(W.ispen())
+/obj/item/newspaper/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.ispen())
if(rolled)
user.visible_message(SPAN_NOTICE("\The [user] unrolls \the [src] to write on it."),\
SPAN_NOTICE("You unroll \the [src] to write on it."))
@@ -1035,8 +1035,7 @@ var/list/obj/machinery/newscaster/allCasters = list()
if(src.scribble_page == src.curr_page)
to_chat(user, "There's already a scribble in this page... You wouldn't want to make things too cluttered, would you?")
else
- var/s = sanitize(input(user, "Write something", "Newspaper", ""))
- s = sanitize(s)
+ var/s = sanitize( tgui_input_text(user, "Write something", "Newspaper", "") )
if (!s)
return
if (!in_range(src, usr) && src.loc != usr)
diff --git a/code/game/machinery/nuclear_bomb.dm b/code/game/machinery/nuclear_bomb.dm
index 87b266434d5..7af37bbd749 100644
--- a/code/game/machinery/nuclear_bomb.dm
+++ b/code/game/machinery/nuclear_bomb.dm
@@ -43,20 +43,20 @@ var/bomb_set
SSnanoui.update_uis(src)
return
-/obj/machinery/nuclearbomb/attackby(obj/item/O as obj, mob/user as mob, params)
- if (O.isscrewdriver())
+/obj/machinery/nuclearbomb/attackby(obj/item/attacking_item, mob/user, params)
+ if (attacking_item.isscrewdriver())
src.add_fingerprint(user)
if (src.auth)
if (panel_open == 0)
panel_open = 1
add_overlay("panel_open")
to_chat(user, "You unscrew the control panel of [src].")
- playsound(src, O.usesound, 50, 1)
+ playsound(src, attacking_item.usesound, 50, 1)
else
panel_open = 0
cut_overlay("panel_open")
to_chat(user, "You screw the control panel of [src] back on.")
- playsound(src, O.usesound, 50, 1)
+ playsound(src, attacking_item.usesound, 50, 1)
else
if (panel_open == 0)
to_chat(user, "\The [src] emits a buzzing noise, the panel staying locked in.")
@@ -64,78 +64,78 @@ var/bomb_set
panel_open = 0
cut_overlay("panel_open")
to_chat(user, "You screw the control panel of \the [src] back on.")
- playsound(src, O.usesound, 50, 1)
+ playsound(src, attacking_item.usesound, 50, 1)
flick("lock", src)
return TRUE
- if (panel_open && (O.ismultitool() || O.iswirecutter()))
+ if (panel_open && (attacking_item.ismultitool() || attacking_item.iswirecutter()))
return attack_hand(user)
if (src.extended)
- if (istype(O, /obj/item/disk/nuclear))
- usr.drop_from_inventory(O,src)
- src.auth = O
+ if (istype(attacking_item, /obj/item/disk/nuclear))
+ usr.drop_from_inventory(attacking_item,src)
+ src.auth = attacking_item
src.add_fingerprint(user)
return attack_hand(user)
if (src.anchored)
switch(removal_stage)
if(0)
- if(O.iswelder())
- var/obj/item/weldingtool/WT = O
+ if(attacking_item.iswelder())
+ var/obj/item/weldingtool/WT = attacking_item
if(!WT.isOn()) return TRUE
if (WT.get_fuel() < 5) // uses up 5 fuel.
to_chat(user, "You need more fuel to complete this task.")
return TRUE
- user.visible_message("[user] starts cutting loose the anchoring bolt covers on [src].", "You start cutting loose the anchoring bolt covers with [O]...")
+ user.visible_message("[user] starts cutting loose the anchoring bolt covers on [src].", "You start cutting loose the anchoring bolt covers with [attacking_item]...")
- if(O.use_tool(src, user, 40, volume = 50))
+ if(attacking_item.use_tool(src, user, 40, volume = 50))
if(!src || !user || !WT.use(5, user)) return TRUE
user.visible_message("[user] cuts through the bolt covers on [src].", "You cut through the bolt cover.")
removal_stage = 1
return TRUE
if(1)
- if(O.iscrowbar())
- user.visible_message("[user] starts forcing open the bolt covers on [src].", "You start forcing open the anchoring bolt covers with [O]...")
+ if(attacking_item.iscrowbar())
+ user.visible_message("[user] starts forcing open the bolt covers on [src].", "You start forcing open the anchoring bolt covers with [attacking_item]...")
- if(O.use_tool(src, user, 15, volume = 50))
+ if(attacking_item.use_tool(src, user, 15, volume = 50))
if(!src || !user) return TRUE
user.visible_message("[user] forces open the bolt covers on [src].", "You force open the bolt covers.")
removal_stage = 2
return TRUE
if(2)
- if(O.iswelder())
- var/obj/item/weldingtool/WT = O
+ if(attacking_item.iswelder())
+ var/obj/item/weldingtool/WT = attacking_item
if(!WT.isOn()) return TRUE
if (WT.get_fuel() < 5) // uses up 5 fuel.
to_chat(user, "You need more fuel to complete this task.")
return TRUE
- user.visible_message("[user] starts cutting apart the anchoring system sealant on [src].", "You start cutting apart the anchoring system's sealant with [O]...")
+ user.visible_message("[user] starts cutting apart the anchoring system sealant on [src].", "You start cutting apart the anchoring system's sealant with [attacking_item]...")
- if(O.use_tool(src, user, 150, amount = 5, volume = 50))
+ if(attacking_item.use_tool(src, user, 150, amount = 5, volume = 50))
user.visible_message("[user] cuts apart the anchoring system sealant on [src].", "You cut apart the anchoring system's sealant.")
removal_stage = 3
return TRUE
if(3)
- if(O.iswrench())
+ if(attacking_item.iswrench())
user.visible_message("[user] begins unwrenching the anchoring bolts on [src].", "You begin unwrenching the anchoring bolts...")
- if(O.use_tool(src, user, 50, volume = 50))
+ if(attacking_item.use_tool(src, user, 50, volume = 50))
if(!src || !user) return TRUE
user.visible_message("[user] unwrenches the anchoring bolts on [src].", "You unwrench the anchoring bolts.")
removal_stage = 4
return TRUE
if(4)
- if(O.iscrowbar())
+ if(attacking_item.iscrowbar())
user.visible_message("[user] begins lifting [src] off of the anchors.", "You begin lifting the device off the anchors...")
- if(O.use_tool(src, user, 80, volume = 50))
+ if(attacking_item.use_tool(src, user, 80, volume = 50))
if(!src || !user) return TRUE
user.visible_message("[user] crowbars [src] off of the anchors. It can now be moved.", "You jam the crowbar under the nuclear device and lift it off its anchors. You can now move it!")
anchored = 0
diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm
index e4b2f399c06..5638c5925f0 100644
--- a/code/game/machinery/pipe/construction.dm
+++ b/code/game/machinery/pipe/construction.dm
@@ -490,15 +490,15 @@
/obj/item/pipe/attack_self(mob/user as mob)
return rotate()
-/obj/item/pipe/attackby(var/obj/item/W as obj, var/mob/user as mob)
+/obj/item/pipe/attackby(obj/item/attacking_item, mob/user)
..()
//*
- if (!W.iswrench() && !istype(W, /obj/item/pipewrench))
+ if (!attacking_item.iswrench() && !istype(attacking_item, /obj/item/pipewrench))
return ..()
- if(istype(W, /obj/item/pipewrench))
- var/action = alert(user, "Change pipe?", "Change pipe", "Yes", "No")
+ if(istype(attacking_item, /obj/item/pipewrench))
+ var/action = tgui_input_list(user, "Change pipe?", "Change pipe", list("Yes", "No"), "No")
if(action == "Yes")
- action = alert(user, "Change pipe type?", "Change pipe", "Yes", "No")
+ action = tgui_input_list(user, "Change pipe type?", "Change pipe", list("Yes", "No"), "No")
if(action == "No")
if(pipe_type in list (PIPE_SIMPLE_STRAIGHT, PIPE_SIMPLE_BENT, PIPE_SCRUBBERS_STRAIGHT, PIPE_SCRUBBERS_BENT, PIPE_SUPPLY_BENT, PIPE_SUPPLY_STRAIGHT, PIPE_FUEL_STRAIGHT, PIPE_FUEL_BENT, PIPE_AUX_STRAIGHT, PIPE_AUX_BENT))
if(pipe_type in list (PIPE_SIMPLE_STRAIGHT, PIPE_SCRUBBERS_STRAIGHT, PIPE_SUPPLY_STRAIGHT, PIPE_FUEL_STRAIGHT, PIPE_AUX_STRAIGHT))
@@ -1506,7 +1506,7 @@
P.atmos_init()
P.build_network()
- playsound(src.loc, W.usesound, 50, 1)
+ playsound(src.loc, attacking_item.usesound, 50, 1)
user.visible_message( \
"[user] fastens the [src].", \
"You have fastened the [src].", \
@@ -1528,13 +1528,13 @@
item_state = "buildpipe"
w_class = ITEMSIZE_LARGE
-/obj/item/pipe_meter/attackby(var/obj/item/W as obj, var/mob/user as mob)
- if (W.iswrench())
+/obj/item/pipe_meter/attackby(obj/item/attacking_item, mob/user)
+ if (attacking_item.iswrench())
if(!locate(/obj/machinery/atmospherics/pipe, src.loc))
to_chat(user, "You need to fasten it to a pipe")
return 1
new/obj/machinery/meter( src.loc )
- playsound(src.loc, W.usesound, 50, 1)
+ playsound(src.loc, attacking_item.usesound, 50, 1)
to_chat(user, "You have fastened the meter to the pipe")
qdel(src)
return TRUE
diff --git a/code/game/machinery/pipe/pipe_dispenser.dm b/code/game/machinery/pipe/pipe_dispenser.dm
index 33eab437c8b..1e5ae6d9224 100644
--- a/code/game/machinery/pipe/pipe_dispenser.dm
+++ b/code/game/machinery/pipe/pipe_dispenser.dm
@@ -115,18 +115,18 @@
new /obj/item/pipe_meter(loc)
pipe_cooldown = world.time + 1.5 SECONDS
-/obj/machinery/pipedispenser/attackby(obj/item/I, mob/user)
- if(!istype(I, /obj/item/forensics))
+/obj/machinery/pipedispenser/attackby(obj/item/attacking_item, mob/user)
+ if(!istype(attacking_item, /obj/item/forensics))
add_fingerprint(user)
- if(istype(I, /obj/item/pipe) || istype(I, /obj/item/pipe_meter))
- to_chat(usr, SPAN_NOTICE("You put \the [I] back into \the [src]."))
- user.remove_from_mob(I) //Catches robot gripper duplication
- qdel(I)
+ if(istype(attacking_item, /obj/item/pipe) || istype(attacking_item, /obj/item/pipe_meter))
+ to_chat(usr, SPAN_NOTICE("You put \the [attacking_item] back into \the [src]."))
+ user.remove_from_mob(attacking_item) //Catches robot gripper duplication
+ qdel(attacking_item)
return TRUE
- else if(I.iswrench())
+ else if(attacking_item.iswrench())
if(anchored)
to_chat(user, SPAN_NOTICE("You begin to unfasten \the [src] from the floor..."))
- if(I.use_tool(src, user, 40, volume = 50))
+ if(attacking_item.use_tool(src, user, 40, volume = 50))
user.visible_message("[user] unfastens \the [src].", SPAN_NOTICE("You have unfastened \the [src]. Now it can be pulled somewhere else."), SPAN_NOTICE("You hear a ratcheting noise."))
anchored = FALSE
stat |= MAINT
@@ -134,7 +134,7 @@
usr << browse(null, "window=[window_id]")
else
to_chat(user, SPAN_NOTICE("You begin to fasten \the [src] to the floor..."))
- if(I.use_tool(src, user, 20, volume = 50))
+ if(attacking_item.use_tool(src, user, 20, volume = 50))
user.visible_message("[user] fastens \the [src].", SPAN_NOTICE("You have fastened \the [src]. Now it can dispense pipes."), SPAN_NOTICE("You hear a ratcheting noise."))
anchored = TRUE
stat &= ~MAINT
diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm
index d699b15039f..075fb2cc38c 100644
--- a/code/game/machinery/portable_turret.dm
+++ b/code/game/machinery/portable_turret.dm
@@ -317,13 +317,13 @@
stat |= NOPOWER
queue_icon_update()
-/obj/machinery/porta_turret/attackby(obj/item/I, mob/user)
+/obj/machinery/porta_turret/attackby(obj/item/attacking_item, mob/user)
if(stat & BROKEN)
- if(I.iscrowbar())
+ if(attacking_item.iscrowbar())
//If the turret is destroyed, you can remove it with a crowbar to
//try and salvage its components
to_chat(user, "You begin prying the metal coverings off.")
- if(I.use_tool(src, user, 20, volume = 50))
+ if(attacking_item.use_tool(src, user, 20, volume = 50))
if(prob(70) && !no_salvage)
to_chat(user, "You remove the turret and salvage some components.")
if(installation)
@@ -338,7 +338,7 @@
qdel(src) // qdel
return TRUE
- else if((I.iswrench()))
+ else if((attacking_item.iswrench()))
if (immobile)
to_chat(user, "[src] is firmly attached to the ground with some form of epoxy.")
return TRUE
@@ -359,22 +359,22 @@
)
wrenching = 1
- if(I.use_tool(src, user, 50, volume = 50))
+ if(attacking_item.use_tool(src, user, 50, volume = 50))
//This code handles moving the turret around. After all, it's a portable turret!
if(!anchored)
- playsound(loc, I.usesound, 100, 1)
+ playsound(loc, attacking_item.usesound, 100, 1)
anchored = 1
update_icon()
to_chat(user, "You secure the exterior bolts on the turret.")
else if(anchored)
- playsound(loc, I.usesound, 100, 1)
+ playsound(loc, attacking_item.usesound, 100, 1)
anchored = 0
to_chat(user, "You unsecure the exterior bolts on the turret.")
update_icon()
wrenching = 0
return TRUE
- else if(I.GetID())
+ else if(attacking_item.GetID())
//Behavior lock/unlock mangement
if(allowed(user))
locked = !locked
@@ -384,8 +384,8 @@
to_chat(user, "Access denied.")
return TRUE
- else if(I.iswelder())
- var/obj/item/weldingtool/WT = I
+ else if(attacking_item.iswelder())
+ var/obj/item/weldingtool/WT = attacking_item
if (!WT.welding)
to_chat(user, "\The [WT] must be turned on!")
else if (health == maxhealth)
@@ -407,8 +407,8 @@
else
//if the turret was attacked with the intention of harming it:
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
- take_damage(I.force * 0.5)
- if(I.force * 0.5 > 1) //if the force of impact dealt at least 1 damage, the turret gets pissed off
+ take_damage(attacking_item.force * 0.5)
+ if(attacking_item.force * 0.5 > 1) //if the force of impact dealt at least 1 damage, the turret gets pissed off
if(!attacked && !emagged)
attacked = 1
addtimer(CALLBACK(src, PROC_REF(reset_attacked)), 1 SECONDS, TIMER_UNIQUE | TIMER_OVERRIDE)
@@ -836,28 +836,28 @@
icon_state = "turret_frame_0_1"
case_sprite_set = 1
-/obj/machinery/porta_turret_construct/attackby(obj/item/I, mob/user)
+/obj/machinery/porta_turret_construct/attackby(obj/item/attacking_item, mob/user)
//this is a bit unwieldy but self-explanatory
switch(build_step)
if(0) //first step
- if(I.iswrench() && !anchored)
- playsound(loc, I.usesound, 100, 1)
+ if(attacking_item.iswrench() && !anchored)
+ playsound(loc, attacking_item.usesound, 100, 1)
to_chat(user, "You secure the external bolts.")
anchored = 1
build_step = 1
icon_state = "turret_frame_1_[case_sprite_set]"
return TRUE
- else if(I.iscrowbar() && !anchored)
- playsound(loc, I.usesound, 75, 1)
+ else if(attacking_item.iscrowbar() && !anchored)
+ playsound(loc, attacking_item.usesound, 75, 1)
to_chat(user, "You dismantle the turret construction.")
new /obj/item/stack/material/steel( loc, 5)
qdel(src)
return TRUE
if(1)
- if(istype(I, /obj/item/stack/material) && I.get_material_name() == DEFAULT_WALL_MATERIAL)
- var/obj/item/stack/M = I
+ if(istype(attacking_item, /obj/item/stack/material) && attacking_item.get_material_name() == DEFAULT_WALL_MATERIAL)
+ var/obj/item/stack/M = attacking_item
if(M.use(2))
to_chat(user, "You add some metal armor to the interior frame.")
build_step = 2
@@ -866,8 +866,8 @@
to_chat(user, "You need two sheets of metal to continue construction.")
return TRUE
- else if(I.iswrench())
- playsound(loc, I.usesound, 75, 1)
+ else if(attacking_item.iswrench())
+ playsound(loc, attacking_item.usesound, 75, 1)
to_chat(user, "You unfasten the external bolts.")
anchored = 0
build_step = 0
@@ -876,15 +876,15 @@
if(2)
- if(I.iswrench())
- playsound(loc, I.usesound, 100, 1)
+ if(attacking_item.iswrench())
+ playsound(loc, attacking_item.usesound, 100, 1)
to_chat(user, "You bolt the metal armor into place.")
build_step = 3
icon_state = "turret_frame_3_[case_sprite_set]"
return TRUE
- else if(I.iswelder())
- var/obj/item/weldingtool/WT = I
+ else if(attacking_item.iswelder())
+ var/obj/item/weldingtool/WT = attacking_item
if(!WT.isOn())
return TRUE
if(WT.get_fuel() < 5) //uses up 5 fuel.
@@ -892,7 +892,7 @@
return TRUE
playsound(loc, pick('sound/items/Welder.ogg', 'sound/items/welder_pry.ogg'), 50, 1)
- if(I.use_tool(src, user, 20, volume = 50))
+ if(attacking_item.use_tool(src, user, 20, volume = 50))
if(!src || !WT.use(5, user)) return TRUE
build_step = 1
to_chat(user, "You remove the turret's interior metal armor.")
@@ -902,45 +902,45 @@
if(3)
- if(istype(I, /obj/item/gun/energy)) //the gun installation part
- E = I //typecasts the item to a gun
+ if(istype(attacking_item, /obj/item/gun/energy)) //the gun installation part
+ E = attacking_item //typecasts the item to a gun
if(E.can_turret)
if(isrobot(user))
return TRUE
- if(!user.unEquip(I))
- to_chat(user, "\the [I] is stuck to your hand, you cannot put it in \the [src]")
+ if(!user.unEquip(attacking_item))
+ to_chat(user, "\the [attacking_item] is stuck to your hand, you cannot put it in \the [src]")
return TRUE
- to_chat(user, "You install [I] into the turret.")
+ to_chat(user, "You install [attacking_item] into the turret.")
user.drop_from_inventory(E,src)
target_type = /obj/machinery/porta_turret
- installation = I //installation becomes I.type
+ installation = attacking_item //installation becomes I.type
build_step = 4
icon_state = "turret_frame_4_[case_sprite_set]"
add_overlay("turret_[E.turret_sprite_set]_off")
return TRUE
- else if(I.iswrench())
- playsound(loc, I.usesound, 100, 1)
+ else if(attacking_item.iswrench())
+ playsound(loc, attacking_item.usesound, 100, 1)
to_chat(user, "You remove the turret's metal armor bolts.")
build_step = 2
icon_state = "turret_frame_2_[case_sprite_set]"
return TRUE
if(4)
- if(isprox(I))
+ if(isprox(attacking_item))
build_step = 5
- if(!user.unEquip(I))
- to_chat(user, "\the [I] is stuck to your hand, you cannot put it in \the [src]")
+ if(!user.unEquip(attacking_item))
+ to_chat(user, "\the [attacking_item] is stuck to your hand, you cannot put it in \the [src]")
return TRUE
to_chat(user, "You add the prox sensor to the turret.")
- qdel(I)
+ qdel(attacking_item)
return TRUE
//attack_hand() removes the gun
if(5)
- if(I.isscrewdriver())
- playsound(loc, I.usesound, 100, 1)
+ if(attacking_item.isscrewdriver())
+ playsound(loc, attacking_item.usesound, 100, 1)
build_step = 6
to_chat(user, "You close the access hatch.")
icon_state = "turret_frame_5a_[case_sprite_set]"
@@ -951,8 +951,8 @@
//attack_hand() removes the prox sensor
if(6)
- if(istype(I, /obj/item/stack/material) && I.get_material_name() == DEFAULT_WALL_MATERIAL)
- var/obj/item/stack/M = I
+ if(istype(attacking_item, /obj/item/stack/material) && attacking_item.get_material_name() == DEFAULT_WALL_MATERIAL)
+ var/obj/item/stack/M = attacking_item
if(M.use(2))
to_chat(user, "You add some metal armor to the exterior frame.")
cut_overlays()
@@ -964,8 +964,8 @@
to_chat(user, "You need two sheets of metal to continue construction.")
return TRUE
- else if(I.isscrewdriver())
- playsound(loc, I.usesound, 100, 1)
+ else if(attacking_item.isscrewdriver())
+ playsound(loc, attacking_item.usesound, 100, 1)
build_step = 5
to_chat(user, "You open the access hatch.")
cut_overlays()
@@ -974,14 +974,14 @@
return TRUE
if(7)
- if(I.iswelder())
- var/obj/item/weldingtool/WT = I
+ if(attacking_item.iswelder())
+ var/obj/item/weldingtool/WT = attacking_item
if(!WT.isOn()) return
if(WT.get_fuel() < 5)
to_chat(user, "You need more fuel to complete this task.")
playsound(loc, pick('sound/items/Welder.ogg', 'sound/items/welder_pry.ogg'), 50, 1)
- if(I.use_tool(src, user, 30, volume = 50))
+ if(attacking_item.use_tool(src, user, 30, volume = 50))
if(!src || !WT.use(5, user))
return
build_step = 8
@@ -1020,8 +1020,8 @@
qdel(src) // qdel
return TRUE
- else if(I.iscrowbar())
- playsound(loc, I.usesound, 75, 1)
+ else if(attacking_item.iscrowbar())
+ playsound(loc, attacking_item.usesound, 75, 1)
to_chat(user, "You pry off the turret's exterior armor.")
new /obj/item/stack/material/steel(loc, 2)
build_step = 6
@@ -1031,7 +1031,7 @@
add_overlay("turret_frame_5c_[case_sprite_set]")
return TRUE
- if(I.ispen()) //you can rename turrets like bots!
+ if(attacking_item.ispen()) //you can rename turrets like bots!
var/t = sanitizeSafe(input(user, "Enter new turret name", name, finish_name) as text, MAX_NAME_LEN)
if(t && in_range(src, usr) && loc != usr)
finish_name = t
diff --git a/code/game/machinery/recharger.dm b/code/game/machinery/recharger.dm
index 194504378dc..f78c4831d89 100644
--- a/code/game/machinery/recharger.dm
+++ b/code/game/machinery/recharger.dm
@@ -48,18 +48,18 @@
LAZYREMOVE(chargebars, bar)
qdel(bar)
-/obj/machinery/recharger/attackby(obj/item/G, mob/user)
- if(portable && G.iswrench())
+/obj/machinery/recharger/attackby(obj/item/attacking_item, mob/user)
+ if(portable && attacking_item.iswrench())
if(charging)
to_chat(user, SPAN_WARNING("You can't modify \the [src] while it has something charging inside."))
return TRUE
anchored = !anchored
user.visible_message("[user] [anchored ? "attaches" : "detaches"] \the [src].", SPAN_NOTICE("You [anchored ? "attach" : "detach"] \the [src]."))
- playsound(loc, G.usesound, 75, 1)
+ playsound(loc, attacking_item.usesound, 75, 1)
return TRUE
- if (istype(G, /obj/item/gripper))//Code for allowing cyborgs to use rechargers
- var/obj/item/gripper/Gri = G
+ if (istype(attacking_item, /obj/item/gripper))//Code for allowing cyborgs to use rechargers
+ var/obj/item/gripper/Gri = attacking_item
if (charging)//If there's something in the charger
if (Gri.grip_item(charging, user))//we attempt to grab it
charging = null
@@ -68,13 +68,13 @@
to_chat(user, SPAN_DANGER("Your gripper cannot hold \the [charging]."))
return TRUE
- if(!G.dropsafety())
+ if(!attacking_item.dropsafety())
return TRUE
- if(is_type_in_list(G, allowed_devices))
- if (G.get_cell() == DEVICE_NO_CELL)
- if (G.charge_failure_message)
- to_chat(user, SPAN_WARNING("\The [G][G.charge_failure_message]"))
+ if(is_type_in_list(attacking_item, allowed_devices))
+ if (attacking_item.get_cell() == DEVICE_NO_CELL)
+ if (attacking_item.charge_failure_message)
+ to_chat(user, SPAN_WARNING("\The [attacking_item][attacking_item.charge_failure_message]"))
return TRUE
if(charging)
to_chat(user, SPAN_WARNING("\A [charging] is already charging here."))
@@ -84,8 +84,8 @@
to_chat(user, SPAN_WARNING("\The [name] blinks red as you try to insert the item!"))
return TRUE
- user.drop_from_inventory(G,src)
- charging = G
+ user.drop_from_inventory(attacking_item,src)
+ charging = attacking_item
update_icon()
return TRUE
diff --git a/code/game/machinery/rechargestation.dm b/code/game/machinery/rechargestation.dm
index 790c0841e3f..fedb9c00c47 100644
--- a/code/game/machinery/rechargestation.dm
+++ b/code/game/machinery/rechargestation.dm
@@ -133,17 +133,17 @@
if(cell)
cell.emp_act(severity)
-/obj/machinery/recharge_station/attackby(var/obj/item/O as obj, var/mob/user as mob)
+/obj/machinery/recharge_station/attackby(obj/item/attacking_item, mob/user)
if(!occupant)
- if(default_deconstruction_screwdriver(user, O))
+ if(default_deconstruction_screwdriver(user, attacking_item))
return TRUE
- else if(default_deconstruction_crowbar(user, O))
+ else if(default_deconstruction_crowbar(user, attacking_item))
return TRUE
- else if(default_part_replacement(user, O))
+ else if(default_part_replacement(user, attacking_item))
return TRUE
- if(istype(O, /obj/item/grab))
- var/obj/item/grab/grab = O
+ if(istype(attacking_item, /obj/item/grab))
+ var/obj/item/grab/grab = attacking_item
var/mob/living/L = grab.affecting
if(!L.isSynthetic())
return TRUE
@@ -153,7 +153,7 @@
return TRUE
move_ipc(grab.affecting)
- qdel(O)
+ qdel(attacking_item)
return ..()
/obj/machinery/recharge_station/RefreshParts()
diff --git a/code/game/machinery/requests_console.dm b/code/game/machinery/requests_console.dm
index 3a90b868f19..20126587335 100644
--- a/code/game/machinery/requests_console.dm
+++ b/code/game/machinery/requests_console.dm
@@ -441,15 +441,15 @@ var/list/obj/machinery/requests_console/allConsoles = list()
return
//err... hacking code, which has no reason for existing... but anyway... it was once supposed to unlock priority 3 messanging on that console (EXTREME priority...), but the code for that was removed.
-/obj/machinery/requests_console/attackby(var/obj/item/O as obj, var/mob/user as mob)
- if (istype(O, /obj/item/card/id))
+/obj/machinery/requests_console/attackby(obj/item/attacking_item, mob/user)
+ if (istype(attacking_item, /obj/item/card/id))
if(inoperable(MAINT)) return TRUE
if(screen == RCS_MESSAUTH)
- var/obj/item/card/id/T = O
+ var/obj/item/card/id/T = attacking_item
msgVerified = text("Verified by [T.registered_name], [T.assignment]")
updateUsrDialog()
if(screen == RCS_ANNOUNCE)
- var/obj/item/card/id/ID = O
+ var/obj/item/card/id/ID = attacking_item
if (ACCESS_RC_ANNOUNCE in ID.GetAccess())
announceAuth = 1
announcement.announcer = ID.assignment ? "[ID.assignment] [ID.registered_name]" : ID.registered_name
@@ -458,17 +458,17 @@ var/list/obj/machinery/requests_console/allConsoles = list()
to_chat(user, "You are not authorized to send announcements.")
updateUsrDialog()
return TRUE
- else if (istype(O, /obj/item/stamp))
+ else if (istype(attacking_item, /obj/item/stamp))
if(inoperable(MAINT)) return
if(screen == RCS_MESSAUTH)
- var/obj/item/stamp/T = O
+ var/obj/item/stamp/T = attacking_item
msgStamped = text("Stamped with the [T.name]")
updateUsrDialog()
return TRUE
- else if (istype(O, /obj/item/paper_bundle))
- var/obj/item/paper_bundle/C = O
+ else if (istype(attacking_item, /obj/item/paper_bundle))
+ var/obj/item/paper_bundle/C = attacking_item
if(lid)
- if(alert(user, "Do you want to restock \the [src] with \the [O]?", "Paper Restocking", "Yes", "No") == "No")
+ if(alert(user, "Do you want to restock \the [src] with \the [attacking_item]?", "Paper Restocking", "Yes", "No") == "No")
to_chat(user, SPAN_NOTICE("You decide against restocking \the [src], noting that the lid is still open."))
return
paperstock += C.amount
@@ -476,20 +476,20 @@ var/list/obj/machinery/requests_console/allConsoles = list()
qdel(C)
audible_message("The Requests Console beeps, \"Paper added.\"")
else if(screen == RCS_MAINMENU) //Faxing them papers
- fax_send(O, user)
+ fax_send(attacking_item, user)
return TRUE
- else if (istype(O, /obj/item/paper))
+ else if (istype(attacking_item, /obj/item/paper))
if(lid)
- if(alert(user, "Do you want to restock \the [src] with \the [O]?", "Paper Restocking", "Yes", "No") == "No")
+ if(alert(user, "Do you want to restock \the [src] with \the [attacking_item]?", "Paper Restocking", "Yes", "No") == "No")
to_chat(user, SPAN_NOTICE("You decide against restocking \the [src], noting that the lid is still open."))
return
- var/obj/item/paper/C = O
+ var/obj/item/paper/C = attacking_item
user.drop_from_inventory(C,get_turf(src))
qdel(C)
paperstock++
audible_message("The Requests Console beeps, \"Paper added.\"")
else if(screen == RCS_MAINMENU) //Faxing them papers
- fax_send(O, user)
+ fax_send(attacking_item, user)
return TRUE
/obj/machinery/requests_console/proc/can_send()
diff --git a/code/game/machinery/ringer.dm b/code/game/machinery/ringer.dm
index 22c93c8ccb1..2cf68461731 100644
--- a/code/game/machinery/ringer.dm
+++ b/code/game/machinery/ringer.dm
@@ -104,22 +104,22 @@ pixel_x = 8;
add_overlay(screen_overlays["bell-standby"])
set_light(1.4, 1, COLOR_CYAN)
-/obj/machinery/ringer/attackby(obj/item/C as obj, mob/living/user as mob)
+/obj/machinery/ringer/attackby(obj/item/attacking_item, mob/user)
if(stat & (BROKEN|NOPOWER) || !istype(user,/mob/living))
return TRUE
- if (istype(C, /obj/item/modular_computer))
- if(!check_access(C))
+ if (istype(attacking_item, /obj/item/modular_computer))
+ if(!check_access(attacking_item))
to_chat(user, "Access Denied.")
return TRUE
- else if (C in rings_pdas)
- to_chat(user, "You unlink \the [C] from \the [src].")
- remove_pda(C)
+ else if (attacking_item in rings_pdas)
+ to_chat(user, "You unlink \the [attacking_item] from \the [src].")
+ remove_pda(attacking_item)
return TRUE
- to_chat(user, "You link \the [C] to \the [src], it will now ring upon someone using \the [src].")
- rings_pdas += C
+ to_chat(user, "You link \the [attacking_item] to \the [src], it will now ring upon someone using \the [src].")
+ rings_pdas += attacking_item
// WONT FIX: This requires callbacks fuck my dick.
- GLOB.destroyed_event.register(C, src, PROC_REF(remove_pda))
+ GLOB.destroyed_event.register(attacking_item, src, PROC_REF(remove_pda))
update_icon()
return TRUE
else
diff --git a/code/game/machinery/seed_extractor.dm b/code/game/machinery/seed_extractor.dm
index 397ff73874d..74430506679 100644
--- a/code/game/machinery/seed_extractor.dm
+++ b/code/game/machinery/seed_extractor.dm
@@ -6,37 +6,37 @@
density = 1
anchored = 1
-/obj/machinery/seed_extractor/attackby(var/obj/item/O as obj, var/mob/user as mob)
+/obj/machinery/seed_extractor/attackby(obj/item/attacking_item, mob/user)
// Fruits and vegetables.
- if(istype(O, /obj/item/reagent_containers/food/snacks/grown) || istype(O, /obj/item/grown))
+ if(istype(attacking_item, /obj/item/reagent_containers/food/snacks/grown) || istype(attacking_item, /obj/item/grown))
- user.remove_from_mob(O)
+ user.remove_from_mob(attacking_item)
var/datum/seed/new_seed_type
- if(istype(O, /obj/item/grown))
- var/obj/item/grown/F = O
+ if(istype(attacking_item, /obj/item/grown))
+ var/obj/item/grown/F = attacking_item
new_seed_type = SSplants.seeds[F.plantname]
else
- var/obj/item/reagent_containers/food/snacks/grown/F = O
+ var/obj/item/reagent_containers/food/snacks/grown/F = attacking_item
new_seed_type = SSplants.seeds[F.plantname]
if(new_seed_type)
- to_chat(user, "You extract some seeds from [O].")
+ to_chat(user, "You extract some seeds from [attacking_item].")
var/produce = rand(1,4)
for(var/i = 0;i<=produce;i++)
var/obj/item/seeds/seeds = new(get_turf(src))
seeds.seed_type = new_seed_type.name
seeds.update_seed()
else
- to_chat(user, "[O] doesn't seem to have any usable seeds inside it.")
+ to_chat(user, "[attacking_item] doesn't seem to have any usable seeds inside it.")
- qdel(O)
+ qdel(attacking_item)
return TRUE
//Grass.
- else if(istype(O, /obj/item/stack/tile/grass))
- var/obj/item/stack/tile/grass/S = O
+ else if(istype(attacking_item, /obj/item/stack/tile/grass))
+ var/obj/item/stack/tile/grass/S = attacking_item
if (S.use(1))
to_chat(user, "You extract some seeds from the grass tile.")
new /obj/item/seeds/grassseed(loc)
diff --git a/code/game/machinery/spaceheater.dm b/code/game/machinery/spaceheater.dm
index 0a3960d31a0..ab61436dfc3 100644
--- a/code/game/machinery/spaceheater.dm
+++ b/code/game/machinery/spaceheater.dm
@@ -59,16 +59,16 @@
if(cell)
cell.emp_act(severity)
-/obj/machinery/space_heater/attackby(obj/item/I, mob/user)
- if(istype(I, /obj/item/cell))
+/obj/machinery/space_heater/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/cell))
if(panel_open)
if(cell)
to_chat(user, "There is already a power cell inside.")
else
// insert cell
- user.drop_from_inventory(I,src)
- cell = I
- I.add_fingerprint(user)
+ user.drop_from_inventory(attacking_item,src)
+ cell = attacking_item
+ attacking_item.add_fingerprint(user)
visible_message(SPAN_NOTICE("[user] inserts a power cell into [src]."),
SPAN_NOTICE("You insert the power cell into [src]."))
@@ -76,7 +76,7 @@
else
to_chat(user, SPAN_NOTICE("The hatch must be open to insert a power cell."))
return TRUE
- else if(I.isscrewdriver())
+ else if(attacking_item.isscrewdriver())
panel_open = !panel_open
user.visible_message(SPAN_NOTICE("[user] [panel_open ? "opens" : "closes"] the hatch on the [src]."),
SPAN_NOTICE("You [panel_open ? "open" : "close"] the hatch on the [src]."))
diff --git a/code/game/machinery/stasis_bed.dm b/code/game/machinery/stasis_bed.dm
index 46a58de739f..ce81efc1adc 100644
--- a/code/game/machinery/stasis_bed.dm
+++ b/code/game/machinery/stasis_bed.dm
@@ -31,12 +31,12 @@
. = ..()
update_icon()
-/obj/machinery/stasis_bed/attackby(obj/item/I, mob/user)
- if(default_part_replacement(user, I))
+/obj/machinery/stasis_bed/attackby(obj/item/attacking_item, mob/user)
+ if(default_part_replacement(user, attacking_item))
return TRUE
- else if(default_deconstruction_screwdriver(user, I))
+ else if(default_deconstruction_screwdriver(user, attacking_item))
return TRUE
- else if(default_deconstruction_crowbar(user, I))
+ else if(default_deconstruction_crowbar(user, attacking_item))
return TRUE
return ..()
diff --git a/code/game/machinery/suit_cycler.dm b/code/game/machinery/suit_cycler.dm
index 5d38367c010..c986db67ef6 100644
--- a/code/game/machinery/suit_cycler.dm
+++ b/code/game/machinery/suit_cycler.dm
@@ -1,25 +1,25 @@
// Commonly used code
#define TRY_INSERT_SUIT_PIECE(slot, path)\
- if(istype(I, /obj/item/##path)){\
+ if(istype(attacking_item, /obj/item/##path)){\
if(active || locked) {\
FEEDBACK_FAILURE(user, "\The [src] is locked.");\
return\
};\
if(occupant) {\
- FEEDBACK_FAILURE(user, "There is no space in \the [src] for \the [I]!");\
+ FEEDBACK_FAILURE(user, "There is no space in \the [src] for \the [attacking_item]!");\
return\
};\
if(##slot){\
FEEDBACK_FAILURE(user, "\The [src] already contains \a [slot]!");\
return\
};\
- if(I.icon_override == CUSTOM_ITEM_MOB){\
+ if(attacking_item.icon_override == CUSTOM_ITEM_MOB){\
FEEDBACK_FAILURE(user, "You cannot insert a customized voidsuit.");\
return\
};\
- to_chat(user, SPAN_NOTICE("You load \the [I] into the storage compartment."));\
- user.drop_from_inventory(I, src);\
- ##slot = I;\
+ to_chat(user, SPAN_NOTICE("You load \the [attacking_item] into the storage compartment."));\
+ user.drop_from_inventory(attacking_item, src);\
+ ##slot = attacking_item;\
update_icon();\
updateUsrDialog();\
return\
@@ -175,12 +175,12 @@
return
return src.attack_hand(user)
-/obj/machinery/suit_cycler/attackby(obj/item/I, mob/user)
+/obj/machinery/suit_cycler/attackby(obj/item/attacking_item, mob/user)
if(electrified != 0)
if(src.shock(user, 100))
return
- if(I.GetID())
+ if(attacking_item.GetID())
if(allowed(user))
locked = !locked
to_chat(user, SPAN_NOTICE("You [locked ? "" : "un"]lock \the [src]."))
@@ -189,14 +189,14 @@
return
//Hacking init.
- if(I.ismultitool() || I.iswirecutter())
+ if(attacking_item.ismultitool() || attacking_item.iswirecutter())
if(panel_open)
wires.interact(user)
return
//Other interface stuff.
- if(istype(I, /obj/item/grab))
- var/obj/item/grab/G = I
+ if(istype(attacking_item, /obj/item/grab))
+ var/obj/item/grab/G = attacking_item
if(G.state < GRAB_NECK)
to_chat(user, SPAN_WARNING("You need a stronger grip to do this!"))
return
@@ -235,7 +235,7 @@
updateUsrDialog()
update_icon()
return
- else if(I.isscrewdriver())
+ else if(attacking_item.isscrewdriver())
panel_open = !panel_open
to_chat(user, SPAN_NOTICE("You [panel_open ? "open" : "close"] the maintenance panel."))
updateUsrDialog()
diff --git a/code/game/machinery/suit_storage_unit.dm b/code/game/machinery/suit_storage_unit.dm
index 735653270ea..71542ac2a0c 100644
--- a/code/game/machinery/suit_storage_unit.dm
+++ b/code/game/machinery/suit_storage_unit.dm
@@ -464,18 +464,18 @@
return
-/obj/machinery/suit_storage_unit/attackby(obj/item/I as obj, mob/user as mob)
+/obj/machinery/suit_storage_unit/attackby(obj/item/attacking_item, mob/user)
if(!src.ispowered)
return TRUE
- if(I.isscrewdriver())
+ if(attacking_item.isscrewdriver())
src.panelopen = !src.panelopen
- playsound(src.loc, I.usesound, 100, 1)
+ playsound(src.loc, attacking_item.usesound, 100, 1)
to_chat(user, text("You [] the unit's maintenance panel.",(src.panelopen ? "open up" : "close") ))
update_icon()
src.updateUsrDialog()
return TRUE
- if ( istype(I, /obj/item/grab) )
- var/obj/item/grab/G = I
+ if ( istype(attacking_item, /obj/item/grab) )
+ var/obj/item/grab/G = attacking_item
if( !(ismob(G.affecting)) )
return TRUE
if (!src.isopen)
@@ -503,10 +503,10 @@
src.update_icon()
return TRUE
return TRUE
- if( istype(I,/obj/item/clothing/suit/space) )
+ if( istype(attacking_item,/obj/item/clothing/suit/space) )
if(!src.isopen)
return TRUE
- var/obj/item/clothing/suit/space/S = I
+ var/obj/item/clothing/suit/space/S = attacking_item
if(src.SUIT)
to_chat(user, "The unit already contains a suit.")
return TRUE
@@ -516,10 +516,10 @@
src.update_icon()
src.updateUsrDialog()
return TRUE
- if( istype(I,/obj/item/clothing/head/helmet) )
+ if( istype(attacking_item,/obj/item/clothing/head/helmet) )
if(!src.isopen)
return TRUE
- var/obj/item/clothing/head/helmet/H = I
+ var/obj/item/clothing/head/helmet/H = attacking_item
if(src.HELMET)
to_chat(user, "The unit already contains a helmet.")
return TRUE
@@ -529,10 +529,10 @@
src.update_icon()
src.updateUsrDialog()
return TRUE
- if( istype(I,/obj/item/clothing/mask) )
+ if( istype(attacking_item,/obj/item/clothing/mask) )
if(!src.isopen)
return TRUE
- var/obj/item/clothing/mask/M = I
+ var/obj/item/clothing/mask/M = attacking_item
if(src.MASK)
to_chat(user, "The unit already contains a mask.")
return TRUE
diff --git a/code/game/machinery/supplybeacon.dm b/code/game/machinery/supplybeacon.dm
index 9558cdcb242..c34dadd9f74 100644
--- a/code/game/machinery/supplybeacon.dm
+++ b/code/game/machinery/supplybeacon.dm
@@ -44,14 +44,14 @@
name = "supermatter supply beacon"
drop_type = "supermatter"
-/obj/machinery/power/supply_beacon/attackby(var/obj/item/W, var/mob/user)
- if(!use_power && W.iswrench())
+/obj/machinery/power/supply_beacon/attackby(obj/item/attacking_item, mob/user)
+ if(!use_power && attacking_item.iswrench())
if(!anchored && !connect_to_network())
to_chat(user, "This device must be placed over an exposed cable.")
return TRUE
anchored = !anchored
user.visible_message("\The [user] [anchored ? "secures" : "unsecures"] \the [src].")
- playsound(src.loc, W.usesound, 50, 1)
+ playsound(src.loc, attacking_item.usesound, 50, 1)
return TRUE
return ..()
diff --git a/code/game/machinery/telecomms/computers/logbrowser.dm b/code/game/machinery/telecomms/computers/logbrowser.dm
index 5075c00a646..d0232fdcfd3 100644
--- a/code/game/machinery/telecomms/computers/logbrowser.dm
+++ b/code/game/machinery/telecomms/computers/logbrowser.dm
@@ -146,9 +146,9 @@
updateUsrDialog()
return
-/obj/machinery/computer/telecomms/server/attackby(var/obj/item/D, var/mob/user)
- if(D.isscrewdriver())
- if(D.use_tool(src, user, 20, volume = 50))
+/obj/machinery/computer/telecomms/server/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.isscrewdriver())
+ if(attacking_item.use_tool(src, user, 20, volume = 50))
if (src.stat & BROKEN)
to_chat(user, "The broken glass falls out.")
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
diff --git a/code/game/machinery/telecomms/computers/message.dm b/code/game/machinery/telecomms/computers/message.dm
index 819d53b4123..26210cd8a9d 100644
--- a/code/game/machinery/telecomms/computers/message.dm
+++ b/code/game/machinery/telecomms/computers/message.dm
@@ -42,12 +42,12 @@
linkedServer = null
return ..()
-/obj/machinery/computer/message_monitor/attackby(obj/item/O as obj, mob/living/user as mob)
+/obj/machinery/computer/message_monitor/attackby(obj/item/attacking_item, mob/living/user)
if(stat & (NOPOWER|BROKEN))
return ..()
if(!istype(user))
return TRUE
- if(O.isscrewdriver() && emag)
+ if(attacking_item.isscrewdriver() && emag)
//Stops people from just unscrewing the monitor and putting it back to get the console working again.
to_chat(user, "It is too hot to mess with!")
return TRUE
diff --git a/code/game/machinery/telecomms/computers/telemonitor.dm b/code/game/machinery/telecomms/computers/telemonitor.dm
index a6a4054d04f..c12ab9b1709 100644
--- a/code/game/machinery/telecomms/computers/telemonitor.dm
+++ b/code/game/machinery/telecomms/computers/telemonitor.dm
@@ -123,9 +123,9 @@
updateUsrDialog()
return
-/obj/machinery/computer/telecomms/monitor/attackby(var/obj/item/D as obj, var/mob/user as mob)
- if(D.isscrewdriver())
- if(D.use_tool(src, user, 20, volume = 50))
+/obj/machinery/computer/telecomms/monitor/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.isscrewdriver())
+ if(attacking_item.use_tool(src, user, 20, volume = 50))
if (src.stat & BROKEN)
to_chat(user, "The broken glass falls out.")
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
diff --git a/code/game/machinery/telecomms/computers/traffic_control.dm b/code/game/machinery/telecomms/computers/traffic_control.dm
index 4410a50752f..d72b692cfe8 100644
--- a/code/game/machinery/telecomms/computers/traffic_control.dm
+++ b/code/game/machinery/telecomms/computers/traffic_control.dm
@@ -200,9 +200,9 @@
updateUsrDialog()
return
-/obj/machinery/computer/telecomms/traffic/attackby(var/obj/item/D as obj, var/mob/user as mob)
- if(D.isscrewdriver())
- if(D.use_tool(src, user, 20, volume = 50))
+/obj/machinery/computer/telecomms/traffic/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.isscrewdriver())
+ if(attacking_item.use_tool(src, user, 20, volume = 50))
if (src.stat & BROKEN)
to_chat(user, "The broken glass falls out.")
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
diff --git a/code/game/machinery/telecomms/machine_interactions.dm b/code/game/machinery/telecomms/machine_interactions.dm
index ab677fc5a81..df7071bf35a 100644
--- a/code/game/machinery/telecomms/machine_interactions.dm
+++ b/code/game/machinery/telecomms/machine_interactions.dm
@@ -3,17 +3,17 @@
var/construct_op = 0
-/obj/machinery/telecomms/attackby(obj/item/I, mob/user)
+/obj/machinery/telecomms/attackby(obj/item/attacking_item, mob/user)
// Using a multitool lets you access the receiver's interface
- if(I.ismultitool())
+ if(attacking_item.ismultitool())
user.set_machine(src)
- interact(user, I)
+ interact(user, attacking_item)
return TRUE
// REPAIRING: Use Nanopaste to repair half of the system's integrity. At 24 machines, it will take 48 uses of nanopaste to repair the entire array.
- if(istype(I, /obj/item/stack/nanopaste))
- var/obj/item/stack/nanopaste/T = I
+ if(istype(attacking_item, /obj/item/stack/nanopaste))
+ var/obj/item/stack/nanopaste/T = attacking_item
if (integrity < 100) //Damaged, let's repair!
if (T.use(1))
integrity = between(0, initial(integrity) / 2, initial(integrity))
@@ -25,30 +25,30 @@
switch(construct_op)
if(0)
- if(I.isscrewdriver())
+ if(attacking_item.isscrewdriver())
to_chat(user, SPAN_NOTICE("You unfasten the bolts."))
- playsound(src.loc, I.usesound, 50, 1)
+ playsound(src.loc, attacking_item.usesound, 50, 1)
construct_op ++
. = TRUE
if(1)
- if(I.isscrewdriver())
+ if(attacking_item.isscrewdriver())
to_chat(user, SPAN_NOTICE("You fasten the bolts."))
- playsound(src.loc, I.usesound, 50, 1)
+ playsound(src.loc, attacking_item.usesound, 50, 1)
construct_op --
. = TRUE
- if(I.iswrench())
+ if(attacking_item.iswrench())
to_chat(user, SPAN_NOTICE("You dislodge the external plating."))
- playsound(src.loc, I.usesound, 75, 1)
+ playsound(src.loc, attacking_item.usesound, 75, 1)
construct_op ++
. = TRUE
if(2)
- if(I.iswrench())
+ if(attacking_item.iswrench())
to_chat(user, SPAN_NOTICE("You secure the external plating."))
- playsound(src.loc, I.usesound, 75, 1)
+ playsound(src.loc, attacking_item.usesound, 75, 1)
construct_op --
. = TRUE
- if(I.iswirecutter())
- playsound(src.loc, I.usesound, 50, 1)
+ if(attacking_item.iswirecutter())
+ playsound(src.loc, attacking_item.usesound, 50, 1)
to_chat(user, SPAN_NOTICE("You remove the cables."))
construct_op ++
var/obj/item/stack/cable_coil/A = new /obj/item/stack/cable_coil( user.loc )
@@ -56,8 +56,8 @@
stat |= BROKEN // the machine's been borked!
. = TRUE
if(3)
- if(I.iscoil())
- var/obj/item/stack/cable_coil/A = I
+ if(attacking_item.iscoil())
+ var/obj/item/stack/cable_coil/A = attacking_item
if (A.use(5))
to_chat(user, "You insert the cables.")
construct_op--
@@ -65,9 +65,9 @@
else
to_chat(user, "You need five coils of wire for this.")
. = TRUE
- if(I.iscrowbar())
+ if(attacking_item.iscrowbar())
to_chat(user, SPAN_NOTICE("You begin prying out the circuit board's components..."))
- if(I.use_tool(src, user, 60, volume = 50))
+ if(attacking_item.use_tool(src, user, 60, volume = 50))
to_chat(user, SPAN_NOTICE("You finish prying out the components."))
// Drop all the component stuff
diff --git a/code/game/machinery/telecomms/machines/message_server.dm b/code/game/machinery/telecomms/machines/message_server.dm
index 7c07eb95385..d98fa10e6e0 100644
--- a/code/game/machinery/telecomms/machines/message_server.dm
+++ b/code/game/machinery/telecomms/machines/message_server.dm
@@ -153,15 +153,15 @@
return
-/obj/machinery/telecomms/message_server/attackby(obj/item/O as obj, mob/living/user as mob)
+/obj/machinery/telecomms/message_server/attackby(obj/item/attacking_item, mob/user)
if (use_power && !inoperable(EMPED) && (spamfilter_limit < MESSAGE_SERVER_DEFAULT_SPAM_LIMIT*2) && \
- istype(O,/obj/item/circuitboard/message_monitor))
+ istype(attacking_item, /obj/item/circuitboard/message_monitor) && istype(user))
spamfilter_limit += round(MESSAGE_SERVER_DEFAULT_SPAM_LIMIT / 2)
- user.drop_from_inventory(O,get_turf(src))
- qdel(O)
+ user.drop_from_inventory(attacking_item, get_turf(src))
+ qdel(attacking_item)
to_chat(user, "You install additional memory and processors into message server. Its filtering capabilities been enhanced.")
else
- ..(O, user)
+ ..()
/obj/machinery/telecomms/message_server/update_icon()
if(inoperable(EMPED))
diff --git a/code/game/machinery/tesla_beacon.dm b/code/game/machinery/tesla_beacon.dm
index 43d3ac0411b..31604cb4a49 100644
--- a/code/game/machinery/tesla_beacon.dm
+++ b/code/game/machinery/tesla_beacon.dm
@@ -49,8 +49,8 @@
to_chat(user, SPAN_WARNING("You need to screw \the [src] to the floor first!"))
return
-/obj/machinery/power/tesla_beacon/attackby(obj/item/W, mob/user)
- if(W.isscrewdriver())
+/obj/machinery/power/tesla_beacon/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.isscrewdriver())
if(active)
to_chat(user, SPAN_WARNING("You need to deactivate \the [src] first!"))
return TRUE
diff --git a/code/game/machinery/turret_control.dm b/code/game/machinery/turret_control.dm
index c4029fd9985..532774ef937 100644
--- a/code/game/machinery/turret_control.dm
+++ b/code/game/machinery/turret_control.dm
@@ -93,11 +93,11 @@
return ..()
-/obj/machinery/turretid/attackby(obj/item/W, mob/user)
+/obj/machinery/turretid/attackby(obj/item/attacking_item, mob/user)
if(stat & BROKEN)
return
- if(W.GetID())
+ if(attacking_item.GetID())
if(src.allowed(usr))
if(emagged)
to_chat(user, "The turret control is unresponsive.")
diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm
index 3313c5f5aba..11bab113388 100644
--- a/code/game/machinery/vending.dm
+++ b/code/game/machinery/vending.dm
@@ -227,26 +227,26 @@
to_chat(user, "You short out the product lock on \the [src]")
return 1
-/obj/machinery/vending/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/device/debugger))
+/obj/machinery/vending/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/device/debugger))
if(!shut_up)
- to_chat(user, SPAN_WARNING("\The [W] reads, \"Software error detected. Rectifying.\"."))
- if(W.use_tool(src, user, 100, volume = 50))
- to_chat(user, SPAN_NOTICE("\The [W] reads, \"Solution found. Fix applied.\"."))
+ to_chat(user, SPAN_WARNING("\The [attacking_item] reads, \"Software error detected. Rectifying.\"."))
+ if(attacking_item.use_tool(src, user, 100, volume = 50))
+ to_chat(user, SPAN_NOTICE("\The [attacking_item] reads, \"Solution found. Fix applied.\"."))
shut_up = TRUE
if(shoot_inventory)
if(wires.is_cut(WIRE_THROW))
- to_chat(user, SPAN_WARNING("\The [W] reads, \"Hardware error detected. Manual repair required.\"."))
+ to_chat(user, SPAN_WARNING("\The [attacking_item] reads, \"Hardware error detected. Manual repair required.\"."))
return TRUE
- to_chat(user, SPAN_WARNING("\The [W] reads, \"Software error detected. Rectifying.\"."))
- if(W.use_tool(src, user, 100, volume = 50))
- to_chat(user, SPAN_NOTICE("\The [W] reads, \"Solution found. Fix applied. Have a NanoTrasen day!\"."))
+ to_chat(user, SPAN_WARNING("\The [attacking_item] reads, \"Software error detected. Rectifying.\"."))
+ if(attacking_item.use_tool(src, user, 100, volume = 50))
+ to_chat(user, SPAN_NOTICE("\The [attacking_item] reads, \"Solution found. Fix applied. Have a NanoTrasen day!\"."))
shoot_inventory = FALSE
else
- to_chat(user, SPAN_NOTICE("\The [W] reads, \"All systems nominal.\"."))
+ to_chat(user, SPAN_NOTICE("\The [attacking_item] reads, \"All systems nominal.\"."))
return TRUE
- var/obj/item/card/id/I = W.GetID()
+ var/obj/item/card/id/I = attacking_item.GetID()
var/datum/money_account/vendor_account = SSeconomy.get_department_account("Vendor")
if (currently_vending && vendor_account && !vendor_account.suspended)
@@ -261,14 +261,14 @@
return TRUE
if (I) //for IDs and PDAs and wallets with IDs
- paid = pay_with_card(I,W)
+ paid = pay_with_card(I,attacking_item)
handled = 1
- else if (istype(W, /obj/item/spacecash/ewallet))
- var/obj/item/spacecash/ewallet/C = W
+ else if (istype(attacking_item, /obj/item/spacecash/ewallet))
+ var/obj/item/spacecash/ewallet/C = attacking_item
paid = pay_with_ewallet(C)
handled = 1
- else if (istype(W, /obj/item/spacecash))
- var/obj/item/spacecash/C = W
+ else if (istype(attacking_item, /obj/item/spacecash))
+ var/obj/item/spacecash/C = attacking_item
paid = pay_with_cash(C, user)
handled = 1
@@ -279,9 +279,9 @@
SStgui.update_uis(src)
return TRUE // don't smack that machine with your 2 credits
- if (I || istype(W, /obj/item/spacecash))
+ if (I || istype(attacking_item, /obj/item/spacecash))
return attack_hand(user)
- else if(W.isscrewdriver())
+ else if(attacking_item.isscrewdriver())
src.panel_open = !src.panel_open
to_chat(user, "You [src.panel_open ? "open" : "close"] the maintenance panel.")
cut_overlays()
@@ -289,33 +289,33 @@
if(src.panel_open)
add_overlay("[initial(icon_state)]-panel")
return TRUE
- else if(W.ismultitool()||W.iswirecutter())
+ else if(attacking_item.ismultitool()||attacking_item.iswirecutter())
if(src.panel_open)
return attack_hand(user)
return TRUE
- else if(istype(W, /obj/item/coin) && premium.len > 0)
- user.drop_from_inventory(W,src)
- coin = W
+ else if(istype(attacking_item, /obj/item/coin) && premium.len > 0)
+ user.drop_from_inventory(attacking_item,src)
+ coin = attacking_item
categories |= CAT_COIN
- to_chat(user, "You insert \the [W] into \the [src].")
+ to_chat(user, "You insert \the [attacking_item] into \the [src].")
SStgui.update_uis(src)
return TRUE
- else if(W.iswrench())
+ else if(attacking_item.iswrench())
if(!can_move)
return TRUE
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
- playsound(src.loc, W.usesound, 50, 1)
+ playsound(src.loc, attacking_item.usesound, 50, 1)
user.visible_message("[user] begins [anchored? "un" : ""]securing \the [src] [anchored? "from" : "to"] the floor.", SPAN_NOTICE("You start [anchored? "un" : ""]securing \the [src] [anchored? "from" : "to"] the floor."))
- if(W.use_tool(src, user, 20, volume = 50))
+ if(attacking_item.use_tool(src, user, 20, volume = 50))
if(!src) return
to_chat(user, "You [anchored? "un" : ""]secured \the [src]!")
anchored = !anchored
power_change()
return TRUE
- else if(istype(W,/obj/item/device/vending_refill))
+ else if(istype(attacking_item,/obj/item/device/vending_refill))
if(panel_open)
- var/obj/item/device/vending_refill/VR = W
+ var/obj/item/device/vending_refill/VR = attacking_item
if(VR.charges)
if(VR.vend_id == vend_id)
VR.restock_inventory(src)
@@ -330,20 +330,20 @@
to_chat(user, "You must open \the [src]'s maintenance panel first!")
return TRUE
- else if(!is_borg_item(W))
+ else if(!is_borg_item(attacking_item))
if(!restock_items)
to_chat(user, "\the [src] can not be restocked manually!")
return TRUE
for(var/path in restock_blocked_items)
- if(istype(W,path))
+ if(istype(attacking_item, path))
to_chat(user, "\the [src] does not accept this item!")
return TRUE
for(var/datum/data/vending_product/R in product_records)
- if(W.type == R.product_path)
+ if(attacking_item.type == R.product_path)
stock(R, user)
- user.remove_from_mob(W) //Catches gripper duplication
- qdel(W)
+ user.remove_from_mob(attacking_item) //Catches gripper duplication
+ qdel(attacking_item)
return TRUE
return ..()
diff --git a/code/game/machinery/wall_frames.dm b/code/game/machinery/wall_frames.dm
index fa4f91fe608..d996b45718c 100644
--- a/code/game/machinery/wall_frames.dm
+++ b/code/game/machinery/wall_frames.dm
@@ -9,8 +9,8 @@
var/refund_type = /obj/item/stack/material/steel
var/reverse = 0 //if resulting object faces opposite its dir (like light fixtures)
-/obj/item/frame/attackby(obj/item/W as obj, mob/user as mob)
- if (W.iswrench())
+/obj/item/frame/attackby(obj/item/attacking_item, mob/user)
+ if (attacking_item.iswrench())
new refund_type( get_turf(src.loc), refund_amt)
qdel(src)
return TRUE
diff --git a/code/game/machinery/washing_machine.dm b/code/game/machinery/washing_machine.dm
index 161b997ed92..19452669344 100644
--- a/code/game/machinery/washing_machine.dm
+++ b/code/game/machinery/washing_machine.dm
@@ -80,19 +80,19 @@
/obj/machinery/washing_machine/update_icon()
icon_state = "wm_[state][panel]"
-/obj/machinery/washing_machine/attackby(obj/item/W as obj, mob/user as mob)
- if(istype(W,/obj/item/pen/crayon) || istype(W,/obj/item/stamp))
+/obj/machinery/washing_machine/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item,/obj/item/pen/crayon) || istype(attacking_item,/obj/item/stamp))
if( state in list( 1, 3, 6 ) )
if(!crayon)
- user.drop_from_inventory(W,src)
- crayon = W
+ user.drop_from_inventory(attacking_item,src)
+ crayon = attacking_item
else
return ..()
else
return ..()
- else if(istype(W,/obj/item/grab))
+ else if(istype(attacking_item,/obj/item/grab))
if( (state == 1) && hacked)
- var/obj/item/grab/G = W
+ var/obj/item/grab/G = attacking_item
if(ishuman(G.assailant) && iscorgi(G.affecting))
G.affecting.forceMove(src)
qdel(G)
@@ -102,7 +102,7 @@
else
if(contents.len < 5)
if (state in list(1, 3))
- user.drop_from_inventory(W,src)
+ user.drop_from_inventory(attacking_item,src)
state = 3
else
to_chat(user, "You can't put the item in right now.")
diff --git a/code/game/objects/auras/auras.dm b/code/game/objects/auras/auras.dm
index 7a3e4d2b350..7514cbcbd9f 100644
--- a/code/game/objects/auras/auras.dm
+++ b/code/game/objects/auras/auras.dm
@@ -21,7 +21,7 @@ They should also be used for when you want to effect the ENTIRE mob, like having
/obj/aura/proc/life_tick()
return FALSE
-/obj/aura/attackby(obj/item/I, mob/user)
+/obj/aura/attackby(obj/item/attacking_item, mob/user)
return FALSE
/obj/aura/bullet_act(obj/item/projectile/P, def_zone)
diff --git a/code/game/objects/effects/burnt_wall.dm b/code/game/objects/effects/burnt_wall.dm
index c8660152296..c7c496af687 100644
--- a/code/game/objects/effects/burnt_wall.dm
+++ b/code/game/objects/effects/burnt_wall.dm
@@ -16,9 +16,9 @@
if(material.opacity < 0.5)
alpha = 125
-/obj/effect/overlay/burnt_wall/attackby(obj/item/I, mob/user)
- if(I.iswelder())
- var/obj/item/weldingtool/WT = I
+/obj/effect/overlay/burnt_wall/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.iswelder())
+ var/obj/item/weldingtool/WT = attacking_item
if(!WT.isOn())
return TRUE
if(WT.use(0,user))
diff --git a/code/game/objects/effects/chem/foam.dm b/code/game/objects/effects/chem/foam.dm
index f37f9ee1bb3..cdf2e149de0 100644
--- a/code/game/objects/effects/chem/foam.dm
+++ b/code/game/objects/effects/chem/foam.dm
@@ -174,22 +174,22 @@
to_chat(user, SPAN_NOTICE("You hit the metal foam but bounce off it."))
shake_animation()
-/obj/structure/foamedmetal/attackby(var/obj/item/I, var/mob/user)
+/obj/structure/foamedmetal/attackby(obj/item/attacking_item, mob/user)
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
- if(istype(I, /obj/item/grab))
- var/obj/item/grab/G = I
+ if(istype(attacking_item, /obj/item/grab))
+ var/obj/item/grab/G = attacking_item
if(G.state < GRAB_AGGRESSIVE)
to_chat(user, SPAN_WARNING("You need a stronger grip to do that!"))
return TRUE
G.affecting.forceMove(src.loc)
visible_message(SPAN_WARNING("[G.assailant] smashes [G.affecting] through the foamed metal wall."))
G.affecting.take_overall_damage(15)
- qdel(I)
+ qdel(attacking_item)
qdel(src)
return TRUE
- else if(istype(I, /obj/item/stack/material))
- var/obj/item/stack/material/S = I
+ else if(istype(attacking_item, /obj/item/stack/material))
+ var/obj/item/stack/material/S = attacking_item
if(S.get_amount() < 4)
to_chat(user, SPAN_NOTICE("There isn't enough material here to construct a wall."))
return TRUE
@@ -213,20 +213,20 @@
qdel(src)
return TRUE
- else if(istype(I, /obj/item/stack/tile/floor))
+ else if(istype(attacking_item, /obj/item/stack/tile/floor))
var/turf/T = get_turf(src)
if(T.type != /turf/space && !isopenturf(T)) // need to do a hard check here because transit turfs are also space turfs
to_chat(user, SPAN_WARNING("The tile below \the [src] isn't an open space, or space itself!"))
return TRUE
- var/obj/item/stack/tile/floor/S = I
+ var/obj/item/stack/tile/floor/S = attacking_item
S.use(1)
T.ChangeTurf(/turf/simulated/floor/airless)
qdel(src)
return TRUE
- user.do_attack_animation(src, I)
- if(prob(I.force * 20 - metal * 25))
- user.visible_message(SPAN_WARNING("[user] smashes through the foamed metal."), SPAN_NOTICE("You smash through the foamed metal with \the [I]."))
+ user.do_attack_animation(src, attacking_item)
+ if(prob(attacking_item.force * 20 - metal * 25))
+ user.visible_message(SPAN_WARNING("[user] smashes through the foamed metal."), SPAN_NOTICE("You smash through the foamed metal with \the [attacking_item]."))
qdel(src)
else
to_chat(user, SPAN_NOTICE("You hit the metal foam to no effect."))
diff --git a/code/game/objects/effects/decals/Cleanable/humans.dm b/code/game/objects/effects/decals/Cleanable/humans.dm
index 7e0cbde42ea..fa0f067995a 100644
--- a/code/game/objects/effects/decals/Cleanable/humans.dm
+++ b/code/game/objects/effects/decals/Cleanable/humans.dm
@@ -64,8 +64,8 @@
desc = drydesc
. = ..()
-/obj/effect/decal/cleanable/attackby(obj/item/I, mob/user)
- if(istype(I, /obj/item/gun/energy/rifle/cult))
+/obj/effect/decal/cleanable/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/gun/energy/rifle/cult))
return TRUE
return ..()
diff --git a/code/game/objects/effects/decals/contraband.dm b/code/game/objects/effects/decals/contraband.dm
index 590dafdfd39..8944826f8fd 100644
--- a/code/game/objects/effects/decals/contraband.dm
+++ b/code/game/objects/effects/decals/contraband.dm
@@ -126,8 +126,8 @@
desc = "[initial(desc)] [design.desc]"
icon_state = design.icon_state // poster[serial_number]
-/obj/structure/sign/poster/attackby(obj/item/W as obj, mob/user as mob)
- if(W.iswirecutter())
+/obj/structure/sign/poster/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.iswirecutter())
playsound(loc, 'sound/items/Wirecutter.ogg', 100, 1)
if(ruined)
to_chat(user, "You remove the remnants of the poster.")
diff --git a/code/game/objects/effects/decals/remains.dm b/code/game/objects/effects/decals/remains.dm
index 85d63932d82..1ed385fe421 100644
--- a/code/game/objects/effects/decals/remains.dm
+++ b/code/game/objects/effects/decals/remains.dm
@@ -41,8 +41,8 @@
desc = "They look like the remains of a small reptile."
icon_state = "lizard"
-/obj/effect/decal/remains/attackby(obj/item/I, mob/user)
- if(istype(I, /obj/item/gun/energy/rifle/cult))
+/obj/effect/decal/remains/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/gun/energy/rifle/cult))
return TRUE
return ..()
diff --git a/code/game/objects/effects/plastic_explosive.dm b/code/game/objects/effects/plastic_explosive.dm
index 0ed64727486..ecc4dc74ba2 100644
--- a/code/game/objects/effects/plastic_explosive.dm
+++ b/code/game/objects/effects/plastic_explosive.dm
@@ -45,5 +45,5 @@
/obj/effect/plastic_explosive/attack_hand(mob/living/user)
to_chat(user, SPAN_WARNING("\The [src] is solidly attached, it doesn't budge!"))
-/obj/effect/plastic_explosive/attackby(var/obj/item/I, var/mob/user)
- return parent.attackby(I, user)
+/obj/effect/plastic_explosive/attackby(obj/item/attacking_item, mob/user)
+ return parent.attackby(attacking_item, user)
diff --git a/code/game/objects/effects/portals.dm b/code/game/objects/effects/portals.dm
index 83346ebecd5..dab249133d0 100644
--- a/code/game/objects/effects/portals.dm
+++ b/code/game/objects/effects/portals.dm
@@ -42,9 +42,9 @@
if(does_teleport)
teleport(AM)
-/obj/effect/portal/attackby(obj/item/I, mob/user)
- if(istype(I, /obj/item/bluespace_neutralizer))
- user.visible_message("[user] collapses \the [src] with \the [I].", SPAN_NOTICE("You collapse \the [src] with \the [I]."))
+/obj/effect/portal/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/bluespace_neutralizer))
+ user.visible_message("[user] collapses \the [src] with \the [attacking_item].", SPAN_NOTICE("You collapse \the [src] with \the [attacking_item]."))
qdel(src)
return TRUE
return ..()
@@ -246,9 +246,9 @@
message_all_revenants(FONT_LARGE(SPAN_WARNING("The rift keeping us here has been destroyed in [A.name]!")))
return ..()
-/obj/effect/portal/revenant/attackby(obj/item/I, mob/user)
- if(istype(I, /obj/item/bluespace_neutralizer))
- to_chat(user, SPAN_WARNING("You need to activate \the [I] and keep it near \the [src] to collapse it."))
+/obj/effect/portal/revenant/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/bluespace_neutralizer))
+ to_chat(user, SPAN_WARNING("You need to activate \the [attacking_item] and keep it near \the [src] to collapse it."))
return TRUE
return ..()
diff --git a/code/game/objects/effects/spiders.dm b/code/game/objects/effects/spiders.dm
index 121ef80b933..88eaafa52aa 100644
--- a/code/game/objects/effects/spiders.dm
+++ b/code/game/objects/effects/spiders.dm
@@ -21,18 +21,18 @@
qdel(src)
return
-/obj/effect/spider/attackby(var/obj/item/W, var/mob/user)
- visible_message(SPAN_WARNING("\The [src] has been [LAZYPICK(W.attack_verb, "attacked")] with [W][(user ? " by [user]." : ".")]"))
- var/damage = W.force / 4.0
- if(W.iswelder())
- var/obj/item/weldingtool/WT = W
+/obj/effect/spider/attackby(obj/item/attacking_item, mob/user)
+ visible_message(SPAN_WARNING("\The [src] has been [LAZYPICK(attacking_item.attack_verb, "attacked")] with [attacking_item][(user ? " by [user]." : ".")]"))
+ var/damage = attacking_item.force / 4.0
+ if(attacking_item.iswelder())
+ var/obj/item/weldingtool/WT = attacking_item
if(WT.use(0, user))
damage = 15
playsound(loc, 'sound/items/Welder.ogg', 100, 1)
return TRUE
else
user.do_attack_animation(src)
- playsound(loc, W.hitsound, 50, 1, -1)
+ playsound(loc, attacking_item.hitsound, 50, 1, -1)
health -= damage
healthcheck()
@@ -278,10 +278,10 @@
visible_message(SPAN_WARNING("\The [user] stomps \the [src] dead!"))
die()
-/obj/effect/spider/spiderling/attackby(var/obj/item/W, var/mob/user)
+/obj/effect/spider/spiderling/attackby(obj/item/attacking_item, mob/user)
. = ..()
- if(istype(W, /obj/item/newspaper))
- var/obj/item/newspaper/N = W
+ if(istype(attacking_item, /obj/item/newspaper))
+ var/obj/item/newspaper/N = attacking_item
if(N.rolled)
die()
return TRUE
diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm
index dbadd0a588c..c77decdcfac 100644
--- a/code/game/objects/items.dm
+++ b/code/game/objects/items.dm
@@ -409,54 +409,16 @@
R.activate_module(src)
R.hud_used.update_robot_modules_display()
-// Due to storage type consolidation this should get used more now.
-// I have cleaned it up a little, but it could probably use more. -Sayu
-/obj/item/attackby(obj/item/I, mob/user)
- if(istype(I,/obj/item/storage))
- var/obj/item/storage/S = I
- if(S.use_to_pickup)
- if(S.collection_mode && !is_type_in_list(src, S.pickup_blacklist)) //Mode is set to collect all items on a tile and we clicked on a valid one.
- if(isturf(loc))
- var/list/rejections = list()
- var/success = FALSE
- var/failure = FALSE
- var/original_loc = user ? user.loc : null
-
- for(var/obj/item/item in loc)
- if (user && user.loc != original_loc)
- break
-
- if(rejections[item.type]) // To limit bag spamming: any given type only complains once
- continue
-
- if(!S.can_be_inserted(item)) // Note can_be_inserted still makes noise when the answer is no
- rejections[item.type] = TRUE // therefore full bags are still a little spammy
- failure = TRUE
- CHECK_TICK
- continue
-
- success = TRUE
- S.handle_item_insertion_deferred(item, user) //The 1 stops the "You put the [src] into [S]" insertion message from being displayed.
- CHECK_TICK // Because people insist on picking up huge-ass piles of stuff.
-
- S.handle_storage_deferred(user)
- if(success && !failure)
- to_chat(user, "You put everything in [S].")
- else if(success)
- to_chat(user, "You put some things in [S].")
- else
- to_chat(user, "You fail to pick anything up with \the [S].")
-
- else if(S.can_be_inserted(src))
- S.handle_item_insertion(src)
- return TRUE
-
-//Called when the user alt-clicks on something with this item in their active hand
-//this function is designed to be overridden by individual weapons
+/**
+ * Called when the user alt-clicks on something with this item in their active hand
+ *
+ * This function is designed to be overridden by individual weapons
+ *
+ * A return value of `TRUE` continues on to do the normal alt-click action,
+ * a return value of `FALSE` does not continue, and will not do the alt-click
+ */
/obj/item/proc/alt_attack(var/atom/target, var/mob/user)
- return 1
- //A return value of 1 continues on to do the normal alt-click action.
- //A return value of 0 does not continue, and will not do the alt-click
+ return TRUE
/obj/item/proc/talk_into(mob/M as mob, text)
return
@@ -524,7 +486,7 @@
zoom(user)
SEND_SIGNAL(src, COMSIG_ITEM_REMOVE, src)
-// called just as an item is picked up (loc is not yet changed)
+///Called just as an item is picked up (loc is not yet changed)
/obj/item/proc/pickup(mob/user)
pixel_x = 0
pixel_y = 0
diff --git a/code/game/objects/items/airbubble.dm b/code/game/objects/items/airbubble.dm
index 9c7ede86eef..88a0f7542e5 100644
--- a/code/game/objects/items/airbubble.dm
+++ b/code/game/objects/items/airbubble.dm
@@ -394,36 +394,36 @@
to_chat(usr, "[src] has no power cell.")
// Handle most of things: restraining, cutting restrains, attaching tank.
-/obj/structure/closet/airbubble/attackby(obj/W, mob/user as mob)
- if(istype(W, /obj/item/tank))
+/obj/structure/closet/airbubble/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/tank))
if(!isnull(use_internal_tank))
user.visible_message(
- "[user] is attaching [W] to [src].",
- "You are attaching [W] to [src]."
+ "[user] is attaching [attacking_item] to [src].",
+ "You are attaching [attacking_item] to [src]."
)
if (!do_after(user, 2 SECONDS, src))
return
user.visible_message(
- "[user] has attached [W] to [src].",
- "You attached [W] to [src]."
+ "[user] has attached [attacking_item] to [src].",
+ "You attached [attacking_item] to [src]."
)
- internal_tank = W
- user.drop_from_inventory(W, src)
+ internal_tank = attacking_item
+ user.drop_from_inventory(attacking_item, src)
use_internal_tank = 1
START_PROCESSING(SSfast_process, src)
else
to_chat(user, "[src] already has a tank attached.")
return TRUE
if(opened)
- if(istype(W, /obj/item/grab))
- var/obj/item/grab/G = W
+ if(istype(attacking_item, /obj/item/grab))
+ var/obj/item/grab/G = attacking_item
MouseDrop_T(G.affecting, user)
return FALSE
- if(!W.dropsafety())
+ if(!attacking_item.dropsafety())
return FALSE
user.drop_item()
return TRUE
- else if(istype(W, /obj/item/handcuffs/cable))
+ else if(istype(attacking_item, /obj/item/handcuffs/cable))
if(zipped)
to_chat(user, "[src]'s zipper is already restrained.")
return TRUE
@@ -441,10 +441,10 @@
"You put restrains on [src]'s zipper."
)
- qdel(W)
+ qdel(attacking_item)
update_icon()
return TRUE
- else if(W.iswirecutter())
+ else if(attacking_item.iswirecutter())
if(!zipped)
to_chat(user, "[src] has no cables to cut.")
attack_hand(user)
@@ -465,24 +465,24 @@
new/obj/item/handcuffs/cable(src.loc)
update_icon()
return TRUE
- else if(istype(W, /obj/item/cell))
+ else if(istype(attacking_item, /obj/item/cell))
if(!isnull(cell))
to_chat(user, "[src] already has [cell] attached to it.")
attack_hand(user)
return TRUE
user.visible_message(
- "[user] is attaching [W] to [src].",
- "You are attaching [W] to [src]."
+ "[user] is attaching [attacking_item] to [src].",
+ "You are attaching [attacking_item] to [src]."
)
if (!do_after(user, 2 SECONDS, src))
return TRUE
user.visible_message(
- "[user] has attached [W] to [src].",
- "You attached [W] to [src]."
+ "[user] has attached [attacking_item] to [src].",
+ "You attached [attacking_item] to [src]."
)
- cell = W
+ cell = attacking_item
cooling = TRUE
- user.drop_from_inventory(W, src)
+ user.drop_from_inventory(attacking_item, src)
return TRUE
else
return attack_hand(user)
diff --git a/code/game/objects/items/apc_frame.dm b/code/game/objects/items/apc_frame.dm
index 8c64b6c438b..96b39ff549d 100644
--- a/code/game/objects/items/apc_frame.dm
+++ b/code/game/objects/items/apc_frame.dm
@@ -7,8 +7,8 @@
icon_state = "apc_frame"
obj_flags = OBJ_FLAG_CONDUCTABLE
-/obj/item/frame/apc/attackby(obj/item/W as obj, mob/user as mob)
- if (W.iswrench())
+/obj/item/frame/apc/attackby(obj/item/attacking_item, mob/user)
+ if (attacking_item.iswrench())
new /obj/item/stack/material/steel( get_turf(src.loc), 2 )
qdel(src)
return TRUE
diff --git a/code/game/objects/items/bodybag.dm b/code/game/objects/items/bodybag.dm
index 8bd7523b7ff..7acdf66cbf2 100644
--- a/code/game/objects/items/bodybag.dm
+++ b/code/game/objects/items/bodybag.dm
@@ -72,10 +72,10 @@
to_chat(user, "\The [src] is full.")
to_chat(user, "It [contains_body ? "contains" : "does not contain"] a body.")
-/obj/structure/closet/body_bag/attackby(var/obj/item/W, mob/user as mob)
- if (W.ispen())
+/obj/structure/closet/body_bag/attackby(obj/item/attacking_item, mob/user)
+ if (attacking_item.ispen())
var/t = tgui_input_text(user, "What would you like the label to be?", name)
- if (user.get_active_hand() != W)
+ if (user.get_active_hand() != attacking_item)
return TRUE
if (!in_range(src, user) && src.loc != user)
return TRUE
@@ -88,7 +88,7 @@
else
src.name = "body bag"
return TRUE
- else if(W.iswirecutter())
+ else if(attacking_item.iswirecutter())
to_chat(user, "You cut the tag off the bodybag.")
playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1)
src.name = "body bag"
diff --git a/code/game/objects/items/canvas.dm b/code/game/objects/items/canvas.dm
index fb5212f3531..4fc8565c90b 100644
--- a/code/game/objects/items/canvas.dm
+++ b/code/game/objects/items/canvas.dm
@@ -49,10 +49,10 @@
/**
* One pixel increments.
*/
-/obj/item/canvas/attackby(obj/item/I, mob/user, params)
- if(I.iswrench())
+/obj/item/canvas/attackby(obj/item/attacking_item, mob/user, params)
+ if(attacking_item.iswrench())
to_chat(user, SPAN_NOTICE("You begin to [anchored ? "loosen" : "tighten"] \the [src]..."))
- if(I.use_tool(src, user, 40, volume = 50))
+ if(attacking_item.use_tool(src, user, 40, volume = 50))
user.visible_message("[user] [anchored ? "loosens" : "tightens"] \the [src].", SPAN_NOTICE("You [anchored ? "loosen" : "tighten"] \the [src]."), SPAN_NOTICE("You hear a ratchet."))
anchored = !anchored
return TRUE
@@ -67,7 +67,7 @@
return TRUE
// Cleaning one pixel with a soap or rag.
- if(istype(I, /obj/item/soap) || istype(I, /obj/item/reagent_containers/glass/rag))
+ if(istype(attacking_item, /obj/item/soap) || istype(attacking_item, /obj/item/reagent_containers/glass/rag))
// Pixel info created only when needed.
var/icon/masterpiece = icon(icon,icon_state)
var/thePix = masterpiece.GetPixel(pixX,pixY)
@@ -83,8 +83,8 @@
return TRUE
// Drawing one pixel with a crayon.
- else if(istype(I, /obj/item/pen/crayon))
- var/obj/item/pen/crayon/C = I
+ else if(istype(attacking_item, /obj/item/pen/crayon))
+ var/obj/item/pen/crayon/C = attacking_item
DrawPixelOn(C.shadeColour, pixX, pixY)
return TRUE
else
diff --git a/code/game/objects/items/contraband.dm b/code/game/objects/items/contraband.dm
index 7c6a405ae63..e1867aa07e7 100644
--- a/code/game/objects/items/contraband.dm
+++ b/code/game/objects/items/contraband.dm
@@ -139,8 +139,8 @@
// Proc to shove them up your nose
-/obj/item/reagent_containers/powder/attackby(obj/item/W, mob/living/user)
- if(istype(W, /obj/item/paper/cig) || istype(W, /obj/item/spacecash))
+/obj/item/reagent_containers/powder/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/paper/cig) || istype(attacking_item, /obj/item/spacecash))
var/mob/living/carbon/human/H = user
var/obj/item/blocked = H.check_mouth_coverage()
if(blocked)
@@ -151,16 +151,16 @@
return TRUE
user.visible_message(
- SPAN_WARNING("\The [user] starts to snort some of \the [src] with \a [W]!"),
- SPAN_NOTICE("You start to snort some of \the [src] with \the [W]!")
+ SPAN_WARNING("\The [user] starts to snort some of \the [src] with \a [attacking_item]!"),
+ SPAN_NOTICE("You start to snort some of \the [src] with \the [attacking_item]!")
)
playsound(loc, 'sound/effects/snort.ogg', 50, 1)
if (!do_after(user, 2 SECONDS))
return TRUE
user.visible_message(
- SPAN_WARNING("\The [user] snorts some of \the [src] with \a [W]!"),
- SPAN_NOTICE("You snort \the [src] with \the [W]!")
+ SPAN_WARNING("\The [user] snorts some of \the [src] with \a [attacking_item]!"),
+ SPAN_NOTICE("You snort \the [src] with \the [attacking_item]!")
)
playsound(loc, 'sound/effects/snort.ogg', 50, 1)
diff --git a/code/game/objects/items/defib.dm b/code/game/objects/items/defib.dm
index b92f71b3cca..e15cb5485b3 100644
--- a/code/game/objects/items/defib.dm
+++ b/code/game/objects/items/defib.dm
@@ -115,21 +115,21 @@
if(!H.put_in_active_hand(paddles))
to_chat(H, SPAN_WARNING("You need a free hand to take out the paddles!"))
-/obj/item/defibrillator/attackby(obj/item/W, mob/user, params)
- if(W == paddles)
+/obj/item/defibrillator/attackby(obj/item/attacking_item, mob/user, params)
+ if(attacking_item == paddles)
reattach_paddles(user)
- else if(istype(W, /obj/item/cell))
+ else if(istype(attacking_item, /obj/item/cell))
if(bcell)
to_chat(user, SPAN_NOTICE("\The [src] already has a cell."))
else
- if(!user.unEquip(W))
+ if(!user.unEquip(attacking_item))
return
- W.forceMove(src)
- bcell = W
+ attacking_item.forceMove(src)
+ bcell = attacking_item
to_chat(user, SPAN_NOTICE("You install a cell in \the [src]."))
update_icon()
- else if(W.isscrewdriver())
+ else if(attacking_item.isscrewdriver())
if(bcell)
bcell.update_icon()
bcell.dropInto(loc)
diff --git a/code/game/objects/items/devices/auto_cpr.dm b/code/game/objects/items/devices/auto_cpr.dm
index 56c97b8e710..769fbf782ab 100644
--- a/code/game/objects/items/devices/auto_cpr.dm
+++ b/code/game/objects/items/devices/auto_cpr.dm
@@ -155,14 +155,14 @@
return
if(user.unEquip(src))
- if(!H.equip_to_slot_if_possible(src, slot_wear_suit, del_on_fail=0, disable_warning=1, redraw_mob=1))
+ if(!H.equip_to_slot_if_possible(src, slot_wear_suit, delete_on_fail = FALSE, disable_warning = TRUE, redraw_mob = TRUE))
user.put_in_active_hand(src)
return 1
else
return ..()
-/obj/item/auto_cpr/attackby(obj/item/W, mob/user)
- if(W.isscrewdriver())
+/obj/item/auto_cpr/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.isscrewdriver())
if(ishuman(loc))
var/mob/living/carbon/human/H = loc
if(H.get_inventory_slot(src) == slot_wear_suit)
@@ -174,7 +174,7 @@
return TRUE
if(panel_open)
- if(W.iswrench())
+ if(attacking_item.iswrench())
if(!tank)
to_chat(user, "There isn't a tank to remove!")
return TRUE
@@ -184,7 +184,7 @@
tank = null
update_icon()
return TRUE
- if(W.iscrowbar())
+ if(attacking_item.iscrowbar())
if(!battery)
to_chat(user, "There isn't a battery to remove!")
return TRUE
@@ -194,34 +194,34 @@
battery = null
update_icon()
return TRUE
- if(istype(W, /obj/item/cell))
+ if(istype(attacking_item, /obj/item/cell))
if(battery)
to_chat(user, "There is already \a [battery] installed.")
return TRUE
- user.drop_from_inventory(W, src)
- battery = W
- user.visible_message(SPAN_NOTICE("[user] places \the [W] in \the [src]."), SPAN_NOTICE("You place \the [W] in \the [src]."))
+ user.drop_from_inventory(attacking_item, src)
+ battery = attacking_item
+ user.visible_message(SPAN_NOTICE("[user] places \the [attacking_item] in \the [src]."), SPAN_NOTICE("You place \the [attacking_item] in \the [src]."))
update_icon()
return TRUE
- if(istype(W, /obj/item/clothing/mask/breath))
- if(is_type_in_list(W, mask_blacklist))
- to_chat(user, "\The [W] is incompatible with \the [src].")
+ if(istype(attacking_item, /obj/item/clothing/mask/breath))
+ if(is_type_in_list(attacking_item, mask_blacklist))
+ to_chat(user, "\The [attacking_item] is incompatible with \the [src].")
return TRUE
if(breath_mask)
to_chat(user, "There is already \a [breath_mask] installed.")
return TRUE
- user.drop_from_inventory(W, src)
- breath_mask = W
- user.visible_message(SPAN_NOTICE("[user] places \the [W] in \the [src]."), SPAN_NOTICE("You place \the [W] in \the [src]."))
+ user.drop_from_inventory(attacking_item, src)
+ breath_mask = attacking_item
+ user.visible_message(SPAN_NOTICE("[user] places \the [attacking_item] in \the [src]."), SPAN_NOTICE("You place \the [attacking_item] in \the [src]."))
update_icon()
return TRUE
- if(istype(W, /obj/item/tank/emergency_oxygen))
+ if(istype(attacking_item, /obj/item/tank/emergency_oxygen))
if(tank)
to_chat(user, "There is already \a [tank] installed!")
return TRUE
- user.drop_from_inventory(W, src)
- tank = W
- user.visible_message(SPAN_NOTICE("[user] places \the [W] in \the [src]."), SPAN_NOTICE("You place \the [W] in \the [src]."))
+ user.drop_from_inventory(attacking_item, src)
+ tank = attacking_item
+ user.visible_message(SPAN_NOTICE("[user] places \the [attacking_item] in \the [src]."), SPAN_NOTICE("You place \the [attacking_item] in \the [src]."))
update_icon()
return TRUE
diff --git a/code/game/objects/items/devices/hacktool.dm b/code/game/objects/items/devices/hacktool.dm
index a149caaca2a..daf4fc19edf 100644
--- a/code/game/objects/items/devices/hacktool.dm
+++ b/code/game/objects/items/devices/hacktool.dm
@@ -29,8 +29,8 @@
hack_state = null
return ..()
-/obj/item/device/multitool/hacktool/attackby(var/obj/item/W, var/mob/user)
- if(W.isscrewdriver())
+/obj/item/device/multitool/hacktool/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.isscrewdriver())
in_hack_mode = !in_hack_mode
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, TRUE)
return TRUE
diff --git a/code/game/objects/items/devices/laserpointer.dm b/code/game/objects/items/devices/laserpointer.dm
index a93bc5da0e4..5016b8d5c3e 100644
--- a/code/game/objects/items/devices/laserpointer.dm
+++ b/code/game/objects/items/devices/laserpointer.dm
@@ -42,18 +42,18 @@
laser_act(M, user)
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
-/obj/item/device/laser_pointer/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/stock_parts/micro_laser))
+/obj/item/device/laser_pointer/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/stock_parts/micro_laser))
if(!diode)
user.drop_item()
- W.forceMove(src)
- diode = W
+ attacking_item.forceMove(src)
+ diode = attacking_item
to_chat(user, "You install a [diode.name] in [src].")
else
to_chat(user, "[src] already has a laser diode.")
return TRUE
- else if(W.isscrewdriver())
+ else if(attacking_item.isscrewdriver())
if(diode)
to_chat(user, "You remove the [diode.name] from the [src].")
diode.forceMove(get_turf(user))
diff --git a/code/game/objects/items/devices/lighting/flare.dm b/code/game/objects/items/devices/lighting/flare.dm
index 95be65af841..471d1196013 100644
--- a/code/game/objects/items/devices/lighting/flare.dm
+++ b/code/game/objects/items/devices/lighting/flare.dm
@@ -124,8 +124,8 @@
START_PROCESSING(SSprocessing, src)
update_icon()
-/obj/item/device/flashlight/flare/torch/attackby(var/obj/item/W, mob/user)
- if(W.isFlameSource() && !on && fuel)
+/obj/item/device/flashlight/flare/torch/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.isFlameSource() && !on && fuel)
light(user)
else
..()
@@ -164,11 +164,11 @@
drop_sound = 'sound/items/drop/woodweapon.ogg'
pickup_sound = 'sound/items/pickup/woodweapon.ogg'
-/obj/item/torch/attackby(obj/item/I, mob/user)
- if(istype(I, /obj/item/reagent_containers/glass/rag))
- to_chat(user, SPAN_NOTICE("You add \the [I] to \the [src]."))
+/obj/item/torch/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/reagent_containers/glass/rag))
+ to_chat(user, SPAN_NOTICE("You add \the [attacking_item] to \the [src]."))
var/obj/item/device/flashlight/flare/torch/T = new()
- qdel(I)
+ qdel(attacking_item)
user.put_in_hands(T)
qdel(src)
diff --git a/code/game/objects/items/devices/lighting/flashlight.dm b/code/game/objects/items/devices/lighting/flashlight.dm
index 204bd31140d..3b9588cde29 100644
--- a/code/game/objects/items/devices/lighting/flashlight.dm
+++ b/code/game/objects/items/devices/lighting/flashlight.dm
@@ -169,14 +169,14 @@
else
return ..()
-/obj/item/device/flashlight/attackby(obj/item/W, mob/user)
+/obj/item/device/flashlight/attackby(obj/item/attacking_item, mob/user)
if(power_use)
- if(istype(W, /obj/item/cell))
- if(istype(W, /obj/item/cell/device) || accepts_large_cells)
+ if(istype(attacking_item, /obj/item/cell))
+ if(istype(attacking_item, /obj/item/cell/device) || accepts_large_cells)
if(!cell)
user.drop_item()
- W.loc = src
- cell = W
+ attacking_item.loc = src
+ cell = attacking_item
to_chat(user, SPAN_NOTICE("You install a cell in \the [src]."))
playsound(src, 'sound/machines/click.ogg', 30, 1, 0)
update_icon()
diff --git a/code/game/objects/items/devices/lightreplacer.dm b/code/game/objects/items/devices/lightreplacer.dm
index f0dbacaa7e6..4a3fd2ded39 100644
--- a/code/game/objects/items/devices/lightreplacer.dm
+++ b/code/game/objects/items/devices/lightreplacer.dm
@@ -79,9 +79,9 @@
if (store_broken)
. += "It is storing [stored()]/[max_stored] broken lights."
-/obj/item/device/lightreplacer/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/stack/material) && W.get_material_name() == "glass")
- var/obj/item/stack/G = W
+/obj/item/device/lightreplacer/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/stack/material) && attacking_item.get_material_name() == "glass")
+ var/obj/item/stack/G = attacking_item
if(uses >= max_uses)
to_chat(user, SPAN_WARNING("[src.name] is full."))
else if(G.use(5))
@@ -93,8 +93,8 @@
to_chat(user, SPAN_WARNING("You need 5 sheets of glass to replace lights."))
return TRUE
- if(istype(W, /obj/item/light))
- var/obj/item/light/L = W
+ if(istype(attacking_item, /obj/item/light))
+ var/obj/item/light/L = attacking_item
if(L.status == 0) // LIGHT OKAY
if(uses < max_uses)
AddUses(1)
@@ -105,8 +105,8 @@
to_chat(user, SPAN_WARNING("You need a working light."))
return TRUE
- if(istype(W, /obj/item/device/lightreplacer))
- var/obj/item/device/lightreplacer/LR = W
+ if(istype(attacking_item, /obj/item/device/lightreplacer))
+ var/obj/item/device/lightreplacer/LR = attacking_item
if(LR.uses == LR.max_uses)
to_chat(user, SPAN_WARNING("\The [LR] is already full!"))
return TRUE
diff --git a/code/game/objects/items/devices/magnetic_lock.dm b/code/game/objects/items/devices/magnetic_lock.dm
index ec54e2877bd..c856425a585 100644
--- a/code/game/objects/items/devices/magnetic_lock.dm
+++ b/code/game/objects/items/devices/magnetic_lock.dm
@@ -111,48 +111,48 @@
takedamage(Proj.damage)
..()
-/obj/item/device/magnetic_lock/attackby(var/obj/item/I, var/mob/user)
+/obj/item/device/magnetic_lock/attackby(obj/item/attacking_item, mob/user)
if (status == STATUS_BROKEN)
to_chat(user, "[src] is broken beyond repair!")
return TRUE
- if (istype(I, /obj/item/card/id))
+ if (istype(attacking_item, /obj/item/card/id))
if (!constructionstate && !hacked)
- if (check_access(I))
+ if (check_access(attacking_item))
locked = !locked
playsound(src, 'sound/machines/ping.ogg', 30, 1)
- var/msg = "[I] through \the [src] and it [locked ? "locks" : "unlocks"] with a beep."
+ var/msg = "[attacking_item] through \the [src] and it [locked ? "locks" : "unlocks"] with a beep."
var/pos_adj = "[user.name] swipes [user.get_pronoun("his")] "
var/fp_adj = "You swipe your "
user.visible_message("[addtext(pos_adj, msg)]", "[addtext(fp_adj, msg)]")
update_icon()
else
playsound(src, 'sound/machines/buzz-sigh.ogg', 30, 1)
- to_chat(user, SPAN_WARNING("\The [src] buzzes as you swipe your [I]."))
+ to_chat(user, SPAN_WARNING("\The [src] buzzes as you swipe your [attacking_item]."))
return
else
- to_chat(user, "You cannot swipe your [I] through [src] with it partially dismantled!")
+ to_chat(user, "You cannot swipe your [attacking_item] through [src] with it partially dismantled!")
return TRUE
- if (istype(I, /obj/item) && user.a_intent == "harm")
- if (I.force >= 18)
- user.visible_message("[user] bashes [src] with [I]!", "You strike [src] with [I], damaging it!")
- takedamage(I.force)
+ if (istype(attacking_item, /obj/item) && user.a_intent == "harm")
+ if (attacking_item.force >= 18)
+ user.visible_message("[user] bashes [src] with [attacking_item]!", "You strike [src] with [attacking_item], damaging it!")
+ takedamage(attacking_item.force)
var/sound_to_play = pick(list('sound/weapons/genhit1.ogg', 'sound/weapons/genhit2.ogg', 'sound/weapons/genhit3.ogg'))
- playsound(loc, sound_to_play, I.force*3, 1)
+ playsound(loc, sound_to_play, attacking_item.force*3, 1)
sound_to_play = pick(list('sound/effects/sparks1.ogg', 'sound/effects/sparks2.ogg', 'sound/effects/sparks3.ogg', 'sound/effects/sparks4.ogg'))
addtimer(CALLBACK(GLOBAL_PROC, /proc/playsound, loc, sound_to_play, 30, 1), 3, TIMER_CLIENT_TIME)
else
- user.visible_message("[user] hits [src] with [I] but fails to damage it.", "You hit [src] with [I], [I.force >= 10 ? "and it almost makes a dent!" : "but it appears to have no visible effect."]")
- playsound(loc, 'sound/weapons/Genhit.ogg', I.force*2.5, 1)
+ user.visible_message("[user] hits [src] with [attacking_item] but fails to damage it.", "You hit [src] with [attacking_item], [attacking_item.force >= 10 ? "and it almost makes a dent!" : "but it appears to have no visible effect."]")
+ playsound(loc, 'sound/weapons/Genhit.ogg', attacking_item.force*2.5, 1)
return TRUE
if(invincible)
return TRUE
switch (constructionstate)
if (0)
- if (istype(I, /obj/item/card/emag))
- var/obj/item/card/emag/emagcard = I
+ if (istype(attacking_item, /obj/item/card/emag))
+ var/obj/item/card/emag/emagcard = attacking_item
emagcard.uses--
visible_message("[src] sparks and falls off the door!", "You emag [src], frying its circuitry[status == STATUS_ACTIVE ? " and making it drop onto the floor" : ""]!")
@@ -162,8 +162,8 @@
update_icon()
return TRUE
- if (I.iswelder())
- var/obj/item/weldingtool/WT = I
+ if (attacking_item.iswelder())
+ var/obj/item/weldingtool/WT = attacking_item
if (WT.use(2, user))
user.visible_message(SPAN_NOTICE("[user] starts welding the metal shell of [src]."), SPAN_NOTICE("You start [hacked ? "repairing" : "welding open"] the metal covering of [src]."))
playsound(loc, 'sound/items/Welder.ogg', 50, 1)
@@ -179,7 +179,7 @@
update_icon()
return TRUE
- if (I.iscrowbar())
+ if (attacking_item.iscrowbar())
if (!locked)
to_chat(user, SPAN_NOTICE("You pry the cover off [src]."))
setconstructionstate(1)
@@ -188,51 +188,51 @@
return TRUE
if (1)
- if (istype(I, /obj/item/cell))
+ if (istype(attacking_item, /obj/item/cell))
if (powercell)
to_chat(user, SPAN_NOTICE("There's already a powercell in \the [src]."))
return TRUE
- if (I.iscrowbar())
+ if (attacking_item.iscrowbar())
to_chat(user, SPAN_NOTICE("You wedge the cover back in place."))
setconstructionstate(0)
return TRUE
if (2)
- if (I.isscrewdriver())
+ if (attacking_item.isscrewdriver())
to_chat(user, SPAN_NOTICE("You unscrew and remove the wiring cover from \the [src]."))
- playsound(loc, I.usesound, 50, 1)
+ playsound(loc, attacking_item.usesound, 50, 1)
setconstructionstate(3)
return TRUE
- if (I.iscrowbar())
+ if (attacking_item.iscrowbar())
to_chat(user, SPAN_NOTICE("You wedge the cover back in place."))
setconstructionstate(0)
return TRUE
- if (istype(I, /obj/item/cell))
+ if (istype(attacking_item, /obj/item/cell))
if (!powercell)
- to_chat(user, SPAN_NOTICE("You place the [I] inside \the [src]."))
- user.drop_from_inventory(I,src)
- powercell = I
+ to_chat(user, SPAN_NOTICE("You place the [attacking_item] inside \the [src]."))
+ user.drop_from_inventory(attacking_item,src)
+ powercell = attacking_item
setconstructionstate(1)
return TRUE
if (3)
- if (I.iswirecutter())
+ if (attacking_item.iswirecutter())
to_chat(user, SPAN_NOTICE("You cut the wires connecting the [src]'s magnets to their internal powersupply, [target ? "making the device fall off [target] and rendering it unusable." : "rendering the device unusable."]"))
playsound(loc, 'sound/items/Wirecutter.ogg', 50, 1)
setconstructionstate(4)
return TRUE
- if (I.isscrewdriver())
+ if (attacking_item.isscrewdriver())
to_chat(user, SPAN_NOTICE("You replace and screw tight the wiring cover from \the [src]."))
- playsound(loc, I.usesound, 50, 1)
+ playsound(loc, attacking_item.usesound, 50, 1)
setconstructionstate(2)
return TRUE
if (4)
- if (I.iswirecutter())
+ if (attacking_item.iswirecutter())
to_chat(user, SPAN_NOTICE("You repair the wires connecting the [src]'s magnets to their internal powersupply"))
setconstructionstate(3)
return TRUE
diff --git a/code/game/objects/items/devices/paicard.dm b/code/game/objects/items/devices/paicard.dm
index abf77c81540..c92a488e447 100644
--- a/code/game/objects/items/devices/paicard.dm
+++ b/code/game/objects/items/devices/paicard.dm
@@ -45,15 +45,15 @@
pai.death(0)
return ..()
-/obj/item/device/paicard/attackby(obj/item/C, mob/user)
- if(istype(C, /obj/item/card/id))
- scan_ID(C, user)
+/obj/item/device/paicard/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/card/id))
+ scan_ID(attacking_item, user)
return TRUE
- else if(istype(C, /obj/item/device/encryptionkey))
+ else if(istype(attacking_item, /obj/item/device/encryptionkey))
if(length(installed_encryptionkeys) > 2)
to_chat(user, SPAN_WARNING("\The [src] already has the full number of possible encryption keys installed!"))
return TRUE
- var/obj/item/device/encryptionkey/EK = C
+ var/obj/item/device/encryptionkey/EK = attacking_item
var/added_channels = FALSE
for(var/thing in (EK.channels | EK.additional_channels))
if(!radio.channels[thing])
@@ -69,22 +69,22 @@
else
to_chat(user, SPAN_WARNING("\The [src] would not gain any new channels from \the [EK]."))
return TRUE
- else if(C.isscrewdriver())
+ else if(attacking_item.isscrewdriver())
if(!length(installed_encryptionkeys))
to_chat(user, SPAN_WARNING("There are no installed encryption keys to remove!"))
return
- user.visible_message("[user] uses \the [C] to pop the encryption key[length(installed_encryptionkeys) > 1 ? "s" : ""] out of \the [src].", SPAN_NOTICE("You use \the [C] to pop the encryption key[length(installed_encryptionkeys) > 1 ? "s" : ""] out of \the [src]."))
+ user.visible_message("[user] uses \the [attacking_item] to pop the encryption key[length(installed_encryptionkeys) > 1 ? "s" : ""] out of \the [src].", SPAN_NOTICE("You use \the [attacking_item] to pop the encryption key[length(installed_encryptionkeys) > 1 ? "s" : ""] out of \the [src]."))
for(var/key in installed_encryptionkeys)
var/obj/item/device/encryptionkey/EK = key
EK.forceMove(get_turf(src))
installed_encryptionkeys -= EK
recalculateChannels()
return TRUE
- else if(istype(C, /obj/item/stack/nanopaste))
+ else if(istype(attacking_item, /obj/item/stack/nanopaste))
if(!pai)
to_chat(user, SPAN_WARNING("You cannot repair a pAI device if there's no active pAI personality installed."))
return TRUE
- pai.attackby(C, user)
+ pai.attackby(attacking_item, user)
/obj/item/device/paicard/proc/recalculateChannels()
radio.channels = list("Common" = radio.FREQ_LISTENING, "Entertainment" = radio.FREQ_LISTENING)
diff --git a/code/game/objects/items/devices/powersink.dm b/code/game/objects/items/devices/powersink.dm
index fb84cd0ca61..331c1028673 100644
--- a/code/game/objects/items/devices/powersink.dm
+++ b/code/game/objects/items/devices/powersink.dm
@@ -31,8 +31,8 @@
return ..()
-/obj/item/device/powersink/attackby(var/obj/item/I, var/mob/user)
- if(I.isscrewdriver())
+/obj/item/device/powersink/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.isscrewdriver())
if(mode == 0)
var/turf/T = loc
if(isturf(T) && !!T.is_plating())
diff --git a/code/game/objects/items/devices/radio/beacon.dm b/code/game/objects/items/devices/radio/beacon.dm
index 15f1ac80a2e..c1e67abdf39 100644
--- a/code/game/objects/items/devices/radio/beacon.dm
+++ b/code/game/objects/items/devices/radio/beacon.dm
@@ -33,8 +33,8 @@ GLOBAL_LIST_EMPTY(teleportbeacons)
/obj/item/device/radio/beacon/send_hear()
return null
-/obj/item/device/radio/beacon/attackby(obj/item/W, mob/user)
- if(isturf(loc) && W.isscrewdriver())
+/obj/item/device/radio/beacon/attackby(obj/item/attacking_item, mob/user)
+ if(isturf(loc) && attacking_item.isscrewdriver())
anchored = !anchored
user.visible_message("[user] [anchored ? "" : "un"]fastens \the [src] [anchored ? "to" : "from"] the floor.", "You [anchored ? "" : "un"]fasten \the [src] [anchored ? "to" : "from"] the floor.")
return
diff --git a/code/game/objects/items/devices/radio/encryptionkey.dm b/code/game/objects/items/devices/radio/encryptionkey.dm
index 12c589ebf70..874e38e1d49 100644
--- a/code/game/objects/items/devices/radio/encryptionkey.dm
+++ b/code/game/objects/items/devices/radio/encryptionkey.dm
@@ -13,7 +13,7 @@
var/list/channels = list(CHANNEL_COMMON = TRUE, CHANNEL_ENTERTAINMENT = TRUE)
var/list/additional_channels = list()
-/obj/item/device/encryptionkey/attackby(obj/item/W, mob/user)
+/obj/item/device/encryptionkey/attackby(obj/item/attacking_item, mob/user)
return
/obj/item/device/encryptionkey/ship
diff --git a/code/game/objects/items/devices/radio/headset.dm b/code/game/objects/items/devices/radio/headset.dm
index 75a51b47678..f5b8a8250a4 100644
--- a/code/game/objects/items/devices/radio/headset.dm
+++ b/code/game/objects/items/devices/radio/headset.dm
@@ -106,8 +106,8 @@
..()
-/obj/item/device/radio/headset/attackby(obj/item/W, mob/user)
- if(W.isscrewdriver())
+/obj/item/device/radio/headset/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.isscrewdriver())
if(keyslot1 || keyslot2)
for(var/ch_name in channels)
SSradio.remove_object(src, radiochannels[ch_name])
@@ -130,17 +130,17 @@
else
to_chat(user, SPAN_WARNING("This headset doesn't have any encryption keys!"))
- else if(istype(W, /obj/item/device/encryptionkey))
+ else if(istype(attacking_item, /obj/item/device/encryptionkey))
if(keyslot1 && keyslot2)
to_chat(user, SPAN_WARNING("The headset can't hold another key!"))
return
if(!keyslot1)
- user.drop_from_inventory(W, src)
- keyslot1 = W
+ user.drop_from_inventory(attacking_item, src)
+ keyslot1 = attacking_item
else
- user.drop_from_inventory(W, src)
- keyslot2 = W
+ user.drop_from_inventory(attacking_item, src)
+ keyslot2 = attacking_item
recalculateChannels(TRUE)
diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm
index e83540ddf4f..2c45de45d7e 100644
--- a/code/game/objects/items/devices/radio/radio.dm
+++ b/code/game/objects/items/devices/radio/radio.dm
@@ -523,10 +523,10 @@ var/global/list/default_interrogation_channels = list(
else
. += SPAN_NOTICE("\The [src] can not be modified or attached!")
-/obj/item/device/radio/attackby(obj/item/W as obj, mob/user as mob)
+/obj/item/device/radio/attackby(obj/item/attacking_item, mob/user)
..()
user.set_machine(src)
- if (!( W.isscrewdriver() ))
+ if (!( attacking_item.isscrewdriver() ))
return
b_stat = !( b_stat )
if(!istype(src, /obj/item/device/radio/beacon))
@@ -578,13 +578,13 @@ var/global/list/default_interrogation_channels = list(
var/datum/robot_component/C = R.components["radio"]
R.cell_use_power(C.active_usage)
-/obj/item/device/radio/borg/attackby(obj/item/W as obj, mob/user as mob)
+/obj/item/device/radio/borg/attackby(obj/item/attacking_item, mob/user)
// ..()
user.set_machine(src)
- if (!( W.isscrewdriver() || (istype(W, /obj/item/device/encryptionkey/ ))))
+ if (!( attacking_item.isscrewdriver() || (istype(attacking_item, /obj/item/device/encryptionkey/ ))))
return
- if(W.isscrewdriver())
+ if(attacking_item.isscrewdriver())
if(keyslot)
@@ -605,14 +605,14 @@ var/global/list/default_interrogation_channels = list(
else
to_chat(user, "This radio doesn't have any encryption keys!")
- if(istype(W, /obj/item/device/encryptionkey/))
+ if(istype(attacking_item, /obj/item/device/encryptionkey/))
if(keyslot)
to_chat(user, "The radio can't hold another key!")
return
if(!keyslot)
- user.drop_from_inventory(W,src)
- keyslot = W
+ user.drop_from_inventory(attacking_item,src)
+ keyslot = attacking_item
recalculateChannels()
diff --git a/code/game/objects/items/devices/radio_jammer.dm b/code/game/objects/items/devices/radio_jammer.dm
index b3a0a11b69f..c812cdc199b 100644
--- a/code/game/objects/items/devices/radio_jammer.dm
+++ b/code/game/objects/items/devices/radio_jammer.dm
@@ -132,8 +132,8 @@ var/list/active_radio_jammers = list()
update_icon()
-/obj/item/device/radiojammer/improvised/attackby(obj/item/W as obj, mob/user as mob)
- if (W.isscrewdriver())
+/obj/item/device/radiojammer/improvised/attackby(obj/item/attacking_item, mob/user)
+ if (attacking_item.isscrewdriver())
to_chat(user, "You disassemble the improvised signal jammer.")
user.put_in_hands(assembly_holder)
assembly_holder.detached()
diff --git a/code/game/objects/items/devices/spy_bug.dm b/code/game/objects/items/devices/spy_bug.dm
index 97bf2621448..64105188dec 100644
--- a/code/game/objects/items/devices/spy_bug.dm
+++ b/code/game/objects/items/devices/spy_bug.dm
@@ -36,9 +36,12 @@
to_chat(user, "\The [src]'s radio is [radio.get_broadcasting() ? "broadcasting" : "not broadcasting"] now. The current frequency is [radio.get_frequency()].")
radio.attack_self(user)
-/obj/item/device/spy_bug/attackby(obj/W as obj, mob/living/user as mob)
- if(istype(W, /obj/item/device/spy_monitor))
- var/obj/item/device/spy_monitor/SM = W
+/obj/item/device/spy_bug/attackby(obj/item/attacking_item, mob/user)
+ if(!istype(user))
+ return
+
+ if(istype(attacking_item, /obj/item/device/spy_monitor))
+ var/obj/item/device/spy_monitor/SM = attacking_item
SM.pair(src, user)
return TRUE
else
@@ -80,9 +83,12 @@
radio.attack_self(user)
view_cameras(user)
-/obj/item/device/spy_monitor/attackby(obj/W as obj, mob/living/user as mob)
- if(istype(W, /obj/item/device/spy_bug))
- pair(W, user)
+/obj/item/device/spy_monitor/attackby(obj/item/attacking_item, mob/user)
+ if(!istype(user))
+ return
+
+ if(istype(attacking_item, /obj/item/device/spy_bug))
+ pair(attacking_item, user)
return TRUE
else
return ..()
diff --git a/code/game/objects/items/devices/suit_cooling.dm b/code/game/objects/items/devices/suit_cooling.dm
index 23d32ce2ffc..57536658206 100644
--- a/code/game/objects/items/devices/suit_cooling.dm
+++ b/code/game/objects/items/devices/suit_cooling.dm
@@ -150,8 +150,8 @@
if(on)
to_chat(user, SPAN_NOTICE("You switch on \the [src]."))
-/obj/item/device/suit_cooling_unit/attackby(obj/item/W, mob/user)
- if(W.isscrewdriver())
+/obj/item/device/suit_cooling_unit/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.isscrewdriver())
if(cover_open)
cover_open = FALSE
to_chat(user, SPAN_NOTICE("You screw the panel into place."))
@@ -161,13 +161,13 @@
update_icon()
return
- if(istype(W, /obj/item/cell))
+ if(istype(attacking_item, /obj/item/cell))
if(cover_open)
if(cell)
to_chat(user, SPAN_WARNING("There is \a [cell] already installed here."))
else
- user.drop_from_inventory(W,src)
- cell = W
+ user.drop_from_inventory(attacking_item,src)
+ cell = attacking_item
to_chat(user, SPAN_NOTICE("You insert \the [cell]."))
update_icon()
return
diff --git a/code/game/objects/items/devices/taperecorder.dm b/code/game/objects/items/devices/taperecorder.dm
index ff75ea0d11e..bfb37c4340b 100644
--- a/code/game/objects/items/devices/taperecorder.dm
+++ b/code/game/objects/items/devices/taperecorder.dm
@@ -319,12 +319,12 @@
icon_state = "taperecorderidle"
return
-/obj/item/device/taperecorder/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/computer_hardware/hard_drive/portable))
+/obj/item/device/taperecorder/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/computer_hardware/hard_drive/portable))
if(portable_drive)
to_chat(user, SPAN_WARNING("\The [src] already has a portable drive!"))
return
- user.drop_from_inventory(W, src)
- portable_drive = W
+ user.drop_from_inventory(attacking_item, src)
+ portable_drive = attacking_item
else
..()
diff --git a/code/game/objects/items/devices/transfer_valve.dm b/code/game/objects/items/devices/transfer_valve.dm
index ce8f3418e57..f9c7c5c4408 100644
--- a/code/game/objects/items/devices/transfer_valve.dm
+++ b/code/game/objects/items/devices/transfer_valve.dm
@@ -16,20 +16,20 @@
/obj/item/device/transfer_valve/IsAssemblyHolder()
return 1
-/obj/item/device/transfer_valve/attackby(obj/item/item, mob/user)
+/obj/item/device/transfer_valve/attackby(obj/item/attacking_item, mob/user)
var/turf/location = get_turf(src) // For admin logs
- if(istype(item, /obj/item/tank))
+ if(istype(attacking_item, /obj/item/tank))
if(tank_one && tank_two)
to_chat(user, "There are already two tanks attached, remove one first.")
return
if(!tank_one)
- tank_one = item
- user.drop_from_inventory(item,src)
+ tank_one = attacking_item
+ user.drop_from_inventory(attacking_item,src)
to_chat(user, "You attach the tank to the transfer valve.")
else if(!tank_two)
- tank_two = item
- user.drop_from_inventory(item,src)
+ tank_two = attacking_item
+ user.drop_from_inventory(attacking_item,src)
to_chat(user, "You attach the tank to the transfer valve.")
message_admins("[key_name_admin(user)] attached both tanks to a transfer valve. (JMP)")
log_game("[key_name_admin(user)] attached both tanks to a transfer valve.",ckey=key_name(user))
@@ -37,24 +37,24 @@
update_icon()
update_static_data_for_all_viewers()
//TODO: Have this take an assemblyholder
- else if(isassembly(item))
- var/obj/item/device/assembly/A = item
+ else if(isassembly(attacking_item))
+ var/obj/item/device/assembly/A = attacking_item
if(A.secured)
to_chat(user, "The device is secured.")
return
if(attached_device)
to_chat(user, "There is already an device attached to the valve, remove it first.")
return
- user.remove_from_mob(item)
+ user.remove_from_mob(attacking_item)
attached_device = A
A.forceMove(src)
- to_chat(user, "You attach the [item] to the valve controls and secure it.")
+ to_chat(user, "You attach the [attacking_item] to the valve controls and secure it.")
A.holder = src
A.toggle_secure() //this calls update_icon(), which calls update_icon() on the holder (i.e. the bomb).
- GLOB.bombers += "[key_name(user)] attached a [item] to a transfer valve."
- message_admins("[key_name_admin(user)] attached a [item] to a transfer valve. (JMP)")
- log_game("[key_name_admin(user)] attached a [item] to a transfer valve.",ckey=key_name(user))
+ GLOB.bombers += "[key_name(user)] attached a [attacking_item] to a transfer valve."
+ message_admins("[key_name_admin(user)] attached a [attacking_item] to a transfer valve. (JMP)")
+ log_game("[key_name_admin(user)] attached a [attacking_item] to a transfer valve.",ckey=key_name(user))
attacher = user
update_static_data_for_all_viewers()
return
diff --git a/code/game/objects/items/devices/tvcamera.dm b/code/game/objects/items/devices/tvcamera.dm
index 1402c94d115..f52ab445e50 100644
--- a/code/game/objects/items/devices/tvcamera.dm
+++ b/code/game/objects/items/devices/tvcamera.dm
@@ -85,7 +85,11 @@
H.update_inv_l_hand()
/* Assembly by a roboticist */
-/obj/item/robot_parts/head/attackby(var/obj/item/device/assembly/S, mob/user as mob)
+/obj/item/robot_parts/head/attackby(obj/item/attacking_item, mob/user)
+ var/obj/item/device/assembly/S = attacking_item
+ if(!istype(S))
+ return
+
if(!istype(S, /obj/item/device/assembly/infra))
..()
return
@@ -106,24 +110,24 @@ Using robohead because of restricting to roboticist */
var/buildstep = 0
w_class = ITEMSIZE_LARGE
-/obj/item/tv_assembly/attackby(var/obj/item/W, var/mob/user)
+/obj/item/tv_assembly/attackby(obj/item/attacking_item, mob/user)
switch(buildstep)
if(0)
- if(istype(W, /obj/item/robot_parts/robot_component/camera))
+ if(istype(attacking_item, /obj/item/robot_parts/robot_component/camera))
to_chat(user, SPAN_NOTICE("You add the camera module to [src]."))
- qdel(W)
+ qdel(attacking_item)
desc = "This TV camera assembly has a camera module."
buildstep++
if(1)
- if(istype(W, /obj/item/device/taperecorder))
- qdel(W)
+ if(istype(attacking_item, /obj/item/device/taperecorder))
+ qdel(attacking_item)
buildstep++
to_chat(user, SPAN_NOTICE("You add the tape recorder to [src]."))
desc = "This TV camera assembly has a camera and audio module."
return
if(2)
- if(W.iscoil())
- var/obj/item/stack/cable_coil/C = W
+ if(attacking_item.iscoil())
+ var/obj/item/stack/cable_coil/C = attacking_item
if(!C.use(3))
to_chat(user, SPAN_NOTICE("You need three cable coils to wire the devices."))
..()
@@ -133,14 +137,14 @@ Using robohead because of restricting to roboticist */
desc = "This TV camera assembly has wires sticking out."
return
if(3)
- if(W.iswirecutter())
+ if(attacking_item.iswirecutter())
to_chat(user, SPAN_NOTICE("You trim the wires."))
buildstep++
desc = "This TV camera assembly needs casing."
return
if(4)
- if(istype(W, /obj/item/stack/material/steel))
- var/obj/item/stack/material/steel/S = W
+ if(istype(attacking_item, /obj/item/stack/material/steel))
+ var/obj/item/stack/material/steel/S = attacking_item
if(S.use(1))
buildstep++
to_chat(user, SPAN_NOTICE("You encase the assembly."))
diff --git a/code/game/objects/items/easel.dm b/code/game/objects/items/easel.dm
index 84f5ef2b875..5729f6016f4 100644
--- a/code/game/objects/items/easel.dm
+++ b/code/game/objects/items/easel.dm
@@ -20,9 +20,9 @@
/*
* Adding canvases.
*/
-/obj/structure/easel/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/canvas))
- var/obj/item/canvas/C = I
+/obj/structure/easel/attackby(obj/item/attacking_item, mob/user, params)
+ if(istype(attacking_item, /obj/item/canvas))
+ var/obj/item/canvas/C = attacking_item
if(user.unEquip(C))
painting = C
C.forceMove(get_turf(src))
@@ -32,7 +32,7 @@
C.pixel_z = 0
user.visible_message("[user] puts \the [C] on \the [src].", SPAN_NOTICE("You place \the [C] on \the [src]."))
return TRUE
- if(I.iswrench())
+ if(attacking_item.iswrench())
to_chat(user, SPAN_NOTICE("You dismantle \the [src]."))
dismantle()
return TRUE
diff --git a/code/game/objects/items/glassjar.dm b/code/game/objects/items/glassjar.dm
index 814806814db..9d0736d3bf2 100644
--- a/code/game/objects/items/glassjar.dm
+++ b/code/game/objects/items/glassjar.dm
@@ -110,9 +110,9 @@
usr.put_in_hands(contained[1])
contained -= contained[1]
-/obj/item/glass_jar/attackby(var/atom/A, var/mob/user, var/proximity)
- if(istype(A, /obj/item/spacecash))
- var/obj/item/spacecash/S = A
+/obj/item/glass_jar/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/spacecash))
+ var/obj/item/spacecash/S = attacking_item
if(contains == JAR_NOTHING)
contains = JAR_MONEY
if(contains != JAR_MONEY)
@@ -120,8 +120,8 @@
user.visible_message(SPAN_NOTICE("[user] puts [S.worth] credit\s into \the [src]."))
user.drop_from_inventory(S,src)
update_icon()
- if(istype(A, /obj/item/clothing/mask/chewable/candy/gum/gumball))
- var/obj/item/clothing/mask/chewable/candy/gum/gumball/G = A
+ if(istype(attacking_item, /obj/item/clothing/mask/chewable/candy/gum/gumball))
+ var/obj/item/clothing/mask/chewable/candy/gum/gumball/G = attacking_item
if(length(contained) < GUMBALL_MAX)
contained += G
user.drop_from_inventory(G)
@@ -133,8 +133,8 @@
else
to_chat(user, SPAN_WARNING("\The [name] is full!"))
return TRUE
- if(istype(A, /obj/item/holder))
- var/obj/item/holder/H = A
+ if(istype(attacking_item, /obj/item/holder))
+ var/obj/item/holder/H = attacking_item
if(H.w_class <= ITEMSIZE_SMALL)
contains = JAR_HOLDER
user.drop_from_inventory(H)
diff --git a/code/game/objects/items/holomenu.dm b/code/game/objects/items/holomenu.dm
index d658b552d54..4651d236317 100644
--- a/code/game/objects/items/holomenu.dm
+++ b/code/game/objects/items/holomenu.dm
@@ -54,8 +54,8 @@
else
set_light(0)
-/obj/item/holomenu/attackby(obj/item/I, mob/user)
- var/obj/item/card/id/ID = I.GetID()
+/obj/item/holomenu/attackby(obj/item/attacking_item, mob/user)
+ var/obj/item/card/id/ID = attacking_item.GetID()
if(istype(ID))
if(check_access(ID))
anchored = !anchored
@@ -64,9 +64,9 @@
else
to_chat(user, SPAN_WARNING("Access denied."))
return TRUE
- if(istype(I, /obj/item/paper) && allowed(user))
- var/obj/item/paper/P = I
- to_chat(user, SPAN_NOTICE("You scan \the [I.name] into \the [name]."))
+ if(istype(attacking_item, /obj/item/paper) && allowed(user))
+ var/obj/item/paper/P = attacking_item
+ to_chat(user, SPAN_NOTICE("You scan \the [attacking_item.name] into \the [name]."))
menu_text = P.info
menu_text = replacetext(menu_text, "color=black>", "color=white>")
update_icon()
@@ -141,13 +141,13 @@
menu_text = pencode2html(new_text)
update_icon()
-/obj/item/holomenu/holodeck/attackby(obj/item/I, mob/user)
- var/obj/item/card/id/ID = I.GetID()
+/obj/item/holomenu/holodeck/attackby(obj/item/attacking_item, mob/user)
+ var/obj/item/card/id/ID = attacking_item.GetID()
if(istype(ID))
return TRUE
- if(istype(I, /obj/item/paper))
- var/obj/item/paper/P = I
- to_chat(user, SPAN_NOTICE("You scan \the [I.name] into \the [name]."))
+ if(istype(attacking_item, /obj/item/paper))
+ var/obj/item/paper/P = attacking_item
+ to_chat(user, SPAN_NOTICE("You scan \the [attacking_item.name] into \the [name]."))
menu_text = P.info
menu_text = replacetext(menu_text, "color=black>", "color=white>")
update_icon()
diff --git a/code/game/objects/items/knitting.dm b/code/game/objects/items/knitting.dm
index 47c31e65f32..00b64c8a6d8 100644
--- a/code/game/objects/items/knitting.dm
+++ b/code/game/objects/items/knitting.dm
@@ -64,13 +64,13 @@
cut_overlays()
update_held_icon()
-/obj/item/knittingneedles/attackby(obj/item/O, mob/user)
- if(istype(O, /obj/item/yarn))
+/obj/item/knittingneedles/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/yarn))
if(!ball)
- user.unEquip(O)
- O.forceMove(src)
- ball = O
- to_chat(user, SPAN_NOTICE("You place \the [O] in \the [src]"))
+ user.unEquip(attacking_item)
+ attacking_item.forceMove(src)
+ ball = attacking_item
+ to_chat(user, SPAN_NOTICE("You place \the [attacking_item] in \the [src]"))
update_icon()
return TRUE
diff --git a/code/game/objects/items/paintkit.dm b/code/game/objects/items/paintkit.dm
index cba80f4969f..ecdb9a28922 100644
--- a/code/game/objects/items/paintkit.dm
+++ b/code/game/objects/items/paintkit.dm
@@ -27,9 +27,9 @@
var/new_light_overlay
var/new_mob_icon_file
-/obj/item/clothing/head/helmet/space/void/attackby(var/obj/item/O, var/mob/user)
- if(istype(O,/obj/item/device/kit/suit))
- var/obj/item/device/kit/suit/kit = O
+/obj/item/clothing/head/helmet/space/void/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item,/obj/item/device/kit/suit))
+ var/obj/item/device/kit/suit/kit = attacking_item
name = "[kit.new_name] suit helmet"
desc = kit.new_desc
icon_state = "[kit.new_icon]_helmet"
@@ -48,9 +48,9 @@
return TRUE
return ..()
-/obj/item/clothing/suit/space/void/attackby(var/obj/item/O, var/mob/user)
- if(istype(O,/obj/item/device/kit/suit))
- var/obj/item/device/kit/suit/kit = O
+/obj/item/clothing/suit/space/void/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/device/kit/suit))
+ var/obj/item/device/kit/suit/kit = attacking_item
name = "[kit.new_name] voidsuit"
desc = kit.new_desc
icon_state = "[kit.new_icon]_suit"
diff --git a/code/game/objects/items/recharger_backpack.dm b/code/game/objects/items/recharger_backpack.dm
index bfb31091931..fcc66fd606c 100644
--- a/code/game/objects/items/recharger_backpack.dm
+++ b/code/game/objects/items/recharger_backpack.dm
@@ -22,23 +22,23 @@
if(powersupply)
. += SPAN_NOTICE("The backpack display shows that the installed power cell is at [round(powersupply.percent())]%.")
-/obj/item/recharger_backpack/attackby(obj/item/I, mob/user)
- if(istype(I, /obj/item/cell) && !powersupply)
- to_chat(usr, SPAN_NOTICE("You slot \the [I] into \the [src]'s power socket."))
+/obj/item/recharger_backpack/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/cell) && !powersupply)
+ to_chat(usr, SPAN_NOTICE("You slot \the [attacking_item] into \the [src]'s power socket."))
playsound(get_turf(src), 'sound/machines/click.ogg', 30, 0)
- user.drop_from_inventory(I, src)
- powersupply = I
+ user.drop_from_inventory(attacking_item, src)
+ powersupply = attacking_item
update_icon()
- else if(istype(I, /obj/item/screwdriver) && powersupply)
+ else if(istype(attacking_item, /obj/item/screwdriver) && powersupply)
to_chat(user, SPAN_NOTICE("You remove \the [powersupply] from \the [src]'s power socket"))
powersupply.forceMove(get_turf(src))
user.put_in_hands(powersupply)
powersupply = null
update_icon()
- else if(istype(I, /obj/item/gun/energy))
- connect(I)
+ else if(istype(attacking_item, /obj/item/gun/energy))
+ connect(attacking_item)
else
. = ..()
diff --git a/code/game/objects/items/shooting_range.dm b/code/game/objects/items/shooting_range.dm
index cfc0f3f8826..11f0b906c9c 100644
--- a/code/game/objects/items/shooting_range.dm
+++ b/code/game/objects/items/shooting_range.dm
@@ -17,12 +17,12 @@
stake.set_target(null)
return ..()
-/obj/item/target/attackby(var/obj/item/W, var/mob/user)
- if(W.iswelder())
+/obj/item/target/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.iswelder())
if(hp == initial(hp))
to_chat(user, SPAN_NOTICE("\The [src] is fully repaired."))
return TRUE
- var/obj/item/weldingtool/WT = W
+ var/obj/item/weldingtool/WT = attacking_item
if(WT.use(0, user))
cut_overlays()
LAZYCLEARLIST(bullet_holes)
diff --git a/code/game/objects/items/skrell.dm b/code/game/objects/items/skrell.dm
index a32d932bac3..24a2160039e 100644
--- a/code/game/objects/items/skrell.dm
+++ b/code/game/objects/items/skrell.dm
@@ -62,7 +62,7 @@
glow_state = make_screen_overlay(icon, icon_state)
add_overlay(glow_state)
-/obj/effect/temp_visual/constellation/attackby(obj/item/W as obj, mob/user as mob)
+/obj/effect/temp_visual/constellation/attackby(obj/item/attacking_item, mob/user)
visible_message("\The [src] vanishes!")
qdel(src)
return TRUE
diff --git a/code/game/objects/items/stacks/rods.dm b/code/game/objects/items/stacks/rods.dm
index 1ca139b4c46..81e71c06ac7 100644
--- a/code/game/objects/items/stacks/rods.dm
+++ b/code/game/objects/items/stacks/rods.dm
@@ -60,10 +60,10 @@ var/global/list/datum/stack_recipe/rod_recipes = list(
..()
recipes = rod_recipes
-/obj/item/stack/rods/attackby(obj/item/W as obj, mob/user as mob)
+/obj/item/stack/rods/attackby(obj/item/attacking_item, mob/user)
..()
- if (W.iswelder())
- var/obj/item/weldingtool/WT = W
+ if (attacking_item.iswelder())
+ var/obj/item/weldingtool/WT = attacking_item
if(get_amount() < 2)
to_chat(user, "You need at least two rods to do this.")
@@ -82,7 +82,7 @@ var/global/list/datum/stack_recipe/rod_recipes = list(
user.put_in_hands(new_item)
return
- if (istype(W, /obj/item/tape_roll))
+ if (istype(attacking_item, /obj/item/tape_roll))
var/obj/item/stack/medical/splint/makeshift/new_splint = new(user.loc)
new_splint.add_fingerprint(user)
diff --git a/code/game/objects/items/stacks/sheets/glass.dm b/code/game/objects/items/stacks/sheets/glass.dm
index 8e9001bcc03..d585a38a601 100644
--- a/code/game/objects/items/stacks/sheets/glass.dm
+++ b/code/game/objects/items/stacks/sheets/glass.dm
@@ -124,19 +124,19 @@
default_type = "wired glass"
construction_options = list()
-/obj/item/stack/material/glass/wired/attackby(var/obj/O, mob/user as mob)
- if(istype(O, /obj/item/stack/material/steel))
- var/obj/item/stack/material/steel/M = O
+/obj/item/stack/material/glass/wired/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/stack/material/steel))
+ var/obj/item/stack/material/steel/M = attacking_item
if (M.use(1))
var/obj/item/L = new /obj/item/stack/tile/light
- user.drop_from_inventory(L,get_turf(src))
+ user.drop_from_inventory(L, get_turf(src))
to_chat(user, "You make a light tile.")
use(1)
else
to_chat(user, "You need one metal sheet to finish the light tile!")
- else if(O.iswirecutter())
- user.drop_from_inventory(O,get_turf(src))
+ else if(attacking_item.iswirecutter())
+ user.drop_from_inventory(attacking_item, get_turf(src))
to_chat(user, "You detach the wire from the [name].")
playsound(src.loc, 'sound/items/Wirecutter.ogg', 100, 1)
new /obj/item/stack/cable_coil(user.loc, 5)
diff --git a/code/game/objects/items/stacks/sheets/leather.dm b/code/game/objects/items/stacks/sheets/leather.dm
index 82864c23610..7ab85b2850d 100644
--- a/code/game/objects/items/stacks/sheets/leather.dm
+++ b/code/game/objects/items/stacks/sheets/leather.dm
@@ -80,8 +80,8 @@
//Animal Hide to leather steps
//Step one - dehairing.
-/obj/item/stack/material/animalhide/attackby(obj/item/W, mob/user)
- if(is_sharp(W) && !W.noslice && !W.iswirecutter()) //Can we cut and slice with the item? And does the hide still have something to remove? Say no to wirecutters since it's more about bladed items.
+/obj/item/stack/material/animalhide/attackby(obj/item/attacking_item, mob/user)
+ if(is_sharp(attacking_item) && !attacking_item.noslice && !attacking_item.iswirecutter()) //Can we cut and slice with the item? And does the hide still have something to remove? Say no to wirecutters since it's more about bladed items.
if(bare)
to_chat(user, SPAN_WARNING("There's nothing left to remove from \the [src]!"))
return
@@ -121,9 +121,9 @@
if(wetness <= 0)
make_leather()
-/obj/item/stack/material/animalhide/wetleather/attackby(obj/item/I, mob/user)
- if(I.iswelder())
- var/obj/item/weldingtool/WT = I
+/obj/item/stack/material/animalhide/wetleather/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.iswelder())
+ var/obj/item/weldingtool/WT = attacking_item
if(WT.isOn())
if(being_dried)
to_chat(user, SPAN_WARNING("\The [src] are already being dried"))
diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm
index 1649c0343ce..44d6e81a8ca 100644
--- a/code/game/objects/items/stacks/stack.dm
+++ b/code/game/objects/items/stacks/stack.dm
@@ -338,9 +338,9 @@
..()
return
-/obj/item/stack/attackby(obj/item/W as obj, mob/user as mob)
- if (istype(W, /obj/item/stack))
- var/obj/item/stack/S = W
+/obj/item/stack/attackby(obj/item/attacking_item, mob/user)
+ if (istype(attacking_item, /obj/item/stack))
+ var/obj/item/stack/S = attacking_item
if (user.get_inactive_hand()==src)
src.transfer_to(S, 1)
else
diff --git a/code/game/objects/items/stacks/tiles/light.dm b/code/game/objects/items/stacks/tiles/light.dm
index 05e0797e85a..34df47a430b 100644
--- a/code/game/objects/items/stacks/tiles/light.dm
+++ b/code/game/objects/items/stacks/tiles/light.dm
@@ -17,11 +17,11 @@
else
state = 0 //fine
-/obj/item/stack/tile/light/attackby(var/obj/item/O, var/mob/user)
- if(O.iscrowbar())
+/obj/item/stack/tile/light/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.iscrowbar())
amount--
to_chat(user, "You pry off the steel sheet from the [name].")
- playsound(src.loc, O.usesound, 100, 1)
+ playsound(src.loc, attacking_item.usesound, 100, 1)
new /obj/item/stack/material/glass/wired(user.loc)
new /obj/item/stack/material/steel(user.loc)
if(amount <= 0)
diff --git a/code/game/objects/items/stacks/wrap.dm b/code/game/objects/items/stacks/wrap.dm
index 3682878eb3a..b710851074d 100644
--- a/code/game/objects/items/stacks/wrap.dm
+++ b/code/game/objects/items/stacks/wrap.dm
@@ -13,15 +13,15 @@
drop_sound = 'sound/items/drop/wrapper.ogg'
pickup_sound = 'sound/items/pickup/wrapper.ogg'
-/obj/item/stack/wrapping_paper/attackby(obj/item/W, mob/user)
+/obj/item/stack/wrapping_paper/attackby(obj/item/attacking_item, mob/user)
..()
if (isrobot(user))
- if(istype(W.loc, /obj/item/gripper))
- var/obj/item/gripper/G = W.loc
+ if(istype(attacking_item.loc, /obj/item/gripper))
+ var/obj/item/gripper/G = attacking_item.loc
if(!is_type_in_list(G, list(/obj/item/gripper/service, /obj/item/gripper/paperwork)))
to_chat(user, SPAN_WARNING("\The [G] isn't deft enough to wrap up \the [G.wrapped]."))
return
- else if(istype(W, /obj/item/gripper))
+ else if(istype(attacking_item, /obj/item/gripper))
return
else
to_chat(user, SPAN_WARNING("You can't wrap up a cyborg module!"))
@@ -30,27 +30,27 @@
if (!isturf(loc))
to_chat(user, SPAN_WARNING("The paper must be set down for you to wrap a gift!"))
return
- if (W.w_class < ITEMSIZE_LARGE)
+ if (attacking_item.w_class < ITEMSIZE_LARGE)
var/a_used = 2 * (src.w_class - 1)
if(src.amount < a_used)
to_chat(user, SPAN_WARNING("You need more paper!"))
return
else
- if(istype(W, /obj/item/smallDelivery) || istype(W, /obj/item/gift)) //No gift wrapping gifts!
+ if(istype(attacking_item, /obj/item/smallDelivery) || istype(attacking_item, /obj/item/gift)) //No gift wrapping gifts!
return
src.amount -= a_used
user.drop_item()
var/obj/item/gift/G = new /obj/item/gift(src.loc)
- G.size = W.w_class
+ G.size = attacking_item.w_class
G.w_class = G.size + 1
G.icon_state = text("gift[]", G.size)
- G.gift = W
- W.forceMove(G)
+ G.gift = attacking_item
+ attacking_item.forceMove(G)
G.add_fingerprint(user)
- W.add_fingerprint(user)
+ attacking_item.add_fingerprint(user)
src.add_fingerprint(user)
- user.visible_message("\The [user] wraps \the [W] into \a [G].", SPAN_NOTICE("You wrap \the [W] into \a [G], leaving [amount] of \the [src] remaining."))
+ user.visible_message("\The [user] wraps \the [attacking_item] into \a [G].", SPAN_NOTICE("You wrap \the [attacking_item] into \a [G], leaving [amount] of \the [src] remaining."))
update_icon()
if(src.amount <= 0)
new /obj/item/c_tube(src.loc)
diff --git a/code/game/objects/items/sticker.dm b/code/game/objects/items/sticker.dm
index 312b4ab19f5..650e81ae978 100644
--- a/code/game/objects/items/sticker.dm
+++ b/code/game/objects/items/sticker.dm
@@ -35,13 +35,13 @@
if(attached_atom && user.Adjacent(attached_atom))
attack_hand(user)
-/obj/item/sticker/attackby(obj/item/I, mob/user)
+/obj/item/sticker/attackby(obj/item/attacking_item, mob/user)
if(!attached)
return ..()
var/atom/movable/attached_atom = attached.resolve()
if(attached_atom)
- attached_atom.attackby(I, user) // don't allow people to make sticker armor
+ attached_atom.attackby(attacking_item, user) // don't allow people to make sticker armor
return TRUE
/obj/item/sticker/afterattack(atom/movable/target, mob/user, proximity_flag, click_parameters)
diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm
index e845fce151c..6d8f6fd2c44 100644
--- a/code/game/objects/items/toys.dm
+++ b/code/game/objects/items/toys.dm
@@ -62,20 +62,20 @@
src.update_icon()
return
-/obj/item/toy/waterballoon/attackby(obj/O as obj, mob/user as mob)
- if(istype(O, /obj/item/reagent_containers/glass))
- if(O.reagents)
- if(O.reagents.total_volume < 1)
- to_chat(user, "The [O] is empty.")
- else if(O.reagents.total_volume >= 1)
- if(O.reagents.has_reagent(/singleton/reagent/acid/polyacid, 1))
+/obj/item/toy/waterballoon/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/reagent_containers/glass))
+ if(attacking_item.reagents)
+ if(attacking_item.reagents.total_volume < 1)
+ to_chat(user, "The [attacking_item] is empty.")
+ else if(attacking_item.reagents.total_volume >= 1)
+ if(attacking_item.reagents.has_reagent(/singleton/reagent/acid/polyacid, 1))
to_chat(user, "The acid chews through the balloon!")
- O.reagents.splash(user, reagents.total_volume)
+ attacking_item.reagents.splash(user, reagents.total_volume)
qdel(src)
else
src.desc = "A translucent balloon with some form of liquid sloshing around in it."
- to_chat(user, "You fill the balloon with the contents of [O].")
- O.reagents.trans_to_obj(src, 10)
+ to_chat(user, "You fill the balloon with the contents of [attacking_item].")
+ attacking_item.reagents.trans_to_obj(src, 10)
src.update_icon()
return TRUE
@@ -174,8 +174,8 @@
burst()
return
-/obj/item/toy/balloon/attackby(obj/item/W as obj, mob/user as mob)
- if(W.can_puncture())
+/obj/item/toy/balloon/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.can_puncture())
burst()
return TRUE
@@ -414,11 +414,11 @@
if(distance <= 2 && dart_count)
. += "\The [src] is loaded with [dart_count] foam dart\s."
-/obj/item/toy/crossbow/attackby(obj/item/I, mob/user)
- if(istype(I, /obj/item/toy/ammo/crossbow))
+/obj/item/toy/crossbow/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/toy/ammo/crossbow))
if(dart_count <= 4)
- user.drop_from_inventory(I, src)
- qdel(I)
+ user.drop_from_inventory(attacking_item, src)
+ qdel(attacking_item)
dart_count++
to_chat(user, "You load the foam dart into \the [src].")
else
diff --git a/code/game/objects/items/trash.dm b/code/game/objects/items/trash.dm
index ce4f94b9d19..b3ad683f1b7 100644
--- a/code/game/objects/items/trash.dm
+++ b/code/game/objects/items/trash.dm
@@ -226,10 +226,10 @@
icon_state = "ricetub"
var/has_chopsticks = FALSE
-/obj/item/trash/ricetub/attackby(obj/item/W, mob/living/user)
- if(istype(W, /obj/item/material/kitchen/utensil/fork/chopsticks))
- to_chat(user, SPAN_NOTICE("You reattach the [W] to \the [src]"))
- qdel(W)
+/obj/item/trash/ricetub/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/material/kitchen/utensil/fork/chopsticks))
+ to_chat(user, SPAN_NOTICE("You reattach the [attacking_item] to \the [src]"))
+ qdel(attacking_item)
has_chopsticks = TRUE
update_icon()
return TRUE
diff --git a/code/game/objects/items/weapons/RFD.dm b/code/game/objects/items/weapons/RFD.dm
index da5766256f8..c4b58b67dd1 100644
--- a/code/game/objects/items/weapons/RFD.dm
+++ b/code/game/objects/items/weapons/RFD.dm
@@ -73,20 +73,20 @@
to_chat(user, SPAN_NOTICE("The mode selection dial is now at [modes[mode]]."))
playsound(get_turf(src), 'sound/weapons/laser_safetyon.ogg', 50, FALSE)
-/obj/item/rfd/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/rfd_ammo))
+/obj/item/rfd/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/rfd_ammo))
if((stored_matter + 10) > 30)
to_chat(user, SPAN_NOTICE("The RFD can't hold any more matter units."))
return
- user.drop_from_inventory(W,src)
- qdel(W)
+ user.drop_from_inventory(attacking_item, src)
+ qdel(attacking_item)
stored_matter += 10
playsound(src.loc, 'sound/weapons/laser_reload1.ogg', 50, FALSE)
to_chat(user, SPAN_NOTICE("The RFD now holds [stored_matter]/30 matter units."))
update_icon()
return TRUE
- if(W.isscrewdriver()) // Turning it into a crossbow
+ if(attacking_item.isscrewdriver()) // Turning it into a crossbow
crafting = !crafting
if(!crafting)
to_chat(user, SPAN_NOTICE("You reassemble the RFD."))
@@ -97,14 +97,14 @@
if(crafting)
var/obj/item/crossbow // the thing we're gonna add, check what it is below
- if(istype(W, /obj/item/crossbowframe))
- var/obj/item/crossbowframe/F = W
+ if(istype(attacking_item, /obj/item/crossbowframe))
+ var/obj/item/crossbowframe/F = attacking_item
if(F.buildstate != 5)
to_chat(user, SPAN_WARNING("You need to fully assemble the crossbow frame first!"))
return TRUE
crossbow = F
- else if(istype(W, /obj/item/gun/launcher/crossbow) && !istype(W, /obj/item/gun/launcher/crossbow/RFD))
- var/obj/item/gun/launcher/crossbow/C = W
+ else if(istype(attacking_item, /obj/item/gun/launcher/crossbow) && !istype(attacking_item, /obj/item/gun/launcher/crossbow/RFD))
+ var/obj/item/gun/launcher/crossbow/C = attacking_item
if(C.bolt)
to_chat(user, SPAN_WARNING("You need to remove \the [C.bolt] from \the [C] before you can attach it to \the [src]."))
return TRUE
diff --git a/code/game/objects/items/weapons/candle.dm b/code/game/objects/items/weapons/candle.dm
index e674f568abb..2cb69e17e81 100644
--- a/code/game/objects/items/weapons/candle.dm
+++ b/code/game/objects/items/weapons/candle.dm
@@ -27,18 +27,18 @@
icon_state = "candle[i][lit ? "_lit" : ""]"
-/obj/item/flame/candle/attackby(obj/item/W as obj, mob/user as mob)
+/obj/item/flame/candle/attackby(obj/item/attacking_item, mob/user)
..()
- if(W.iswelder())
- var/obj/item/weldingtool/WT = W
+ if(attacking_item.iswelder())
+ var/obj/item/weldingtool/WT = attacking_item
if(WT.isOn()) //Badasses dont get blinded by lighting their candle with a welding tool
light()
- to_chat(user, SPAN_NOTICE("\The [user] casually lights \the [name] with [W]."))
- else if(W.isFlameSource())
+ to_chat(user, SPAN_NOTICE("\The [user] casually lights \the [name] with [attacking_item]."))
+ else if(attacking_item.isFlameSource())
light()
to_chat(user, SPAN_NOTICE("\The [user] lights \the [name]."))
- else if(istype(W, /obj/item/flame/candle))
- var/obj/item/flame/candle/C = W
+ else if(istype(attacking_item, /obj/item/flame/candle))
+ var/obj/item/flame/candle/C = attacking_item
if(C.lit)
light()
to_chat(user, SPAN_NOTICE("\The [user] lights \the [name]."))
diff --git a/code/game/objects/items/weapons/cards_ids.dm b/code/game/objects/items/weapons/cards_ids.dm
index 646f3854cb6..62d948af694 100644
--- a/code/game/objects/items/weapons/cards_ids.dm
+++ b/code/game/objects/items/weapons/cards_ids.dm
@@ -282,9 +282,9 @@ var/const/NO_EMAG_ACT = -50
return 1
return ..()
-/obj/item/card/id/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/card/id))
- var/obj/item/card/id/ID = W
+/obj/item/card/id/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/card/id))
+ var/obj/item/card/id/ID = attacking_item
if(ID.can_copy_access)
ID.access |= src.access
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
diff --git a/code/game/objects/items/weapons/cigs_lighters.dm b/code/game/objects/items/weapons/cigs_lighters.dm
index 31980513c47..1090e590e7d 100644
--- a/code/game/objects/items/weapons/cigs_lighters.dm
+++ b/code/game/objects/items/weapons/cigs_lighters.dm
@@ -87,11 +87,11 @@ CIGARETTE PACKETS ARE IN FANCY.DM
die(TRUE)
return ..()
-/obj/item/flame/match/attackby(obj/item/W as obj, mob/user as mob)
+/obj/item/flame/match/attackby(obj/item/attacking_item, mob/user)
..()
- if(W.isFlameSource() && !src.lit)
+ if(attacking_item.isFlameSource() && !src.lit)
playsound(src, 'sound/items/cigs_lighters/cig_light.ogg', 75, 1, -1)
- user.visible_message("In a feat of redundancy, [user] lights \the [src] using \the [W].", range = 3)
+ user.visible_message("In a feat of redundancy, [user] lights \the [src] using \the [attacking_item].", range = 3)
light()
/obj/item/flame/match/dropped(mob/user as mob)
@@ -243,7 +243,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
else if(M.wear_mask == src)
M.remove_from_mob(src) //un-equip it so the overlays can update
M.update_inv_wear_mask(0)
- if(!(M.equip_to_slot_if_possible(butt, slot_wear_mask, ignore_blocked = TRUE)))
+ if(!(M.equip_to_slot_if_possible(butt, slot_wear_mask, bypass_blocked_check = TRUE)))
M.put_in_hands(butt) // In case the above somehow fails, ensure it is placed somewhere
else
M.remove_from_mob(src) // if it dies in your hand.
@@ -268,25 +268,25 @@ CIGARETTE PACKETS ARE IN FANCY.DM
item_state = icon_off
STOP_PROCESSING(SSprocessing, src)
-/obj/item/clothing/mask/smokable/attackby(obj/item/W as obj, mob/user as mob)
+/obj/item/clothing/mask/smokable/attackby(obj/item/attacking_item, mob/user)
..()
- if(W.isFlameSource())
+ if(attacking_item.isFlameSource())
var/text = matchmes
- if(istype(W, /obj/item/flame/match))
+ if(istype(attacking_item, /obj/item/flame/match))
text = matchmes
- else if(istype(W, /obj/item/flame/lighter/zippo))
+ else if(istype(attacking_item, /obj/item/flame/lighter/zippo))
text = zippomes
- else if(istype(W, /obj/item/flame/lighter))
+ else if(istype(attacking_item, /obj/item/flame/lighter))
text = lightermes
- else if(W.iswelder())
+ else if(attacking_item.iswelder())
text = weldermes
- else if(istype(W, /obj/item/device/assembly/igniter))
+ else if(istype(attacking_item, /obj/item/device/assembly/igniter))
text = ignitermes
else
text = genericmes
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/clothing/mask/smokable/isFlameSource()
@@ -318,12 +318,12 @@ CIGARETTE PACKETS ARE IN FANCY.DM
/singleton/reagent/mental/nicotine = 5
)
-/obj/item/clothing/mask/smokable/cigarette/attackby(obj/item/W as obj, mob/user as mob)
+/obj/item/clothing/mask/smokable/cigarette/attackby(obj/item/attacking_item, mob/user)
..()
- if(istype(W, /obj/item/melee/energy/sword))
- var/obj/item/melee/energy/sword/S = W
+ if(istype(attacking_item, /obj/item/melee/energy/sword))
+ var/obj/item/melee/energy/sword/S = attacking_item
if(S.active)
- light(SPAN_WARNING("[user] swings their [W], barely missing themselves. They light their [name] in the process."))
+ light(SPAN_WARNING("[user] swings their [attacking_item], barely missing themselves. They light their [name] in the process."))
return TRUE
/obj/item/clothing/mask/smokable/cigarette/catch_fire()
@@ -554,7 +554,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
/obj/item/trash/cigbutt/cigarbutt/alt
icon_state = "cigar2butt"
-/obj/item/clothing/mask/smokable/cigarette/cigar/attackby(obj/item/W as obj, mob/user as mob)
+/obj/item/clothing/mask/smokable/cigarette/cigar/attackby(obj/item/attacking_item, mob/user)
..()
user.update_inv_wear_mask(0)
user.update_inv_l_hand(0)
@@ -633,14 +633,14 @@ CIGARETTE PACKETS ARE IN FANCY.DM
reagents.clear_reagents()
name = "empty [initial(name)]"
-/obj/item/clothing/mask/smokable/pipe/attackby(obj/item/W as obj, mob/user as mob)
- if(istype(W, /obj/item/melee/energy/sword))
+/obj/item/clothing/mask/smokable/pipe/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/melee/energy/sword))
return
..()
- if (istype(W, /obj/item/reagent_containers/food/snacks))
- var/obj/item/reagent_containers/food/snacks/grown/G = W
+ if (istype(attacking_item, /obj/item/reagent_containers/food/snacks))
+ var/obj/item/reagent_containers/food/snacks/grown/G = attacking_item
if (!G.dry)
to_chat(user, SPAN_NOTICE("[G] must be dried before you stuff it into [src]."))
return
@@ -654,18 +654,18 @@ CIGARETTE PACKETS ARE IN FANCY.DM
burn_rate = initial(burn_rate)
qdel(G)
- else if(istype(W, /obj/item/flame/lighter))
- var/obj/item/flame/lighter/L = W
+ else if(istype(attacking_item, /obj/item/flame/lighter))
+ var/obj/item/flame/lighter/L = attacking_item
if(L.lit)
- light(SPAN_NOTICE("[user] manages to light their [name] with [W]."))
+ light(SPAN_NOTICE("[user] manages to light their [name] with [attacking_item]."))
- else if(istype(W, /obj/item/flame/match))
- var/obj/item/flame/match/M = W
+ else if(istype(attacking_item, /obj/item/flame/match))
+ var/obj/item/flame/match/M = attacking_item
if(M.lit)
- light(SPAN_NOTICE("[user] lights their [name] with their [W]."))
+ light(SPAN_NOTICE("[user] lights their [name] with their [attacking_item]."))
- else if(istype(W, /obj/item/device/assembly/igniter))
- light(SPAN_NOTICE("[user] fiddles with [W], and manages to light their [name] with the power of science."))
+ else if(istype(attacking_item, /obj/item/device/assembly/igniter))
+ light(SPAN_NOTICE("[user] fiddles with [attacking_item], and manages to light their [name] with the power of science."))
user.update_inv_wear_mask(0)
user.update_inv_l_hand(0)
@@ -1047,10 +1047,10 @@ CIGARETTE PACKETS ARE IN FANCY.DM
w_class = ITEMSIZE_TINY
can_fold = FALSE
-/obj/item/paper/cig/attackby(obj/item/P as obj, mob/user as mob)
- if(istype(P, /obj/item/flame) || P.iswelder())
+/obj/item/paper/cig/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/flame) || attacking_item.iswelder())
..()
- if(P.ispen())
+ if(attacking_item.ispen())
..()
else
return
@@ -1067,9 +1067,9 @@ CIGARETTE PACKETS ARE IN FANCY.DM
icon_state = "cigfilter"
w_class = ITEMSIZE_TINY
-/obj/item/cigarette_filter/attackby(obj/item/I, mob/user)
- if(istype(I, /obj/item/clothing/mask/smokable/cigarette/rolled))
- var/obj/item/clothing/mask/smokable/cigarette/rolled/CR = I
+/obj/item/cigarette_filter/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/clothing/mask/smokable/cigarette/rolled))
+ var/obj/item/clothing/mask/smokable/cigarette/rolled/CR = attacking_item
return CR.attackby(src, user)
. = ..()
@@ -1108,37 +1108,38 @@ CIGARETTE PACKETS ARE IN FANCY.DM
/obj/item/reagent_containers/food/snacks/grown/dried_oracle/fine
plantname = "vedamororacle"
-/obj/item/clothing/mask/smokable/cigarette/rolled/attackby(obj/item/I, mob/user)
- if(istype(I, /obj/item/cigarette_filter))
+/obj/item/clothing/mask/smokable/cigarette/rolled/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/cigarette_filter))
if(filter)
to_chat(user, SPAN_WARNING("\The [src] already has a filter!"))
return
if(lit)
to_chat(user, SPAN_WARNING("\The [src] is lit already!"))
return
- if(user.unEquip(I))
+ if(user.unEquip(attacking_item))
user.visible_message(SPAN_NOTICE("[user] sticks a cigarette filter into \the [src]."), SPAN_NOTICE("You stick a cigarette filter into \the [src]."))
playsound(src, 'sound/items/drop/gloves.ogg', 25, 1)
filter = TRUE
name = "filtered [name]"
update_icon()
- qdel(I)
+ qdel(attacking_item)
return
..()
-/obj/item/reagent_containers/food/snacks/grown/attackby(obj/item/I, mob/user)
- if(istype(I, /obj/item/paper))
+/obj/item/reagent_containers/food/snacks/grown/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/paper))
if(!dry)
to_chat(user, SPAN_WARNING("You need to dry \the [src] first!"))
return
- if(user.unEquip(I))
+ if(user.unEquip(attacking_item))
var/obj/item/clothing/mask/smokable/cigarette/rolled/R = new(get_turf(src))
R.chem_volume = reagents.total_volume
reagents.trans_to_holder(R.reagents, R.chem_volume)
- user.visible_message(SPAN_NOTICE("[user] rolls a cigarette in their hands with \the [I] and [src]."), SPAN_NOTICE("You roll a cigarette in your hands with \the [I] and [src]."))
+ user.visible_message(SPAN_NOTICE("[user] rolls a cigarette in their hands with \the [attacking_item] and [src]."),
+ SPAN_NOTICE("You roll a cigarette in your hands with \the [attacking_item] and [src]."))
playsound(src, 'sound/bureaucracy/paperfold.ogg', 25, 1)
user.put_in_active_hand(R)
- qdel(I)
+ qdel(attacking_item)
qdel(src)
return
..()
diff --git a/code/game/objects/items/weapons/circuitboards/computer/camera_monitor.dm b/code/game/objects/items/weapons/circuitboards/computer/camera_monitor.dm
index d663a66401e..6d101ed7730 100644
--- a/code/game/objects/items/weapons/circuitboards/computer/camera_monitor.dm
+++ b/code/game/objects/items/weapons/circuitboards/computer/camera_monitor.dm
@@ -46,22 +46,23 @@
locked = 0
return 1
-/obj/item/circuitboard/security/attackby(obj/item/I as obj, mob/user as mob)
- if(istype(I,/obj/item/card/id))
+/obj/item/circuitboard/security/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/card/id))
if(emagged)
to_chat(user, "Circuit lock does not respond.")
return
- if(check_access(I))
+ if(check_access(attacking_item))
locked = !locked
to_chat(user, "You [locked ? "" : "un"]lock the circuit controls.")
else
to_chat(user, "Access denied.")
- else if(I.ismultitool())
+ else if(attacking_item.ismultitool())
if(locked)
to_chat(user, "Circuit controls are locked.")
return
var/existing_networks = jointext(network,",")
- var/input = sanitize(input(usr, "Which networks would you like to connect this camera console circuit to? Seperate networks with a comma. No Spaces!\nFor example: SS13,Security,Secret ", "Multitool-Circuitboard interface", existing_networks))
+ var/input = sanitize( tgui_input_text(user, "Which networks would you like to connect this camera console circuit to? Seperate networks with a comma. No Spaces!\nFor example: SS13,Security,Secret ",
+ "Multitool-Circuitboard interface", existing_networks) )
if(!input)
to_chat(usr, "No input found please hang up and try your call again.")
return
diff --git a/code/game/objects/items/weapons/circuitboards/computer/research.dm b/code/game/objects/items/weapons/circuitboards/computer/research.dm
index da2993106c4..181e3b3f899 100644
--- a/code/game/objects/items/weapons/circuitboards/computer/research.dm
+++ b/code/game/objects/items/weapons/circuitboards/computer/research.dm
@@ -6,8 +6,8 @@
name = T_BOARD("R&D control console")
build_path = /obj/machinery/computer/rdconsole/core
-/obj/item/circuitboard/rdconsole/attackby(obj/item/I as obj, mob/user as mob)
- if(I.isscrewdriver())
+/obj/item/circuitboard/rdconsole/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.isscrewdriver())
user.visible_message("\The [user] adjusts the jumper on \the [src]'s access protocol pins.", "You adjust the jumper on the access protocol pins.")
if(src.build_path == /obj/machinery/computer/rdconsole/core)
src.name = T_BOARD("RD Console - Robotics")
diff --git a/code/game/objects/items/weapons/circuitboards/machinery/power.dm b/code/game/objects/items/weapons/circuitboards/machinery/power.dm
index 8ea6681d7c1..21a2d059871 100644
--- a/code/game/objects/items/weapons/circuitboards/machinery/power.dm
+++ b/code/game/objects/items/weapons/circuitboards/machinery/power.dm
@@ -23,8 +23,8 @@
board_type = "machine"
req_components = list("/obj/item/cell" = 3)
-/obj/item/circuitboard/ghettosmes/attackby(obj/item/W, mob/user)
- if(W.ismultitool())
+/obj/item/circuitboard/ghettosmes/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.ismultitool())
var/obj/item/module/power_control/new_circuit = new /obj/item/module/power_control(get_turf(src))
to_chat(user, SPAN_NOTICE("You modify \the [src] into an APC power control module."))
qdel(src)
diff --git a/code/game/objects/items/weapons/circuitboards/machinery/unary_atmos.dm b/code/game/objects/items/weapons/circuitboards/machinery/unary_atmos.dm
index bf205108c46..91409d6b2a2 100644
--- a/code/game/objects/items/weapons/circuitboards/machinery/unary_atmos.dm
+++ b/code/game/objects/items/weapons/circuitboards/machinery/unary_atmos.dm
@@ -7,8 +7,8 @@
var/machine_dir = SOUTH
var/init_dirs = SOUTH
-/obj/item/circuitboard/unary_atmos/attackby(obj/item/I as obj, mob/user as mob)
- if(I.isscrewdriver())
+/obj/item/circuitboard/unary_atmos/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.isscrewdriver())
machine_dir = turn(machine_dir, 90)
init_dirs = machine_dir
user.visible_message("\The [user] adjusts the jumper on the [src]'s port configuration pins.", "You adjust the jumper on the port configuration pins. Now set to [dir2text(machine_dir)].")
diff --git a/code/game/objects/items/weapons/cloaking_device.dm b/code/game/objects/items/weapons/cloaking_device.dm
index 414c8026ae0..880d3057eb8 100644
--- a/code/game/objects/items/weapons/cloaking_device.dm
+++ b/code/game/objects/items/weapons/cloaking_device.dm
@@ -118,17 +118,17 @@
modifier.stop(1)
modifier = null
-/obj/item/cloaking_device/attackby(obj/item/W as obj, mob/user as mob)
- if(istype(W, /obj/item/cell))
+/obj/item/cloaking_device/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/cell))
if(!cell)
- user.drop_from_inventory(W,src)
- cell = W
+ user.drop_from_inventory(attacking_item, src)
+ cell = attacking_item
to_chat(user, "You install a cell in [src].")
update_icon()
else
to_chat(user, "[src] already has a cell.")
- else if(W.isscrewdriver())
+ else if(attacking_item.isscrewdriver())
if(cell)
cell.update_icon()
cell.forceMove(get_turf(src.loc))
diff --git a/code/game/objects/items/weapons/ecigs.dm b/code/game/objects/items/weapons/ecigs.dm
index 2a86e3f57ec..31ce277af73 100644
--- a/code/game/objects/items/weapons/ecigs.dm
+++ b/code/game/objects/items/weapons/ecigs.dm
@@ -154,17 +154,17 @@
M.update_inv_l_hand(0)
M.update_inv_r_hand(1)
-/obj/item/clothing/mask/smokable/ecig/attackby(obj/item/I, mob/user)
- if(istype(I, /obj/item/reagent_containers/ecig_cartridge))
+/obj/item/clothing/mask/smokable/ecig/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/reagent_containers/ecig_cartridge))
if (ec_cartridge)//can't add second one
to_chat(user, SPAN_WARNING("A cartridge has already been installed."))
else //fits in new one
- user.drop_from_inventory(I,src)
- ec_cartridge = I
+ user.drop_from_inventory(attacking_item, src)
+ ec_cartridge = attacking_item
update_icon()
- to_chat(user, SPAN_NOTICE("You insert \the [I] into \the [src]."))
+ to_chat(user, SPAN_NOTICE("You insert \the [attacking_item] into \the [src]."))
- if(I.isscrewdriver())
+ if(attacking_item.isscrewdriver())
if(cig_cell) //if contains powercell
cig_cell.update_icon()
user.put_in_hands(cig_cell)
@@ -173,16 +173,16 @@
else //does not contains cell
to_chat(user, SPAN_WARNING("There's no battery in \the [src]."))
- if (istype(I, /obj/item/cell))
+ if (istype(attacking_item, /obj/item/cell))
if(cig_cell)
to_chat(user, SPAN_WARNING("\The [src] already has a battery installed."))
return
- if (!istype(I, /obj/item/cell/device))
- to_chat(user, SPAN_WARNING("\The [I] is too large to be inserted into \the [src]."))
+ if (!istype(attacking_item, /obj/item/cell/device))
+ to_chat(user, SPAN_WARNING("\The [attacking_item] is too large to be inserted into \the [src]."))
return
- if(user.unEquip(I))
- I.forceMove(src)
- cig_cell = I
+ if(user.unEquip(attacking_item))
+ attacking_item.forceMove(src)
+ cig_cell = attacking_item
to_chat(user, SPAN_NOTICE("You install \the [cig_cell] into \the [src]."))
update_icon()
diff --git a/code/game/objects/items/weapons/explosives.dm b/code/game/objects/items/weapons/explosives.dm
index 1fcd97f1995..742a19535ef 100644
--- a/code/game/objects/items/weapons/explosives.dm
+++ b/code/game/objects/items/weapons/explosives.dm
@@ -24,12 +24,12 @@
wires = null
return ..()
-/obj/item/plastique/attackby(var/obj/item/I, var/mob/user)
- if(I.isscrewdriver())
+/obj/item/plastique/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.isscrewdriver())
open_panel = !open_panel
to_chat(user, "You [open_panel ? "open" : "close"] the wire panel.")
return TRUE
- else if(I.iswirecutter() || I.ismultitool() || istype(I, /obj/item/device/assembly/signaler ))
+ else if(attacking_item.iswirecutter() || attacking_item.ismultitool() || istype(attacking_item, /obj/item/device/assembly/signaler ))
wires.interact(user)
return TRUE
else
diff --git a/code/game/objects/items/weapons/extinguisher.dm b/code/game/objects/items/weapons/extinguisher.dm
index 7b8fb5c0392..2a1ef9603d6 100644
--- a/code/game/objects/items/weapons/extinguisher.dm
+++ b/code/game/objects/items/weapons/extinguisher.dm
@@ -20,17 +20,17 @@
drop_sound = 'sound/items/drop/gascan.ogg'
pickup_sound = 'sound/items/pickup/gascan.ogg'
-/obj/item/reagent_containers/extinguisher_refill/attackby(obj/item/O, mob/user)
- if(O.isscrewdriver())
+/obj/item/reagent_containers/extinguisher_refill/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.isscrewdriver())
if(is_open_container())
atom_flags &= ~ATOM_FLAG_OPEN_CONTAINER
else
atom_flags |= ATOM_FLAG_OPEN_CONTAINER
- to_chat(user, SPAN_NOTICE("Using \the [O], you [is_open_container() ? "unsecure" : "secure"] the cartridge's lid!"))
+ to_chat(user, SPAN_NOTICE("Using \the [attacking_item], you [is_open_container() ? "unsecure" : "secure"] the cartridge's lid!"))
return TRUE
- if(istype(O,/obj/item/extinguisher))
- var/obj/item/extinguisher/E = O
+ if(istype(attacking_item, /obj/item/extinguisher))
+ var/obj/item/extinguisher/E = attacking_item
if(is_open_container())
to_chat(user,"\The [src] needs to be secured first!")
else if(reagents.total_volume <= 0)
@@ -147,10 +147,10 @@
to_chat(user, "The safety is [safety ? "on" : "off"].")
return
-/obj/item/extinguisher/attackby(var/obj/O as obj, var/mob/user as mob)
+/obj/item/extinguisher/attackby(obj/item/attacking_item, mob/user)
- if(istype(O,/obj/item/reagent_containers/extinguisher_refill))
- var/obj/item/reagent_containers/extinguisher_refill/ER = O
+ if(istype(attacking_item,/obj/item/reagent_containers/extinguisher_refill))
+ var/obj/item/reagent_containers/extinguisher_refill/ER = attacking_item
if(ER.is_open_container())
to_chat(user,"\The [ER] needs to be secured first!")
else if(ER.reagents.total_volume <= 0)
diff --git a/code/game/objects/items/weapons/flamethrower.dm b/code/game/objects/items/weapons/flamethrower.dm
index 50322a759b0..289e6416d34 100644
--- a/code/game/objects/items/weapons/flamethrower.dm
+++ b/code/game/objects/items/weapons/flamethrower.dm
@@ -102,11 +102,11 @@
var/turflist = get_turfs_in_cone(user, Get_Angle(user, target_turf), get_dist(user, target_turf), 30)
flame_turf(turflist)
-/obj/item/flamethrower/attackby(obj/item/W, mob/user)
+/obj/item/flamethrower/attackby(obj/item/attacking_item, mob/user)
if(use_check_and_message(user))
return TRUE
- if(W.iswrench() && !secured)//Taking this apart
+ if(attacking_item.iswrench() && !secured)//Taking this apart
var/turf/T = get_turf(src)
if(welding_tool)
welding_tool.forceMove(T)
@@ -121,14 +121,14 @@
qdel(src)
return TRUE
- else if(W.isscrewdriver() && igniter && !lit)
+ else if(attacking_item.isscrewdriver() && igniter && !lit)
secured = !secured
to_chat(user, SPAN_NOTICE("[igniter] is now [secured ? "secured" : "unsecured"]!"))
update_icon()
return TRUE
- else if(isigniter(W))
- var/obj/item/device/assembly/igniter/I = W
+ else if(isigniter(attacking_item))
+ var/obj/item/device/assembly/igniter/I = attacking_item
if(I.secured)
to_chat(user, SPAN_WARNING("\The [I] is not ready to attach yet! Use a screwdriver on it first."))
return TRUE
@@ -140,21 +140,21 @@
update_icon()
return TRUE
- else if(istype(W, /obj/item/tank/phoron) || istype(W, /obj/item/tank/hydrogen))
+ else if(istype(attacking_item, /obj/item/tank/phoron) || istype(attacking_item, /obj/item/tank/hydrogen))
if(gas_tank)
to_chat(user, SPAN_WARNING("There appears to already be a tank loaded in \the [src]!"))
return
- user.drop_from_inventory(W, src)
- gas_tank = W
+ user.drop_from_inventory(attacking_item, src)
+ gas_tank = attacking_item
update_icon()
return TRUE
- else if(istype(W, /obj/item/device/analyzer))
- var/obj/item/device/analyzer/A = W
+ else if(istype(attacking_item, /obj/item/device/analyzer))
+ var/obj/item/device/analyzer/A = attacking_item
A.analyze_gases(src, user)
return TRUE
- else if(W.isFlameSource()) // you can light it with external input, even without an igniter
+ else if(attacking_item.isFlameSource()) // you can light it with external input, even without an igniter
attempt_lighting(user, TRUE)
update_icon()
return TRUE
diff --git a/code/game/objects/items/weapons/grenades/chem_grenade.dm b/code/game/objects/items/weapons/grenades/chem_grenade.dm
index 79a02681dab..19efb133006 100644
--- a/code/game/objects/items/weapons/grenades/chem_grenade.dm
+++ b/code/game/objects/items/weapons/grenades/chem_grenade.dm
@@ -47,10 +47,10 @@
var/mob/living/carbon/C = user
C.throw_mode_on()
-/obj/item/grenade/chem_grenade/attackby(obj/item/W as obj, mob/user as mob)
+/obj/item/grenade/chem_grenade/attackby(obj/item/attacking_item, mob/user)
- if(istype(W,/obj/item/device/assembly_holder) && (!stage || stage==1) && path != 2)
- var/obj/item/device/assembly_holder/det = W
+ if(istype(attacking_item,/obj/item/device/assembly_holder) && (!stage || stage==1) && path != 2)
+ var/obj/item/device/assembly_holder/det = attacking_item
if(istype(det.a_left,det.a_right.type) || (!isigniter(det.a_left) && !isigniter(det.a_right)))
to_chat(user, "Assembly must contain one igniter.")
return
@@ -58,8 +58,8 @@
to_chat(user, "Assembly must be secured with screwdriver.")
return
path = 1
- to_chat(user, "You add [W] to the metal casing.")
- playsound(src.loc, W.usesound, 25, -3)
+ to_chat(user, "You add [attacking_item] to the metal casing.")
+ playsound(src.loc, attacking_item.usesound, 25, -3)
user.remove_from_mob(det)
det.forceMove(src)
detonator = det
@@ -72,7 +72,7 @@
icon_state = initial(icon_state) +"_ass"
name = "unsecured grenade with [beakers.len] containers[detonator?" and detonator":""]"
stage = 1
- else if(W.isscrewdriver() && path != 2)
+ else if(attacking_item.isscrewdriver() && path != 2)
if(stage == 1)
path = 1
if(beakers.len)
@@ -81,7 +81,7 @@
else
to_chat(user, "You lock the empty assembly.")
name = "fake grenade"
- playsound(src.loc, W.usesound, 25, -3)
+ playsound(src.loc, attacking_item.usesound, 25, -3)
icon_state = initial(icon_state) +"_locked"
stage = 2
else if(stage == 2)
@@ -91,25 +91,25 @@
return
else
to_chat(user, "You unlock the assembly.")
- playsound(src.loc, W.usesound, 25, -3)
+ playsound(src.loc, attacking_item.usesound, 25, -3)
name = "unsecured grenade with [beakers.len] containers[detonator?" and detonator":""]"
icon_state = initial(icon_state) + (detonator?"_ass":"")
stage = 1
active = 0
- else if(is_type_in_list(W, allowed_containers) && (!stage || stage==1) && path != 2)
+ else if(is_type_in_list(attacking_item, allowed_containers) && (!stage || stage==1) && path != 2)
path = 1
if(beakers.len == 2)
to_chat(user, "The grenade can not hold more containers.")
return
else
- if(W.reagents.total_volume)
- to_chat(user, "You add \the [W] to the assembly.")
- user.drop_from_inventory(W,src)
- beakers += W
+ if(attacking_item.reagents.total_volume)
+ to_chat(user, "You add \the [attacking_item] to the assembly.")
+ user.drop_from_inventory(attacking_item,src)
+ beakers += attacking_item
stage = 1
name = "unsecured grenade with [beakers.len] containers[detonator?" and detonator":""]"
else
- to_chat(user, "\The [W] is empty.")
+ to_chat(user, "\The [attacking_item] is empty.")
/obj/item/grenade/chem_grenade/get_examine_text(mob/user, distance, is_adjacent, infix, suffix)
. = ..()
diff --git a/code/game/objects/items/weapons/grenades/dynamite.dm b/code/game/objects/items/weapons/grenades/dynamite.dm
index eece9f56317..6f969ce19bd 100644
--- a/code/game/objects/items/weapons/grenades/dynamite.dm
+++ b/code/game/objects/items/weapons/grenades/dynamite.dm
@@ -8,26 +8,26 @@
/obj/item/grenade/dynamite/attack_self(mob/user)
return
-/obj/item/grenade/dynamite/attackby(obj/item/W, mob/user)
+/obj/item/grenade/dynamite/attackby(obj/item/attacking_item, mob/user)
..()
if(active)
return
- if(W.iswelder())
- var/obj/item/weldingtool/WT = W
+ if(attacking_item.iswelder())
+ var/obj/item/weldingtool/WT = attacking_item
if(WT.isOn())
activate(user)
- else if(W.isFlameSource())
+ else if(attacking_item.isFlameSource())
activate(user)
- else if(istype(W, /obj/item/flame/candle))
- var/obj/item/flame/candle/C = W
+ else if(istype(attacking_item, /obj/item/flame/candle))
+ var/obj/item/flame/candle/C = attacking_item
if(C.lit)
activate(user)
- else if(istype(W, /obj/item/grenade/dynamite))
- var/obj/item/grenade/dynamite/C = W
+ else if(istype(attacking_item, /obj/item/grenade/dynamite))
+ var/obj/item/grenade/dynamite/C = attacking_item
if(C.active)
activate(user)
diff --git a/code/game/objects/items/weapons/grenades/grenade.dm b/code/game/objects/items/weapons/grenades/grenade.dm
index b95370f3399..502853c8653 100644
--- a/code/game/objects/items/weapons/grenades/grenade.dm
+++ b/code/game/objects/items/weapons/grenades/grenade.dm
@@ -40,9 +40,9 @@
return
. += SPAN_NOTICE("\The [src] is set for instant detonation.")
-/obj/item/grenade/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/gun/launcher/grenade))
- var/obj/item/gun/launcher/grenade/G = W
+/obj/item/grenade/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/gun/launcher/grenade))
+ var/obj/item/gun/launcher/grenade/G = attacking_item
G.load(src, user)
else
..()
diff --git a/code/game/objects/items/weapons/handcuffs.dm b/code/game/objects/items/weapons/handcuffs.dm
index 3baf09f8d3f..306cb24516f 100644
--- a/code/game/objects/items/weapons/handcuffs.dm
+++ b/code/game/objects/items/weapons/handcuffs.dm
@@ -209,17 +209,17 @@
color = pick(COLOR_RED, COLOR_BLUE, COLOR_LIME, COLOR_ORANGE, COLOR_WHITE, COLOR_PINK, COLOR_YELLOW, COLOR_CYAN)
. = ..()
-/obj/item/handcuffs/cable/attackby(var/obj/item/I, mob/user as mob)
+/obj/item/handcuffs/cable/attackby(obj/item/attacking_item, mob/user)
..()
- if(istype(I, /obj/item/stack/rods))
- var/obj/item/stack/rods/R = I
+ if(istype(attacking_item, /obj/item/stack/rods))
+ var/obj/item/stack/rods/R = attacking_item
if (R.use(1))
var/obj/item/material/wirerod/W = new(get_turf(user), MATERIAL_STEEL, color)
user.put_in_hands(W)
to_chat(user, SPAN_NOTICE("You wrap \the [src] around the top of the rod."))
qdel(src)
update_icon(user)
- else if(can_be_cut && I.iswirecutter())
+ else if(can_be_cut && attacking_item.iswirecutter())
user.visible_message("[user] cuts the [src].", SPAN_NOTICE("You cut the [src]."))
playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1)
new/obj/item/stack/cable_coil(get_turf(src), 15, color)
diff --git a/code/game/objects/items/weapons/implants/implantcase.dm b/code/game/objects/items/weapons/implants/implantcase.dm
index 4c747c578fc..d133676779c 100644
--- a/code/game/objects/items/weapons/implants/implantcase.dm
+++ b/code/game/objects/items/weapons/implants/implantcase.dm
@@ -36,10 +36,10 @@
var/mutable_appearance/overlay_implant_icon = mutable_appearance(icon, overlay_icon_state)
add_overlay(overlay_implant_icon)
-/obj/item/implantcase/attackby(obj/item/I, mob/user)
- if (I.ispen())
+/obj/item/implantcase/attackby(obj/item/attacking_item, mob/user)
+ if (attacking_item.ispen())
var/t = tgui_input_text(user, "What would you like the label to be?", name, name, MAX_NAME_LEN)
- if (user.get_active_hand() != I)
+ if (user.get_active_hand() != attacking_item)
return
if((!in_range(src, usr) && loc != user))
return
@@ -49,10 +49,10 @@
else
src.name = "implant case"
desc = "An aluminium case, which can safely contain an implant."
- else if(istype(I, /obj/item/reagent_containers/syringe))
- imp.attackby(I, user)
- else if (istype(I, /obj/item/implanter))
- var/obj/item/implanter/M = I
+ else if(istype(attacking_item, /obj/item/reagent_containers/syringe))
+ imp.attackby(attacking_item, user)
+ else if (istype(attacking_item, /obj/item/implanter))
+ var/obj/item/implanter/M = attacking_item
if (M.imp && !imp && !M.imp.implanted)
M.imp.forceMove(src)
imp = M.imp
@@ -64,17 +64,17 @@
update_description()
update_icon()
M.update_icon()
- else if (istype(I, /obj/item/implant))
+ else if (istype(attacking_item, /obj/item/implant))
if(imp == null)
- to_chat(user, SPAN_NOTICE("You slide \the [I] into \the [src]."))
- user.drop_from_inventory(I,src)
- imp = I
+ to_chat(user, SPAN_NOTICE("You slide \the [attacking_item] into \the [src]."))
+ user.drop_from_inventory(attacking_item,src)
+ imp = attacking_item
else
to_chat(user, SPAN_WARNING("\The [src] already has an implant inside of it!"))
update_description()
update_icon()
- else if(istype(I, /obj/item/implantpad))
- var/obj/item/implantpad/pad = I
+ else if(istype(attacking_item, /obj/item/implantpad))
+ var/obj/item/implantpad/pad = attacking_item
if(!pad.case)
user.drop_from_inventory(src,pad)
pad.case = src
diff --git a/code/game/objects/items/weapons/implants/implanter.dm b/code/game/objects/items/weapons/implants/implanter.dm
index abcd38e60e6..f402be71a35 100644
--- a/code/game/objects/items/weapons/implants/implanter.dm
+++ b/code/game/objects/items/weapons/implants/implanter.dm
@@ -23,10 +23,10 @@
overlay_implant_icon.color = imp.implant_color
add_overlay(overlay_implant_icon)
-/obj/item/implanter/attackby(obj/item/I, mob/user)
- if(!imp && istype(I, /obj/item/implant) && user.unEquip(I,src))
- to_chat(usr, SPAN_NOTICE("You slide \the [I] into \the [src]."))
- imp = I
+/obj/item/implanter/attackby(obj/item/attacking_item, mob/user)
+ if(!imp && istype(attacking_item, /obj/item/implant) && user.unEquip(attacking_item, src))
+ to_chat(usr, SPAN_NOTICE("You slide \the [attacking_item] into \the [src]."))
+ imp = attacking_item
update_icon()
else
..()
@@ -111,8 +111,8 @@
update_icon()
-/obj/item/implanter/ipc_tag/attackby(obj/item/I, mob/user)
- if(I.isscrewdriver())
+/obj/item/implanter/ipc_tag/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.isscrewdriver())
if(!ipc_tag)
to_chat(user, SPAN_WARNING("\The [src] doesn't have an IPC tag loaded."))
return
@@ -122,12 +122,12 @@
ipc_tag = null
update_icon()
return
- if(istype(I, /obj/item/organ/internal/ipc_tag))
+ if(istype(attacking_item, /obj/item/organ/internal/ipc_tag))
if(ipc_tag)
to_chat(user, SPAN_WARNING("\The [src] already has an IPC tag loaded."))
return
- ipc_tag = I
- user.drop_from_inventory(I, src)
+ ipc_tag = attacking_item
+ user.drop_from_inventory(attacking_item, src)
update_icon()
return
..()
diff --git a/code/game/objects/items/weapons/implants/implantpad.dm b/code/game/objects/items/weapons/implants/implantpad.dm
index a2ffd62317d..61a19c49a12 100644
--- a/code/game/objects/items/weapons/implants/implantpad.dm
+++ b/code/game/objects/items/weapons/implants/implantpad.dm
@@ -33,11 +33,11 @@
return
return ..()
-/obj/item/implantpad/attackby(obj/item/C, mob/user)
- if(istype(C, /obj/item/implantcase))
+/obj/item/implantpad/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/implantcase))
if(!case)
- user.drop_from_inventory(C,src)
- case = C
+ user.drop_from_inventory(attacking_item, src)
+ case = attacking_item
update_icon()
else
to_chat(user, SPAN_WARNING("\The [src] already has an implant case attached to it!"))
diff --git a/code/game/objects/items/weapons/implants/implants/chem.dm b/code/game/objects/items/weapons/implants/implants/chem.dm
index 9c25e456d27..76764e4c9ff 100644
--- a/code/game/objects/items/weapons/implants/implants/chem.dm
+++ b/code/game/objects/items/weapons/implants/implants/chem.dm
@@ -50,14 +50,14 @@ the implant may become unstable and either pre-maturely inject the subject or si
if(!reagents.total_volume)
to_chat(R, SPAN_WARNING("You hear a faint *click*."))
-/obj/item/implant/chem/attackby(obj/item/I, mob/user)
- if(istype(I, /obj/item/reagent_containers/syringe))
+/obj/item/implant/chem/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/reagent_containers/syringe))
if(reagents.total_volume >= reagents.maximum_volume)
to_chat(user, SPAN_WARNING("\The [src] is full."))
else
if(do_after(user, 0.5 SECONDS, src))
- I.reagents.trans_to_obj(src, 5)
- to_chat(user, SPAN_NOTICE("You inject 5 units of the solution. The syringe now contains [I.reagents.total_volume] units."))
+ attacking_item.reagents.trans_to_obj(src, 5)
+ to_chat(user, SPAN_NOTICE("You inject 5 units of the solution. The syringe now contains [attacking_item.reagents.total_volume] units."))
else
..()
diff --git a/code/game/objects/items/weapons/implants/implants/circuit.dm b/code/game/objects/items/weapons/implants/implants/circuit.dm
index a76787b94b4..0887d7982cf 100644
--- a/code/game/objects/items/weapons/implants/implants/circuit.dm
+++ b/code/game/objects/items/weapons/implants/implants/circuit.dm
@@ -41,9 +41,9 @@
/obj/item/implant/integrated_circuit/examine(mob/user, distance, is_adjacent)
return IC.examine(user, distance, is_adjacent)
-/obj/item/implant/integrated_circuit/attackby(var/obj/item/O, var/mob/user)
- if(O.iscrowbar() || istype(O, /obj/item/device/integrated_electronics) || istype(O, /obj/item/integrated_circuit) || O.isscrewdriver() || istype(O, /obj/item/cell/device) )
- IC.attackby(O, user)
+/obj/item/implant/integrated_circuit/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.iscrowbar() || istype(attacking_item, /obj/item/device/integrated_electronics) || istype(attacking_item, /obj/item/integrated_circuit) || attacking_item.isscrewdriver() || istype(attacking_item, /obj/item/cell/device) )
+ IC.attackby(attacking_item, user)
else
..()
diff --git a/code/game/objects/items/weapons/implants/implants/compressed_matter.dm b/code/game/objects/items/weapons/implants/implants/compressed_matter.dm
index 674d4872853..bf37fe4d84d 100644
--- a/code/game/objects/items/weapons/implants/implants/compressed_matter.dm
+++ b/code/game/objects/items/weapons/implants/implants/compressed_matter.dm
@@ -10,16 +10,16 @@
hidden = TRUE
var/obj/item/scanned = null
-/obj/item/implant/compressed/attackby(var/obj/item/T, mob/user)
- if(T.isscrewdriver())
+/obj/item/implant/compressed/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.isscrewdriver())
if(!scanned)
to_chat(user, SPAN_NOTICE("There is nothing to remove from the implant."))
else
to_chat(user, SPAN_NOTICE("You remove \the [scanned] from the implant."))
user.put_in_hands(scanned)
scanned = null
- if(istype(T, /obj/item/implanter))
- var/obj/item/implanter/implanter = T
+ if(istype(attacking_item, /obj/item/implanter))
+ var/obj/item/implanter/implanter = attacking_item
if(implanter.imp)
to_chat(user, SPAN_NOTICE("\The [implanter] already has an implant loaded."))
return
diff --git a/code/game/objects/items/weapons/improvised_components.dm b/code/game/objects/items/weapons/improvised_components.dm
index 47bd6bcf231..365118615a8 100644
--- a/code/game/objects/items/weapons/improvised_components.dm
+++ b/code/game/objects/items/weapons/improvised_components.dm
@@ -6,8 +6,8 @@
force_divisor = 0.1
thrown_force_divisor = 0.1
-/obj/item/material/butterflyconstruction/attackby(obj/item/W as obj, mob/user as mob)
- if(W.isscrewdriver())
+/obj/item/material/butterflyconstruction/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.isscrewdriver())
to_chat(user, "You finish the concealed blade weapon.")
new /obj/item/material/knife/butterfly(user.loc, material.name)
qdel(src)
@@ -29,12 +29,12 @@
force_divisor = 0.1
thrown_force_divisor = 0.1
-/obj/item/material/butterflyhandle/attackby(obj/item/W as obj, mob/user as mob)
- if(istype(W,/obj/item/material/butterflyblade))
- var/obj/item/material/butterflyblade/B = W
+/obj/item/material/butterflyhandle/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/material/butterflyblade))
+ var/obj/item/material/butterflyblade/B = attacking_item
to_chat(user, "You attach the two concealed blade parts.")
var/finished = new /obj/item/material/butterflyconstruction(user.loc, B.material.name)
- qdel(W)
+ qdel(attacking_item)
qdel(src)
user.put_in_hands(finished)
return
@@ -64,24 +64,24 @@
I.color = cable_color
add_overlay(I)
-/obj/item/material/wirerod/attackby(var/obj/item/I, mob/user as mob)
+/obj/item/material/wirerod/attackby(obj/item/attacking_item, mob/user)
..()
var/obj/item/finished
- if(istype(I, /obj/item/material/shard) || istype(I, /obj/item/material/spearhead))
- var/obj/item/material/tmp_shard = I
+ if(istype(attacking_item, /obj/item/material/shard) || istype(attacking_item, /obj/item/material/spearhead))
+ var/obj/item/material/tmp_shard = attacking_item
finished = new /obj/item/material/twohanded/spear(get_turf(user), tmp_shard.material.name)
- to_chat(user, SPAN_NOTICE("You fasten \the [I] to the top of the rod with the cable."))
- else if(I.iswirecutter())
+ to_chat(user, SPAN_NOTICE("You fasten \the [attacking_item] to the top of the rod with the cable."))
+ else if(attacking_item.iswirecutter())
finished = new /obj/item/melee/baton/cattleprod(get_turf(user), forward_cable_color)
to_chat(user, SPAN_NOTICE("You fasten the wirecutters to the top of the rod with the cable, prongs outward."))
- else if(istype(I, /obj/item/material/wirerod))
+ else if(istype(attacking_item, /obj/item/material/wirerod))
finished = new /obj/item/trap/tripwire(get_turf(user), forward_cable_color)
to_chat(user, SPAN_NOTICE("You attach the two wired rods together, spooling the cable between them."))
if(finished)
user.drop_from_inventory(src,finished)
- user.drop_from_inventory(I,finished)
+ user.drop_from_inventory(attacking_item,finished)
//TODO: Possible better animation here.
- qdel(I)
+ qdel(attacking_item)
qdel(src)
user.put_in_hands(finished)
update_icon(user)
@@ -100,17 +100,17 @@
thrown_force_divisor = 0.1
default_material = "wood"
-/obj/item/material/shaft/attackby(var/obj/item/I, mob/user as mob)
+/obj/item/material/shaft/attackby(obj/item/attacking_item, mob/user)
..()
var/obj/item/finished
- if(istype(I, /obj/item/material/spearhead))
- var/obj/item/material/spearhead/tip = I
+ if(istype(attacking_item, /obj/item/material/spearhead))
+ var/obj/item/material/spearhead/tip = attacking_item
finished = new /obj/item/material/twohanded/pike(get_turf(user), tip.material.name)
- to_chat(user, SPAN_NOTICE("You attach \the [I] to the top of \the [src]."))
+ to_chat(user, SPAN_NOTICE("You attach \the [attacking_item] to the top of \the [src]."))
if(finished)
user.drop_from_inventory(src,finished)
- user.drop_from_inventory(I,finished)
- qdel(I)
+ user.drop_from_inventory(attacking_item,finished)
+ qdel(attacking_item)
qdel(src)
//TODO: Possible better animation here.
user.put_in_hands(finished)
@@ -139,17 +139,17 @@
thrown_force_divisor = 0.1
default_material = "wood"
-/obj/item/material/woodenshield/attackby(var/obj/item/I, mob/user as mob)
+/obj/item/material/woodenshield/attackby(obj/item/attacking_item, mob/user)
..()
var/obj/item/finished
- if(istype(I, /obj/item/material/shieldbits))
- var/obj/item/material/woodenshield/donut = I
+ if(istype(attacking_item, /obj/item/material/shieldbits))
+ var/obj/item/material/woodenshield/donut = attacking_item
finished = new /obj/item/shield/buckler(get_turf(user), donut.material.name)
- to_chat(user, SPAN_NOTICE("You attach \the [I] to \the [src]."))
+ to_chat(user, SPAN_NOTICE("You attach \the [attacking_item] to \the [src]."))
if(finished)
user.drop_from_inventory(src)
- user.drop_from_inventory(I)
- qdel(I)
+ user.drop_from_inventory(attacking_item)
+ qdel(attacking_item)
qdel(src)
user.put_in_hands(finished)
update_icon(user)
@@ -171,10 +171,10 @@
item_state = "woodcirclet"
w_class = ITEMSIZE_SMALL
-/obj/item/woodcirclet/attackby(obj/item/W as obj, mob/user as mob)
+/obj/item/woodcirclet/attackby(obj/item/attacking_item, mob/user)
var/obj/item/complete = null
- if(istype(W, /obj/item/seeds)) // Only allow seeds, since we rely on their structure
- var/obj/item/seeds/S = W
+ if(istype(attacking_item, /obj/item/seeds)) // Only allow seeds, since we rely on their structure
+ var/obj/item/seeds/S = attacking_item
if(istype(S.seed, /datum/seed/flower/poppy))
complete = new /obj/item/clothing/head/poppy_crown(get_turf(user))
else if(istype(S.seed, /datum/seed/flower/sunflower))
@@ -184,9 +184,9 @@
if(complete != null)
to_chat(user, SPAN_NOTICE("You attach the " + S.seed.seed_name + " to the circlet and create a beautiful flower crown."))
- user.drop_from_inventory(W)
+ user.drop_from_inventory(attacking_item)
user.drop_from_inventory(src)
- qdel(W)
+ qdel(attacking_item)
qdel(src)
user.put_in_hands(complete)
return
diff --git a/code/game/objects/items/weapons/ipc_scanner.dm b/code/game/objects/items/weapons/ipc_scanner.dm
index 83f713807cf..dfd0f93a983 100644
--- a/code/game/objects/items/weapons/ipc_scanner.dm
+++ b/code/game/objects/items/weapons/ipc_scanner.dm
@@ -49,11 +49,11 @@
to_chat(user, SPAN_NOTICE("Ownership Status: [tag.ownership_info]"))
to_chat(user, SPAN_NOTICE("Citizenship Info: [tag.citizenship_info]"))
-/obj/item/ipc_tag_scanner/attackby(obj/item/W, mob/user)
- if(W.isscrewdriver())
+/obj/item/ipc_tag_scanner/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.isscrewdriver())
wires_exposed = !wires_exposed
user.visible_message(SPAN_WARNING("\The [user] [wires_exposed ? "exposes the wiring" : "closes the panel"] on \the [src]."), SPAN_WARNING("You [wires_exposed ? "expose the wiring" : "close the panel"] on \the [src]."), 3)
- else if(W.iswirecutter() || W.ismultitool())
+ else if(attacking_item.iswirecutter() || attacking_item.ismultitool())
if(wires_exposed)
wires.interact(user)
else
diff --git a/code/game/objects/items/weapons/landmines.dm b/code/game/objects/items/weapons/landmines.dm
index 57d3169c976..9694241bc15 100644
--- a/code/game/objects/items/weapons/landmines.dm
+++ b/code/game/objects/items/weapons/landmines.dm
@@ -135,10 +135,10 @@
src.deactivated = TRUE
-/obj/item/landmine/attackby(obj/item/I, mob/user)
+/obj/item/landmine/attackby(obj/item/attacking_item, mob/user)
..()
- if(deactivated && istype(I, /obj/item/stack/cable_coil))
- var/obj/item/stack/cable_coil/C = I
+ if(deactivated && istype(attacking_item, /obj/item/stack/cable_coil))
+ var/obj/item/stack/cable_coil/C = attacking_item
if(C.use(1))
to_chat(user, SPAN_NOTICE("You start carefully start rewiring \the [src]."))
if(do_after(user, 10 SECONDS, do_flags = DO_REPAIR_CONSTRUCT))
@@ -148,11 +148,11 @@
else
to_chat(user, SPAN_WARNING("There's not enough cable to finish the task."))
return
- else if(deployed && istype(I, /obj/item/wirecutters))
- var/obj/item/wirecutters/W = I
+ else if(deployed && istype(attacking_item, /obj/item/wirecutters))
+ var/obj/item/wirecutters/W = attacking_item
user.visible_message(SPAN_WARNING("\The [user] starts snipping some wires in \the [src] with \the [W]..."), \
SPAN_NOTICE("You start snipping some wires in \the [src] with \the [W]..."))
- if(I.use_tool(src, user, 150, volume = 50))
+ if(attacking_item.use_tool(src, user, 150, volume = 50))
if(prob(W.bomb_defusal_chance))
to_chat(user, SPAN_NOTICE("You successfully defuse \the [src], though it's missing some essential wiring now."))
deactivate(user)
@@ -162,7 +162,7 @@
return
to_chat(user, FONT_LARGE(SPAN_DANGER("You slip, snipping the wrong wire!")))
trigger(user)
- else if(I.force > 10 && deployed)
+ else if(attacking_item.force > 10 && deployed)
trigger(user)
/obj/item/landmine/bullet_act()
@@ -328,7 +328,7 @@
src.engaged_by = null
. = ..()
-/obj/item/landmine/standstill/attackby(obj/item/I, mob/user)
+/obj/item/landmine/standstill/attackby(obj/item/attacking_item, mob/user)
if(engaged_by && (user == locate(engaged_by)))
to_chat(user, SPAN_ALERT("You are unable to reach the mine without moving your foot, and you feel like doing so would not end well..."))
else
@@ -369,15 +369,15 @@
/obj/item/landmine/claymore/update_icon()
icon_state = (src.deployed) ? "[initial(icon_state)]_active" : initial(icon_state)
-/obj/item/landmine/claymore/attackby(obj/item/I, mob/user)
- if(istype(I, /obj/item/device/assembly/signaler))
+/obj/item/landmine/claymore/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/device/assembly/signaler))
if(!isnull(signaler))
to_chat(user, SPAN_NOTICE("There is already a signaler inserted in \the [src]."))
return
- signaler = I
+ signaler = attacking_item
- user.drop_from_inventory(I, src)
+ user.drop_from_inventory(attacking_item, src)
trigger_wire.attach_assembly(WIRE_EXPLODE, signaler)
diff --git a/code/game/objects/items/weapons/material/ashtray.dm b/code/game/objects/items/weapons/material/ashtray.dm
index 860360e6af4..6c3b715879f 100644
--- a/code/game/objects/items/weapons/material/ashtray.dm
+++ b/code/game/objects/items/weapons/material/ashtray.dm
@@ -57,18 +57,18 @@
else
desc = "An ashtray made of [material.display_name]."
-/obj/item/material/ashtray/attackby(obj/item/W as obj, mob/user as mob)
+/obj/item/material/ashtray/attackby(obj/item/attacking_item, mob/user)
if (health <= 0)
return
- if (istype(W,/obj/item/trash/cigbutt) || istype(W,/obj/item/clothing/mask/smokable/cigarette) || istype(W, /obj/item/flame/match))
+ if (istype(attacking_item, /obj/item/trash/cigbutt) || istype(attacking_item, /obj/item/clothing/mask/smokable/cigarette) || istype(attacking_item, /obj/item/flame/match))
if (contents.len >= max_butts)
to_chat(user, "\The [src] is full.")
return
- user.remove_from_mob(W)
- W.forceMove(src)
+ user.remove_from_mob(attacking_item)
+ attacking_item.forceMove(src)
- if (istype(W,/obj/item/clothing/mask/smokable/cigarette))
- var/obj/item/clothing/mask/smokable/cigarette/cig = W
+ if (istype(attacking_item,/obj/item/clothing/mask/smokable/cigarette))
+ var/obj/item/clothing/mask/smokable/cigarette/cig = attacking_item
if (cig.lit == TRUE)
user.visible_message("[user] crushes [cig] in [src], putting it out.", SPAN_NOTICE("You crush [cig] in [src], putting it out."))
playsound(src.loc, 'sound/items/cigs_lighters/cig_snuff.ogg', 50, 1)
@@ -76,7 +76,7 @@
var/obj/item/butt = new cig.type_butt(src)
cig.transfer_fingerprints_to(butt)
qdel(cig)
- W = butt
+ attacking_item = butt
//spawn(1)
// TemperatureAct(150)
else if (cig.lit == FALSE)
@@ -85,15 +85,15 @@
SPAN_NOTICE("You place [cig] in [src] without even smoking it. Why would you do that?")
)
else
- user.visible_message("[user] places [W] in [src].", SPAN_NOTICE("You place [W] in [src]."))
+ user.visible_message("[user] places [attacking_item] in [src].", SPAN_NOTICE("You place [attacking_item] in [src]."))
user.update_inv_l_hand()
user.update_inv_r_hand()
add_fingerprint(user)
update_icon()
else
- health = max(0,health - W.force)
- user.visible_message(user, SPAN_DANGER("[user] hits [src] with [W]!"), SPAN_DANGER("You hit [src] with [W]."))
+ health = max(0,health - attacking_item.force)
+ user.visible_message(user, SPAN_DANGER("[user] hits [src] with [attacking_item]!"), SPAN_DANGER("You hit [src] with [attacking_item]."))
playsound(get_turf(src), material.hitsound, 25)
if (health < 1)
shatter()
diff --git a/code/game/objects/items/weapons/material/material_armor.dm b/code/game/objects/items/weapons/material/material_armor.dm
index 7deebc39038..59787395811 100644
--- a/code/game/objects/items/weapons/material/material_armor.dm
+++ b/code/game/objects/items/weapons/material/material_armor.dm
@@ -52,9 +52,9 @@ Protectiveness | Armor %
thrown_force_divisor = 0.2
var/wired = FALSE
-/obj/item/material/armor_plating/attackby(var/obj/O, mob/user)
- if(istype(O, /obj/item/stack/cable_coil))
- var/obj/item/stack/cable_coil/S = O
+/obj/item/material/armor_plating/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/stack/cable_coil))
+ var/obj/item/stack/cable_coil/S = attacking_item
if(wired)
to_chat(user, "This already has enough wires on it.")
return
@@ -66,8 +66,8 @@ Protectiveness | Armor %
else
to_chat(user, "You need more wire for that.")
return
- if(istype(O, /obj/item/material/armor_plating))
- var/obj/item/material/armor_plating/second_plate = O
+ if(istype(attacking_item, /obj/item/material/armor_plating))
+ var/obj/item/material/armor_plating/second_plate = attacking_item
if(!wired && !second_plate.wired)
to_chat(user, "You need something to hold the two pieces of plating together.")
return
@@ -111,9 +111,9 @@ Protectiveness | Armor %
item_state = "woodbucket"
contained_sprite = 1
-/obj/item/clothing/head/helmet/bucket/attackby(var/obj/O, mob/user)
- if(istype(O, /obj/item/stack/material))
- var/obj/item/stack/material/S = O
+/obj/item/clothing/head/helmet/bucket/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/stack/material))
+ var/obj/item/stack/material/S = attacking_item
if(S.use(2))
to_chat(user, "You apply some [S.material.use_name] to \the [src]. ")
var/obj/item/clothing/head/helmet/material/makeshift/helmet = new(null, S.material.name)
@@ -151,9 +151,9 @@ Protectiveness | Armor %
icon_state = "material_kelly"
item_state = "material_kelly"
-/obj/item/clothing/suit/armor/material/makeshift/attackby(var/obj/O, mob/user)
- if(istype(O, /obj/item/clothing/suit/storage/toggle/trench))
- var/obj/item/clothing/suit/storage/toggle/trench/kelly = O
+/obj/item/clothing/suit/armor/material/makeshift/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/clothing/suit/storage/toggle/trench))
+ var/obj/item/clothing/suit/storage/toggle/trench/kelly = attacking_item
user.drop_from_inventory(src)
user.drop_from_inventory(kelly)
var/obj/item/clothing/suit/armor/material/makeshift/trenchcoat/new_armor = new(null, src.material.name)
diff --git a/code/game/objects/items/weapons/material/shards.dm b/code/game/objects/items/weapons/material/shards.dm
index 705948dc580..0f5c7999057 100644
--- a/code/game/objects/items/weapons/material/shards.dm
+++ b/code/game/objects/items/weapons/material/shards.dm
@@ -54,9 +54,9 @@
color = "#ffffff"
alpha = 255
-/obj/item/material/shard/attackby(obj/item/W as obj, mob/user as mob)
- if(W.iswelder() && material.shard_can_repair)
- var/obj/item/weldingtool/WT = W
+/obj/item/material/shard/attackby(obj/item/attacking_item, mob/user as mob)
+ if(attacking_item.iswelder() && material.shard_can_repair)
+ var/obj/item/weldingtool/WT = attacking_item
if(WT.use(0, user))
material.place_sheet(user.loc)
qdel(src)
diff --git a/code/game/objects/items/weapons/material/swords.dm b/code/game/objects/items/weapons/material/swords.dm
index 2c3631a4ef3..6a2511df571 100644
--- a/code/game/objects/items/weapons/material/swords.dm
+++ b/code/game/objects/items/weapons/material/swords.dm
@@ -189,9 +189,9 @@
force_divisor = 0.05
thrown_force_divisor = 0.2
-/obj/item/material/sword_hilt/attackby(var/obj/O, mob/user)
- if(istype(O, /obj/item/material/sword_blade))
- var/obj/item/material/sword_blade/blade = O
+/obj/item/material/sword_hilt/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/material/sword_blade))
+ var/obj/item/material/sword_blade/blade = attacking_item
var/obj/item/material/sword/improvised_sword/new_sword = new(src.loc, blade.material.name)
new_sword.hilt = src
user.drop_from_inventory(src,new_sword)
@@ -212,9 +212,9 @@
force_divisor = 0.20
thrown_force_divisor = 0.3
-/obj/item/material/sword_blade/attackby(var/obj/O, mob/user)
- if(istype(O, /obj/item/material/sword_hilt))
- var/obj/item/material/sword_hilt/hilt = O
+/obj/item/material/sword_blade/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/material/sword_hilt))
+ var/obj/item/material/sword_hilt/hilt = attacking_item
var/obj/item/material/sword/improvised_sword/new_sword = new(src.loc, src.material.name)
new_sword.hilt = hilt.material
new_sword.assignDescription()
diff --git a/code/game/objects/items/weapons/material/twohanded.dm b/code/game/objects/items/weapons/material/twohanded.dm
index 604cc0be846..75c62978cdb 100644
--- a/code/game/objects/items/weapons/material/twohanded.dm
+++ b/code/game/objects/items/weapons/material/twohanded.dm
@@ -268,26 +268,26 @@
if(explosive)
. += "It has \the [explosive] strapped to it."
-/obj/item/material/twohanded/spear/attackby(var/obj/item/I, var/mob/living/user)
- if(istype(I, /obj/item/organ/external/head))
+/obj/item/material/twohanded/spear/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/organ/external/head))
to_chat(user, "You stick the head onto the spear and stand it upright on the ground.")
var/obj/structure/headspear/HS = new /obj/structure/headspear(user.loc)
var/matrix/M = matrix()
- I.transform = M
- usr.drop_from_inventory(I,HS)
- var/mutable_appearance/MA = new(I)
+ attacking_item.transform = M
+ usr.drop_from_inventory(attacking_item, HS)
+ var/mutable_appearance/MA = new(attacking_item)
MA.layer = FLOAT_LAYER
HS.add_overlay(MA)
- HS.name = "[I.name] on a spear"
+ HS.name = "[attacking_item.name] on a spear"
HS.material = material.name
qdel(src)
return
- if(istype(I, /obj/item/grenade))
- to_chat(user, "You strap \the [I] to \the [src].")
- user.unEquip(I)
- I.forceMove(src)
- explosive = I
+ if(istype(attacking_item, /obj/item/grenade))
+ to_chat(user, "You strap \the [attacking_item] to \the [src].")
+ user.unEquip(attacking_item)
+ attacking_item.forceMove(src)
+ explosive = attacking_item
update_icon()
return
return ..()
diff --git a/code/game/objects/items/weapons/mop.dm b/code/game/objects/items/weapons/mop.dm
index 32e8f9ec175..4b98db28d02 100644
--- a/code/game/objects/items/weapons/mop.dm
+++ b/code/game/objects/items/weapons/mop.dm
@@ -61,8 +61,8 @@
if(clean_msg)
to_chat(user, SPAN_NOTICE("You have finished mopping!"))
-/obj/effect/attackby(obj/item/I, mob/user)
- if(istype(I, /obj/item/mop) || istype(I, /obj/item/soap))
+/obj/effect/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/mop) || istype(attacking_item, /obj/item/soap))
return FALSE
return ..()
diff --git a/code/game/objects/items/weapons/policetape.dm b/code/game/objects/items/weapons/policetape.dm
index 67930e06cb9..c36ffc2919d 100644
--- a/code/game/objects/items/weapons/policetape.dm
+++ b/code/game/objects/items/weapons/policetape.dm
@@ -95,8 +95,8 @@ var/list/tape_roll_applications = list()
if(shield_marker)
. += SPAN_NOTICE("This strip of tape has been modified to serve as a marker for emergency shield generators to lock onto.")
-/obj/item/tape/engineering/attackby(obj/item/W, mob/user)
- if(W.ismultitool())
+/obj/item/tape/engineering/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.ismultitool())
shield_marker = !shield_marker
to_chat(user, SPAN_NOTICE("You [shield_marker ? "" : "un"]designate \the [src] as a target for an emergency shield generator."))
if(shield_marker)
@@ -222,8 +222,8 @@ var/list/tape_roll_applications = list()
crumple(mover)
return ..()
-/obj/item/tape/attackby(obj/item/W, mob/user)
- return breaktape(W, user)
+/obj/item/tape/attackby(obj/item/attacking_item, mob/user)
+ return breaktape(attacking_item, user)
/obj/item/tape/attack_hand(mob/user)
if(user.a_intent == I_HELP)
diff --git a/code/game/objects/items/weapons/shields.dm b/code/game/objects/items/weapons/shields.dm
index e921e054deb..12a65575875 100644
--- a/code/game/objects/items/weapons/shields.dm
+++ b/code/game/objects/items/weapons/shields.dm
@@ -84,10 +84,10 @@
return 0
return base_block_chance
-/obj/item/shield/riot/attackby(obj/item/W as obj, mob/user as mob)
- if(istype(W, /obj/item/melee/baton))
+/obj/item/shield/riot/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/melee/baton))
if(cooldown < world.time - 25)
- user.visible_message("[user] bashes [src] with [W]!")
+ user.visible_message("[user] bashes [src] with [attacking_item]!")
playsound(user.loc, 'sound/effects/shieldbash.ogg', 50, 1)
cooldown = world.time
else
diff --git a/code/game/objects/items/weapons/soap.dm b/code/game/objects/items/weapons/soap.dm
index e308b069575..05322add121 100644
--- a/code/game/objects/items/weapons/soap.dm
+++ b/code/game/objects/items/weapons/soap.dm
@@ -31,11 +31,11 @@
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
reagents.add_reagent(/singleton/reagent/spacecleaner, capacity)
-/obj/item/soap/attackby(var/obj/item/I, var/mob/user)
- if(istype(I, /obj/item/key))
+/obj/item/soap/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/key))
if(!key_data)
- to_chat(user, SPAN_NOTICE("You imprint \the [I] into \the [src]."))
- var/obj/item/key/K = I
+ to_chat(user, SPAN_NOTICE("You imprint \the [attacking_item] into \the [src]."))
+ var/obj/item/key/K = attacking_item
key_data = K.key_data
update_icon()
return TRUE
diff --git a/code/game/objects/items/weapons/storage/backpack.dm b/code/game/objects/items/weapons/storage/backpack.dm
index cb2cbef1732..3d674b2c978 100644
--- a/code/game/objects/items/weapons/storage/backpack.dm
+++ b/code/game/objects/items/weapons/storage/backpack.dm
@@ -94,10 +94,10 @@
storage_cost = 29
empty_delay = 0.8 SECOND
-/obj/item/storage/backpack/holding/attackby(obj/item/W as obj, mob/user as mob)
- if(istype(W, /obj/item/storage/backpack/holding))
+/obj/item/storage/backpack/holding/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/storage/backpack/holding))
to_chat(user, "The Bluespace interfaces of the two devices conflict and malfunction.")
- qdel(W)
+ qdel(attacking_item)
return
..()
diff --git a/code/game/objects/items/weapons/storage/bags.dm b/code/game/objects/items/weapons/storage/bags.dm
index 95bc4b99681..c29f7e50176 100644
--- a/code/game/objects/items/weapons/storage/bags.dm
+++ b/code/game/objects/items/weapons/storage/bags.dm
@@ -55,10 +55,10 @@
icon_state = "trashbag2"
else icon_state = "trashbag3"
-/obj/item/storage/bag/trash/attackby(var/obj/item/I, var/mob/user)
- if (istype (I, /obj/item/device/lightreplacer))
+/obj/item/storage/bag/trash/attackby(obj/item/attacking_item, mob/user)
+ if (istype (attacking_item, /obj/item/device/lightreplacer))
var/count = 0
- var/obj/item/device/lightreplacer/R = I
+ var/obj/item/device/lightreplacer/R = attacking_item
var/bagfull = 0
if (R.store_broken)
for(var/obj/item/light/L in R.contents)
diff --git a/code/game/objects/items/weapons/storage/bible.dm b/code/game/objects/items/weapons/storage/bible.dm
index e3e7670cdd7..5a8cec08409 100644
--- a/code/game/objects/items/weapons/storage/bible.dm
+++ b/code/game/objects/items/weapons/storage/bible.dm
@@ -37,7 +37,7 @@
A.reagents.del_reagent(/singleton/reagent/water)
A.reagents.add_reagent(/singleton/reagent/water/holywater, water2holy)
-/obj/item/storage/bible/attackby(obj/item/W as obj, mob/user as mob)
+/obj/item/storage/bible/attackby(obj/item/attacking_item, mob/user)
if(src.use_sound)
playsound(src.loc, src.use_sound, 50, 1, -5)
return ..()
diff --git a/code/game/objects/items/weapons/storage/boxes.dm b/code/game/objects/items/weapons/storage/boxes.dm
index 5612a2979b5..c2c93594036 100644
--- a/code/game/objects/items/weapons/storage/boxes.dm
+++ b/code/game/objects/items/weapons/storage/boxes.dm
@@ -131,13 +131,13 @@
qdel(src)
user.put_in_hands(trash)
-/obj/item/storage/box/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/stack/packageWrap))
- var/total_storage_space = W.get_storage_cost()
+/obj/item/storage/box/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/stack/packageWrap))
+ var/total_storage_space = attacking_item.get_storage_cost()
for(var/obj/item/I in contents)
total_storage_space += I.get_storage_cost()
if(total_storage_space <= max_storage_space)
- var/question = alert(user, "Will you want to wrap \the [src] or store the item inside?", "Wrap or Store", "Wrap", "Store")
+ var/question = tgui_input_list(user, "Will you want to wrap \the [src] or store the item inside?", "Wrap or Store", list("Wrap", "Store"))
if(question == "Wrap")
return
else if(question == "Store")
@@ -1118,8 +1118,8 @@
else if(length(contents) < 8)
icon_state = "paperbag_[choice]-food"
-/obj/item/storage/box/papersack/attackby(obj/item/O, mob/user)
- if(O.ispen())
+/obj/item/storage/box/papersack/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.ispen())
if(!papersack_designs)
papersack_designs = sortList(list(
"None" = image(icon = src.icon, icon_state = "paperbag_None"),
@@ -1150,10 +1150,10 @@
update_icon()
return
- else if(O.isscrewdriver())
+ else if(attacking_item.isscrewdriver())
if(length(contents) == 0)
to_chat(user, SPAN_NOTICE("You begin poking holes in \the [src]."))
- if(O.use_tool(src, user, 30))
+ if(attacking_item.use_tool(src, user, 30))
if(choice == "SmileyFace")
var/obj/item/clothing/head/papersack/smiley/S = new()
user.put_in_hands(S)
diff --git a/code/game/objects/items/weapons/storage/fancy.dm b/code/game/objects/items/weapons/storage/fancy.dm
index d23ad124cd3..bb269e0866d 100644
--- a/code/game/objects/items/weapons/storage/fancy.dm
+++ b/code/game/objects/items/weapons/storage/fancy.dm
@@ -226,8 +226,9 @@
for(var/obj/item/pen/crayon/crayon in contents)
add_overlay("[crayon.colourName]")
-/obj/item/storage/box/fancy/crayons/attackby(obj/item/W as obj, mob/user as mob)
- if(istype(W,/obj/item/pen/crayon))
+/obj/item/storage/box/fancy/crayons/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/pen/crayon))
+ var/obj/item/pen/crayon/W = attacking_item
switch(W:colourName)
if("mime")
to_chat(usr, "This crayon is too sad to be contained in this box.")
@@ -256,7 +257,8 @@
starts_with = list(/obj/item/flame/match = 10)
icon_overlays = FALSE
-/obj/item/storage/box/fancy/matches/attackby(obj/item/flame/match/W, mob/user)
+/obj/item/storage/box/fancy/matches/attackby(obj/item/attacking_item, mob/user)
+ var/obj/item/flame/match/W = attacking_item
if(istype(W) && !W.lit)
if(prob(25))
playsound(src.loc, 'sound/items/cigs_lighters/matchstick_lit.ogg', 25, 0, -1)
@@ -473,7 +475,7 @@
else
add_overlay("ledb")
-/obj/item/storage/lockbox/vials/attackby(obj/item/W as obj, mob/user as mob)
+/obj/item/storage/lockbox/vials/attackby(attacking_item, mob/user)
..()
update_icon()
@@ -611,18 +613,18 @@
update_icon()
-/obj/item/pizzabox/attackby( obj/item/I as obj, mob/user as mob )
- if( istype(I, /obj/item/pizzabox/) )
- var/obj/item/pizzabox/box = I
+/obj/item/pizzabox/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/pizzabox/) )
+ var/obj/item/pizzabox/box = attacking_item
- if( !box.open && !src.open )
+ if(!box.open && !src.open )
// Make a list of all boxes to be added
var/list/boxestoadd = list()
boxestoadd += box
for(var/obj/item/pizzabox/i in box.boxes)
boxestoadd += i
- if( (boxes.len+1) + boxestoadd.len <= 5 )
+ if((boxes.len+1) + boxestoadd.len <= 5)
user.drop_from_inventory(box,src)
box.boxes = list() // Clear the box boxes so we don't have boxes inside boxes. - Xzibit
src.boxes.Add( boxestoadd )
@@ -638,28 +640,28 @@
return
- if( istype(I, /obj/item/reagent_containers/food/snacks/sliceable/pizza/) ) // Long ass fucking object name
+ if(istype(attacking_item, /obj/item/reagent_containers/food/snacks/sliceable/pizza/)) // Long ass fucking object name
- if( src.open )
- user.drop_from_inventory(I,src)
- src.pizza = I
+ if(src.open)
+ user.drop_from_inventory(attacking_item, src)
+ src.pizza = attacking_item
update_icon()
- to_chat(user, SPAN_WARNING("You put \the [I] in \the [src]!"))
+ to_chat(user, SPAN_WARNING("You put \the [attacking_item] in \the [src]!"))
else
- to_chat(user, SPAN_WARNING("You try to push \the [I] through the lid but it doesn't work!"))
+ to_chat(user, SPAN_WARNING("You try to push \the [attacking_item] through the lid but it doesn't work!"))
return
- if( I.ispen() )
+ if(attacking_item.ispen())
- if( src.open )
+ if(src.open)
return
- var/t = sanitize(input("Enter what you want to add to the tag:", "Write", null, null) as text, 30)
+ var/t = sanitize( tgui_input_text(user, "Enter what you want to add to the tag:", "Write", max_length = 30), 30 )
var/obj/item/pizzabox/boxtotagto = src
- if( boxes.len > 0 )
+ if(boxes.len > 0)
boxtotagto = boxes[boxes.len]
boxtotagto.boxtag = copytext("[boxtotagto.boxtag][t]", 1, 30)
diff --git a/code/game/objects/items/weapons/storage/lockbox.dm b/code/game/objects/items/weapons/storage/lockbox.dm
index 6fee9176f1c..dbf943a11e6 100644
--- a/code/game/objects/items/weapons/storage/lockbox.dm
+++ b/code/game/objects/items/weapons/storage/lockbox.dm
@@ -18,8 +18,8 @@
var/icon_broken = "lockbox+b"
-/obj/item/storage/lockbox/attackby(obj/item/W as obj, mob/user as mob)
- if(istype(W, /obj/item/card/id))
+/obj/item/storage/lockbox/attackby(attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/card/id))
if(src.broken)
to_chat(user, "It appears to be broken.")
return
@@ -37,9 +37,9 @@
return
else
to_chat(user, "Access Denied")
- else if(istype(W, /obj/item/melee/energy/blade))
- if(emag_act(INFINITY, user, W, "The locker has been sliced open by [user] with an energy blade!", "You hear metal being sliced and sparks flying."))
- var/obj/item/melee/energy/blade/blade = W
+ else if(istype(attacking_item, /obj/item/melee/energy/blade))
+ if(emag_act(INFINITY, user, attacking_item, "The locker has been sliced open by [user] with an energy blade!", "You hear metal being sliced and sparks flying."))
+ var/obj/item/melee/energy/blade/blade = attacking_item
blade.spark_system.queue()
playsound(src.loc, 'sound/weapons/blade.ogg', 50, 1)
playsound(src.loc, /singleton/sound_category/spark_sound, 50, 1)
diff --git a/code/game/objects/items/weapons/storage/secure.dm b/code/game/objects/items/weapons/storage/secure.dm
index a1156690e59..452001862e5 100644
--- a/code/game/objects/items/weapons/storage/secure.dm
+++ b/code/game/objects/items/weapons/storage/secure.dm
@@ -33,29 +33,28 @@
if(distance <= 1)
. += "The service panel is [src.open ? "open" : "closed"]."
-/obj/item/storage/secure/attackby(obj/item/W as obj, mob/user as mob)
+/obj/item/storage/secure/attackby(obj/item/attacking_item, mob/user)
if(locked)
- if (istype(W, /obj/item/melee/energy/blade) && emag_act(INFINITY, user, "You slice through the lock of \the [src]"))
- var/obj/item/melee/energy/blade/blade = W
+ if (istype(attacking_item, /obj/item/melee/energy/blade) && emag_act(INFINITY, user, "You slice through the lock of \the [src]"))
+ var/obj/item/melee/energy/blade/blade = attacking_item
blade.spark_system.queue()
playsound(src.loc, 'sound/weapons/blade.ogg', 50, 1)
playsound(src.loc, /singleton/sound_category/spark_sound, 50, 1)
return
- if (W.isscrewdriver())
- if(W.use_tool(src, user, 20, volume = 50))
+ if (attacking_item.isscrewdriver())
+ if(attacking_item.use_tool(src, user, 20, volume = 50))
src.open =! src.open
to_chat(user, SPAN_NOTICE("You [src.open ? "open" : "close"] the service panel."))
return
- if ((W.ismultitool()) && (src.open == 1)&& (!src.l_hacking))
+ if ((attacking_item.ismultitool()) && (src.open == 1)&& (!src.l_hacking))
to_chat(user, SPAN_NOTICE("Now attempting to reset internal memory, please hold."))
src.l_hacking = 1
if (do_after(usr, 100))
if (prob(40))
src.l_setshort = 1
src.l_set = 0
- to_chat(user, SPAN_NOTICE("Internal memory reset. Please give it a few seconds to reinitialize."))
- sleep(80)
+ to_chat(user, SPAN_NOTICE("Internal memory reset."))
src.l_setshort = 0
src.l_hacking = 0
else
diff --git a/code/game/objects/items/weapons/storage/storage.dm b/code/game/objects/items/weapons/storage/storage.dm
index 19a1d7a1d3c..54ba9614a24 100644
--- a/code/game/objects/items/weapons/storage/storage.dm
+++ b/code/game/objects/items/weapons/storage/storage.dm
@@ -94,6 +94,106 @@
QDEL_NULL(closer)
return ..()
+/obj/item/storage/resolve_attackby(atom/A, mob/user, click_parameters)
+ . = ..()
+
+ //Can't be used to pick up things by clicking them
+ if(!use_to_pickup)
+ return
+
+ //Pick up everything in a tile
+ if(collection_mode)
+ var/turf/location_to_pickup = null
+ if(isturf(A))
+ location_to_pickup = A
+ else
+ var/turf/possible_turf_location = get_turf(A)
+ if(isturf(possible_turf_location))
+ location_to_pickup = possible_turf_location
+
+ //If we found a turf, pick up things from there
+ if(location_to_pickup)
+ pickup_items_from_loc_and_feedback(user, location_to_pickup)
+
+ //Pick up one thing at a time
+ else
+ if(can_be_inserted(A))
+ handle_item_insertion(A, FALSE, user)
+
+/**
+ * Pick up item from a location, respecting the tick time, and feedback the user
+ *
+ * This process can sleep
+ *
+ * * user - The user trying to pick up things
+ * * location - A `/turf` to pick up things from
+ */
+/obj/item/storage/proc/pickup_items_from_loc_and_feedback(mob/user, turf/location)
+ set waitfor = FALSE
+
+ //pickup_result[1] is if there's any success, pickup_result[2] is if there's any failure
+ //both are booleans
+ var/list/pickup_result = pickup_items_from_loc(user, location)
+
+ //Choose the feedback message depending on what happened and send it to the user
+ var/pickup_feedback_message
+ if(pickup_result[1] && !pickup_result[2])
+ pickup_feedback_message = SPAN_NOTICE("You put everything in \the [src].")
+
+ else if(pickup_result[1] && pickup_result[2])
+ pickup_feedback_message = SPAN_NOTICE("You put some things in \the [src].")
+
+ else if(!pickup_result[1] && pickup_result[2])
+ pickup_feedback_message = SPAN_NOTICE("You fail to pick anything up with \the [src].")
+
+ //Check if we got a feedback message and, if so, send it to the user
+ if(pickup_feedback_message)
+ to_chat(user, pickup_feedback_message)
+
+/**
+ * Pick up item from a location, respecting the tick time
+ *
+ * Returns a `/list` in the format of `(SUCCESS, FAILURE)` (both booleans),
+ * the first indicates if there was any successful pickup, the later if there was any failed pickup
+ *
+ * * user - The user trying to pick up things
+ * * location - A `/turf` to pick up things from
+ */
+/obj/item/storage/proc/pickup_items_from_loc(mob/user, turf/location)
+
+ //In the format of list(SUCCESS, FAILURE)
+ var/list/return_status = list(FALSE, FALSE)
+ RETURN_TYPE(return_status)
+
+ var/list/rejections = list()
+
+ //So we know where the user is when the pickup starts
+ var/original_location = user ? get_turf(user) : null
+
+ for(var/obj/item/item in location)
+ if(rejections[item.type]) // To limit bag spamming: any given type only complains once
+ continue
+
+ if (user && get_turf(user) != original_location)
+ break
+
+ if(!can_be_inserted(item)) // Note can_be_inserted still makes noise when the answer is no
+ rejections[item.type] = TRUE // therefore full bags are still a little spammy
+ return_status[2] = TRUE
+ CHECK_TICK
+ continue
+
+ return_status[1] = TRUE
+ handle_item_insertion_deferred(item, user)
+ CHECK_TICK // Because people insist on picking up huge-ass piles of stuff.
+
+ //Refresh the icon, add fingerprints and whatnot if we have picked up anything
+ if(return_status[1])
+ handle_storage_deferred(user)
+
+ return return_status
+
+
/obj/item/storage/get_examine_text(mob/user, distance, is_adjacent, infix, suffix)
. = ..()
if(isobserver(user))
@@ -385,64 +485,81 @@
src.slot_orient_objs(row_num, col_count, numbered_contents)
return
-//This proc return 1 if the item can be picked up and 0 if it can't.
-//Set the stop_messages to stop it from printing messages
-/obj/item/storage/proc/can_be_inserted(obj/item/W as obj, stop_messages = 0)
- if(!istype(W)) return //Not an item
+/**
+ * Checks if an item can be inserted in the storage
+ *
+ * Returns `TRUE` if it can be inserted, `FALSE` otherwise
+ *
+ * * item_to_check - The `/obj` to check if it can be inserted
+ * * stop_messages - Boolean, if `TRUE`, prevents this proc from giving feedback messages
+ */
+/obj/item/storage/proc/can_be_inserted(obj/item/item_to_check, stop_messages = FALSE)
+ SHOULD_NOT_SLEEP(TRUE)
- if(usr && usr.isEquipped(W) && !usr.canUnEquip(W))
- return 0
+ if(!istype(item_to_check))
+ return FALSE
- if(!W.dropsafety())
- return 0
+ if(usr && usr.isEquipped(item_to_check) && !usr.canUnEquip(item_to_check))
+ return FALSE
- if(src.loc == W)
- return 0 //Means the item is already in the storage item
+ if(!item_to_check.dropsafety())
+ return FALSE
+
+ //Check if the item is in the storage already
+ if(src.loc == item_to_check)
+ return FALSE
+
+ //Check if the storage is full, or in blacklist
if(storage_slots != null && contents.len >= storage_slots)
- if(!stop_messages || is_type_in_list(W, pickup_blacklist)) // the is_type_in_list is a bit risky, but you tend to not want to pick up things in your blacklist anyway
- to_chat(usr, "[src] is full, make some space.")
- return 0 //Storage item is full
+ if(!stop_messages || is_type_in_list(item_to_check, pickup_blacklist)) // the is_type_in_list is a bit risky, but you tend to not want to pick up things in your blacklist anyway
+ to_chat(usr, SPAN_NOTICE("\The [src] is full, make some space."))
+ return FALSE
- if(W.anchored)
- return 0
+ //Check if the item is anchored
+ if(item_to_check.anchored)
+ return FALSE
+ //Whitelist check for item holding
if(LAZYLEN(can_hold))
- var/can_hold_item = can_hold_strict ? (W.type in can_hold) : is_type_in_list(W, can_hold)
+ var/can_hold_item = can_hold_strict ? (item_to_check.type in can_hold) : is_type_in_list(item_to_check, can_hold)
if(!can_hold_item)
- if(!stop_messages && ! istype(W, /obj/item/device/hand_labeler))
- to_chat(usr, "[src] cannot hold \the [W].")
- return 0
- var/max_instances = can_hold[W.type]
- if(max_instances && instances_of_type_in_list(W, contents, TRUE) >= max_instances)
- if(!stop_messages && !istype(W, /obj/item/device/hand_labeler))
- to_chat(usr, "[src] has no more space specifically for \the [W].")
- return 0
+ if(!stop_messages && ! istype(item_to_check, /obj/item/device/hand_labeler))
+ to_chat(usr, SPAN_NOTICE("\The [src] cannot hold \the [item_to_check]."))
+ return FALSE
+ var/max_instances = can_hold[item_to_check.type]
+ if(max_instances && instances_of_type_in_list(item_to_check, contents, TRUE) >= max_instances)
+ if(!stop_messages && !istype(item_to_check, /obj/item/device/hand_labeler))
+ to_chat(usr, SPAN_NOTICE("\The [src] has no more space specifically for \the [item_to_check]."))
+ return FALSE
- if(LAZYLEN(cant_hold) && is_type_in_list(W, cant_hold))
+ //Blacklist check for item holding
+ if(LAZYLEN(cant_hold) && is_type_in_list(item_to_check, cant_hold))
if(!stop_messages)
- to_chat(usr, "[src] cannot hold [W].")
- return 0
+ to_chat(usr, SPAN_NOTICE("\The [src] cannot hold [item_to_check]."))
+ return FALSE
- if (max_w_class != null && W.w_class > max_w_class)
+ //Size (lenght) check for item holding
+ if (max_w_class != null && item_to_check.w_class > max_w_class)
if(!stop_messages)
- to_chat(usr, "[W] is too long for this [src].")
- return 0
+ to_chat(usr, SPAN_NOTICE("\The [item_to_check] is too long for this [src]."))
+ return FALSE
- var/total_storage_space = W.get_storage_cost()
+ var/total_storage_space = item_to_check.get_storage_cost()
for(var/obj/item/I in contents)
total_storage_space += I.get_storage_cost() //Adds up the combined w_classes which will be in the storage item if the item is added to it.
if(total_storage_space > max_storage_space)
if(!stop_messages)
- to_chat(usr, "[src] is too full, make some space.")
- return 0
+ to_chat(usr, SPAN_NOTICE("\The [src] is too full, make some space."))
+ return FALSE
- if(W.w_class >= src.w_class && (istype(W, /obj/item/storage)))
+ //To prevent the stacking of same sized storage items
+ if(item_to_check.w_class >= src.w_class && (istype(item_to_check, /obj/item/storage)))
if(!stop_messages)
- to_chat(usr, "[src] cannot hold [W] as it's a storage item of the same size.")
- return 0 //To prevent the stacking of same sized storage items.
+ to_chat(usr, SPAN_NOTICE("\The [src] cannot hold [item_to_check] as it's a storage item of the same size."))
+ return FALSE
- return 1
+ return TRUE
//This proc handles items being inserted. It does not perform any checks of whether an item can or can't be inserted. That's done by can_be_inserted()
//The stop_warning parameter will stop the insertion message from being displayed. It is intended for cases where you are inserting multiple items at once,
@@ -476,8 +593,13 @@
queue_icon_update()
return 1
-// This is for inserting more than one thing at a time, you should call handle_storage_deferred after all the items have been inserted.
+/**
+ * This is for inserting more than one thing at a time,
+ * you should call `handle_storage_deferred` after all the items have been inserted
+ */
/obj/item/storage/proc/handle_item_insertion_deferred(obj/item/W, mob/user)
+ SHOULD_NOT_SLEEP(TRUE)
+
if (!istype(W))
return FALSE
@@ -584,14 +706,14 @@
return handle_item_insertion(W, prevent_messages)
-/obj/item/storage/attackby(obj/item/W as obj, mob/user as mob)
+/obj/item/storage/attackby(obj/item/attacking_item, mob/user)
..()
- if(!W.dropsafety())
+ if(!attacking_item.dropsafety())
return.
- if(istype(W, /obj/item/device/lightreplacer))
- var/obj/item/device/lightreplacer/LP = W
+ if(istype(attacking_item, /obj/item/device/lightreplacer))
+ var/obj/item/device/lightreplacer/LP = attacking_item
var/amt_inserted = 0
var/turf/T = get_turf(user)
for(var/obj/item/light/L in src.contents)
@@ -605,23 +727,23 @@
to_chat(user, "You inserted [amt_inserted] light\s into \the [LP.name]. You have [LP.uses] light\s remaining.")
return
- if(!can_be_inserted(W))
+ if(!can_be_inserted(attacking_item))
return
- if(istype(W, /obj/item/tray))
- var/obj/item/tray/T = W
+ if(istype(attacking_item, /obj/item/tray))
+ var/obj/item/tray/T = attacking_item
if(T.current_weight > 0)
T.spill(user)
to_chat(user, "Trying to place a loaded tray into [src] was a bad idea.")
return
- if(istype(W, /obj/item/device/hand_labeler))
- var/obj/item/device/hand_labeler/HL = W
+ if(istype(attacking_item, /obj/item/device/hand_labeler))
+ var/obj/item/device/hand_labeler/HL = attacking_item
if(HL.mode == 1)
return
- W.add_fingerprint(user)
- return handle_item_insertion(W, null, user)
+ attacking_item.add_fingerprint(user)
+ return handle_item_insertion(attacking_item, null, user)
/obj/item/storage/dropped(mob/user as mob)
return ..()
diff --git a/code/game/objects/items/weapons/stunbaton.dm b/code/game/objects/items/weapons/stunbaton.dm
index c19b2fc7dda..8b7c370deaf 100644
--- a/code/game/objects/items/weapons/stunbaton.dm
+++ b/code/game/objects/items/weapons/stunbaton.dm
@@ -68,17 +68,17 @@
else
. += "The baton does not have a power source installed."
-/obj/item/melee/baton/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/cell))
+/obj/item/melee/baton/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/cell))
if(!bcell)
- user.drop_from_inventory(W,src)
- bcell = W
+ user.drop_from_inventory(attacking_item, src)
+ bcell = attacking_item
to_chat(user, "You install a cell in [src].")
update_icon()
else
to_chat(user, "[src] already has a cell.")
- else if(W.isscrewdriver())
+ else if(attacking_item.isscrewdriver())
if(bcell)
bcell.update_icon()
bcell.forceMove(get_turf(src))
@@ -215,7 +215,7 @@
bcell = R.cell
return ..()
-/obj/item/melee/baton/robot/attackby(obj/item/W, mob/user)
+/obj/item/melee/baton/robot/attackby(obj/item/attacking_item, mob/user)
return
/obj/item/melee/baton/robot/arm
diff --git a/code/game/objects/items/weapons/surgery_tools.dm b/code/game/objects/items/weapons/surgery_tools.dm
index 2dd358c129b..7e6e47a5e11 100644
--- a/code/game/objects/items/weapons/surgery_tools.dm
+++ b/code/game/objects/items/weapons/surgery_tools.dm
@@ -269,7 +269,7 @@
. = ..()
update_icon()
-/obj/item/storage/box/fancy/tray/attackby(obj/item/W as obj, mob/user as mob)
+/obj/item/storage/box/fancy/tray/attackby(obj/item/attacking_item, mob/user)
..()
update_icon()
diff --git a/code/game/objects/items/weapons/tanks/tank_types.dm b/code/game/objects/items/weapons/tanks/tank_types.dm
index 791e16200f2..613881667fe 100644
--- a/code/game/objects/items/weapons/tanks/tank_types.dm
+++ b/code/game/objects/items/weapons/tanks/tank_types.dm
@@ -99,11 +99,11 @@
/obj/item/tank/phoron/shuttle/adjust_initial_gas()
air_contents.adjust_gas(GAS_PHORON, 4*(3*ONE_ATMOSPHERE)*70/(R_IDEAL_GAS_EQUATION*T20C))
-/obj/item/tank/phoron/attackby(obj/item/W as obj, mob/user as mob)
+/obj/item/tank/phoron/attackby(obj/item/attacking_item, mob/user)
..()
- if (istype(W, /obj/item/flamethrower))
- var/obj/item/flamethrower/F = W
+ if (istype(attacking_item, /obj/item/flamethrower))
+ var/obj/item/flamethrower/F = attacking_item
if ((!F.secured)||(F.gas_tank)) return
src.master = F
F.gas_tank = src
diff --git a/code/game/objects/items/weapons/tanks/tanks.dm b/code/game/objects/items/weapons/tanks/tanks.dm
index 26630fd84e5..b7ff0078f34 100644
--- a/code/game/objects/items/weapons/tanks/tanks.dm
+++ b/code/game/objects/items/weapons/tanks/tanks.dm
@@ -67,19 +67,19 @@
descriptive = "cold"
. += SPAN_NOTICE("\The [src] feels [descriptive].")
-/obj/item/tank/attackby(obj/item/W as obj, mob/user as mob)
+/obj/item/tank/attackby(obj/item/attacking_item, mob/user)
..()
- if ((istype(W, /obj/item/device/analyzer)) && get_dist(user, src) <= 1)
- var/obj/item/device/analyzer/A = W
+ if ((istype(attacking_item, /obj/item/device/analyzer)) && get_dist(user, src) <= 1)
+ var/obj/item/device/analyzer/A = attacking_item
A.analyze_gases(src, user)
- if (istype(W, /obj/item/toy/balloon))
- var/obj/item/toy/balloon/B = W
+ if (istype(attacking_item, /obj/item/toy/balloon))
+ var/obj/item/toy/balloon/B = attacking_item
B.blow(src)
src.add_fingerprint(user)
- if(istype(W, /obj/item/device/assembly_holder))
- bomb_assemble(W,user)
+ if(istype(attacking_item, /obj/item/device/assembly_holder))
+ bomb_assemble(attacking_item, user)
/obj/item/tank/attack_self(mob/user as mob)
if (!(src.air_contents))
diff --git a/code/game/objects/items/weapons/tanks/watertank.dm b/code/game/objects/items/weapons/tanks/watertank.dm
index f6fafb49873..8b1b5f81f38 100644
--- a/code/game/objects/items/weapons/tanks/watertank.dm
+++ b/code/game/objects/items/weapons/tanks/watertank.dm
@@ -83,8 +83,8 @@
noz = null
return ..()
-/obj/item/watertank/attackby(obj/item/W, mob/user, params)
- if(W == noz)
+/obj/item/watertank/attackby(obj/item/attacking_item, mob/user, params)
+ if(attacking_item == noz)
remove_noz()
return TRUE
else
diff --git a/code/game/objects/items/weapons/tools.dm b/code/game/objects/items/weapons/tools.dm
index 50ecfd806eb..73a705cb34a 100644
--- a/code/game/objects/items/weapons/tools.dm
+++ b/code/game/objects/items/weapons/tools.dm
@@ -344,8 +344,8 @@
if(distance <= 0)
. += "It contains [get_fuel()]/[max_fuel] units of fuel."
-/obj/item/weldingtool/attackby(obj/item/W, mob/user)
- if(W.isscrewdriver())
+/obj/item/weldingtool/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.isscrewdriver())
if(isrobot(loc))
to_chat(user, SPAN_ALERT("You cannot modify your own welder!"))
return TRUE
@@ -360,8 +360,8 @@
add_fingerprint(user)
return TRUE
- if(!status && (istype(W, /obj/item/stack/rods)))
- var/obj/item/stack/rods/R = W
+ if(!status && (istype(attacking_item, /obj/item/stack/rods)))
+ var/obj/item/stack/rods/R = attacking_item
R.use(1)
add_fingerprint(user)
user.drop_from_inventory(src)
@@ -576,28 +576,28 @@
STOP_PROCESSING(SSprocessing, src) //Stop processing when destroyed regardless of conditions
return ..()
-/obj/item/weldingtool/experimental/attackby(obj/item/I, mob/user)
- if(istype(I, /obj/item/eyeshield))
+/obj/item/weldingtool/experimental/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/eyeshield))
if(eyeshield)
to_chat(user, SPAN_WARNING("\The [src] already has an eye shield installed!"))
return TRUE
- user.drop_from_inventory(I, src)
- to_chat(user, SPAN_NOTICE("You install \the [I] into \the [src]."))
- eyeshield = I
+ user.drop_from_inventory(attacking_item, src)
+ to_chat(user, SPAN_NOTICE("You install \the [attacking_item] into \the [src]."))
+ eyeshield = attacking_item
produces_flash = FALSE
add_overlay("eyeshield_attached", TRUE)
return TRUE
- if(istype(I, /obj/item/overcapacitor))
+ if(istype(attacking_item, /obj/item/overcapacitor))
if(overcap)
to_chat(user, SPAN_WARNING("\The [src] already has an overcapacitor installed!"))
return TRUE
- user.drop_from_inventory(I, src)
- to_chat(user, SPAN_NOTICE("You install \the [I] into \the [src]."))
- overcap = I
+ user.drop_from_inventory(attacking_item, src)
+ to_chat(user, SPAN_NOTICE("You install \the [attacking_item] into \the [src]."))
+ overcap = attacking_item
add_overlay("overcap_attached", TRUE)
toolspeed *= 2
return TRUE
- if(I.isscrewdriver())
+ if(attacking_item.isscrewdriver())
if(!eyeshield && !overcap)
to_chat(user, SPAN_WARNING("\The [src] doesn't have any accessories to remove!"))
return TRUE
@@ -916,14 +916,14 @@
/obj/item/steelwool/isFlameSource()
return lit
-/obj/item/steelwool/attackby(obj/item/W, mob/user)
- if(W.isFlameSource())
- ignite(W, user)
+/obj/item/steelwool/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.isFlameSource())
+ ignite(attacking_item, user)
return TRUE
- else if(istype(W, /obj/item/cell))
- var/obj/item/cell/S = W
+ else if(istype(attacking_item, /obj/item/cell))
+ var/obj/item/cell/S = attacking_item
if(S.charge)
- ignite(W, user)
+ ignite(attacking_item, user)
else
to_chat(user, SPAN_WARNING("The cell isn't charged!"))
return TRUE
diff --git a/code/game/objects/items/weapons/traps.dm b/code/game/objects/items/weapons/traps.dm
index 4265277272b..982b58d37cb 100644
--- a/code/game/objects/items/weapons/traps.dm
+++ b/code/game/objects/items/weapons/traps.dm
@@ -373,9 +373,9 @@
release_time = world.time
layer = initial(layer)
-/obj/item/trap/animal/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/grab))
- var/obj/item/grab/G = W
+/obj/item/trap/animal/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/grab))
+ var/obj/item/grab/G = attacking_item
var/mob/living/M = G.affecting
if (G.state == GRAB_PASSIVE || G.state == GRAB_UPGRADING)
@@ -393,8 +393,8 @@
return
capture(M)
- else if(W.iswelder())
- var/obj/item/weldingtool/WT = W
+ else if(attacking_item.iswelder())
+ var/obj/item/weldingtool/WT = attacking_item
if(!WT.isOn())
to_chat(user, SPAN_WARNING("\The [WT] is off!"))
return
@@ -411,7 +411,7 @@
release(user)
qdel(src)
- else if(W.isscrewdriver())
+ else if(attacking_item.isscrewdriver())
var/turf/T = get_turf(src)
if(!T)
to_chat(user, "There is nothing to secure [src] to!")
@@ -422,7 +422,7 @@
var/sound_to_play = pick(list('sound/items/Screwdriver.ogg', 'sound/items/Screwdriver2.ogg'))
playsound(src.loc, sound_to_play, 50, 1)
- if(W.use_tool(src, user, 30, volume = 50))
+ if(attacking_item.use_tool(src, user, 30, volume = 50))
density = !density
anchored = !anchored
user.visible_message("[user] [anchored ? "" : "un" ]secures \the [src]!",
@@ -588,8 +588,8 @@
else
..()
-/obj/item/trap/animal/large/attackby(obj/item/W, mob/user)
- if(W.iswrench())
+/obj/item/trap/animal/large/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.iswrench())
var/turf/T = get_turf(src)
if(!T)
to_chat(user, "There is nothing to secure [src] to!")
@@ -602,12 +602,12 @@
user.visible_message("[user] begins [anchored ? "un" : "" ]securing \the [src]!",
"You begin [anchored ? "un" : "" ]securing \the [src]!")
- if(W.use_tool(src, user, 30, volume = 50))
+ if(attacking_item.use_tool(src, user, 30, volume = 50))
anchored = !anchored
user.visible_message("[user] [anchored ? "" : "un" ]secures \the [src]!",
"You [anchored ? "" : "un" ]secure \the [src]!")
- else if(W.isscrewdriver())
+ else if(attacking_item.isscrewdriver())
// Unlike smaller traps, screwdriver shouldn't work on this.
return
else
@@ -647,9 +647,9 @@
force = 5
w_class = ITEMSIZE_HUGE
-/obj/item/large_trap_foundation/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/stack/rods))
- var/obj/item/stack/rods/O = W
+/obj/item/large_trap_foundation/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/stack/rods))
+ var/obj/item/stack/rods/O = attacking_item
if(O.get_amount() >= 12)
to_chat(user, "You are trying to add metal bars to \the [src].")
@@ -664,7 +664,7 @@
return
else
to_chat(user, "You need at least 12 rods to complete \the [src].")
- else if(istype(W, /obj/item/screwdriver))
+ else if(istype(attacking_item, /obj/item/screwdriver))
return
else
..()
diff --git a/code/game/objects/items/weapons/vaurca_items.dm b/code/game/objects/items/weapons/vaurca_items.dm
index 4fe24474e18..eb9ac9ff62d 100644
--- a/code/game/objects/items/weapons/vaurca_items.dm
+++ b/code/game/objects/items/weapons/vaurca_items.dm
@@ -524,11 +524,11 @@
else
to_chat(user, "[src] is empty.")
-/obj/item/gun/launcher/crossbow/vaurca/attackby(obj/item/I, mob/user)
- if(istype(I, /obj/item/arrow))
- load(I, user)
- if(istype(I, /obj/item/stack/rods))
- var/obj/item/stack/rods/R = I
+/obj/item/gun/launcher/crossbow/vaurca/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/arrow))
+ load(attacking_item, user)
+ if(istype(attacking_item, /obj/item/stack/rods))
+ var/obj/item/stack/rods/R = attacking_item
if (R.use(1))
var/obj/item/arrow/rod/ROD = new /obj/item/arrow/rod(src)
load(ROD, user)
diff --git a/code/game/objects/items/weapons/weaponry.dm b/code/game/objects/items/weapons/weaponry.dm
index 6b5332862c7..f493f334d58 100644
--- a/code/game/objects/items/weapons/weaponry.dm
+++ b/code/game/objects/items/weapons/weaponry.dm
@@ -104,9 +104,9 @@
user.visible_message(SPAN_WARNING("\The [user] claws at \the [src]!"), SPAN_WARNING("You claw at \the [src]!"))
health_check()
-/obj/effect/energy_net/attackby(obj/item/W, mob/user)
- user.do_attack_animation(src, W)
- var/attack_force = W.force
+/obj/effect/energy_net/attackby(obj/item/attacking_item, mob/user)
+ user.do_attack_animation(src, attacking_item)
+ var/attack_force = attacking_item.force
if(user == affecting)
attack_force /= 2
health -= attack_force
diff --git a/code/game/objects/structures/barricades/_barricade.dm b/code/game/objects/structures/barricades/_barricade.dm
index e2b2812fa9e..db5016f9769 100644
--- a/code/game/objects/structures/barricades/_barricade.dm
+++ b/code/game/objects/structures/barricades/_barricade.dm
@@ -142,20 +142,20 @@
L.do_attack_animation(src)
take_damage(damage)
-/obj/structure/barricade/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/stack/barbed_wire))
- var/obj/item/stack/barbed_wire/B = W
+/obj/structure/barricade/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/stack/barbed_wire))
+ var/obj/item/stack/barbed_wire/B = attacking_item
if(can_wire)
- user.visible_message(SPAN_NOTICE("[user] starts setting up [W.name] on [src]."),
- SPAN_NOTICE("You start setting up [W.name] on [src]."))
+ user.visible_message(SPAN_NOTICE("[user] starts setting up [attacking_item.name] on [src]."),
+ SPAN_NOTICE("You start setting up [attacking_item.name] on [src]."))
if(do_after(user, 20, src, DO_REPAIR_CONSTRUCT) && can_wire)
// Make sure there's still enough wire in the stack
if(!B.use(1))
return
playsound(src.loc, 'sound/effects/barbed_wire_movement.ogg', 25, 1)
- user.visible_message(SPAN_NOTICE("[user] sets up [W.name] on [src]."),
- SPAN_NOTICE("You set up [W.name] on [src]."))
+ user.visible_message(SPAN_NOTICE("[user] sets up [attacking_item.name] on [src]."),
+ SPAN_NOTICE("You set up [attacking_item.name] on [src]."))
maxhealth += 50
update_health(-50)
@@ -165,7 +165,7 @@
update_icon()
return
- if(W.iswirecutter())
+ if(attacking_item.iswirecutter())
if(is_wired)
user.visible_message(SPAN_NOTICE("[user] begin removing the barbed wire on [src]."),
SPAN_NOTICE("You begin removing the barbed wire on [src]."))
@@ -185,11 +185,11 @@
new /obj/item/stack/barbed_wire(loc)
return
- if((W.force + W.armor_penetration) > force_level_absorption)
+ if((attacking_item.force + attacking_item.armor_penetration) > force_level_absorption)
..()
if(barricade_hitsound)
playsound(src, barricade_hitsound, 25, 1)
- hit_barricade(W, user)
+ hit_barricade(attacking_item, user)
/obj/structure/barricade/bullet_act(obj/item/projectile/P)
bullet_ping(P)
diff --git a/code/game/objects/structures/barricades/liquid.dm b/code/game/objects/structures/barricades/liquid.dm
index 204875591b9..4cee55999e9 100644
--- a/code/game/objects/structures/barricades/liquid.dm
+++ b/code/game/objects/structures/barricades/liquid.dm
@@ -54,9 +54,9 @@
if(changed && is_wired)
maxhealth += 50
-/obj/structure/barricade/liquid/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/crowbar) && user.a_intent != I_HURT)
- var/obj/item/crowbar/ET = W
+/obj/structure/barricade/liquid/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/crowbar) && user.a_intent != I_HURT)
+ var/obj/item/crowbar/ET = attacking_item
user.visible_message(SPAN_NOTICE("[user] starts disassembling [src]."), \
SPAN_NOTICE("You start disassembling [src]."))
if(ET.use_tool(src, user, 4 SECONDS))
@@ -65,8 +65,8 @@
barricade_deconstruct(TRUE)
return TRUE
- if(istype(W, stack_type))
- var/obj/item/stack/liquidbags/SB = W
+ if(istype(attacking_item, stack_type))
+ var/obj/item/stack/liquidbags/SB = attacking_item
if(build_stage == BARRICADE_LIQUIDBAG_5)
to_chat(user, SPAN_WARNING("You can't stack more on [src]."))
return
diff --git a/code/game/objects/structures/barricades/metal.dm b/code/game/objects/structures/barricades/metal.dm
index 4d0d0c8582a..33886d790ac 100644
--- a/code/game/objects/structures/barricades/metal.dm
+++ b/code/game/objects/structures/barricades/metal.dm
@@ -24,9 +24,9 @@
if(BARRICADE_BSTATE_MOVABLE)
. += SPAN_INFO("The protection panel has been removed and the anchor bolts loosened. It's ready to be taken apart.")
-/obj/structure/barricade/metal/attackby(obj/item/W, mob/user)
- if(W.iswelder())
- var/obj/item/weldingtool/WT = W
+/obj/structure/barricade/metal/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.iswelder())
+ var/obj/item/weldingtool/WT = attacking_item
if(damage_state == BARRICADE_DMG_HEAVY)
to_chat(user, SPAN_WARNING("[src] has sustained too much structural damage to be repaired."))
return
@@ -40,8 +40,8 @@
switch(build_state)
if(BARRICADE_BSTATE_SECURED) //Fully constructed step. Use screwdriver to remove the protection panels to reveal the bolts
- if(W.isscrewdriver())
- if(!W.use_tool(src, user, 1 SECOND, volume = 40))
+ if(attacking_item.isscrewdriver())
+ if(!attacking_item.use_tool(src, user, 1 SECOND, volume = 40))
return
user.visible_message(SPAN_NOTICE("[user] removes [src]'s protection panel."),
SPAN_NOTICE("You remove [src]'s protection panels, exposing the anchor bolts."))
@@ -49,15 +49,15 @@
return
if(BARRICADE_BSTATE_UNSECURED) //Protection panel removed step. Screwdriver to put the panel back, wrench to unsecure the anchor bolts
- if(W.isscrewdriver())
- if(!W.use_tool(src, user, 2 SECONDS, volume = 40))
+ if(attacking_item.isscrewdriver())
+ if(!attacking_item.use_tool(src, user, 2 SECONDS, volume = 40))
return
user.visible_message(SPAN_NOTICE("[user] screws \the [src]'s protection panel back."),
SPAN_NOTICE("You screw \the [src]'s protection panel back."))
build_state = BARRICADE_BSTATE_SECURED
return
- if(W.iswrench())
- if(!W.use_tool(src, user, 1 SECOND, volume = 40))
+ if(attacking_item.iswrench())
+ if(!attacking_item.use_tool(src, user, 1 SECOND, volume = 40))
return
user.visible_message(SPAN_NOTICE("[user] loosens [src]'s anchor bolts."),
SPAN_NOTICE("You loosen [src]'s anchor bolts."))
@@ -66,7 +66,7 @@
update_icon() //unanchored changes layer
return
if(BARRICADE_BSTATE_MOVABLE) //Anchor bolts loosened step. Apply crowbar to unseat the panel and take apart the whole thing. Apply wrench to resecure anchor bolts
- if(W.iswrench())
+ if(attacking_item.iswrench())
for(var/obj/structure/barricade/B in loc)
if(B != src && B.dir == dir)
to_chat(user, SPAN_WARNING("There's already a barricade here."))
@@ -75,7 +75,7 @@
if(!(istype(T)) || istype(T, /turf/space))
to_chat(user, SPAN_WARNING("[src] must be secured on a proper surface!"))
return
- if(!W.use_tool(src, user, 1 SECOND, volume = 50))
+ if(!attacking_item.use_tool(src, user, 1 SECOND, volume = 50))
return
user.visible_message(SPAN_NOTICE("[user] secures [src]'s anchor bolts."),
SPAN_NOTICE("You secure [src]'s anchor bolts."))
@@ -83,10 +83,10 @@
anchored = TRUE
update_icon() //unanchored changes layer
return
- if(W.iscrowbar())
+ if(attacking_item.iscrowbar())
user.visible_message(SPAN_NOTICE("[user] starts unseating [src]'s panels."),
SPAN_NOTICE("You start unseating [src]'s panels."))
- if(W.use_tool(src, user, 3 SECONDS, volume = 40))
+ if(attacking_item.use_tool(src, user, 3 SECONDS, volume = 40))
user.visible_message(SPAN_NOTICE("[user] takes [src]'s panels apart."),
SPAN_NOTICE("You take [src]'s panels apart."))
barricade_deconstruct(TRUE) //Note : Handles deconstruction too !
diff --git a/code/game/objects/structures/barricades/plasteel.dm b/code/game/objects/structures/barricades/plasteel.dm
index f13c454b394..83d014edc1f 100644
--- a/code/game/objects/structures/barricades/plasteel.dm
+++ b/code/game/objects/structures/barricades/plasteel.dm
@@ -57,12 +57,12 @@
..()
busy = FALSE
-/obj/structure/barricade/plasteel/attackby(obj/item/W, mob/user)
- if(W.iswelder())
+/obj/structure/barricade/plasteel/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.iswelder())
if(busy || tool_cooldown > world.time)
return
tool_cooldown = world.time + 10
- var/obj/item/weldingtool/WT = W
+ var/obj/item/weldingtool/WT = attacking_item
if(damage_state == BARRICADE_DMG_HEAVY)
to_chat(user, SPAN_WARNING("[src] has sustained too much structural damage to be repaired."))
return
@@ -76,7 +76,7 @@
switch(build_state)
if(2) //Fully constructed step. Use screwdriver to remove the protection panels to reveal the bolts
- if(W.isscrewdriver())
+ if(attacking_item.isscrewdriver())
if(busy || tool_cooldown > world.time)
return
tool_cooldown = world.time + 10
@@ -84,13 +84,13 @@
if(B != src && B.dir == dir)
to_chat(user, SPAN_WARNING("There's already a barricade here."))
return
- if(!W.use_tool(src, user, 10, volume = 50))
+ if(!attacking_item.use_tool(src, user, 10, volume = 50))
return
user.visible_message(SPAN_NOTICE("[user] removes [src]'s protection panel."),
SPAN_NOTICE("You remove [src]'s protection panels, exposing the anchor bolts."))
build_state = BARRICADE_BSTATE_UNSECURED
return
- if(W.iscrowbar())
+ if(attacking_item.iscrowbar())
playsound(src.loc, 'sound/items/crowbar_pry.ogg', 25, 1)
if(linked)
user.visible_message(SPAN_NOTICE("[user] removes the linking on [src]."),
@@ -107,20 +107,20 @@
cade.update_icon()
update_icon()
if(1) //Protection panel removed step. Screwdriver to put the panel back, wrench to unsecure the anchor bolts
- if(W.isscrewdriver())
+ if(attacking_item.isscrewdriver())
if(busy || tool_cooldown > world.time)
return
tool_cooldown = world.time + 10
- if(!W.use_tool(src, user, 10, volume = 50))
+ if(!attacking_item.use_tool(src, user, 10, volume = 50))
return
user.visible_message(SPAN_NOTICE("[user] set [src]'s protection panel back."),
SPAN_NOTICE("You set [src]'s protection panel back."))
build_state = BARRICADE_BSTATE_SECURED
return
- if(W.iswrench())
+ if(attacking_item.iswrench())
if(busy || tool_cooldown > world.time)
return
- if(!W.use_tool(src, user, 10, volume = 50))
+ if(!attacking_item.use_tool(src, user, 10, volume = 50))
return
user.visible_message(SPAN_NOTICE("[user] loosens [src]'s anchor bolts."),
SPAN_NOTICE("You loosen [src]'s anchor bolts."))
@@ -130,7 +130,7 @@
return
if(0) //Anchor bolts loosened step. Apply crowbar to unseat the panel and take apart the whole thing. Apply wrench to rescure anchor bolts
- if(W.iswrench())
+ if(attacking_item.iswrench())
if(busy || tool_cooldown > world.time)
return
tool_cooldown = world.time + 10
@@ -138,7 +138,7 @@
if(!(istype(T)) || istype(T, /turf/space))
to_chat(user, SPAN_WARNING("[src] must be secured on a proper surface!"))
return
- if(!W.use_tool(src, user, 10, volume = 50))
+ if(!attacking_item.use_tool(src, user, 10, volume = 50))
return
user.visible_message(SPAN_NOTICE("[user] secures [src]'s anchor bolts."),
SPAN_NOTICE("You secure [src]'s anchor bolts."))
@@ -146,7 +146,7 @@
build_state = BARRICADE_BSTATE_UNSECURED
update_icon() //unanchored changes layer
return
- if(W.iscrowbar())
+ if(attacking_item.iscrowbar())
if(busy || tool_cooldown > world.time)
return
tool_cooldown = world.time + 10
@@ -154,7 +154,7 @@
SPAN_NOTICE("You start unseating [src]'s panels."))
playsound(src.loc, 'sound/items/crowbar_pry.ogg', 25, 1)
busy = 1
- if(W.use_tool(src, user, 8 SECONDS, volume = 50))
+ if(attacking_item.use_tool(src, user, 8 SECONDS, volume = 50))
busy = 0
user.visible_message(SPAN_NOTICE("[user] takes [src]'s panels apart."),
SPAN_NOTICE("You take [src]'s panels apart."))
diff --git a/code/game/objects/structures/barricades/wood.dm b/code/game/objects/structures/barricades/wood.dm
index 3d3313458d0..88a84b5c447 100644
--- a/code/game/objects/structures/barricades/wood.dm
+++ b/code/game/objects/structures/barricades/wood.dm
@@ -15,9 +15,9 @@
can_wire = FALSE
metallic = FALSE
-/obj/structure/barricade/wooden/attackby(obj/item/W as obj, mob/user as mob)
- if(istype(W, /obj/item/stack/material/wood))
- var/obj/item/stack/material/wood/D = W
+/obj/structure/barricade/wooden/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/stack/material/wood))
+ var/obj/item/stack/material/wood/D = attacking_item
if(health < maxhealth)
if(D.get_amount() < 1)
to_chat(user, SPAN_WARNING("You need one plank of wood to repair [src]."))
diff --git a/code/game/objects/structures/barsign.dm b/code/game/objects/structures/barsign.dm
index cbb123647bd..5497f844a77 100644
--- a/code/game/objects/structures/barsign.dm
+++ b/code/game/objects/structures/barsign.dm
@@ -8,10 +8,10 @@
var/cult = 0
var/choice_types = /singleton/sign/double/bar
-/obj/structure/sign/double/barsign/attackby(obj/item/I, mob/user)
+/obj/structure/sign/double/barsign/attackby(obj/item/attacking_item, mob/user)
if(cult)
return ..()
- var/obj/item/card/id/card = I.GetID()
+ var/obj/item/card/id/card = attacking_item.GetID()
if(istype(card))
if(check_access(card))
set_sign()
diff --git a/code/game/objects/structures/bedsheet_bin.dm b/code/game/objects/structures/bedsheet_bin.dm
index a4c9f39be97..b19d9eb12cd 100644
--- a/code/game/objects/structures/bedsheet_bin.dm
+++ b/code/game/objects/structures/bedsheet_bin.dm
@@ -176,17 +176,19 @@ LINEN BINS
inuse = FALSE
return FALSE
-/obj/item/bedsheet/attackby(obj/item/I, mob/user)
- if(I.isscrewdriver())
- user.visible_message(SPAN_NOTICE("\The [user] begins poking eyeholes in \the [src] with \the [I]."), SPAN_NOTICE("You begin poking eyeholes in \the [src] with \the [I]."))
- if(I.use_tool(src, user, 50, volume = 50))
+/obj/item/bedsheet/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.isscrewdriver())
+ user.visible_message(SPAN_NOTICE("\The [user] begins poking eyeholes in \the [src] with \the [attacking_item]."),
+ SPAN_NOTICE("You begin poking eyeholes in \the [src] with \the [attacking_item]."))
+ if(attacking_item.use_tool(src, user, 50, volume = 50))
to_chat(user, SPAN_NOTICE("You poke eyeholes in \the [src]!"))
new /obj/item/bedsheet/costume(get_turf(src))
qdel(src)
return TRUE
- else if(is_sharp(I))
- user.visible_message(SPAN_NOTICE("\The [user] begins cutting up \the [src] with \the [I]."), SPAN_NOTICE("You begin cutting up \the [src] with \the [I]."))
- if(I.use_tool(src, user, 50, volume = 50))
+ else if(is_sharp(attacking_item))
+ user.visible_message(SPAN_NOTICE("\The [user] begins cutting up \the [src] with \the [attacking_item]."),
+ SPAN_NOTICE("You begin cutting up \the [src] with \the [attacking_item]."))
+ if(attacking_item.use_tool(src, user, 50, volume = 50))
to_chat(user, SPAN_NOTICE("You cut \the [src] into pieces!"))
new /obj/item/stack/material/cloth(get_turf(src), rand(2, 5))
qdel(src)
@@ -396,16 +398,16 @@ LINEN BINS
else
icon_state = "linenbin-empty"
-/obj/structure/bedsheetbin/attackby(obj/item/I as obj, mob/user as mob)
- if(istype(I, /obj/item/bedsheet))
- user.drop_from_inventory(I,src)
- sheets.Add(I)
+/obj/structure/bedsheetbin/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/bedsheet))
+ user.drop_from_inventory(attacking_item,src)
+ sheets.Add(attacking_item)
amount++
- to_chat(user, "You put [I] in [src].")
- else if(amount && !hidden && I.w_class < 4) //make sure there's sheets to hide it among, make sure nothing else is hidden in there.
- user.drop_from_inventory(I,src)
- hidden = I
- to_chat(user, "You hide [I] among the sheets.")
+ to_chat(user, "You put [attacking_item] in [src].")
+ else if(amount && !hidden && attacking_item.w_class < 4) //make sure there's sheets to hide it among, make sure nothing else is hidden in there.
+ user.drop_from_inventory(attacking_item,src)
+ hidden = attacking_item
+ to_chat(user, "You hide [attacking_item] among the sheets.")
/obj/structure/bedsheetbin/attack_hand(mob/user as mob)
if(amount >= 1)
diff --git a/code/game/objects/structures/bonfire.dm b/code/game/objects/structures/bonfire.dm
index f04c53eb064..7c3acbd2226 100644
--- a/code/game/objects/structures/bonfire.dm
+++ b/code/game/objects/structures/bonfire.dm
@@ -71,40 +71,40 @@ GLOBAL_LIST_EMPTY(total_active_bonfires)
var/obj/item/device/flashlight/flare/torch/stick/torch = new(get_turf(user))
H.put_in_active_hand(torch)
-/obj/structure/bonfire/attackby(obj/item/W, mob/user)
- if(W.isFlameSource() && !on_fire) // needs to go last or else nothing else will work
+/obj/structure/bonfire/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.isFlameSource() && !on_fire) // needs to go last or else nothing else will work
light(user)
return
- if(on_fire && (istype(W, /obj/item/flame) || istype(W, /obj/item/device/flashlight/flare/torch) || istype(W, /obj/item/clothing/mask/smokable))) //light unlit stuff
- W.attackby(src, user)
+ if(on_fire && (istype(attacking_item, /obj/item/flame) || istype(attacking_item, /obj/item/device/flashlight/flare/torch) || istype(attacking_item, /obj/item/clothing/mask/smokable))) //light unlit stuff
+ attacking_item.attackby(src, user)
return
if(fuel < max_fuel)
- if(istype(W, /obj/item/stack/material))
- var/obj/item/stack/material/I = W
+ if(istype(attacking_item, /obj/item/stack/material))
+ var/obj/item/stack/material/I = attacking_item
if(I.default_type in burnable_materials)
I.use(1)
fuel = min(fuel + burnable_materials[I.default_type], max_fuel)
user.visible_message(SPAN_NOTICE("\The [user] adds some of \the [I] to \the [src]."))
return
- if(is_type_in_list(W, burnable_other))
- var/fuel_add = burnable_other[W]
+ if(is_type_in_list(attacking_item, burnable_other))
+ var/fuel_add = burnable_other[attacking_item]
fuel = min(fuel + fuel_add, max_fuel)
- user.visible_message(SPAN_NOTICE("\The [user] tosses \the [W] into \the [src]."))
- user.drop_from_inventory(W)
- qdel(W)
+ user.visible_message(SPAN_NOTICE("\The [user] tosses \the [attacking_item] into \the [src]."))
+ user.drop_from_inventory(attacking_item)
+ qdel(attacking_item)
return
- else if(istype(W, /obj/item/material))
- var/obj/item/material/M = W
+ else if(istype(attacking_item, /obj/item/material))
+ var/obj/item/material/M = attacking_item
if(M.material.name in burnable_materials)
var/fuel_add = burnable_materials[M.material] * (M.w_class / 5) //if you crafted a small item, it's not worth as much fuel
fuel = min(fuel + fuel_add, max_fuel)
user.visible_message(SPAN_NOTICE("\The [user] tosses \the [M] into \the [src]."))
- user.drop_from_inventory(W)
- W.forceMove(get_turf(src))
- qdel(W)
+ user.drop_from_inventory(attacking_item)
+ attacking_item.forceMove(get_turf(src))
+ qdel(attacking_item)
return
else
- var/obj/item/reagent_containers/RC = W
+ var/obj/item/reagent_containers/RC = attacking_item
if(RC.is_open_container())
RC.reagents.trans_to(src, RC.amount_per_transfer_from_this)
handle_reagents()
diff --git a/code/game/objects/structures/coatrack.dm b/code/game/objects/structures/coatrack.dm
index f672012ffa8..1d38bd541f0 100644
--- a/code/game/objects/structures/coatrack.dm
+++ b/code/game/objects/structures/coatrack.dm
@@ -37,22 +37,22 @@
hat = null
update_icon()
-/obj/structure/coatrack/attackby(obj/item/W as obj, mob/user as mob)
+/obj/structure/coatrack/attackby(obj/item/attacking_item, mob/user)
if(use_check_and_message(user))
return
- if(!coat && (istype(W, /obj/item/clothing/suit/storage/toggle) || istype(W, /obj/item/clothing/accessory/poncho)))
- user.visible_message("[user] hangs [W] on \the [src].", SPAN_NOTICE("You hang [W] on the \the [src]."))
- coat = W
+ if(!coat && (istype(attacking_item, /obj/item/clothing/suit/storage/toggle) || istype(attacking_item, /obj/item/clothing/accessory/poncho)))
+ user.visible_message("[user] hangs [attacking_item] on \the [src].", SPAN_NOTICE("You hang [attacking_item] on the \the [src]."))
+ coat = attacking_item
user.drop_from_inventory(coat, src)
- playsound(src, W.drop_sound, DROP_SOUND_VOLUME)
+ playsound(src, attacking_item.drop_sound, DROP_SOUND_VOLUME)
update_icon()
- else if(!hat && istype(W, /obj/item/clothing/head) && !istype(W, /obj/item/clothing/head/helmet))
- user.visible_message("[user] hangs [W] on \the [src].", SPAN_NOTICE("You hang [W] on the \the [src]."))
- hat = W
+ else if(!hat && istype(attacking_item, /obj/item/clothing/head) && !istype(attacking_item, /obj/item/clothing/head/helmet))
+ user.visible_message("[user] hangs [attacking_item] on \the [src].", SPAN_NOTICE("You hang [attacking_item] on the \the [src]."))
+ hat = attacking_item
user.drop_from_inventory(hat, src)
- playsound(src, W.drop_sound, DROP_SOUND_VOLUME)
+ playsound(src, attacking_item.drop_sound, DROP_SOUND_VOLUME)
update_icon()
- else if(istype(W, /obj/item/clothing))
+ else if(istype(attacking_item, /obj/item/clothing))
to_chat(user, SPAN_WARNING("You can't hang that up."))
else
return ..()
diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm
index e6794df2ff4..c869438d18d 100644
--- a/code/game/objects/structures/crates_lockers/closets.dm
+++ b/code/game/objects/structures/crates_lockers/closets.dm
@@ -304,12 +304,12 @@
..()
damage(proj_damage)
-/obj/structure/closet/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/closet_teleporter))
+/obj/structure/closet/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/closet_teleporter))
if(linked_teleporter)
to_chat(user, SPAN_WARNING("\The [src] already has a linked teleporter!"))
return
- var/obj/item/closet_teleporter/CT = W
+ var/obj/item/closet_teleporter/CT = attacking_item
user.visible_message(SPAN_NOTICE("\The [user] starts attaching \the [CT] to \the [src]..."), SPAN_NOTICE("You begin attaching \the [CT] to \the [src]..."), range = 3)
if(do_after(user, 30, src, DO_REPAIR_CONSTRUCT))
user.visible_message(SPAN_NOTICE("\The [user] attaches \the [CT] to \the [src]."), SPAN_NOTICE("You attach \the [CT] to \the [src]."), range = 3)
@@ -318,11 +318,11 @@
user.drop_from_inventory(CT, src)
return
if(opened)
- if(istype(W, /obj/item/grab))
- var/obj/item/grab/G = W
+ if(istype(attacking_item, /obj/item/grab))
+ var/obj/item/grab/G = attacking_item
MouseDrop_T(G.affecting, user) //act like they were dragged onto the closet
return 0
- if(W.isscrewdriver()) // Moved here so you can only detach linked teleporters when the door is open. So you can like unscrew and bolt the locker normally in most circumstances.
+ if(attacking_item.isscrewdriver()) // Moved here so you can only detach linked teleporters when the door is open. So you can like unscrew and bolt the locker normally in most circumstances.
if(linked_teleporter)
user.visible_message(SPAN_NOTICE("\The [user] starts detaching \the [linked_teleporter] from \the [src]..."), SPAN_NOTICE("You begin detaching \the [linked_teleporter] from \the [src]..."), range = 3)
if(do_after(user, 30, src, DO_REPAIR_CONSTRUCT))
@@ -331,8 +331,8 @@
user.put_in_hands(linked_teleporter)
linked_teleporter = null
return
- if(W.iswelder())
- var/obj/item/weldingtool/WT = W
+ if(attacking_item.iswelder())
+ var/obj/item/weldingtool/WT = attacking_item
if(WT.isOn())
user.visible_message(
SPAN_WARNING("[user] begins cutting [src] apart."),
@@ -355,8 +355,8 @@
linked_teleporter = null
dismantle()
return
- if(istype(W, /obj/item/storage/laundry_basket) && W.contents.len)
- var/obj/item/storage/laundry_basket/LB = W
+ if(istype(attacking_item, /obj/item/storage/laundry_basket) && attacking_item.contents.len)
+ var/obj/item/storage/laundry_basket/LB = attacking_item
var/turf/T = get_turf(src)
for(var/obj/item/I in LB.contents)
LB.remove_from_storage(I, T)
@@ -366,27 +366,27 @@
SPAN_NOTICE("You hear rustling of clothes.")
)
return
- if(!W.dropsafety())
+ if(!attacking_item.dropsafety())
return
- if(W)
- user.drop_from_inventory(W,loc)
+ if(attacking_item)
+ user.drop_from_inventory(attacking_item,loc)
else
user.drop_item()
- else if(istype(W, /obj/item/device/cratescanner))
- var/obj/item/device/cratescanner/Cscanner = W
+ else if(istype(attacking_item, /obj/item/device/cratescanner))
+ var/obj/item/device/cratescanner/Cscanner = attacking_item
if(locked)
- to_chat(user, SPAN_WARNING("[W] refuses to scan [src]. Unlock it first!"))
+ to_chat(user, SPAN_WARNING("[attacking_item] refuses to scan [src]. Unlock it first!"))
return
if(welded)
- to_chat(user, SPAN_WARNING("[W] detects that [src] is welded shut, and refuses to scan."))
+ to_chat(user, SPAN_WARNING("[attacking_item] detects that [src] is welded shut, and refuses to scan."))
return
Cscanner.print_contents(name, contents, src.loc)
- else if(istype(W, /obj/item/stack/packageWrap))
+ else if(istype(attacking_item, /obj/item/stack/packageWrap))
return
- else if(istype(W, /obj/item/ducttape))
+ else if(istype(attacking_item, /obj/item/ducttape))
return
- else if(W.iswelder())
- var/obj/item/weldingtool/WT = W
+ else if(attacking_item.iswelder())
+ var/obj/item/weldingtool/WT = attacking_item
if(WT.isOn())
user.visible_message(
SPAN_WARNING("[user] begins welding [src] [welded ? "open" : "shut"]."),
@@ -394,7 +394,7 @@
"You hear a welding torch on metal."
)
playsound(loc, 'sound/items/welder_pry.ogg', 50, 1)
- if(!W.use_tool(src, user, 20, volume = 50, extra_checks = CALLBACK(src, PROC_REF(is_closed))))
+ if(!attacking_item.use_tool(src, user, 20, volume = 50, extra_checks = CALLBACK(src, PROC_REF(is_closed))))
return
if(!WT.use(0,user))
to_chat(user, SPAN_NOTICE("You need more welding fuel to complete this task."))
@@ -407,67 +407,67 @@
)
else
attack_hand(user)
- else if(W.isscrewdriver() && canbemoved)
+ else if(attacking_item.isscrewdriver() && canbemoved)
if(screwed)
to_chat(user, SPAN_NOTICE("You start to unscrew \the [src] from the floor..."))
- playsound(loc, W.usesound, 50, 1)
- if (do_after(user, 10/W.toolspeed SECONDS, src, DO_REPAIR_CONSTRUCT))
+ playsound(loc, attacking_item.usesound, 50, 1)
+ if (do_after(user, 10/attacking_item.toolspeed SECONDS, src, DO_REPAIR_CONSTRUCT))
to_chat(user, SPAN_NOTICE("You unscrew the locker!"))
- playsound(loc, W.usesound, 50, 1)
+ playsound(loc, attacking_item.usesound, 50, 1)
screwed = FALSE
else if(!screwed && wrenched)
to_chat(user, SPAN_NOTICE("You start to screw the \the [src] to the floor..."))
playsound(src, 'sound/items/Welder.ogg', 80, 1)
- if (do_after(user, 15/W.toolspeed SECONDS, src, DO_REPAIR_CONSTRUCT))
+ if (do_after(user, 15/attacking_item.toolspeed SECONDS, src, DO_REPAIR_CONSTRUCT))
to_chat(user, SPAN_NOTICE("You screw \the [src]!"))
- playsound(loc, W.usesound, 50, 1)
+ playsound(loc, attacking_item.usesound, 50, 1)
screwed = TRUE
- else if(W.iswrench() && canbemoved)
+ else if(attacking_item.iswrench() && canbemoved)
if(wrenched && !screwed)
to_chat(user, SPAN_NOTICE("You start to unfasten the bolts holding \the [src] in place..."))
- playsound(loc, W.usesound, 50, 1)
- if (do_after(user, 15/W.toolspeed SECONDS, src, DO_REPAIR_CONSTRUCT))
+ playsound(loc, attacking_item.usesound, 50, 1)
+ if (do_after(user, 15/attacking_item.toolspeed SECONDS, src, DO_REPAIR_CONSTRUCT))
to_chat(user, SPAN_NOTICE("You unfasten \the [src]'s bolts!"))
- playsound(loc, W.usesound, 50, 1)
+ playsound(loc, attacking_item.usesound, 50, 1)
wrenched = FALSE
anchored = FALSE
else if(!wrenched)
to_chat(user, SPAN_NOTICE("You start to fasten the bolts holding the locker in place..."))
- playsound(loc, W.usesound, 50, 1)
- if (do_after(user, 15/W.toolspeed SECONDS, src, DO_REPAIR_CONSTRUCT))
+ playsound(loc, attacking_item.usesound, 50, 1)
+ if (do_after(user, 15/attacking_item.toolspeed SECONDS, src, DO_REPAIR_CONSTRUCT))
to_chat(user, SPAN_NOTICE("You fasten the \the [src]'s bolts!"))
- playsound(loc, W.usesound, 50, 1)
+ playsound(loc, attacking_item.usesound, 50, 1)
wrenched = TRUE
anchored = TRUE
- else if(istype(W, /obj/item/device/hand_labeler))
- var/obj/item/device/hand_labeler/HL = W
+ else if(istype(attacking_item, /obj/item/device/hand_labeler))
+ var/obj/item/device/hand_labeler/HL = attacking_item
if(HL.mode == 1)
return
else
attack_hand(user)
- else if(istype(W,/obj/item/card/id) && secure)
+ else if(istype(attacking_item,/obj/item/card/id) && secure)
togglelock(user)
// Secure locker cutting open stuff.
else if(!opened && secure)
- if(!broken && istype(W,/obj/item/material/twohanded/chainsaw))
- var/obj/item/material/twohanded/chainsaw/ChainSawVar = W
+ if(!broken && istype(attacking_item,/obj/item/material/twohanded/chainsaw))
+ var/obj/item/material/twohanded/chainsaw/ChainSawVar = attacking_item
ChainSawVar.cutting = 1
user.visible_message(\
- SPAN_DANGER("[user.name] starts cutting \the [src] with the [W]!"),\
+ SPAN_DANGER("[user.name] starts cutting \the [src] with the [attacking_item]!"),\
SPAN_WARNING("You start cutting the [src]..."),\
SPAN_NOTICE("You hear a loud buzzing sound and metal grinding on metal...")\
)
if(do_after(user, ChainSawVar.opendelay SECONDS, user, DO_REPAIR_CONSTRUCT))
user.visible_message(\
- SPAN_WARNING("[user.name] finishes cutting open \the [src] with the [W]."),\
+ SPAN_WARNING("[user.name] finishes cutting open \the [src] with the [attacking_item]."),\
SPAN_WARNING("You finish cutting open the [src]."),\
SPAN_NOTICE("You hear a metal clank and some sparks.")\
)
- emag_act(INFINITY, user, SPAN_DANGER("\The [src] has been sliced open by [user] with \an [W]!"), SPAN_DANGER("You hear metal being sliced and sparks flying."))
+ emag_act(INFINITY, user, SPAN_DANGER("\The [src] has been sliced open by [user] with \an [attacking_item]!"), SPAN_DANGER("You hear metal being sliced and sparks flying."))
ChainSawVar.cutting = 0
- else if(istype(W, /obj/item/melee/energy/blade))//Attempt to cut open locker if locked
- if(emag_act(INFINITY, user, SPAN_DANGER("\The [src] has been sliced open by [user] with \an [W]!"), SPAN_DANGER("You hear metal being sliced and sparks flying.")))
+ else if(istype(attacking_item, /obj/item/melee/energy/blade))//Attempt to cut open locker if locked
+ if(emag_act(INFINITY, user, SPAN_DANGER("\The [src] has been sliced open by [user] with \an [attacking_item]!"), SPAN_DANGER("You hear metal being sliced and sparks flying.")))
playsound(loc, 'sound/weapons/blade.ogg', 50, 1)
else
attack_hand(user)
diff --git a/code/game/objects/structures/crates_lockers/closets/gimmick.dm b/code/game/objects/structures/crates_lockers/closets/gimmick.dm
index 9c7498d22e5..c0701141d17 100644
--- a/code/game/objects/structures/crates_lockers/closets/gimmick.dm
+++ b/code/game/objects/structures/crates_lockers/closets/gimmick.dm
@@ -10,19 +10,19 @@
door_hinge_alt = 7.5
double_doors = TRUE
-/obj/structure/closet/cabinet/attackby(obj/item/W as obj, mob/user as mob)
+/obj/structure/closet/cabinet/attackby(obj/item/attacking_item, mob/user)
if(opened)
- if(istype(W, /obj/item/grab))
- var/obj/item/grab/G = W
+ if(istype(attacking_item, /obj/item/grab))
+ var/obj/item/grab/G = attacking_item
MouseDrop_T(G.affecting, user) //act like they were dragged onto the closet
return 0
- if(!W.dropsafety())
+ if(!attacking_item.dropsafety())
return
- if(W)
- user.drop_from_inventory(W,loc)
+ if(attacking_item)
+ user.drop_from_inventory(attacking_item, loc)
else
user.drop_item()
- else if(istype(W, /obj/item/stack/packageWrap))
+ else if(istype(attacking_item, /obj/item/stack/packageWrap))
return
else
attack_hand(user)
diff --git a/code/game/objects/structures/crates_lockers/closets/secure/personal.dm b/code/game/objects/structures/crates_lockers/closets/secure/personal.dm
index 3cce3dd2c7c..6ab182c5f49 100644
--- a/code/game/objects/structures/crates_lockers/closets/secure/personal.dm
+++ b/code/game/objects/structures/crates_lockers/closets/secure/personal.dm
@@ -37,19 +37,19 @@
new /obj/item/device/radio/headset(src)
new /obj/item/device/radio/headset/alt(src)
-/obj/structure/closet/secure_closet/personal/attackby(obj/item/W as obj, mob/user as mob)
+/obj/structure/closet/secure_closet/personal/attackby(obj/item/attacking_item, mob/user)
if (opened)
- if (istype(W, /obj/item/grab))
- MouseDrop_T(W:affecting, user) //act like they were dragged onto the closet
- if(W)
- user.drop_from_inventory(W,loc)
+ if (istype(attacking_item, /obj/item/grab))
+ MouseDrop_T(attacking_item:affecting, user) //act like they were dragged onto the closet
+ if(attacking_item)
+ user.drop_from_inventory(attacking_item,loc)
else
user.drop_item()
- else if(W.GetID())
+ else if(attacking_item.GetID())
if(user.loc == src)
to_chat(user, "You can't reach the lock from inside.")
return
- var/obj/item/card/id/I = W.GetID()
+ var/obj/item/card/id/I = attacking_item.GetID()
if(broken)
to_chat(user, "It appears to be broken.")
@@ -65,8 +65,8 @@
desc = "Owned by [I.registered_name]."
else
to_chat(user, "Access Denied")
- else if(istype(W, /obj/item/melee/energy/blade))
- var/obj/item/melee/energy/blade/blade = W
+ else if(istype(attacking_item, /obj/item/melee/energy/blade))
+ var/obj/item/melee/energy/blade/blade = attacking_item
if(emag_act(INFINITY, user, "The locker has been sliced open by [user] with \an [blade]!", "You hear metal being sliced and sparks flying."))
blade.spark_system.queue()
playsound(loc, 'sound/weapons/blade.ogg', 50, 1)
diff --git a/code/game/objects/structures/crates_lockers/closets/statue.dm b/code/game/objects/structures/crates_lockers/closets/statue.dm
index 37660033c98..d48e80ba044 100644
--- a/code/game/objects/structures/crates_lockers/closets/statue.dm
+++ b/code/game/objects/structures/crates_lockers/closets/statue.dm
@@ -142,11 +142,11 @@
health -= 60 / severity
check_health()
-/obj/structure/closet/statue/attackby(obj/item/I as obj, mob/user as mob)
+/obj/structure/closet/statue/attackby(obj/item/attacking_item, mob/user)
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
- health -= I.force
+ health -= attacking_item.force
user.do_attack_animation(src)
- visible_message("[user] strikes [src] with [I].")
+ visible_message("[user] strikes [src] with [attacking_item].")
check_health()
/obj/structure/closet/statue/MouseDrop_T()
diff --git a/code/game/objects/structures/crates_lockers/largecrate.dm b/code/game/objects/structures/crates_lockers/largecrate.dm
index ce963f79c79..263675176f4 100644
--- a/code/game/objects/structures/crates_lockers/largecrate.dm
+++ b/code/game/objects/structures/crates_lockers/largecrate.dm
@@ -8,8 +8,8 @@
to_chat(user, SPAN_NOTICE("You need a crowbar to pry this open!"))
return
-/obj/structure/largecrate/attackby(obj/item/W as obj, mob/user as mob)
- if(W.iscrowbar())
+/obj/structure/largecrate/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.iscrowbar())
new /obj/item/stack/material/wood(src)
var/turf/T = get_turf(src)
for(var/atom/movable/AM in contents)
diff --git a/code/game/objects/structures/crystals.dm b/code/game/objects/structures/crystals.dm
index 5bb747e5835..2005c3383a0 100644
--- a/code/game/objects/structures/crystals.dm
+++ b/code/game/objects/structures/crystals.dm
@@ -55,30 +55,30 @@
return
return ..()
-/obj/structure/reagent_crystal/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/gun/energy/plasmacutter))
- mine_crystal(user, 30 / W.toolspeed, W.usesound)
+/obj/structure/reagent_crystal/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/gun/energy/plasmacutter))
+ mine_crystal(user, 30 / attacking_item.toolspeed, attacking_item.usesound)
- else if(istype(W, /obj/item/melee/energy))
- var/obj/item/melee/energy/WT = W
+ else if(istype(attacking_item, /obj/item/melee/energy))
+ var/obj/item/melee/energy/WT = attacking_item
if(WT.active)
- mine_crystal(user, 30 / W.toolspeed, W.usesound)
+ mine_crystal(user, 30 / attacking_item.toolspeed, attacking_item.usesound)
else
- to_chat(user, SPAN_NOTICE("You need to activate \the [W] to do that!"))
+ to_chat(user, SPAN_NOTICE("You need to activate \the [attacking_item] to do that!"))
return
- else if(istype(W, /obj/item/melee/energy/blade))
- mine_crystal(user, 30 / W.toolspeed, W.usesound)
+ else if(istype(attacking_item, /obj/item/melee/energy/blade))
+ mine_crystal(user, 30 / attacking_item.toolspeed, attacking_item.usesound)
- else if(istype(W, /obj/item/pickaxe))
- var/obj/item/pickaxe/P = W
- mine_crystal(user, P.digspeed, W.usesound)
+ else if(istype(attacking_item, /obj/item/pickaxe))
+ var/obj/item/pickaxe/P = attacking_item
+ mine_crystal(user, P.digspeed, attacking_item.usesound)
- else if(W.force > 5)
+ else if(attacking_item.force > 5)
user.do_attack_animation(src)
playsound(get_turf(src), 'sound/weapons/smash.ogg', 50)
- visible_message(SPAN_WARNING("\The [user] smashes \the [W] into \the [src]."))
- take_damage(W.force * 4)
+ visible_message(SPAN_WARNING("\The [user] smashes \the [attacking_item] into \the [src]."))
+ take_damage(attacking_item.force * 4)
/obj/structure/reagent_crystal/proc/mine_crystal(var/mob/user, var/time_to_dig, var/use_sound)
if(!user)
diff --git a/code/game/objects/structures/curtains.dm b/code/game/objects/structures/curtains.dm
index 6b233207e6a..b4fb69e412e 100644
--- a/code/game/objects/structures/curtains.dm
+++ b/code/game/objects/structures/curtains.dm
@@ -39,28 +39,28 @@
if(istype(user, /mob/living/silicon/robot) && Adjacent(user)) // Robots can open/close it, but not the AI.
attack_hand(user)
-/obj/structure/curtain/attackby(obj/item/W, mob/user)
+/obj/structure/curtain/attackby(obj/item/attacking_item, mob/user)
- if(W.iswirecutter() || W.sharp && !W.noslice)
+ if(attacking_item.iswirecutter() || attacking_item.sharp && !attacking_item.noslice)
if(manipulating) return
manipulating = TRUE
visible_message(SPAN_NOTICE("[user] begins cutting down \the [src]."),
SPAN_NOTICE("You begin cutting down \the [src]."))
- if(!W.use_tool(src, user, 30, volume = 50))
+ if(!attacking_item.use_tool(src, user, 30, volume = 50))
manipulating = FALSE
return
visible_message(SPAN_NOTICE("[user] cuts down \the [src]."),
SPAN_NOTICE("You cut down \the [src]."))
dismantle()
- if(W.isscrewdriver()) //You can anchor/unanchor curtains
+ if(attacking_item.isscrewdriver()) //You can anchor/unanchor curtains
anchored = !anchored
var/obj/structure/curtain/C
for(C in src.loc)
if(C != src && C.anchored) //Can't secure more than one curtain in a tile
to_chat(user, "There is already a curtain secured here!")
return
- playsound(src.loc, W.usesound, 50, 1)
+ playsound(src.loc, attacking_item.usesound, 50, 1)
visible_message(SPAN_NOTICE("\The [src] has been [anchored ? "secured in place" : "unsecured"] by \the [user]."))
/obj/structure/curtain/proc/toggle()
diff --git a/code/game/objects/structures/displaycase.dm b/code/game/objects/structures/displaycase.dm
index 94cb40b7c9f..5992a41054c 100644
--- a/code/game/objects/structures/displaycase.dm
+++ b/code/game/objects/structures/displaycase.dm
@@ -65,13 +65,13 @@
var/image/I = image(held_obj.icon, src, held_obj.icon_state)
underlays += I
-/obj/structure/displaycase/attackby(obj/item/W, mob/user)
+/obj/structure/displaycase/attackby(obj/item/attacking_item, mob/user)
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
- if(istype(W, /obj/item/card/id))
+ if(istype(attacking_item, /obj/item/card/id))
if(destroyed)
to_chat(user, SPAN_WARNING("\The [src] has been destroyed and cannot be unlocked."))
return
- var/obj/item/card/id/ID = W
+ var/obj/item/card/id/ID = attacking_item
if(check_access(ID))
user.visible_message("[user] presses their ID against \the [src], [open ? "closing" : "opening"] it.", SPAN_NOTICE("You press your ID against \the [src], [open ? "closing" : "opening"] it."))
open = !open
@@ -79,15 +79,15 @@
else
to_chat(user, SPAN_WARNING("Access denied."))
else if(!held_obj && (destroyed || open))
- to_chat(user, SPAN_NOTICE("You set \the [W] down on \the [src]."))
- user.drop_from_inventory(W, src)
- held_obj = W
+ to_chat(user, SPAN_NOTICE("You set \the [attacking_item] down on \the [src]."))
+ user.drop_from_inventory(attacking_item, src)
+ held_obj = attacking_item
update_icon()
else
if(destroyed)
to_chat(user, SPAN_WARNING("\The [src] has already been destroyed."))
return
- health -= W.force
+ health -= attacking_item.force
health_check()
return ..()
diff --git a/code/game/objects/structures/door_assembly.dm b/code/game/objects/structures/door_assembly.dm
index 591541fb7da..c2884897781 100644
--- a/code/game/objects/structures/door_assembly.dm
+++ b/code/game/objects/structures/door_assembly.dm
@@ -85,8 +85,8 @@
bound_width = world.icon_size
bound_height = width * world.icon_size
-/obj/structure/door_assembly/attackby(obj/item/W as obj, mob/user as mob)
- if(W.ispen())
+/obj/structure/door_assembly/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.ispen())
var/door_name = sanitizeSafe(input(user, "Enter the name for the door.", src.name, src.created_name), MAX_NAME_LEN)
if(!door_name)
return
@@ -94,16 +94,16 @@
return
created_name = door_name
- else if(W.iswelder())
+ else if(attacking_item.iswelder())
if(!glass || anchored)
to_chat(user, SPAN_WARNING("\The [src] isn't ready to be welded yet. It doesn't have any installed glass to remove, and it has to be unsecured to deconstruct it."))
return
- var/obj/item/weldingtool/WT = W
+ var/obj/item/weldingtool/WT = attacking_item
if(WT.use(0, user))
playsound(src.loc, 'sound/items/welder_pry.ogg', 50, 1)
if(glass)
user.visible_message("[user] starts welding the glass panel out of the airlock assembly.", SPAN_NOTICE("You start welding the glass panel out of the airlock assembly."))
- if(W.use_tool(src, user, 40, volume = 50))
+ if(attacking_item.use_tool(src, user, 40, volume = 50))
if(!src || !WT.isOn())
return
to_chat(user, SPAN_NOTICE("You weld the glass panel out."))
@@ -111,7 +111,7 @@
glass = FALSE
else if(!anchored)
user.visible_message("[user] starts disassembling the airlock assembly.", SPAN_NOTICE("You start disassembling the airlock assembly."))
- if(W.use_tool(src, user, 40, volume = 50))
+ if(attacking_item.use_tool(src, user, 40, volume = 50))
if(!src || !WT.isOn())
return
to_chat(user, SPAN_NOTICE("You disassemble the airlock assembly."))
@@ -120,7 +120,7 @@
to_chat(user, SPAN_WARNING("You need more welding fuel."))
return
- else if(W.iswrench())
+ else if(attacking_item.iswrench())
if(state != STATE_UNWIRED)
to_chat(user, SPAN_WARNING("You have to remove the wiring before you can use the wrench on \the [src]."))
return
@@ -132,30 +132,30 @@
user.visible_message("[user] begins securing the airlock assembly to the floor.", \
SPAN_NOTICE("You start securing the airlock assembly to the floor."))
- if(W.use_tool(src, user, 40, volume = 50))
+ if(attacking_item.use_tool(src, user, 40, volume = 50))
if(!src)
return
to_chat(user, SPAN_NOTICE("You [anchored? "un" : ""]secure \the [src]."))
anchored = !anchored
- else if(W.iscoil())
+ else if(attacking_item.iscoil())
if(state > STATE_UNWIRED)
to_chat(user, SPAN_WARNING("\The [src] has already been wired."))
return
if(!anchored)
to_chat(user, SPAN_WARNING("\The [src] must be anchored before it can be wired."))
return
- var/obj/item/stack/cable_coil/C = W
+ var/obj/item/stack/cable_coil/C = attacking_item
if (C.get_amount() < 3)
to_chat(user, SPAN_WARNING("You need three lengths of coil to wire the airlock assembly."))
return
user.visible_message("[user] starts wiring the airlock assembly.", SPAN_NOTICE("You start wiring the airlock assembly."))
- if(W.use_tool(src, user, 40, volume = 50) && state == STATE_UNWIRED && anchored)
+ if(attacking_item.use_tool(src, user, 40, volume = 50) && state == STATE_UNWIRED && anchored)
if(C.use(3))
state = STATE_WIRED
to_chat(user, SPAN_NOTICE("You wire the airlock."))
- else if(W.iswirecutter())
+ else if(attacking_item.iswirecutter())
if(state == STATE_UNWIRED)
to_chat(user, SPAN_WARNING("\The [src] doesn't have any wires to remove."))
return
@@ -166,26 +166,26 @@
playsound(src.loc, 'sound/items/Wirecutter.ogg', 100, 1)
user.visible_message("[user] starts cutting the wires from the airlock assembly.", SPAN_NOTICE("You start cutting the wires from airlock assembly."))
- if(W.use_tool(src, user, 40, volume = 50))
+ if(attacking_item.use_tool(src, user, 40, volume = 50))
if(!src)
return
to_chat(user, SPAN_NOTICE("You cut the airlock wires."))
new /obj/item/stack/cable_coil(src.loc, 1)
state = STATE_UNWIRED
- else if(istype(W, /obj/item/airlock_electronics))
+ else if(istype(attacking_item, /obj/item/airlock_electronics))
if(state == STATE_UNWIRED)
to_chat(user, SPAN_WARNING("\The [src] must be wired before you can install electronics into it."))
return
else if(state > STATE_WIRED)
to_chat(user, SPAN_WARNING("\The [src] already has electronics installed."))
return
- var/obj/item/airlock_electronics/EL = W
+ var/obj/item/airlock_electronics/EL = attacking_item
if(!EL.is_installed)
playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1)
user.visible_message("[user] starts installing \the [EL] into the airlock assembly.", SPAN_NOTICE("You start installing \the [EL] into the airlock assembly."))
EL.is_installed = TRUE
- if(W.use_tool(src, user, 40, volume = 50) && state == STATE_WIRED)
+ if(attacking_item.use_tool(src, user, 40, volume = 50) && state == STATE_WIRED)
EL.is_installed = FALSE
if(!src)
return
@@ -196,7 +196,7 @@
else
EL.is_installed = FALSE
- else if(W.iscrowbar())
+ else if(attacking_item.iscrowbar())
if(state != STATE_ELECTRONICS_INSTALLED)
to_chat(user, SPAN_WARNING("\The [src] has no electronics to remove."))
return
@@ -210,7 +210,7 @@
user.visible_message("[user] starts removing the electronics from \the [src].", SPAN_NOTICE("You start removing the electronics from \the [src]."))
- if(W.use_tool(src, user, 40, volume = 50))
+ if(attacking_item.use_tool(src, user, 40, volume = 50))
if(!src)
return
to_chat(user, SPAN_NOTICE("You remove \the [electronics]."))
@@ -218,28 +218,28 @@
electronics.forceMove(src.loc)
electronics = null
- else if(istype(W, /obj/item/stack/material) && glass_type)
+ else if(istype(attacking_item, /obj/item/stack/material) && glass_type)
if(glass)
to_chat(user, SPAN_WARNING("\The [src] already has glass installed."))
return
- var/obj/item/stack/S = W
+ var/obj/item/stack/S = attacking_item
var/material_name = S.get_material_name()
if(S.get_amount() >= 2)
if(material_name == MATERIAL_GLASS_REINFORCED)
user.visible_message("[user] starts installing \the [S] into the airlock assembly.", SPAN_WARNING("You start installing \the [S] into the airlock assembly."))
- if(W.use_tool(src, user, 40, volume = 50) && !glass)
+ if(attacking_item.use_tool(src, user, 40, volume = 50) && !glass)
if(S.use(2))
to_chat(user, SPAN_NOTICE("You install reinforced glass windows into the airlock assembly."))
glass = TRUE
- else if(W.isscrewdriver())
+ else if(attacking_item.isscrewdriver())
if(state != STATE_ELECTRONICS_INSTALLED)
to_chat(user, SPAN_WARNING("\The [src] doesn't have any electronics installed."))
return
user.visible_message("[user] starts finishing \the [src].", SPAN_NOTICE("You start finishing \the [src]."))
- if(W.use_tool(src, user, 40, volume = 50))
+ if(attacking_item.use_tool(src, user, 40, volume = 50))
if(!src)
return
to_chat(user, SPAN_NOTICE("You finish the airlock!"))
@@ -250,24 +250,24 @@
new airlock_type(loc, dir, FALSE, src)
qdel(src)
- else if(istype(W, /obj/item/material/twohanded/chainsaw))
- var/obj/item/material/twohanded/chainsaw/ChainSawVar = W
+ else if(istype(attacking_item, /obj/item/material/twohanded/chainsaw))
+ var/obj/item/material/twohanded/chainsaw/ChainSawVar = attacking_item
if(!ChainSawVar.wielded)
to_chat(user, SPAN_WARNING("Cutting the airlock requires the strength of two hands."))
else if(ChainSawVar.cutting)
to_chat(user, SPAN_WARNING("You are already cutting an airlock open."))
else if(!ChainSawVar.powered)
- to_chat(user, SPAN_WARNING("\The [W] needs to be on in order to tear \the [src] apart."))
+ to_chat(user, SPAN_WARNING("\The [attacking_item] needs to be on in order to tear \the [src] apart."))
else
ChainSawVar.cutting = TRUE
user.visible_message(\
- SPAN_DANGER("[user] starts cutting \the [src] apart with \the [W]!"), \
+ SPAN_DANGER("[user] starts cutting \the [src] apart with \the [attacking_item]!"), \
SPAN_NOTICE("You start cutting \the [src] apart..."), \
SPAN_WARNING("You hear a loud buzzing sound and metal grinding on metal...") \
)
- if(do_after(user, ChainSawVar.opendelay SECONDS, user, extra_checks = CALLBACK(src, PROC_REF(CanChainsaw), W)))
+ if(do_after(user, ChainSawVar.opendelay SECONDS, user, extra_checks = CALLBACK(src, PROC_REF(CanChainsaw), attacking_item)))
user.visible_message(\
- SPAN_DANGER("[user] finishes cutting \the [src] apart with the [W]."), \
+ SPAN_DANGER("[user] finishes cutting \the [src] apart with the [attacking_item]."), \
SPAN_NOTICE("You finish cutting \the [src] apart."), \
SPAN_WARNING("You hear a metal clank and some sparks.") \
)
diff --git a/code/game/objects/structures/extinguisher.dm b/code/game/objects/structures/extinguisher.dm
index e25860f049e..bab25178488 100644
--- a/code/game/objects/structures/extinguisher.dm
+++ b/code/game/objects/structures/extinguisher.dm
@@ -40,15 +40,15 @@
pixel_x = dir & (NORTH|SOUTH) ? 0 : (dir == EAST ? 21 : 4)
pixel_y = dir & (NORTH|SOUTH) ? (dir == NORTH ? 24 : -23) : 4
-/obj/structure/extinguisher_cabinet/attackby(obj/item/O, mob/user)
+/obj/structure/extinguisher_cabinet/attackby(obj/item/attacking_item, mob/user)
if(isrobot(user))
return
- if(istype(O, /obj/item/extinguisher))
+ if(istype(attacking_item, /obj/item/extinguisher))
if(!has_extinguisher && opened)
- user.remove_from_mob(O)
- contents += O
- has_extinguisher = O
- to_chat(user, "You place [O] in [src].")
+ user.remove_from_mob(attacking_item)
+ contents += attacking_item
+ has_extinguisher = attacking_item
+ to_chat(user, "You place [attacking_item] in [src].")
playsound(src.loc, 'sound/effects/extin.ogg', 50, 0)
else
opened = !opened
diff --git a/code/game/objects/structures/fireaxe_cabinet.dm b/code/game/objects/structures/fireaxe_cabinet.dm
index c2a01c9cba2..bf498e7726b 100644
--- a/code/game/objects/structures/fireaxe_cabinet.dm
+++ b/code/game/objects/structures/fireaxe_cabinet.dm
@@ -114,25 +114,25 @@
fireaxe = null
return ..()
-/obj/structure/fireaxecabinet/attackby(var/obj/item/O, var/mob/user)
- if(O.ismultitool())
+/obj/structure/fireaxecabinet/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.ismultitool())
toggle_lock(user)
return
- if(istype(O, /obj/item/material/twohanded/fireaxe))
+ if(istype(attacking_item, /obj/item/material/twohanded/fireaxe))
if(open)
if(fireaxe)
to_chat(user, SPAN_ALERT("There is already \a [fireaxe] inside \the [src]."))
- else if(user.unEquip(O))
- O.forceMove(src)
- fireaxe = O
+ else if(user.unEquip(attacking_item))
+ attacking_item.forceMove(src)
+ fireaxe = attacking_item
to_chat(user, SPAN_NOTICE("You place \the [fireaxe] into \the [src]."))
update_icon()
return
- if(O.force)
+ if(attacking_item.force)
user.setClickCooldown(10)
- attack_generic(user, O.force, "bashes")
+ attack_generic(user, attacking_item.force, "bashes")
return
return ..()
diff --git a/code/game/objects/structures/flags_banners.dm b/code/game/objects/structures/flags_banners.dm
index 4432e264bcf..8dd09bc8aee 100644
--- a/code/game/objects/structures/flags_banners.dm
+++ b/code/game/objects/structures/flags_banners.dm
@@ -263,9 +263,9 @@
if(rip_linked && linked_flag)
linked_flag.rip(user, FALSE) // Prevents an infinite ripping loop.
-/obj/structure/sign/flag/attackby(obj/item/W, mob/user)
+/obj/structure/sign/flag/attackby(obj/item/attacking_item, mob/user)
..()
- if(W.isFlameSource())
+ if(attacking_item.isFlameSource())
visible_message(SPAN_WARNING("\The [user] starts to burn \the [src] down!"))
if(!do_after(user, 2 SECONDS, src))
return FALSE
diff --git a/code/game/objects/structures/full_window_frame.dm b/code/game/objects/structures/full_window_frame.dm
index 2fde8584026..115ff4ab822 100644
--- a/code/game/objects/structures/full_window_frame.dm
+++ b/code/game/objects/structures/full_window_frame.dm
@@ -54,20 +54,20 @@
return TRUE
return FALSE
-/obj/structure/window_frame/attackby(obj/item/W, mob/user)
- if((W.isscrewdriver()) && (istype(loc, /turf/simulated) || anchored))
+/obj/structure/window_frame/attackby(obj/item/attacking_item, mob/user)
+ if((attacking_item.isscrewdriver()) && (istype(loc, /turf/simulated) || anchored))
if(has_glass_installed)
to_chat(user, SPAN_NOTICE("You can't unfasten \the [src] if it has glass installed."))
return
if(anchored)
- if(W.use_tool(src, user, 2 SECONDS, volume = 50))
+ if(attacking_item.use_tool(src, user, 2 SECONDS, volume = 50))
anchored = FALSE
to_chat(user, SPAN_NOTICE("You unfasten \the [src]."))
update_icon()
update_nearby_icons()
return
else
- if(W.use_tool(src, user, 2 SECONDS, volume = 50))
+ if(attacking_item.use_tool(src, user, 2 SECONDS, volume = 50))
anchored = TRUE
to_chat(user, SPAN_NOTICE("You fasten \the [src]."))
dir = 2
@@ -75,14 +75,14 @@
update_nearby_icons()
return
- else if(W.iswelder())
+ else if(attacking_item.iswelder())
if(has_glass_installed)
to_chat(user, SPAN_NOTICE("You can't disassemble \the [src] if it has glass installed."))
return
if(anchored)
to_chat(user, SPAN_NOTICE("\The [src] needs to be unanchored to be able to be welded apart."))
return
- var/obj/item/weldingtool/WT = W
+ var/obj/item/weldingtool/WT = attacking_item
if(!WT.isOn())
to_chat(user, SPAN_NOTICE("\The [WT] isn't turned on."))
return
@@ -92,7 +92,7 @@
SPAN_NOTICE("You start welding \the [src] apart..."),
"You hear deconstruction."
)
- if(W.use_tool(src, user, 2 SECONDS, volume = 50))
+ if(attacking_item.use_tool(src, user, 2 SECONDS, volume = 50))
if(!src || !WT.isOn())
return
if(WT.use(0, user))
@@ -102,11 +102,11 @@
qdel(src)
return
- else if(istype(W, /obj/item/stack/material) && W.get_material_name() == MATERIAL_GLASS_REINFORCED && anchored)
+ else if(istype(attacking_item, /obj/item/stack/material) && attacking_item.get_material_name() == MATERIAL_GLASS_REINFORCED && anchored)
if(has_glass_installed)
to_chat(user, SPAN_NOTICE("\The [src] already has glass installed."))
return
- var/obj/item/stack/material/G = W
+ var/obj/item/stack/material/G = attacking_item
if(do_after(user, 2 SECONDS))
if(G.use(glass_needed))
playsound(src, 'sound/items/Deconstruct.ogg', 50, 1)
@@ -118,11 +118,11 @@
else
to_chat(user, SPAN_NOTICE("You need at least [glass_needed] sheets of [MATERIAL_GLASS_REINFORCED] to install a window in \the [src]."))
- else if(istype(W, /obj/item/stack/material) && W.get_material_name() == MATERIAL_GLASS_REINFORCED_PHORON && anchored)
+ else if(istype(attacking_item, /obj/item/stack/material) && attacking_item.get_material_name() == MATERIAL_GLASS_REINFORCED_PHORON && anchored)
if(has_glass_installed)
to_chat(user, SPAN_NOTICE("\The [src] already has glass installed."))
return
- var/obj/item/stack/material/G = W
+ var/obj/item/stack/material/G = attacking_item
if(do_after(user, 2 SECONDS))
if(G.use(glass_needed))
playsound(src, 'sound/items/Deconstruct.ogg', 50, 1)
diff --git a/code/game/objects/structures/girders.dm b/code/game/objects/structures/girders.dm
index 0be32dee5f3..8ea8209328c 100644
--- a/code/game/objects/structures/girders.dm
+++ b/code/game/objects/structures/girders.dm
@@ -72,36 +72,36 @@
if(reinf_material)
reinforce_girder()
-/obj/structure/girder/attackby(obj/item/W as obj, mob/user as mob)
- if(W.iswrench() && state == 0)
+/obj/structure/girder/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.iswrench() && state == 0)
if(anchored && !reinf_material)
to_chat(user, "Now disassembling the girder...")
- if(W.use_tool(src, user, 40, volume = 50))
+ if(attacking_item.use_tool(src, user, 40, volume = 50))
if(!src) return
to_chat(user, "You dissasembled the girder!")
dismantle()
else if(!anchored)
to_chat(user, "Now securing the girder...")
- if(W.use_tool(src, user, 40, volume = 50))
+ if(attacking_item.use_tool(src, user, 40, volume = 50))
to_chat(user, "You secured the girder!")
reset_girder()
- else if(istype(W, /obj/item/gun/energy/plasmacutter))
- var/obj/item/gun/energy/plasmacutter/PC = W
+ else if(istype(attacking_item, /obj/item/gun/energy/plasmacutter))
+ var/obj/item/gun/energy/plasmacutter/PC = attacking_item
to_chat(user, SPAN_NOTICE("You start lining up \the [PC] to the joints of \the [src]..."))
if(do_after(user, 2 SECONDS))
if(!src)
return
playsound(loc, PC.fire_sound, 100, 1)
to_chat(user, SPAN_NOTICE("You blast apart the girder!"))
- W.use_resource(user, 1)
+ attacking_item.use_resource(user, 1)
dismantle()
- else if(istype(W, /obj/item/melee/energy))
- var/obj/item/melee/energy/WT = W
+ else if(istype(attacking_item, /obj/item/melee/energy))
+ var/obj/item/melee/energy/WT = attacking_item
if(WT.active)
to_chat(user, "Now slicing apart the girder...")
- if(W.use_tool(src, user, 30, volume = 50))
+ if(attacking_item.use_tool(src, user, 30, volume = 50))
if(!src) return
to_chat(user, "You slice apart the girder!")
dismantle()
@@ -109,15 +109,15 @@
to_chat(user, "You need to activate the weapon to do that!")
return
- else if(istype(W, /obj/item/melee/energy/blade))
+ else if(istype(attacking_item, /obj/item/melee/energy/blade))
to_chat(user, "Now slicing apart the girder...")
- if(W.use_tool(src, user, 30, volume = 50))
+ if(attacking_item.use_tool(src, user, 30, volume = 50))
if(!src) return
to_chat(user, "You slice apart the girder!")
dismantle()
- else if(istype(W, /obj/item/melee/chainsword))
- var/obj/item/melee/chainsword/WT = W
+ else if(istype(attacking_item, /obj/item/melee/chainsword))
+ var/obj/item/melee/chainsword/WT = attacking_item
if(WT.active)
to_chat(user, "Now slicing apart the girder...")
if(WT.use_tool(src, user, 60, volume = 50))
@@ -128,11 +128,11 @@
to_chat(user, "You need to activate the weapon to do that!")
return
- else if(istype(W, /obj/item/pickaxe/diamonddrill))
+ else if(istype(attacking_item, /obj/item/pickaxe/diamonddrill))
to_chat(user, "You drill through the girder!")
dismantle()
- else if(istype(W, /obj/item/melee/arm_blade/))
+ else if(istype(attacking_item, /obj/item/melee/arm_blade/))
to_chat(user, "Now slicing apart the girder...")
if(do_after(user,150))
if(!src)
@@ -140,31 +140,31 @@
to_chat(user, "You slice apart the girder!")
dismantle()
- else if(W.isscrewdriver())
+ else if(attacking_item.isscrewdriver())
if(state == 2)
to_chat(user, "Now unsecuring support struts...")
- if(W.use_tool(src, user, 40, volume = 50))
+ if(attacking_item.use_tool(src, user, 40, volume = 50))
if(!src)
return
to_chat(user, "You unsecured the support struts!")
state = 1
else if(anchored && !reinf_material)
- playsound(src.loc, W.usesound, 50, 1)
+ playsound(src.loc, attacking_item.usesound, 50, 1)
reinforcing = !reinforcing
to_chat(user, "\The [src] can now be [reinforcing? "reinforced" : "constructed"]!")
return
- else if(W.iswirecutter() && state == 1)
+ else if(attacking_item.iswirecutter() && state == 1)
to_chat(user, "Now removing support struts...")
- if(W.use_tool(src, user, 40, volume = 50))
+ if(attacking_item.use_tool(src, user, 40, volume = 50))
if(!src) return
to_chat(user, "You removed the support struts!")
reinf_material = null
reset_girder()
- else if(W.iscrowbar() && state == 0 && anchored)
+ else if(attacking_item.iscrowbar() && state == 0 && anchored)
to_chat(user, "Now dislodging the girder...")
- if(W.use_tool(src, user, 40, volume = 50))
+ if(attacking_item.use_tool(src, user, 40, volume = 50))
if(!src) return
to_chat(user, "You dislodged the girder!")
icon_state = "displaced"
@@ -172,16 +172,16 @@
health = 50
cover = 25
- else if(istype(W, /obj/item/stack/material))
+ else if(istype(attacking_item, /obj/item/stack/material))
if(reinforcing && !reinf_material)
- if(!reinforce_with_material(W, user))
+ if(!reinforce_with_material(attacking_item, user))
return ..()
else
- if(!construct_wall(W, user))
+ if(!construct_wall(attacking_item, user))
return ..()
- else if(W.force)
- var/damage_to_deal = W.force
+ else if(attacking_item.force)
+ var/damage_to_deal = attacking_item.force
var/weaken = 0
if(reinf_material)
weaken += reinf_material.integrity * 3 //Since girders don't have a secondary material, buff 'em up a bit.
@@ -190,10 +190,10 @@
playsound(src, 'sound/weapons/smash.ogg', 50)
if(damage_to_deal > weaken && (damage_to_deal > MIN_DAMAGE_TO_HIT))
damage_to_deal -= weaken
- visible_message("[user] strikes \the [src] with \the [W], [is_sharp(W) ? "slicing" : "denting"] a support rod!")
+ visible_message("[user] strikes \the [src] with \the [attacking_item], [is_sharp(attacking_item) ? "slicing" : "denting"] a support rod!")
take_damage(damage_to_deal)
else
- visible_message("[user] strikes \the [src] with \the [W], but it bounces off!")
+ visible_message("[user] strikes \the [src] with \the [attacking_item], but it bounces off!")
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
return
@@ -325,43 +325,43 @@
new /obj/effect/decal/remains/human(get_turf(src))
qdel(src)
-/obj/structure/girder/cult/attackby(obj/item/W as obj, mob/user as mob)
- if(W.iswrench())
+/obj/structure/girder/cult/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.iswrench())
to_chat(user, "Now disassembling the girder...")
- if(W.use_tool(src, user, 40, volume = 50))
+ if(attacking_item.use_tool(src, user, 40, volume = 50))
to_chat(user, "You dissasembled the girder!")
dismantle()
- else if(istype(W, /obj/item/gun/energy/plasmacutter))
+ else if(istype(attacking_item, /obj/item/gun/energy/plasmacutter))
to_chat(user, "Now slicing apart the girder...")
- if(W.use_tool(src, user, 30, volume = 50))
+ if(attacking_item.use_tool(src, user, 30, volume = 50))
to_chat(user, "You slice apart the girder!")
dismantle()
- else if(istype(W, /obj/item/pickaxe/diamonddrill))
+ else if(istype(attacking_item, /obj/item/pickaxe/diamonddrill))
to_chat(user, "You drill through the girder!")
new /obj/effect/decal/remains/human(get_turf(src))
dismantle()
- else if(istype(W, /obj/item/melee/energy))
- var/obj/item/melee/energy/WT = W
+ else if(istype(attacking_item, /obj/item/melee/energy))
+ var/obj/item/melee/energy/WT = attacking_item
if(WT.active)
to_chat(user, "Now slicing apart the girder...")
- if(W.use_tool(src, user, 30, volume = 50))
+ if(attacking_item.use_tool(src, user, 30, volume = 50))
to_chat(user, "You slice apart the girder!")
dismantle()
else
to_chat(user, "You need to activate the weapon to do that!")
return
- else if(istype(W, /obj/item/melee/energy/blade))
+ else if(istype(attacking_item, /obj/item/melee/energy/blade))
to_chat(user, "Now slicing apart the girder...")
- if(W.use_tool(src, user, 30, volume = 50))
+ if(attacking_item.use_tool(src, user, 30, volume = 50))
to_chat(user, "You slice apart the girder!")
dismantle()
- else if(istype(W, /obj/item/melee/chainsword))
- var/obj/item/melee/chainsword/WT = W
+ else if(istype(attacking_item, /obj/item/melee/chainsword))
+ var/obj/item/melee/chainsword/WT = attacking_item
if(WT.active)
to_chat(user, "Now slicing apart the girder...")
if(WT.use_tool(src, user, 60, volume = 50))
diff --git a/code/game/objects/structures/gore/core.dm b/code/game/objects/structures/gore/core.dm
index 95c511fbc82..fa9823aa4a4 100644
--- a/code/game/objects/structures/gore/core.dm
+++ b/code/game/objects/structures/gore/core.dm
@@ -66,11 +66,11 @@
/obj/structure/gore/attack_generic()
attack_hand(usr)
-/obj/structure/gore/attackby(obj/item/W, mob/user)
+/obj/structure/gore/attackby(obj/item/attacking_item, mob/user)
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
- user.do_attack_animation(src, W)
- var/force_damage = W.force
- if(W.damtype == DAMAGE_BURN)
+ user.do_attack_animation(src, attacking_item)
+ var/force_damage = attacking_item.force
+ if(attacking_item.damtype == DAMAGE_BURN)
force_damage *= 1.25
health -= force_damage
playsound(loc, 'sound/effects/attackblob.ogg', 80, TRUE)
diff --git a/code/game/objects/structures/gore/nest.dm b/code/game/objects/structures/gore/nest.dm
index 32aec2a9d9d..098da1e2df9 100644
--- a/code/game/objects/structures/gore/nest.dm
+++ b/code/game/objects/structures/gore/nest.dm
@@ -50,11 +50,11 @@
buck.old_y = 0
unbuckle()
-/obj/structure/bed/nest/attackby(obj/item/W, mob/user)
+/obj/structure/bed/nest/attackby(obj/item/attacking_item, mob/user)
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
- user.do_attack_animation(src, W)
- var/force_damage = W.force
- if(W.damtype == DAMAGE_BURN)
+ user.do_attack_animation(src, attacking_item)
+ var/force_damage = attacking_item.force
+ if(attacking_item.damtype == DAMAGE_BURN)
force_damage *= 1.25
health -= force_damage
playsound(loc, 'sound/effects/attackblob.ogg', 80, TRUE)
diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm
index 8cec894e2d8..e8974f14693 100644
--- a/code/game/objects/structures/grille.dm
+++ b/code/game/objects/structures/grille.dm
@@ -139,30 +139,30 @@
src.health -= damage*0.2
spawn(0) healthcheck() //spawn to make sure we return properly if the grille is deleted
-/obj/structure/grille/attackby(obj/item/W, mob/user)
- if(W.iswirecutter())
+/obj/structure/grille/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.iswirecutter())
if(!shock(user, 100))
playsound(loc, 'sound/items/Wirecutter.ogg', 100, 1)
new /obj/item/stack/rods(get_turf(src), destroyed ? 1 : 2)
qdel(src)
- else if(istype(W, /obj/item/gun/energy/plasmacutter))
- var/obj/item/gun/energy/plasmacutter/PC = W
+ else if(istype(attacking_item, /obj/item/gun/energy/plasmacutter))
+ var/obj/item/gun/energy/plasmacutter/PC = attacking_item
if(PC.check_power_and_message(user))
return
PC.use_resource(user, 1)
playsound(loc, PC.fire_sound, 100, TRUE)
new /obj/item/stack/rods(get_turf(src), destroyed ? 1 : 2)
qdel(src)
- else if((W.isscrewdriver()) && (istype(loc, /turf/simulated) || anchored))
+ else if((attacking_item.isscrewdriver()) && (istype(loc, /turf/simulated) || anchored))
if(!shock(user, 90))
playsound(loc, 'sound/items/Screwdriver.ogg', 100, 1)
anchored = !anchored
user.visible_message("[user] [anchored ? "fastens" : "unfastens"] the grille.", \
"You have [anchored ? "fastened the grille to" : "unfastened the grill from"] the floor.")
return
- else if(istype(W,/obj/item/stack/rods) && destroyed == 1)
+ else if(istype(attacking_item,/obj/item/stack/rods) && destroyed == 1)
if(!shock(user, 90))
- var/obj/item/stack/rods/ROD = W
+ var/obj/item/stack/rods/ROD = attacking_item
health = 10
density = 1
destroyed = 0
@@ -173,8 +173,8 @@
return
//window placing begin //TODO CONVERT PROPERLY TO MATERIAL DATUM
- else if(istype(W,/obj/item/stack/material))
- var/obj/item/stack/material/ST = W
+ else if(istype(attacking_item,/obj/item/stack/material))
+ var/obj/item/stack/material/ST = attacking_item
if(!ST.material.created_window)
return 0
@@ -215,15 +215,15 @@
return
//window placing end
- else if(!(W.obj_flags & OBJ_FLAG_CONDUCTABLE) || !shock(user, 70))
+ else if(!(attacking_item.obj_flags & OBJ_FLAG_CONDUCTABLE) || !shock(user, 70))
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
user.do_attack_animation(src)
playsound(loc, 'sound/effects/grillehit.ogg', 80, 1)
- switch(W.damtype)
+ switch(attacking_item.damtype)
if("fire")
- health -= W.force
+ health -= attacking_item.force
if("brute")
- health -= W.force * 0.1
+ health -= attacking_item.force * 0.1
healthcheck()
..()
return
diff --git a/code/game/objects/structures/hadii_statue.dm b/code/game/objects/structures/hadii_statue.dm
index 20edfd79e61..eeecf4a7460 100644
--- a/code/game/objects/structures/hadii_statue.dm
+++ b/code/game/objects/structures/hadii_statue.dm
@@ -44,16 +44,16 @@
toppled = TRUE
update_icon()
-/obj/structure/hadii_statue/attackby(obj/item/W, mob/user)
+/obj/structure/hadii_statue/attackby(obj/item/attacking_item, mob/user)
if(toppled)
return
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
user.do_attack_animation(src)
- if(W.force <= 15)
- visible_message(SPAN_WARNING("\The [W] bounces off \the [src]!"))
+ if(attacking_item.force <= 15)
+ visible_message(SPAN_WARNING("\The [attacking_item] bounces off \the [src]!"))
return
- visible_message(SPAN_WARNING("\The [user] strikes \the [src] with \the [W]!"))
- do_integrity_check(W.force)
+ visible_message(SPAN_WARNING("\The [user] strikes \the [src] with \the [attacking_item]!"))
+ do_integrity_check(attacking_item.force)
/obj/structure/hadii_statue/proc/do_integrity_check(damage)
if(toppled)
diff --git a/code/game/objects/structures/inflatable.dm b/code/game/objects/structures/inflatable.dm
index bc3019a8cf9..021112f30ff 100644
--- a/code/game/objects/structures/inflatable.dm
+++ b/code/game/objects/structures/inflatable.dm
@@ -96,17 +96,17 @@
add_fingerprint(user)
return
-/obj/structure/inflatable/attackby(obj/item/W, mob/user)
- if(!istype(W) || istype(W, /obj/item/inflatable_dispenser))
+/obj/structure/inflatable/attackby(obj/item/attacking_item, mob/user)
+ if(!istype(attacking_item) || istype(attacking_item, /obj/item/inflatable_dispenser))
return
if(deflating)
return
- if(W.can_puncture())
- user.visible_message(SPAN_DANGER("[user] pierces \the [src] with \the [W]!"), SPAN_WARNING("You pierce \the [src] with \the [W]!"))
+ if(attacking_item.can_puncture())
+ user.visible_message(SPAN_DANGER("[user] pierces \the [src] with \the [attacking_item]!"), SPAN_WARNING("You pierce \the [src] with \the [attacking_item]!"))
deflate(TRUE)
- else if(W.damtype == DAMAGE_BRUTE || W.damtype == DAMAGE_BURN)
- hit(W.force)
+ else if(attacking_item.damtype == DAMAGE_BRUTE || attacking_item.damtype == DAMAGE_BURN)
+ hit(attacking_item.force)
..()
/obj/structure/inflatable/proc/hit(var/damage, var/sound_effect = TRUE)
diff --git a/code/game/objects/structures/janicart.dm b/code/game/objects/structures/janicart.dm
index c448097d4e1..a4b1682c29a 100644
--- a/code/game/objects/structures/janicart.dm
+++ b/code/game/objects/structures/janicart.dm
@@ -133,67 +133,67 @@
return mybag.attackby(I, usr)
-/obj/structure/janitorialcart/attackby(obj/item/I, mob/user)
- if(istype(I, /obj/item/mop) || istype(I, /obj/item/reagent_containers/glass/rag) || istype(I, /obj/item/soap))
+/obj/structure/janitorialcart/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/mop) || istype(attacking_item, /obj/item/reagent_containers/glass/rag) || istype(attacking_item, /obj/item/soap))
if (mybucket)
- if(I.reagents.total_volume < I.reagents.maximum_volume)
+ if(attacking_item.reagents.total_volume < attacking_item.reagents.maximum_volume)
if(mybucket.reagents.total_volume < 1)
to_chat(user, "[mybucket] is empty!")
update_icon()
else
- mybucket.reagents.trans_to_obj(I, 5) //
- to_chat(user, "You wet [I] in [mybucket].")
+ mybucket.reagents.trans_to_obj(attacking_item, 5) //
+ to_chat(user, "You wet [attacking_item] in [mybucket].")
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
update_icon()
else
- to_chat(user, "[I] can't absorb anymore liquid!")
+ to_chat(user, "[attacking_item] can't absorb anymore liquid!")
else
- to_chat(user, "There is no bucket mounted here to dip [I] into!")
+ to_chat(user, "There is no bucket mounted here to dip [attacking_item] into!")
return 1
- else if(istype(I, /obj/item/reagent_containers/spray) && !myspray)
- user.drop_from_inventory(I,src)
- myspray = I
+ else if(istype(attacking_item, /obj/item/reagent_containers/spray) && !myspray)
+ user.drop_from_inventory(attacking_item, src)
+ myspray = attacking_item
update_icon()
updateUsrDialog()
- to_chat(user, "You put [I] into [src].")
+ to_chat(user, "You put [attacking_item] into [src].")
return 1
- else if(istype(I, /obj/item/device/lightreplacer) && !myreplacer)
- user.drop_from_inventory(I,src)
- myreplacer = I
+ else if(istype(attacking_item, /obj/item/device/lightreplacer) && !myreplacer)
+ user.drop_from_inventory(attacking_item, src)
+ myreplacer = attacking_item
update_icon()
updateUsrDialog()
- to_chat(user, "You put [I] into [src].")
+ to_chat(user, "You put [attacking_item] into [src].")
return 1
- else if(istype(I, /obj/item/storage/bag/trash) && !mybag)
- user.drop_from_inventory(I,src)
- mybag = I
- I.forceMove(src)
+ else if(istype(attacking_item, /obj/item/storage/bag/trash) && !mybag)
+ user.drop_from_inventory(attacking_item, src)
+ mybag = attacking_item
+ attacking_item.forceMove(src)
update_icon()
updateUsrDialog()
- to_chat(user, "You put [I] into [src].")
+ to_chat(user, "You put [attacking_item] into [src].")
return 1
- else if(istype(I, /obj/item/clothing/suit/caution))
+ else if(istype(attacking_item, /obj/item/clothing/suit/caution))
if(signs < 4)
- user.drop_from_inventory(I,src)
+ user.drop_from_inventory(attacking_item, src)
signs++
update_icon()
updateUsrDialog()
- to_chat(user, "You put [I] into [src].")
+ to_chat(user, "You put [attacking_item] into [src].")
else
to_chat(user, "[src] can't hold any more signs.")
return 1
else if(mybag)
- return mybag.attackby(I, user)
+ return mybag.attackby(attacking_item, user)
//This return will prevent afterattack from executing if the object goes into the trashbag,
//This prevents dumb stuff like splashing the cart with the contents of a container, after putting said container into trash
- else if (!has_items && (I.iswrench() || I.iswelder() || istype(I, /obj/item/gun/energy/plasmacutter)))
- take_apart(user, I)
+ else if (!has_items && (attacking_item.iswrench() || attacking_item.iswelder() || istype(attacking_item, /obj/item/gun/energy/plasmacutter)))
+ take_apart(user, attacking_item)
return
..()
diff --git a/code/game/objects/structures/kitchen_spike.dm b/code/game/objects/structures/kitchen_spike.dm
index d2a6291cac4..cc3167664ec 100644
--- a/code/game/objects/structures/kitchen_spike.dm
+++ b/code/game/objects/structures/kitchen_spike.dm
@@ -12,8 +12,9 @@
var/meat_type
var/victim_name = "corpse"
-/obj/structure/kitchenspike/attackby(obj/item/grab/G as obj, mob/user as mob)
- if(!istype(G, /obj/item/grab) || !G.affecting)
+/obj/structure/kitchenspike/attackby(obj/item/attacking_item, mob/user)
+ var/obj/item/grab/G = attacking_item
+ if(!istype(G) || !G.affecting)
return
if(occupied)
to_chat(user, SPAN_DANGER("The spike already has something on it, finish collecting its meat first!"))
diff --git a/code/game/objects/structures/lattice.dm b/code/game/objects/structures/lattice.dm
index 7b5289d6bdc..ca4f4a0dccc 100644
--- a/code/game/objects/structures/lattice.dm
+++ b/code/game/objects/structures/lattice.dm
@@ -49,19 +49,19 @@
qdel(src)
return
-/obj/structure/lattice/attackby(obj/item/C, mob/user)
- if (istype(C, /obj/item/stack/tile/floor))
+/obj/structure/lattice/attackby(obj/item/attacking_item, mob/user)
+ if (istype(attacking_item, /obj/item/stack/tile/floor))
var/turf/T = get_turf(src)
- T.attackby(C, user) //BubbleWrap - hand this off to the underlying turf instead
+ T.attackby(attacking_item, user) //BubbleWrap - hand this off to the underlying turf instead
return
- if (C.iswelder())
- var/obj/item/weldingtool/WT = C
+ if (attacking_item.iswelder())
+ var/obj/item/weldingtool/WT = attacking_item
if(WT.use(1, user))
to_chat(user, "Slicing lattice joints ...")
new /obj/item/stack/rods(src.loc)
qdel(src)
- if (istype(C, /obj/item/stack/rods))
- var/obj/item/stack/rods/R = C
+ if (istype(attacking_item, /obj/item/stack/rods))
+ var/obj/item/stack/rods/R = attacking_item
if (R.use(2))
to_chat(user, "Constructing catwalk ...")
playsound(src, 'sound/weapons/Genhit.ogg', 50, 1)
@@ -87,22 +87,22 @@
can_be_unanchored = TRUE
layer = 2.7 // Above wires.
-/obj/structure/lattice/catwalk/attackby(obj/item/C, mob/user)
- if(C.iswelder())
- var/obj/item/weldingtool/WT = C
+/obj/structure/lattice/catwalk/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.iswelder())
+ var/obj/item/weldingtool/WT = attacking_item
if(!WT.use(1, user))
to_chat(user, SPAN_WARNING("You need more welding fuel to complete this task."))
return
- if(C.use_tool(src, user, 5, volume = 50))
+ if(attacking_item.use_tool(src, user, 5, volume = 50))
to_chat(user, SPAN_NOTICE("You slice apart [src]."))
var/obj/item/stack/rods/R = new /obj/item/stack/rods(get_turf(src))
R.amount = return_amount
R.update_icon()
qdel(src)
-/obj/structure/lattice/catwalk/indoor/attackby(obj/item/C, mob/user)
- if(C.isscrewdriver())
- if(C.use_tool(src, user, 5, volume = 50))
+/obj/structure/lattice/catwalk/indoor/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.isscrewdriver())
+ if(attacking_item.use_tool(src, user, 5, volume = 50))
anchored = !anchored
to_chat(user, SPAN_NOTICE("You [anchored ? "" : "un"]anchor [src]."))
SSicon_smooth.add_to_queue(src)
@@ -127,10 +127,10 @@
var/base_icon_state = "grate"
var/damaged = FALSE
-/obj/structure/lattice/catwalk/indoor/grate/attackby(obj/item/C, mob/user)
- if(C.iswelder() && damaged)
- var/obj/item/weldingtool/WT = C
- if(C.use_tool(src, user, 5, volume = 50) && WT.use(1, user))
+/obj/structure/lattice/catwalk/indoor/grate/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.iswelder() && damaged)
+ var/obj/item/weldingtool/WT = attacking_item
+ if(attacking_item.use_tool(src, user, 5, volume = 50) && WT.use(1, user))
user.visible_message(
SPAN_NOTICE("\The [user] slices apart \the [src], leaving nothing useful behind."),
SPAN_NOTICE("You slice apart \the [src], leaving nothing useful behind."),
diff --git a/code/game/objects/structures/mirror.dm b/code/game/objects/structures/mirror.dm
index 041537b8902..cadd924a155 100644
--- a/code/game/objects/structures/mirror.dm
+++ b/code/game/objects/structures/mirror.dm
@@ -65,16 +65,16 @@
playsound(src, 'sound/effects/hit_on_shattered_glass.ogg', 70, 1)
..()
-/obj/structure/mirror/attackby(obj/item/I as obj, mob/user as mob)
+/obj/structure/mirror/attackby(obj/item/attacking_item, mob/user)
if(shattered)
playsound(src.loc, 'sound/effects/hit_on_shattered_glass.ogg', 70, 1)
return
- if(prob(I.force * 2))
- visible_message("[user] smashes [src] with [I]!")
+ if(prob(attacking_item.force * 2))
+ visible_message("[user] smashes [src] with [attacking_item]!")
shatter()
else
- visible_message("[user] hits [src] with [I]!")
+ visible_message("[user] hits [src] with [attacking_item]!")
playsound(src.loc, 'sound/effects/glass_hit.ogg', 70, 1)
/obj/structure/mirror/attack_generic(var/mob/user, var/damage)
diff --git a/code/game/objects/structures/mop_bucket.dm b/code/game/objects/structures/mop_bucket.dm
index 0248b6486f9..2cc37cf68d9 100644
--- a/code/game/objects/structures/mop_bucket.dm
+++ b/code/game/objects/structures/mop_bucket.dm
@@ -23,13 +23,13 @@
if(distance <= 1)
. += "It contains [reagents.total_volume] unit\s of water."
-/obj/structure/mopbucket/attackby(obj/item/I, mob/user)
- if(istype(I, /obj/item/mop))
+/obj/structure/mopbucket/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/mop))
if(reagents.total_volume < 1)
to_chat(user, "\The [src] is out of water!")
else
- reagents.trans_to_obj(I, 5)
- to_chat(user, "You wet \the [I] in \the [src].")
+ reagents.trans_to_obj(attacking_item, 5)
+ to_chat(user, "You wet \the [attacking_item] in \the [src].")
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
return ..()
update_icon()
diff --git a/code/game/objects/structures/morgue.dm b/code/game/objects/structures/morgue.dm
index 1d05a12eba7..bc0946f51f2 100644
--- a/code/game/objects/structures/morgue.dm
+++ b/code/game/objects/structures/morgue.dm
@@ -92,10 +92,10 @@
return attack_hand(user)
else return ..()
-/obj/structure/morgue/attackby(obj/P, mob/user)
- if(P.ispen())
+/obj/structure/morgue/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.ispen())
var/t = tgui_input_text(user, "What would you like the label to be?", "Morgue", "", MAX_NAME_LEN)
- if(user.get_active_hand() != P)
+ if(user.get_active_hand() != attacking_item)
return
if((!in_range(src, usr) > 1 && src.loc != user))
return
diff --git a/code/game/objects/structures/noticeboard.dm b/code/game/objects/structures/noticeboard.dm
index 8e9802f116e..1d26a17a3e4 100644
--- a/code/game/objects/structures/noticeboard.dm
+++ b/code/game/objects/structures/noticeboard.dm
@@ -17,12 +17,12 @@
icon_state = "nboard0[notices]"
//attaching papers!!
-/obj/structure/noticeboard/attackby(var/obj/item/O as obj, var/mob/user as mob)
- if(istype(O, /obj/item/paper))
+/obj/structure/noticeboard/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/paper))
if(notices < 5)
- O.add_fingerprint(user)
+ attacking_item.add_fingerprint(user)
add_fingerprint(user)
- user.drop_from_inventory(O,src)
+ user.drop_from_inventory(attacking_item,src)
notices++
icon_state = "nboard0[notices]" //update sprite
to_chat(user, "You pin the paper to the noticeboard.")
diff --git a/code/game/objects/structures/plasticflaps.dm b/code/game/objects/structures/plasticflaps.dm
index 4ba9e654f82..aa18b97fb5e 100644
--- a/code/game/objects/structures/plasticflaps.dm
+++ b/code/game/objects/structures/plasticflaps.dm
@@ -89,13 +89,13 @@
if (prob(5))
qdel(src)
-/obj/structure/plasticflaps/attackby(obj/item/W, mob/user)
+/obj/structure/plasticflaps/attackby(obj/item/attacking_item, mob/user)
if(manipulating) return
- if(W.iswirecutter() || W.sharp && !W.noslice)
+ if(attacking_item.iswirecutter() || attacking_item.sharp && !attacking_item.noslice)
manipulating = TRUE
visible_message(SPAN_NOTICE("[user] begins cutting down \the [src]."),
SPAN_NOTICE("You begin cutting down \the [src]."))
- if(!W.use_tool(src, user, 30, volume = 50))
+ if(!attacking_item.use_tool(src, user, 30, volume = 50))
manipulating = FALSE
return
visible_message(SPAN_NOTICE("[user] cuts down \the [src]."), SPAN_NOTICE("You cut down \the [src]."))
diff --git a/code/game/objects/structures/railing.dm b/code/game/objects/structures/railing.dm
index 9ff031cf8fd..752b0630ca5 100644
--- a/code/game/objects/structures/railing.dm
+++ b/code/game/objects/structures/railing.dm
@@ -198,10 +198,10 @@
return FALSE
return TRUE
-/obj/structure/railing/attackby(var/obj/item/W, var/mob/user)
+/obj/structure/railing/attackby(obj/item/attacking_item, mob/user)
// Handle harm intent grabbing/tabling.
- if(istype(W, /obj/item/grab) && user.Adjacent(src))
- var/obj/item/grab/G = W
+ if(istype(attacking_item, /obj/item/grab) && user.Adjacent(src))
+ var/obj/item/grab/G = attacking_item
if(ishuman(G.affecting))
var/obj/occupied = turf_is_crowded(TRUE)
if(occupied)
@@ -225,10 +225,10 @@
return
// Dismantle
- if(W.iswrench())
+ if(attacking_item.iswrench())
if(!anchored)
user.visible_message(SPAN_NOTICE("\The [user] starts dismantling \the [src]..."), SPAN_NOTICE("You start dismantling \the [src]..."))
- if(W.use_tool(src, user, 20, volume = 50))
+ if(attacking_item.use_tool(src, user, 20, volume = 50))
if(anchored)
return
user.visible_message(SPAN_NOTICE("\The [user] dismantles \the [src]."), SPAN_NOTICE("You dismantle \the [src]."))
@@ -237,7 +237,7 @@
return
// Wrench Open
else
- playsound(get_turf(src), W.usesound, 50, TRUE)
+ playsound(get_turf(src), attacking_item.usesound, 50, TRUE)
if(density)
user.visible_message(SPAN_NOTICE("\The [user] wrenches \the [src] open."), SPAN_NOTICE("You wrench \the [src] open."))
density = FALSE
@@ -247,13 +247,13 @@
update_icon()
return
// Repair
- if(W.iswelder())
- var/obj/item/weldingtool/F = W
+ if(attacking_item.iswelder())
+ var/obj/item/weldingtool/F = attacking_item
if(F.isOn())
if(health >= maxhealth)
to_chat(user, SPAN_WARNING("\The [src] does not need repairs."))
return
- playsound(get_turf(src), W.usesound, 50, TRUE)
+ playsound(get_turf(src), attacking_item.usesound, 50, TRUE)
if(do_after(user, 20, src))
if(health >= maxhealth)
return
@@ -262,22 +262,22 @@
return
// Install
- if(W.isscrewdriver())
+ if(attacking_item.isscrewdriver())
if(!density)
to_chat(user, SPAN_NOTICE("You need to wrench \the [src] from back into place first."))
return
user.visible_message(anchored ? "\The [user] begins unscrewing \the [src]." : "\The [user] begins fastening \the [src]." )
- playsound(get_turf(src), W.usesound, 75, TRUE)
+ playsound(get_turf(src), attacking_item.usesound, 75, TRUE)
if(do_after(user, 10, src) && density)
to_chat(user, (anchored ? "You have unfastened \the [src] from the floor." : "You have fastened \the [src] to the floor."))
anchored = !anchored
update_icon()
return
- if(W.force && (W.damtype == DAMAGE_BURN || W.damtype == DAMAGE_BRUTE))
+ if(attacking_item.force && (attacking_item.damtype == DAMAGE_BURN || attacking_item.damtype == DAMAGE_BRUTE))
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
- visible_message(SPAN_WARNING("\The [src] has been [LAZYLEN(W.attack_verb) ? pick(W.attack_verb) : "attacked"] with \the [W] by \the [user]!"))
- take_damage(W.force)
+ visible_message(SPAN_WARNING("\The [src] has been [LAZYLEN(attacking_item.attack_verb) ? pick(attacking_item.attack_verb) : "attacked"] with \the [attacking_item] by \the [user]!"))
+ take_damage(attacking_item.force)
return
. = ..()
diff --git a/code/game/objects/structures/safe.dm b/code/game/objects/structures/safe.dm
index d7a6b1e7323..3fab4824e8c 100644
--- a/code/game/objects/structures/safe.dm
+++ b/code/game/objects/structures/safe.dm
@@ -215,29 +215,29 @@ FLOOR SAFES
updateUsrDialog()
-/obj/structure/safe/attackby(obj/item/I as obj, mob/user as mob)
+/obj/structure/safe/attackby(obj/item/attacking_item, mob/user)
if(open)
- if(I.w_class + space <= maxspace)
- space += I.w_class
- user.drop_from_inventory(I,src)
- to_chat(user, SPAN_NOTICE("You put [I] in [src]."))
+ if(attacking_item.w_class + space <= maxspace)
+ space += attacking_item.w_class
+ user.drop_from_inventory(attacking_item, src)
+ to_chat(user, SPAN_NOTICE("You put [attacking_item] in [src]."))
updateUsrDialog()
return
else
- to_chat(user, SPAN_NOTICE("[I] won't fit in [src]."))
+ to_chat(user, SPAN_NOTICE("[attacking_item] won't fit in [src]."))
return
else
- if(istype(I, /obj/item/clothing/accessory/stethoscope))
+ if(istype(attacking_item, /obj/item/clothing/accessory/stethoscope))
attack_hand(user)
- else if(istype(I, /obj/item/thermal_drill))
+ else if(istype(attacking_item, /obj/item/thermal_drill))
if(drill)
to_chat(user, SPAN_WARNING("There is already a drill attached!"))
else if(do_after(user, 2 SECONDS))
- user.drop_from_inventory(I, src)
- drill = I
+ user.drop_from_inventory(attacking_item, src)
+ drill = attacking_item
update_icon()
else
- to_chat(user, SPAN_WARNING("You can't put [I] into the safe while it is closed!"))
+ to_chat(user, SPAN_WARNING("You can't put [attacking_item] into the safe while it is closed!"))
/obj/structure/safe/process()
if(!drill)
diff --git a/code/game/objects/structures/sarcophagus.dm b/code/game/objects/structures/sarcophagus.dm
index a89d3dd94c7..2dfe8425764 100644
--- a/code/game/objects/structures/sarcophagus.dm
+++ b/code/game/objects/structures/sarcophagus.dm
@@ -37,11 +37,11 @@
open()
return
-/obj/structure/sarcophagus/attackby(obj/item/I as obj, mob/user as mob)
+/obj/structure/sarcophagus/attackby(obj/item/attacking_item, mob/user)
if(open)
return
- if(istype(I, /obj/item/sarcophagus_key))
- to_chat(usr, "You slide \the [I] inside an opening in \the [src].")
+ if(istype(attacking_item, /obj/item/sarcophagus_key))
+ to_chat(usr, "You slide \the [attacking_item] inside an opening in \the [src].")
open()
/obj/structure/sarcophagus/proc/open()
diff --git a/code/game/objects/structures/signs.dm b/code/game/objects/structures/signs.dm
index c30643c2ece..429419916eb 100644
--- a/code/game/objects/structures/signs.dm
+++ b/code/game/objects/structures/signs.dm
@@ -16,10 +16,10 @@
/obj/structure/sign/ex_act(severity)
qdel(src)
-/obj/structure/sign/attackby(obj/item/tool, mob/user) // Deconstruction.
- if(tool.isscrewdriver() && !istype(src, /obj/structure/sign/double))
+/obj/structure/sign/attackby(obj/item/attacking_item, mob/user) // Deconstruction.
+ if(attacking_item.isscrewdriver() && !istype(src, /obj/structure/sign/double))
user.visible_message(SPAN_NOTICE("\The [user] starts to unfasten \the [src]."), SPAN_NOTICE("You start to unfasten \the [src]."))
- if(tool.use_tool(src, user, 0, volume = 50))
+ if(attacking_item.use_tool(src, user, 0, volume = 50))
unfasten(user)
else ..()
@@ -39,8 +39,8 @@
w_class = ITEMSIZE_HUGE
var/sign_state = ""
-/obj/item/sign/attackby(obj/item/tool, mob/user) // Construction.
- if(tool.isscrewdriver() && isturf(user.loc))
+/obj/item/sign/attackby(obj/item/attacking_item, mob/user) // Construction.
+ if(attacking_item.isscrewdriver() && isturf(user.loc))
var/direction = tgui_input_list(user, "In which direction?", "Select Direction", list("North", "East", "South", "West", "Cancel"))
if(direction == "Cancel") return
if(QDELETED(src)) //Prevents spawning multiple new signs with queued dialogues
@@ -59,7 +59,7 @@
S.name = name
S.desc = desc
S.icon_state = sign_state
- to_chat(user, "You fasten \the [S] with your [tool].")
+ to_chat(user, "You fasten \the [S] with your [attacking_item].")
qdel(src)
else ..()
diff --git a/code/game/objects/structures/simple_doors.dm b/code/game/objects/structures/simple_doors.dm
index 07e33f0b78a..b703a715a6f 100644
--- a/code/game/objects/structures/simple_doors.dm
+++ b/code/game/objects/structures/simple_doors.dm
@@ -147,26 +147,26 @@
else
icon_state = material.door_icon_base
-/obj/structure/simple_door/attackby(obj/item/W as obj, mob/user as mob)
- if(istype(W, /obj/item/key) && lock)
- var/obj/item/key/K = W
- if(!lock.toggle(W))
+/obj/structure/simple_door/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/key) && lock)
+ var/obj/item/key/K = attacking_item
+ if(!lock.toggle(attacking_item))
to_chat(user, "\The [K] does not fit in the lock!")
return
- if(lock && lock.pick_lock(W,user))
+ if(lock && lock.pick_lock(attacking_item, user))
return
- if(istype(W,/obj/item/material/lock_construct))
+ if(istype(attacking_item, /obj/item/material/lock_construct))
if(lock)
to_chat(user, "\The [src] already has a lock.")
else
- var/obj/item/material/lock_construct/L = W
+ var/obj/item/material/lock_construct/L = attacking_item
lock = L.create_lock(src,user)
return
- else if(istype(W,/obj/item))
- var/obj/item/I = W
+ else if(istype(attacking_item, /obj/item))
+ var/obj/item/I = attacking_item
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
if(I.damtype == DAMAGE_BRUTE || I.damtype == DAMAGE_BURN)
if(I.force < 10)
@@ -175,8 +175,8 @@
user.do_attack_animation(src)
shake_animation()
user.visible_message("\The [user] forcefully strikes \the [src] with \the [I]!")
- playsound(src.loc, material.hitsound, W.get_clamped_volume(), 1)
- src.health -= W.force * 1
+ playsound(src.loc, material.hitsound, attacking_item.get_clamped_volume(), 1)
+ src.health -= attacking_item.force * 1
CheckHealth()
else
diff --git a/code/game/objects/structures/stool_bed_chair_nest/bed.dm b/code/game/objects/structures/stool_bed_chair_nest/bed.dm
index f2bf279757c..954c5369af5 100644
--- a/code/game/objects/structures/stool_bed_chair_nest/bed.dm
+++ b/code/game/objects/structures/stool_bed_chair_nest/bed.dm
@@ -146,26 +146,26 @@
qdel(src)
return
-/obj/structure/bed/attackby(obj/item/W as obj, mob/user as mob)
- if(W.iswrench())
+/obj/structure/bed/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.iswrench())
if(can_dismantle)
- dismantle(W, user)
- else if(istype(W,/obj/item/stack))
+ dismantle(attacking_item, user)
+ else if(istype(attacking_item,/obj/item/stack))
if(!can_pad)
return
if(padding_material)
to_chat(user, "\The [src] is already padded.")
return
- var/obj/item/stack/C = W
+ var/obj/item/stack/C = attacking_item
if(C.get_amount() < 1) // How??
to_chat(user, SPAN_WARNING("You don't have enough [C]!"))
qdel(C)
return
var/padding_type //This is awful but it needs to be like this until tiles are given a material var.
- if(istype(W,/obj/item/stack/tile/carpet))
+ if(istype(attacking_item,/obj/item/stack/tile/carpet))
padding_type = "carpet"
- else if(istype(W,/obj/item/stack/material))
- var/obj/item/stack/material/M = W
+ else if(istype(attacking_item,/obj/item/stack/material))
+ var/obj/item/stack/material/M = attacking_item
if(M.material && (M.material.flags & MATERIAL_PADDING))
padding_type = "[M.material.name]"
if(!padding_type)
@@ -179,7 +179,7 @@
add_padding(padding_type)
return
- else if (W.iswirecutter())
+ else if (attacking_item.iswirecutter())
if(!can_pad)
return
if(!padding_material)
@@ -190,7 +190,7 @@
painted_colour = null
remove_padding()
- else if (W.isscrewdriver())
+ else if (attacking_item.isscrewdriver())
if(anchored)
anchored = FALSE
to_chat(user, "You unfasten \the [src] from floor.")
@@ -199,8 +199,8 @@
to_chat(user, "You fasten \the [src] to the floor.")
playsound(src, 'sound/items/Screwdriver.ogg', 100, 1)
- else if(istype(W, /obj/item/grab))
- var/obj/item/grab/G = W
+ else if(istype(attacking_item, /obj/item/grab))
+ var/obj/item/grab/G = attacking_item
var/mob/living/affecting = G.affecting
user.visible_message("[user] attempts to buckle [affecting] into \the [src]!")
if(do_after(user, 2 SECONDS, affecting, DO_UNIQUE))
@@ -211,22 +211,22 @@
SPAN_DANGER("[affecting.name] is buckled to [src] by [user.name]!"),\
SPAN_DANGER("You are buckled to [src] by [user.name]!"),\
SPAN_NOTICE("You hear metal clanking."))
- qdel(W)
+ qdel(attacking_item)
- else if(istype(W, /obj/item/gripper) && buckled)
- var/obj/item/gripper/G = W
+ else if(istype(attacking_item, /obj/item/gripper) && buckled)
+ var/obj/item/gripper/G = attacking_item
if(!G.wrapped)
user_unbuckle(user)
- else if(istype(W, /obj/item/disk))
- user.drop_from_inventory(W, get_turf(src))
- W.pixel_x = 10 //make sure they reach the pillow
- W.pixel_y = -6
+ else if(istype(attacking_item, /obj/item/disk))
+ user.drop_from_inventory(attacking_item, get_turf(src))
+ attacking_item.pixel_x = 10 //make sure they reach the pillow
+ attacking_item.pixel_y = -6
- else if(istype(W, /obj/item/device/paint_sprayer))
+ else if(istype(attacking_item, /obj/item/device/paint_sprayer))
return
- else if(!istype(W, /obj/item/bedsheet))
+ else if(!istype(attacking_item, /obj/item/bedsheet))
..()
/obj/structure/bed/proc/remove_padding()
@@ -417,24 +417,24 @@
vitals.update_monitor()
vis_contents += vitals
-/obj/structure/bed/roller/attackby(obj/item/I, mob/user)
- if(iswrench(I) || istype(I, /obj/item/stack) || iswirecutter(I))
+/obj/structure/bed/roller/attackby(obj/item/attacking_item, mob/user)
+ if(iswrench(attacking_item) || istype(attacking_item, /obj/item/stack) || iswirecutter(attacking_item))
return 1
- if(istype(I, /obj/item/vitals_monitor))
+ if(istype(attacking_item, /obj/item/vitals_monitor))
if(vitals)
to_chat(user, SPAN_WARNING("\The [src] already has a vitals monitor attached!"))
return
- to_chat(user, SPAN_NOTICE("You attach \the [I] to \the [src]."))
- user.drop_from_inventory(I, src)
- vitals = I
+ to_chat(user, SPAN_NOTICE("You attach \the [attacking_item] to \the [src]."))
+ user.drop_from_inventory(attacking_item, src)
+ vitals = attacking_item
vitals.bed = src
update_icon()
return
- if(iv_stand && !beaker && is_type_in_list(I, accepted_containers))
- if(!user.unEquip(I, target = src))
+ if(iv_stand && !beaker && is_type_in_list(attacking_item, accepted_containers))
+ if(!user.unEquip(attacking_item, target = src))
return
- to_chat(user, SPAN_NOTICE("You attach \the [I] to \the [src]."))
- beaker = I
+ to_chat(user, SPAN_NOTICE("You attach \the [attacking_item] to \the [src]."))
+ beaker = attacking_item
update_icon()
return 1
..()
@@ -599,9 +599,9 @@
if(!T.density)
deploy_roller(user, T)
-/obj/item/roller/attackby(obj/item/W as obj, mob/user as mob)
- if(istype(W,/obj/item/roller_holder))
- var/obj/item/roller_holder/RH = W
+/obj/item/roller/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/roller_holder))
+ var/obj/item/roller_holder/RH = attacking_item
if(!RH.held)
to_chat(user, SPAN_NOTICE("You collect the roller bed."))
src.forceMove(RH)
diff --git a/code/game/objects/structures/tank_dispenser.dm b/code/game/objects/structures/tank_dispenser.dm
index 1aead171d40..063053a4d96 100644
--- a/code/game/objects/structures/tank_dispenser.dm
+++ b/code/game/objects/structures/tank_dispenser.dm
@@ -49,32 +49,32 @@
dispenser_win.set_content(dat)
dispenser_win.open()
-/obj/structure/dispenser/attackby(obj/item/I, mob/user)
- if(istype(I, /obj/item/tank/oxygen) || istype(I, /obj/item/tank/air) || istype(I, /obj/item/tank/anesthetic))
+/obj/structure/dispenser/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/tank/oxygen) || istype(attacking_item, /obj/item/tank/air) || istype(attacking_item, /obj/item/tank/anesthetic))
if(oxygentanks < 10)
- user.drop_from_inventory(I, src)
- oxytanks.Add(I)
+ user.drop_from_inventory(attacking_item, src)
+ oxytanks.Add(attacking_item)
oxygentanks++
- to_chat(user, SPAN_NOTICE("You put \the [I] into \the [src]."))
+ to_chat(user, SPAN_NOTICE("You put \the [attacking_item] into \the [src]."))
if(oxygentanks < 5)
update_icon()
else
to_chat(user, SPAN_WARNING("\The [src] is full."))
updateUsrDialog()
return
- if(istype(I, /obj/item/tank/phoron))
+ if(istype(attacking_item, /obj/item/tank/phoron))
if(phorontanks < 10)
- user.drop_from_inventory(I, src)
- platanks.Add(I)
+ user.drop_from_inventory(attacking_item, src)
+ platanks.Add(attacking_item)
phorontanks++
- to_chat(user, SPAN_NOTICE("You put \the [I] into \the [src]."))
+ to_chat(user, SPAN_NOTICE("You put \the [attacking_item] into \the [src]."))
if(oxygentanks < 6)
update_icon()
else
to_chat(user, SPAN_WARNING("\The [src] is full."))
updateUsrDialog()
return
- if(I.iswrench())
+ if(attacking_item.iswrench())
if(anchored)
to_chat(user, SPAN_NOTICE("You lean down and unwrench [src]."))
anchored = FALSE
diff --git a/code/game/objects/structures/target_stake.dm b/code/game/objects/structures/target_stake.dm
index 797f1bfce8b..3febb4c3382 100644
--- a/code/game/objects/structures/target_stake.dm
+++ b/code/game/objects/structures/target_stake.dm
@@ -13,16 +13,16 @@
. = ..()
material = SSmaterials.get_material_by_name(MATERIAL_STEEL)
-/obj/structure/target_stake/attackby(var/obj/item/W, var/mob/user)
- if(istype(W, /obj/item/target))
+/obj/structure/target_stake/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/target))
if(pinned_target)
to_chat(user, SPAN_WARNING("\The [src] already has a target."))
return
- if(user.unEquip(W, FALSE, get_turf(src)))
- to_chat(user, SPAN_NOTICE("You slide \the [W] into the stake."))
- set_target(W)
+ if(user.unEquip(attacking_item, FALSE, get_turf(src)))
+ to_chat(user, SPAN_NOTICE("You slide \the [attacking_item] into the stake."))
+ set_target(attacking_item)
return
- if(W.iswrench())
+ if(attacking_item.iswrench())
if(pinned_target)
to_chat(user, SPAN_WARNING("You cannot dismantle \the [src] while it has a target attached."))
return
diff --git a/code/game/objects/structures/therapy.dm b/code/game/objects/structures/therapy.dm
index 40e3ad6e1af..28eba94e4ad 100644
--- a/code/game/objects/structures/therapy.dm
+++ b/code/game/objects/structures/therapy.dm
@@ -179,9 +179,9 @@
. = ..()
START_PROCESSING(SSfast_process, src)
-/obj/structure/metronome/attackby(obj/item/W as obj, mob/user as mob)
- if(W.iswrench())
- playsound(src.loc, W.usesound, 50, 1)
+/obj/structure/metronome/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.iswrench())
+ playsound(src.loc, attacking_item.usesound, 50, 1)
if(anchored)
to_chat(user, "You unanchor \the [src] and it destabilizes.")
STOP_PROCESSING(SSfast_process, src)
diff --git a/code/game/objects/structures/tranqcabinet.dm b/code/game/objects/structures/tranqcabinet.dm
index 16136c189f6..62562a6ad98 100644
--- a/code/game/objects/structures/tranqcabinet.dm
+++ b/code/game/objects/structures/tranqcabinet.dm
@@ -12,15 +12,15 @@
..()
has_tranq = new/obj/item/gun/projectile/heavysniper/tranq(src)
-/obj/structure/tranqcabinet/attackby(obj/item/O, mob/user)
+/obj/structure/tranqcabinet/attackby(obj/item/attacking_item, mob/user)
if(isrobot(user))
return
- if(istype(O, /obj/item/gun/projectile/heavysniper/tranq))
+ if(istype(attacking_item, /obj/item/gun/projectile/heavysniper/tranq))
if(!has_tranq && opened)
- user.remove_from_mob(O)
- contents += O
- has_tranq = O
- to_chat(user, "You place [O] in [src].")
+ user.remove_from_mob(attacking_item)
+ contents += attacking_item
+ has_tranq = attacking_item
+ to_chat(user, "You place [attacking_item] in [src].")
else
opened = !opened
else
diff --git a/code/game/objects/structures/urban.dm b/code/game/objects/structures/urban.dm
index 157d12e2458..959111ca8fd 100644
--- a/code/game/objects/structures/urban.dm
+++ b/code/game/objects/structures/urban.dm
@@ -131,8 +131,8 @@
anchored = TRUE
var/open = 0
-/obj/structure/manhole/attackby(obj/item/W as obj, mob/user as mob)
- if(W.iscrowbar())
+/obj/structure/manhole/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.iscrowbar())
playsound(src.loc, 'sound/effects/stonedoor_openclose.ogg', 50, 1)
to_chat(user, "You forcibly relocate the manhole, hopefully in the right way.")
if(!open)
@@ -455,10 +455,10 @@
menu_text = pencode2html(new_text)
update_icon()
-/obj/structure/restaurant_menu/attackby(obj/item/I, mob/user)
- if(istype(I, /obj/item/paper))
- var/obj/item/paper/P = I
- to_chat(user, SPAN_NOTICE("You scan \the [I.name] into \the [name]."))
+/obj/structure/restaurant_menu/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/paper))
+ var/obj/item/paper/P = attacking_item
+ to_chat(user, SPAN_NOTICE("You scan \the [attacking_item.name] into \the [name]."))
menu_text = P.info
menu_text = replacetext(menu_text, "color=black>", "color=white>")
icon_state = "menu_active"
@@ -648,11 +648,11 @@
flick("[base_icon]c1", src)
return
-/obj/machinery/door/urban/attackby(obj/item/I, mob/user)
+/obj/machinery/door/urban/attackby(obj/item/attacking_item, mob/user)
- if(istype(I, /obj/item/key/door_key))
+ if(istype(attacking_item, /obj/item/key/door_key))
- if(check_access(I))
+ if(check_access(attacking_item))
if(src.density && !(length(previous_req_one_access) || length(previous_req_access)))
//Only say that it's unlocked if there actually was an access list that did the locking
diff --git a/code/game/objects/structures/vr/_remote_chair.dm b/code/game/objects/structures/vr/_remote_chair.dm
index 78513c239e5..5299bd406b4 100644
--- a/code/game/objects/structures/vr/_remote_chair.dm
+++ b/code/game/objects/structures/vr/_remote_chair.dm
@@ -25,8 +25,8 @@
/obj/structure/bed/stool/chair/remote/update_icon()
return
-/obj/structure/bed/stool/chair/remote/attackby(obj/item/W, mob/user)
- if(portable_type && W.iswrench())
+/obj/structure/bed/stool/chair/remote/attackby(obj/item/attacking_item, mob/user)
+ if(portable_type && attacking_item.iswrench())
user.visible_message(SPAN_NOTICE("\The [user] starts dismantling \the [src]..."), SPAN_NOTICE("You start dismantling \the [src]..."))
if(do_after(user, 20 SECONDS, src, DO_REPAIR_CONSTRUCT))
user.visible_message(SPAN_NOTICE("\The [user] dismantles \the [src]."), SPAN_NOTICE("You dismantle \the [src]."))
diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm
index 87fecbb1c36..cf28960382f 100644
--- a/code/game/objects/structures/watercloset.dm
+++ b/code/game/objects/structures/watercloset.dm
@@ -44,19 +44,19 @@
/obj/structure/toilet/update_icon()
icon_state = "toilet[open][cistern]"
-/obj/structure/toilet/attackby(obj/item/I as obj, mob/living/user as mob)
- if(I.iscrowbar())
+/obj/structure/toilet/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.iscrowbar())
to_chat(user, SPAN_NOTICE("You start to [cistern ? "replace the lid on the cistern" : "lift the lid off the cistern"]."))
playsound(loc, 'sound/effects/stonedoor_openclose.ogg', 50, 1)
- if(I.use_tool(src, user, 30, volume = 0))
+ if(attacking_item.use_tool(src, user, 30, volume = 0))
user.visible_message(SPAN_NOTICE("[user] [cistern ? "replaces the lid on the cistern" : "lifts the lid off the cistern"]!"), SPAN_NOTICE("You [cistern ? "replace the lid on the cistern" : "lift the lid off the cistern"]!"), "You hear grinding porcelain.")
cistern = !cistern
update_icon()
return
- if(istype(I, /obj/item/grab))
+ if(istype(attacking_item, /obj/item/grab))
usr.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
- var/obj/item/grab/G = I
+ var/obj/item/grab/G = attacking_item
if(isliving(G.affecting))
var/mob/living/GM = G.affecting
@@ -81,15 +81,15 @@
to_chat(user, SPAN_NOTICE("You need a tighter grip."))
if(cistern && !istype(user,/mob/living/silicon/robot)) //STOP PUTTING YOUR MODULES IN THE TOILET.
- if(I.w_class > 3)
- to_chat(user, SPAN_NOTICE("\The [I] does not fit."))
+ if(attacking_item.w_class > 3)
+ to_chat(user, SPAN_NOTICE("\The [attacking_item] does not fit."))
return
- if(w_items + I.w_class > 5)
+ if(w_items + attacking_item.w_class > 5)
to_chat(user, SPAN_NOTICE("The cistern is full."))
return
- user.drop_from_inventory(I,src)
- w_items += I.w_class
- to_chat(user, "You carefully place \the [I] into the cistern.")
+ user.drop_from_inventory(attacking_item,src)
+ w_items += attacking_item.w_class
+ to_chat(user, "You carefully place \the [attacking_item] into the cistern.")
return
/obj/structure/toilet/noose
@@ -109,9 +109,9 @@
density = 0
anchored = 1
-/obj/structure/urinal/attackby(obj/item/I, mob/user)
- if(istype(I, /obj/item/grab))
- var/obj/item/grab/G = I
+/obj/structure/urinal/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/grab))
+ var/obj/item/grab/G = attacking_item
if(isliving(G.affecting))
var/mob/living/GM = G.affecting
if(G.state>1)
@@ -173,15 +173,15 @@
for (var/atom/movable/G in src.loc)
G.clean_blood()
-/obj/machinery/shower/attackby(obj/item/I as obj, mob/user as mob)
- if(I.type == /obj/item/device/analyzer)
+/obj/machinery/shower/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.type == /obj/item/device/analyzer)
to_chat(user, SPAN_NOTICE("The water temperature seems to be [watertemp]."))
- if(I.iswrench())
+ if(attacking_item.iswrench())
var/newtemp = input(user, "What setting would you like to set the temperature valve to?", "Water Temperature Valve") in temperature_settings
- to_chat(user, SPAN_NOTICE("You begin to adjust the temperature valve with \the [I]."))
- if(I.use_tool(src, user, 50, volume = 50))
+ to_chat(user, SPAN_NOTICE("You begin to adjust the temperature valve with \the [attacking_item]."))
+ if(attacking_item.use_tool(src, user, 50, volume = 50))
watertemp = newtemp
- user.visible_message(SPAN_NOTICE("[user] adjusts the shower with \the [I]."), SPAN_NOTICE("You adjust the shower with \the [I]."))
+ user.visible_message(SPAN_NOTICE("[user] adjusts the shower with \the [attacking_item]."), SPAN_NOTICE("You adjust the shower with \the [attacking_item]."))
add_fingerprint(user)
/obj/machinery/shower/update_icon() //this is terribly unreadable, but basically it makes the shower mist up
@@ -451,13 +451,13 @@
SPAN_NOTICE("[user] washes their hands using \the [src]."), \
SPAN_NOTICE("You wash your hands using \the [src]."))
-/obj/structure/sink/attackby(obj/item/O as obj, mob/user as mob)
+/obj/structure/sink/attackby(obj/item/attacking_item, mob/user)
if(busy)
to_chat(user, SPAN_WARNING("Someone's already washing here."))
return
// Filling/emptying open reagent containers
- var/obj/item/reagent_containers/RG = O
+ var/obj/item/reagent_containers/RG = attacking_item
if (istype(RG) && RG.is_open_container())
var/atype = alert(usr, "Do you want to fill or empty \the [RG] at \the [src]?", "Fill or Empty", "Fill", "Empty", "Cancel")
@@ -490,8 +490,8 @@
return
// Filling/empying Syringes
- else if (istype(O, /obj/item/reagent_containers/syringe))
- var/obj/item/reagent_containers/syringe/S = O
+ else if (istype(attacking_item, /obj/item/reagent_containers/syringe))
+ var/obj/item/reagent_containers/syringe/S = attacking_item
switch(S.mode)
if(0) // draw
if(S.reagents.total_volume >= S.volume)
@@ -513,8 +513,8 @@
SPAN_NOTICE("You empty [trans] units of water into \the [src]. \The [S] now contains [S.reagents.total_volume] units."))
return
- else if (istype(O, /obj/item/melee/baton))
- var/obj/item/melee/baton/B = O
+ else if (istype(attacking_item, /obj/item/melee/baton))
+ var/obj/item/melee/baton/B = attacking_item
if(B.bcell)
if(B.bcell.charge > 0 && B.status == 1)
flick("baton_active", src)
@@ -526,19 +526,19 @@
R.cell.charge -= 20
else
B.deductcharge(B.hitcost)
- user.visible_message(SPAN_DANGER("[user] was stunned by \the [O]!"))
+ user.visible_message(SPAN_DANGER("[user] was stunned by \the [attacking_item]!"))
return 1
// Short of a rewrite, this is necessary to stop monkeycubes being washed.
- else if(istype(O, /obj/item/reagent_containers/food/snacks/monkeycube))
+ else if(istype(attacking_item, /obj/item/reagent_containers/food/snacks/monkeycube))
return
- else if(istype(O, /obj/item/mop))
- O.reagents.add_reagent(/singleton/reagent/water, 5)
- to_chat(user, SPAN_NOTICE("You wet \the [O] in \the [src]."))
+ else if(istype(attacking_item, /obj/item/mop))
+ attacking_item.reagents.add_reagent(/singleton/reagent/water, 5)
+ to_chat(user, SPAN_NOTICE("You wet \the [attacking_item] in \the [src]."))
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
return
- else if(istype(O, /obj/item/reagent_containers/bowl))
- var/obj/item/reagent_containers/bowl/B = O
+ else if(istype(attacking_item, /obj/item/reagent_containers/bowl))
+ var/obj/item/reagent_containers/bowl/B = attacking_item
if(B.grease)
B.grease = FALSE
B.update_icon()
@@ -546,7 +546,7 @@
var/turf/location = user.loc
if(!isturf(location)) return
- var/obj/item/I = O
+ var/obj/item/I = attacking_item
if(!I || !istype(I,/obj/item)) return
to_chat(usr, SPAN_NOTICE("You start washing \the [I]."))
@@ -581,7 +581,7 @@
..()
icon_state = "puddle"
-/obj/structure/sink/puddle/attackby(obj/item/O as obj, mob/user as mob)
+/obj/structure/sink/puddle/attackby(obj/item/attacking_item, mob/user)
icon_state = "puddle-splash"
..()
icon_state = "puddle"
diff --git a/code/game/objects/structures/weapon_rack.dm b/code/game/objects/structures/weapon_rack.dm
index f36c1863817..8ce8ddd1b01 100644
--- a/code/game/objects/structures/weapon_rack.dm
+++ b/code/game/objects/structures/weapon_rack.dm
@@ -14,17 +14,17 @@
held_weapon = new held_weapon(src)
icon_state = initial(icon_state) + "_[held_weapon.icon_state]"
-/obj/structure/weapon_rack/attackby(obj/item/W, mob/user)
+/obj/structure/weapon_rack/attackby(obj/item/attacking_item, mob/user)
if(isrobot(user))
return
- if((initial(icon_state) + "_[W.icon_state]") in icon_states(icon))
- user.unEquip(W)
- W.forceMove(src)
- held_weapon = W
- to_chat(user, SPAN_NOTICE("You place \the [W] on \the [src]."))
- icon_state = initial(icon_state) + "_[W.icon_state]"
+ if((initial(icon_state) + "_[attacking_item.icon_state]") in icon_states(icon))
+ user.unEquip(attacking_item)
+ attacking_item.forceMove(src)
+ held_weapon = attacking_item
+ to_chat(user, SPAN_NOTICE("You place \the [attacking_item] on \the [src]."))
+ icon_state = initial(icon_state) + "_[attacking_item.icon_state]"
else
- to_chat(user, SPAN_NOTICE("[W] does not fit on \the [src]."))
+ to_chat(user, SPAN_NOTICE("[attacking_item] does not fit on \the [src]."))
/obj/structure/weapon_rack/attack_hand(mob/user)
if(isrobot(user))
diff --git a/code/game/objects/structures/windoor_assembly.dm b/code/game/objects/structures/windoor_assembly.dm
index b836c658eb7..03681d5763b 100644
--- a/code/game/objects/structures/windoor_assembly.dm
+++ b/code/game/objects/structures/windoor_assembly.dm
@@ -66,17 +66,17 @@
return 1
-/obj/structure/windoor_assembly/attackby(obj/item/W as obj, mob/user as mob)
+/obj/structure/windoor_assembly/attackby(obj/item/attacking_item, mob/user)
//I really should have spread this out across more states but thin little windoors are hard to sprite.
switch(state)
if("01")
- if(W.iswelder() && !anchored)
- var/obj/item/weldingtool/WT = W
+ if(attacking_item.iswelder() && !anchored)
+ var/obj/item/weldingtool/WT = attacking_item
if (WT.use(0,user))
user.visible_message("[user] dissassembles the windoor assembly.", "You start to dissassemble the windoor assembly.")
playsound(src.loc, 'sound/items/welder_pry.ogg', 50, 1)
- if(W.use_tool(src, user, 40, volume = 50))
+ if(attacking_item.use_tool(src, user, 40, volume = 50))
if(!src || !WT.isOn()) return
to_chat(user, "You dissasembled the windoor assembly!")
new /obj/item/stack/material/glass/reinforced(get_turf(src), 5)
@@ -88,10 +88,10 @@
return
//Wrenching an unsecure assembly anchors it in place. Step 4 complete
- if(W.iswrench() && !anchored)
+ if(attacking_item.iswrench() && !anchored)
user.visible_message("[user] secures the windoor assembly to the floor.", "You start to secure the windoor assembly to the floor.")
- if(W.use_tool(src, user, 40, volume = 50))
+ if(attacking_item.use_tool(src, user, 40, volume = 50))
if(!src) return
to_chat(user, "You've secured the windoor assembly!")
src.anchored = 1
@@ -101,10 +101,10 @@
src.name = "Anchored Windoor Assembly"
//Unwrenching an unsecure assembly un-anchors it. Step 4 undone
- else if(W.iswrench() && anchored)
+ else if(attacking_item.iswrench() && anchored)
user.visible_message("[user] unsecures the windoor assembly to the floor.", "You start to unsecure the windoor assembly to the floor.")
- if(W.use_tool(src, user, 40, volume = 50))
+ if(attacking_item.use_tool(src, user, 40, volume = 50))
if(!src) return
to_chat(user, "You've unsecured the windoor assembly!")
src.anchored = 0
@@ -114,14 +114,14 @@
src.name = "Windoor Assembly"
//Adding plasteel makes the assembly a secure windoor assembly. Step 2 (optional) complete.
- else if(istype(W, /obj/item/stack/rods) && !secure)
- var/obj/item/stack/rods/R = W
+ else if(istype(attacking_item, /obj/item/stack/rods) && !secure)
+ var/obj/item/stack/rods/R = attacking_item
if(R.get_amount() < 4)
to_chat(user, "You need more rods to do this.")
return
to_chat(user, "You start to reinforce the windoor with rods.")
- if(W.use_tool(src, user, 40, volume = 50) && !secure)
+ if(attacking_item.use_tool(src, user, 40, volume = 50) && !secure)
if (R.use(4))
to_chat(user, "You reinforce the windoor.")
src.secure = "secure_"
@@ -131,11 +131,11 @@
src.name = "Secure Windoor Assembly"
//Adding cable to the assembly. Step 5 complete.
- else if(W.iscoil() && anchored)
+ else if(attacking_item.iscoil() && anchored)
user.visible_message("[user] wires the windoor assembly.", "You start to wire the windoor assembly.")
- var/obj/item/stack/cable_coil/CC = W
- if(W.use_tool(src, user, 40, volume = 50))
+ var/obj/item/stack/cable_coil/CC = attacking_item
+ if(attacking_item.use_tool(src, user, 40, volume = 50))
if (CC.use(1))
to_chat(user, "You wire the windoor!")
src.state = "02"
@@ -149,11 +149,11 @@
if("02")
//Removing wire from the assembly. Step 5 undone.
- if(W.iswirecutter() && !src.electronics)
+ if(attacking_item.iswirecutter() && !src.electronics)
playsound(src.loc, 'sound/items/Wirecutter.ogg', 100, 1)
user.visible_message("[user] cuts the wires from the airlock assembly.", "You start to cut the wires from airlock assembly.")
- if(W.use_tool(src, user, 40, volume = 50))
+ if(attacking_item.use_tool(src, user, 40, volume = 50))
if(!src) return
to_chat(user, "You cut the windoor wires.!")
@@ -165,8 +165,8 @@
src.name = "Anchored Windoor Assembly"
//Adding airlock electronics for access. Step 6 complete.
- else if(istype(W, /obj/item/airlock_electronics) && W:icon_state != "door_electronics_smoked")
- var/obj/item/airlock_electronics/EL = W
+ else if(istype(attacking_item, /obj/item/airlock_electronics) && attacking_item:icon_state != "door_electronics_smoked")
+ var/obj/item/airlock_electronics/EL = attacking_item
if(!EL.is_installed)
playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1)
user.visible_message("[user] installs the electronics into the airlock assembly.", "You start to install electronics into the airlock assembly.")
@@ -182,10 +182,10 @@
EL.is_installed = 0
//Screwdriver to remove airlock electronics. Step 6 undone.
- else if(W.isscrewdriver() && src.electronics)
+ else if(attacking_item.isscrewdriver() && src.electronics)
user.visible_message("[user] removes the electronics from the airlock assembly.", "You start to uninstall electronics from the airlock assembly.")
- if(W.use_tool(src, user, 40, volume = 50))
+ if(attacking_item.use_tool(src, user, 40, volume = 50))
if(!src || !src.electronics) return
to_chat(user, "You've removed the airlock electronics!")
if(src.secure)
@@ -197,14 +197,14 @@
ae.forceMove(src.loc)
//Crowbar to complete the assembly, Step 7 complete.
- else if(W.iscrowbar())
+ else if(attacking_item.iscrowbar())
if(!src.electronics)
to_chat(usr, "The assembly is missing electronics.")
return
usr << browse(null, "window=windoor_access")
user.visible_message("[user] pries the windoor into the frame.", "You start prying the windoor into the frame.")
- if(W.use_tool(src, user, 40, volume = 50))
+ if(attacking_item.use_tool(src, user, 40, volume = 50))
if(!src) return
diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm
index 5a5720fe7c8..933ac553af6 100644
--- a/code/game/objects/structures/window.dm
+++ b/code/game/objects/structures/window.dm
@@ -249,42 +249,42 @@
playsound(loc, 'sound/effects/glass_hit.ogg', 50, 1)
return TRUE
-/obj/structure/window/attackby(obj/item/W, mob/user)
- if(!istype(W) || istype(W, /obj/item/flag))
+/obj/structure/window/attackby(obj/item/attacking_item, mob/user)
+ if(!istype(attacking_item) || istype(attacking_item, /obj/item/flag))
return
- if(istype(W, /obj/item/grab) && get_dist(src,user)<2)
- var/obj/item/grab/G = W
+ if(istype(attacking_item, /obj/item/grab) && get_dist(src,user)<2)
+ var/obj/item/grab/G = attacking_item
if(istype(G.affecting,/mob/living))
grab_smash_attack(G, DAMAGE_BRUTE)
return
- if(W.item_flags & ITEM_FLAG_NO_BLUDGEON)
+ if(attacking_item.item_flags & ITEM_FLAG_NO_BLUDGEON)
return
- if(W.isscrewdriver() && user.a_intent != I_HURT)
+ if(attacking_item.isscrewdriver() && user.a_intent != I_HURT)
if(reinf && state >= 1)
state = 3 - state
update_nearby_icons()
- playsound(loc, W.usesound, 75, 1)
+ playsound(loc, attacking_item.usesound, 75, 1)
to_chat(user, (state == 1 ? SPAN_NOTICE("You have unfastened the window from the frame.") : SPAN_NOTICE("You have fastened the window to the frame.")))
else if(reinf && state == 0)
anchored = !anchored
update_icon()
update_nearby_icons()
- playsound(loc, W.usesound, 75, 1)
+ playsound(loc, attacking_item.usesound, 75, 1)
to_chat(user, (anchored ? SPAN_NOTICE("You have fastened the frame to the floor.") : SPAN_NOTICE("You have unfastened the frame from the floor.")))
else if(!reinf)
anchored = !anchored
update_nearby_icons()
- playsound(loc, W.usesound, 75, 1)
+ playsound(loc, attacking_item.usesound, 75, 1)
to_chat(user, (anchored ? SPAN_NOTICE("You have fastened the window to the floor.") : SPAN_NOTICE("You have unfastened the window.")))
update_icon()
update_nearby_icons()
- else if(W.iscrowbar() && reinf && state <= 1 && user.a_intent != I_HURT)
+ else if(attacking_item.iscrowbar() && reinf && state <= 1 && user.a_intent != I_HURT)
state = 1 - state
- playsound(loc, W.usesound, 75, 1)
+ playsound(loc, attacking_item.usesound, 75, 1)
to_chat(user, (state ? SPAN_NOTICE("You have pried the window into the frame.") : SPAN_NOTICE("You have pried the window out of the frame.")))
- else if(W.iswrench() && !anchored && (!state || !reinf) && user.a_intent != I_HURT)
+ else if(attacking_item.iswrench() && !anchored && (!state || !reinf) && user.a_intent != I_HURT)
if(!glasstype)
to_chat(user, SPAN_NOTICE("You're not sure how to dismantle \the [src] properly."))
else
@@ -292,19 +292,19 @@
dismantle_window()
else
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
- if(W.damtype == DAMAGE_BRUTE || W.damtype == DAMAGE_BURN)
+ if(attacking_item.damtype == DAMAGE_BRUTE || attacking_item.damtype == DAMAGE_BURN)
if(reinf)
user.do_attack_animation(src)
- if(W.force >= REINFORCED_WINDOW_DAMAGE_FORCE)
- user.visible_message(SPAN_DANGER("\The [user] forcefully strikes \the [src] with \the [W]!"))
- playsound(src, hitsound, W.get_clamped_volume(), 1)
- hit(W.force)
+ if(attacking_item.force >= REINFORCED_WINDOW_DAMAGE_FORCE)
+ user.visible_message(SPAN_DANGER("\The [user] forcefully strikes \the [src] with \the [attacking_item]!"))
+ playsound(src, hitsound, attacking_item.get_clamped_volume(), 1)
+ hit(attacking_item.force)
else
- user.visible_message(SPAN_WARNING("[user] hits \the [src] with \the [W], but it glances off, doing no damage."))
- playsound(src, hitsound, W.get_clamped_volume(), 1)
+ user.visible_message(SPAN_WARNING("[user] hits \the [src] with \the [attacking_item], but it glances off, doing no damage."))
+ playsound(src, hitsound, attacking_item.get_clamped_volume(), 1)
else
user.do_attack_animation(src)
- hit(W.force)
+ hit(attacking_item.force)
if(health <= 7)
anchored = 0
update_nearby_icons()
@@ -656,61 +656,61 @@
WF.has_glass_installed = FALSE
return ..()
-/obj/structure/window/full/attackby(obj/item/W, mob/user)
- if(!istype(W) || istype(W, /obj/item/flag))
+/obj/structure/window/full/attackby(obj/item/attacking_item, mob/user)
+ if(!istype(attacking_item) || istype(attacking_item, /obj/item/flag))
return
- if(istype(W, /obj/item/grab) && get_dist(src,user)<2)
- var/obj/item/grab/G = W
+ if(istype(attacking_item, /obj/item/grab) && get_dist(src,user)<2)
+ var/obj/item/grab/G = attacking_item
if(istype(G.affecting,/mob/living))
grab_smash_attack(G, DAMAGE_BRUTE)
return
- if(W.item_flags & ITEM_FLAG_NO_BLUDGEON)
+ if(attacking_item.item_flags & ITEM_FLAG_NO_BLUDGEON)
return
- if(W.isscrewdriver() && user.a_intent != I_HURT)
+ if(attacking_item.isscrewdriver() && user.a_intent != I_HURT)
if(state == 2)
- if(W.use_tool(src, user, 2 SECONDS, volume = 50))
+ if(attacking_item.use_tool(src, user, 2 SECONDS, volume = 50))
to_chat(user, SPAN_NOTICE("You have unfastened the glass from the window frame."))
state--
update_nearby_icons()
else if(state == 1)
- if(W.use_tool(src, user, 2 SECONDS, volume = 50))
+ if(attacking_item.use_tool(src, user, 2 SECONDS, volume = 50))
to_chat(user, SPAN_NOTICE("You have fastened the glass to the window frame."))
state++
update_nearby_icons()
- else if(W.iscrowbar() && user.a_intent != I_HURT)
+ else if(attacking_item.iscrowbar() && user.a_intent != I_HURT)
if(state == 1)
- if(W.use_tool(src, user, 2 SECONDS, volume = 50))
+ if(attacking_item.use_tool(src, user, 2 SECONDS, volume = 50))
to_chat(user, SPAN_NOTICE("You pry the glass out of the window frame."))
state--
update_nearby_icons()
else if(state == 0)
- if(W.use_tool(src, user, 2 SECONDS, volume = 50))
+ if(attacking_item.use_tool(src, user, 2 SECONDS, volume = 50))
to_chat(user, SPAN_NOTICE("You pry the glass into the window frame."))
state++
update_nearby_icons()
- else if(W.iswrench() && user.a_intent != I_HURT)
+ else if(attacking_item.iswrench() && user.a_intent != I_HURT)
if(state == 0)
user.visible_message(SPAN_DANGER("\The [user] is dismantling \the [src]!"))
- if(W.use_tool(src, user, 2 SECONDS, volume = 50))
+ if(attacking_item.use_tool(src, user, 2 SECONDS, volume = 50))
to_chat(user, SPAN_NOTICE("You undo the safety bolts and remove the glass from \the [src]."))
dismantle_window()
else
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
- if(W.damtype == DAMAGE_BRUTE || W.damtype == DAMAGE_BURN)
+ if(attacking_item.damtype == DAMAGE_BRUTE || attacking_item.damtype == DAMAGE_BURN)
if(reinf)
user.do_attack_animation(src)
- if(W.force >= FULL_REINFORCED_WINDOW_DAMAGE_FORCE)
- user.visible_message(SPAN_DANGER("\The [user] forcefully strikes \the [src] with \the [W]!"))
- playsound(src, hitsound, W.get_clamped_volume(), 1)
- hit(W.force)
+ if(attacking_item.force >= FULL_REINFORCED_WINDOW_DAMAGE_FORCE)
+ user.visible_message(SPAN_DANGER("\The [user] forcefully strikes \the [src] with \the [attacking_item]!"))
+ playsound(src, hitsound, attacking_item.get_clamped_volume(), 1)
+ hit(attacking_item.force)
else
- user.visible_message(SPAN_WARNING("[user] hits \the [src] with \the [W], but it glances off, doing no damage."))
- playsound(src, hitsound, W.get_clamped_volume(), 1)
+ user.visible_message(SPAN_WARNING("[user] hits \the [src] with \the [attacking_item], but it glances off, doing no damage."))
+ playsound(src, hitsound, attacking_item.get_clamped_volume(), 1)
else
user.do_attack_animation(src)
- hit(W.force)
+ hit(attacking_item.force)
else
playsound(src, hitsound, 10, 1)
return
diff --git a/code/game/turfs/simulated/floor_attackby.dm b/code/game/turfs/simulated/floor_attackby.dm
index c872ee03dc0..af7d216f865 100644
--- a/code/game/turfs/simulated/floor_attackby.dm
+++ b/code/game/turfs/simulated/floor_attackby.dm
@@ -1,10 +1,10 @@
-/turf/simulated/floor/attackby(obj/item/C as obj, mob/user as mob)
+/turf/simulated/floor/attackby(obj/item/attacking_item, mob/user)
- if(!C || !user)
+ if(!attacking_item || !user)
return 0
if(flooring && (!ismob(user) || user.a_intent != I_HURT))
- if(C.iscrowbar())
+ if(attacking_item.iscrowbar())
if(broken || burnt)
to_chat(user, "You remove the broken [flooring.descriptor].")
make_plating()
@@ -18,50 +18,50 @@
return
playsound(src, 'sound/items/crowbar_tile.ogg', 80, 1)
return
- else if(C.isscrewdriver() && (flooring.flags & TURF_REMOVE_SCREWDRIVER))
+ else if(attacking_item.isscrewdriver() && (flooring.flags & TURF_REMOVE_SCREWDRIVER))
if(broken || burnt)
return
to_chat(user, "You unscrew and remove the [flooring.descriptor].")
make_plating(1)
- playsound(src, C.usesound, 80, 1)
+ playsound(src, attacking_item.usesound, 80, 1)
return
- else if(C.iswrench() && (flooring.flags & TURF_REMOVE_WRENCH))
+ else if(attacking_item.iswrench() && (flooring.flags & TURF_REMOVE_WRENCH))
to_chat(user, "You unwrench and remove the [flooring.descriptor].")
make_plating(1)
- playsound(src, C.usesound, 80, 1)
+ playsound(src, attacking_item.usesound, 80, 1)
return
- else if(istype(C, /obj/item/shovel) && (flooring.flags & TURF_REMOVE_SHOVEL))
+ else if(istype(attacking_item, /obj/item/shovel) && (flooring.flags & TURF_REMOVE_SHOVEL))
to_chat(user, "You shovel off the [flooring.descriptor].")
make_plating(1)
- playsound(src, C.usesound, 80, 1)
+ playsound(src, attacking_item.usesound, 80, 1)
return
- else if(C.iswelder() && (flooring.flags & TURF_REMOVE_WELDER))
- var/obj/item/weldingtool/WT = C
+ else if(attacking_item.iswelder() && (flooring.flags & TURF_REMOVE_WELDER))
+ var/obj/item/weldingtool/WT = attacking_item
if(!WT.isOn())
to_chat(user, SPAN_WARNING("\The [WT] isn't turned on."))
return
if(WT.use(0, user))
to_chat(user, SPAN_NOTICE("You use \the [WT] to remove \the [src]."))
make_plating(1)
- playsound(src, C.usesound, 80, 1)
+ playsound(src, attacking_item.usesound, 80, 1)
return
- else if(C.iscoil())
+ else if(attacking_item.iscoil())
to_chat(user, "You must remove the [flooring.descriptor] first.")
return
else
- if(C.iscoil())
+ if(attacking_item.iscoil())
if(broken || burnt)
to_chat(user, "This section is too damaged to support anything. Use a welder to fix the damage.")
return
- var/obj/item/stack/cable_coil/coil = C
+ var/obj/item/stack/cable_coil/coil = attacking_item
coil.turf_place(src, user)
return
- else if(istype(C, /obj/item/stack))
+ else if(istype(attacking_item, /obj/item/stack))
if(broken || burnt)
to_chat(user, "This section is too damaged to support anything. Use a welder to fix the damage.")
return
- var/obj/item/stack/S = C
+ var/obj/item/stack/S = attacking_item
var/singleton/flooring/use_flooring
var/list/decls = GET_SINGLETON_SUBTYPE_MAP(/singleton/flooring)
for(var/flooring_type in decls)
@@ -88,7 +88,7 @@
playsound(src, 'sound/items/Deconstruct.ogg', 80, 1)
return
// Repairs and deconstruction
- else if(C.iscrowbar())
+ else if(attacking_item.iscrowbar())
if(broken || burnt)
playsound(src, 'sound/items/crowbar_tile.ogg', 80, 1)
visible_message("[user] has begun prying off the damaged plating.")
@@ -108,8 +108,8 @@
T.visible_message("The ceiling above has been pried off!")
return
return
- else if(C.iswelder())
- var/obj/item/weldingtool/welder = C
+ else if(attacking_item.iswelder())
+ var/obj/item/weldingtool/welder = attacking_item
if(welder.isOn() && (is_plating()))
if(broken || burnt)
if(do_after(user, 5 SECONDS))
@@ -131,8 +131,8 @@
playsound(src, 'sound/items/Welder.ogg', 80, 1)
return
- if(istype(C,/obj/item/floor_frame))
- var/obj/item/floor_frame/F = C
+ if(istype(attacking_item,/obj/item/floor_frame))
+ var/obj/item/floor_frame/F = attacking_item
F.try_build(src, user)
return
diff --git a/code/game/turfs/simulated/floor_static.dm b/code/game/turfs/simulated/floor_static.dm
index fe6474c3795..de428f949c7 100644
--- a/code/game/turfs/simulated/floor_static.dm
+++ b/code/game/turfs/simulated/floor_static.dm
@@ -7,8 +7,8 @@
icon_state = "tiled_preview"
initial_flooring = null
-/turf/simulated/floor/fixed/attackby(var/obj/item/C, var/mob/user)
- if(istype(C, /obj/item/stack) && !C.iscoil())
+/turf/simulated/floor/fixed/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/stack) && !attacking_item.iscoil())
return
return ..()
diff --git a/code/game/turfs/simulated/wall_attacks.dm b/code/game/turfs/simulated/wall_attacks.dm
index 7351dc86690..b39e9622a92 100644
--- a/code/game/turfs/simulated/wall_attacks.dm
+++ b/code/game/turfs/simulated/wall_attacks.dm
@@ -103,7 +103,7 @@
return success_smash(user)
return fail_smash(user, wallbreaker)
-/turf/simulated/wall/attackby(obj/item/W, mob/user)
+/turf/simulated/wall/attackby(obj/item/attacking_item, mob/user)
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
if(!user)
return
@@ -112,49 +112,49 @@
if(!istype(user.loc, /turf))
return //can't do this stuff whilst inside objects and such
- if(istype(W, /obj/item/plastique))
+ if(istype(attacking_item, /obj/item/plastique))
return
- if(W)
+ if(attacking_item)
radiate()
- if(is_hot(W))
- burn(is_hot(W))
+ if(is_hot(attacking_item))
+ burn(is_hot(attacking_item))
if(locate(/obj/effect/overlay/wallrot) in src)
- if(W.iswelder())
- var/obj/item/weldingtool/WT = W
+ if(attacking_item.iswelder())
+ var/obj/item/weldingtool/WT = attacking_item
if(WT.use(0,user))
to_chat(user, SPAN_NOTICE("You burn away the fungi with \the [WT]."))
playsound(src, 'sound/items/Welder.ogg', 10, 1)
for(var/obj/effect/overlay/wallrot/WR in src)
qdel(WR)
return
- else if(W.sharp)
- user.visible_message("[user] starts scraping the rot away with \the [W].", SPAN_NOTICE("You start scraping the rot away with \the [W]."))
- if(W.use_tool(src, user, rand(3 SECONDS, 5 SECONDS), volume = 50))
- user.visible_message("[user] scrapes away the rot with \the [W].", SPAN_NOTICE("You start scraping away the rot with \the [W]."))
- playsound(src, W.hitsound, W.get_clamped_volume(), TRUE)
+ else if(attacking_item.sharp)
+ user.visible_message("[user] starts scraping the rot away with \the [attacking_item].", SPAN_NOTICE("You start scraping the rot away with \the [attacking_item]."))
+ if(attacking_item.use_tool(src, user, rand(3 SECONDS, 5 SECONDS), volume = 50))
+ user.visible_message("[user] scrapes away the rot with \the [attacking_item].", SPAN_NOTICE("You start scraping away the rot with \the [attacking_item]."))
+ playsound(src, attacking_item.hitsound, attacking_item.get_clamped_volume(), TRUE)
for(var/obj/effect/overlay/wallrot/WR in src)
WR.scrape(user)
return
- else if(W.force >= 10)
- user.do_attack_animation(src, W)
- to_chat(user, SPAN_NOTICE("\The [src] crumbles away under the force of your [W]."))
+ else if(attacking_item.force >= 10)
+ user.do_attack_animation(src, attacking_item)
+ to_chat(user, SPAN_NOTICE("\The [src] crumbles away under the force of your [attacking_item]."))
dismantle_wall(TRUE)
return
//THERMITE related stuff. Calls src.thermitemelt() which handles melting simulated walls and the relevant effects
if(thermite)
- if(W.isFlameSource())
+ if(attacking_item.isFlameSource())
thermitemelt(user)
return
- else if(istype(W, /obj/item/gun/energy/plasmacutter))
+ else if(istype(attacking_item, /obj/item/gun/energy/plasmacutter))
thermitemelt(user)
return
- else if( istype(W, /obj/item/melee/energy/blade) )
- var/obj/item/melee/energy/blade/EB = W
+ else if( istype(attacking_item, /obj/item/melee/energy/blade) )
+ var/obj/item/melee/energy/blade/EB = attacking_item
spark(EB, 5)
to_chat(user, SPAN_NOTICE("You slash \the [src] with \the [EB], igniting the thermite!"))
@@ -166,9 +166,9 @@
var/turf/T = user.loc //get user's location for delay checks
- if(damage && W.iswelder())
+ if(damage && attacking_item.iswelder())
- var/obj/item/weldingtool/WT = W
+ var/obj/item/weldingtool/WT = attacking_item
if(!WT.isOn())
return
@@ -192,8 +192,8 @@
var/dismantle_verb
var/dismantle_sound
- if(W.iswelder())
- var/obj/item/weldingtool/WT = W
+ if(attacking_item.iswelder())
+ var/obj/item/weldingtool/WT = attacking_item
if(!WT.isOn())
return
if(!WT.use(0,user))
@@ -202,15 +202,15 @@
dismantle_verb = "cutting"
dismantle_sound = 'sound/items/Welder.ogg'
cut_delay *= 0.7
- else if(istype(W, /obj/item/gun/energy/plasmacutter))
- var/obj/item/gun/energy/plasmacutter/PC = W
+ else if(istype(attacking_item, /obj/item/gun/energy/plasmacutter))
+ var/obj/item/gun/energy/plasmacutter/PC = attacking_item
if(PC.check_power_and_message(user))
return
dismantle_sound = PC.fire_sound
dismantle_verb = "slicing"
cut_delay *= 0.8
- else if(istype(W,/obj/item/melee/energy))
- var/obj/item/melee/energy/WT = W
+ else if(istype(attacking_item, /obj/item/melee/energy))
+ var/obj/item/melee/energy/WT = attacking_item
if(WT.active)
dismantle_sound = /singleton/sound_category/spark_sound
dismantle_verb = "slicing"
@@ -218,12 +218,12 @@
else
to_chat(user, SPAN_NOTICE("You need to activate the weapon to do that!"))
return
- else if(istype(W,/obj/item/melee/energy/blade))
+ else if(istype(attacking_item, /obj/item/melee/energy/blade))
dismantle_sound = /singleton/sound_category/spark_sound
dismantle_verb = "slicing"
cut_delay *= 0.5
- else if(istype(W,/obj/item/melee/chainsword))
- var/obj/item/melee/chainsword/WT = W
+ else if(istype(attacking_item, /obj/item/melee/chainsword))
+ var/obj/item/melee/chainsword/WT = attacking_item
if(WT.active)
dismantle_sound = 'sound/weapons/saw/chainsawhit.ogg'
dismantle_verb = "slicing"
@@ -231,12 +231,12 @@
else
to_chat(user, SPAN_NOTICE("You need to activate the weapon to do that!"))
return
- else if(istype(W,/obj/item/pickaxe))
- var/obj/item/pickaxe/P = W
+ else if(istype(attacking_item, /obj/item/pickaxe))
+ var/obj/item/pickaxe/P = attacking_item
dismantle_verb = P.drill_verb
dismantle_sound = P.drill_sound
cut_delay -= P.digspeed
- else if(istype(W,/obj/item/melee/arm_blade/))
+ else if(istype(attacking_item,/obj/item/melee/arm_blade/))
dismantle_sound = /singleton/sound_category/pickaxe_sound
dismantle_verb = "slicing and stabbing"
cut_delay *= 1.5
@@ -247,7 +247,7 @@
if(cut_delay<0)
cut_delay = 1
- if(!W.use_tool(src, user, cut_delay, volume = 50))
+ if(!attacking_item.use_tool(src, user, cut_delay, volume = 50))
return
//This prevents runtime errors if someone clicks the same wall more than once
@@ -256,7 +256,7 @@
if(dismantle_sound)
playsound(src, dismantle_sound, 100, 1)
- W.use_resource(user, 1)
+ attacking_item.use_resource(user, 1)
dismantle_wall()
user.visible_message(SPAN_WARNING("The wall was torn open by \the [user]!"), SPAN_NOTICE("You remove the outer plating."))
return
@@ -265,24 +265,24 @@
else
switch(construction_stage)
if(6)
- if (W.iswirecutter())
+ if (attacking_item.iswirecutter())
playsound(src, 'sound/items/Wirecutter.ogg', 100, 1)
construction_stage = 5
to_chat(user, SPAN_NOTICE("You cut the outer grille."))
update_icon()
return
if(5)
- if (W.isscrewdriver())
+ if (attacking_item.isscrewdriver())
to_chat(user, SPAN_NOTICE("You begin removing the support lines."))
- playsound(src, W.usesound, 100, 1)
- if(!W.use_tool(src, user, 60, volume = 50) || !istype(src, /turf/simulated/wall) || construction_stage != 5)
+ playsound(src, attacking_item.usesound, 100, 1)
+ if(!attacking_item.use_tool(src, user, 60, volume = 50) || !istype(src, /turf/simulated/wall) || construction_stage != 5)
return
construction_stage = 4
update_icon()
to_chat(user, SPAN_NOTICE("You remove the support lines."))
return
- else if( istype(W, /obj/item/stack/rods) )
- var/obj/item/stack/O = W
+ else if( istype(attacking_item, /obj/item/stack/rods) )
+ var/obj/item/stack/O = attacking_item
if(O.get_amount()>0)
O.use(1)
construction_stage = 6
@@ -291,8 +291,8 @@
return
if(4)
var/cut_cover
- if(W.iswelder())
- var/obj/item/weldingtool/WT = W
+ if(attacking_item.iswelder())
+ var/obj/item/weldingtool/WT = attacking_item
if(!WT.isOn())
return
if(WT.use(0,user))
@@ -300,29 +300,29 @@
else
to_chat(user, SPAN_NOTICE("You need more welding fuel to complete this task."))
return
- else if (istype(W, /obj/item/gun/energy/plasmacutter))
+ else if (istype(attacking_item, /obj/item/gun/energy/plasmacutter))
cut_cover = 1
if(cut_cover)
to_chat(user, SPAN_NOTICE("You begin slicing through the metal cover."))
- if(!W.use_tool(src, user , 60, volume = 50) || !istype(src, /turf/simulated/wall) || construction_stage != 4)
+ if(!attacking_item.use_tool(src, user , 60, volume = 50) || !istype(src, /turf/simulated/wall) || construction_stage != 4)
return
construction_stage = 3
update_icon()
to_chat(user, SPAN_NOTICE("You press firmly on the cover, dislodging it."))
return
if(3)
- if (W.iscrowbar())
+ if (attacking_item.iscrowbar())
to_chat(user, SPAN_NOTICE("You struggle to pry off the cover."))
- if(!W.use_tool(src, user , 100, volume = 50) || !istype(src, /turf/simulated/wall) || construction_stage != 3)
+ if(!attacking_item.use_tool(src, user , 100, volume = 50) || !istype(src, /turf/simulated/wall) || construction_stage != 3)
return
construction_stage = 2
update_icon()
to_chat(user, SPAN_NOTICE("You pry off the cover."))
return
if(2)
- if (W.iswrench())
+ if (attacking_item.iswrench())
to_chat(user, SPAN_NOTICE("You start loosening the anchoring bolts which secure the support rods to their frame."))
- if(!W.use_tool(src, user , 40, volume = 50) || !istype(src, /turf/simulated/wall) || construction_stage != 2)
+ if(!attacking_item.use_tool(src, user , 40, volume = 50) || !istype(src, /turf/simulated/wall) || construction_stage != 2)
return
construction_stage = 1
update_icon()
@@ -330,18 +330,18 @@
return
if(1)
var/cut_cover
- if(W.iswelder())
- var/obj/item/weldingtool/WT = W
+ if(attacking_item.iswelder())
+ var/obj/item/weldingtool/WT = attacking_item
if( WT.use(0,user) )
cut_cover=1
else
to_chat(user, SPAN_NOTICE("You need more welding fuel to complete this task."))
return
- else if(istype(W, /obj/item/gun/energy/plasmacutter))
+ else if(istype(attacking_item, /obj/item/gun/energy/plasmacutter))
cut_cover = 1
if(cut_cover)
to_chat(user, SPAN_NOTICE("You begin slicing through the support rods."))
- if(!W.use_tool(src, user , 70, volume = 50) || !istype(src, /turf/simulated/wall) || construction_stage != 1)
+ if(!attacking_item.use_tool(src, user , 70, volume = 50) || !istype(src, /turf/simulated/wall) || construction_stage != 1)
return
construction_stage = 0
update_icon()
@@ -349,30 +349,30 @@
to_chat(user, SPAN_NOTICE("The support rods drop out as you cut them loose from the frame."))
return
if(0)
- if(W.iscrowbar())
+ if(attacking_item.iscrowbar())
to_chat(user, SPAN_NOTICE("You struggle to pry off the outer sheath."))
- if(!W.use_tool(src, user , 100, volume = 50)) return
- if(!istype(src, /turf/simulated/wall) || !user || !W || !T ) return
- if(user.loc == T && user.get_active_hand() == W )
+ if(!attacking_item.use_tool(src, user , 100, volume = 50)) return
+ if(!istype(src, /turf/simulated/wall) || !user || !attacking_item || !T ) return
+ if(user.loc == T && user.get_active_hand() == attacking_item )
to_chat(user, SPAN_NOTICE("You pry off the outer sheath."))
dismantle_wall()
return
- if(istype(W, /obj/item/device/electronic_assembly/wallmount))
- var/obj/item/device/electronic_assembly/wallmount/IC = W
+ if(istype(attacking_item, /obj/item/device/electronic_assembly/wallmount))
+ var/obj/item/device/electronic_assembly/wallmount/IC = attacking_item
IC.mount_assembly(src, user)
return
- if(istype(W,/obj/item/frame))
- var/obj/item/frame/F = W
+ if(istype(attacking_item,/obj/item/frame))
+ var/obj/item/frame/F = attacking_item
F.try_build(src, user)
return
- else if(!istype(W,/obj/item/rfd/construction) && !istype(W, /obj/item/reagent_containers))
- if(user.a_intent != I_HURT || !W.force)
+ else if(!istype(attacking_item,/obj/item/rfd/construction) && !istype(attacking_item, /obj/item/reagent_containers))
+ if(user.a_intent != I_HURT || !attacking_item.force)
return
- var/damage_to_deal = W.force
+ var/damage_to_deal = attacking_item.force
var/weaken = 0
var/sound_to_play = 'sound/weapons/smash.ogg'
if(material)
@@ -387,9 +387,9 @@
//Plasteel walls take 24 & 15 minimum damage.
//Steel walls take 3 & 15 minimum damage.
damage_to_deal -= weaken
- visible_message(SPAN_WARNING("[user] strikes \the [src] with \the [W], [is_sharp(W) ? "slicing some of the plating" : "putting a heavy dent on it"]!"))
+ visible_message(SPAN_WARNING("[user] strikes \the [src] with \the [attacking_item], [is_sharp(attacking_item) ? "slicing some of the plating" : "putting a heavy dent on it"]!"))
take_damage(damage_to_deal)
else
- visible_message(SPAN_WARNING("[user] strikes \the [src] with \the [W], but it bounces off!"))
+ visible_message(SPAN_WARNING("[user] strikes \the [src] with \the [attacking_item], but it bounces off!"))
playsound(src, hitsound, 25, 1)
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
diff --git a/code/game/turfs/space/space.dm b/code/game/turfs/space/space.dm
index 138b88dfb0a..f96803759ea 100644
--- a/code/game/turfs/space/space.dm
+++ b/code/game/turfs/space/space.dm
@@ -79,23 +79,23 @@
else
set_light(0)
-/turf/space/attackby(obj/item/C as obj, mob/user as mob)
+/turf/space/attackby(obj/item/attacking_item, mob/user)
- if (istype(C, /obj/item/stack/rods))
+ if (istype(attacking_item, /obj/item/stack/rods))
var/obj/structure/lattice/L = locate(/obj/structure/lattice, src)
if(L)
return
- var/obj/item/stack/rods/R = C
+ var/obj/item/stack/rods/R = attacking_item
if (R.use(1))
to_chat(user, "Constructing support lattice ...")
playsound(src, 'sound/weapons/Genhit.ogg', 50, 1)
ReplaceWithLattice()
return
- if (istype(C, /obj/item/stack/tile/floor))
+ if (istype(attacking_item, /obj/item/stack/tile/floor))
var/obj/structure/lattice/L = locate(/obj/structure/lattice, src)
if(L)
- var/obj/item/stack/tile/floor/S = C
+ var/obj/item/stack/tile/floor/S = attacking_item
if (S.get_amount() < 1)
return
qdel(L)
@@ -106,7 +106,7 @@
else
to_chat(user, "The plating is going to need some support.")
- ..(C, user)
+ ..()
// Ported from unstable r355
diff --git a/code/game/turfs/space/transit.dm b/code/game/turfs/space/transit.dm
index e30c1c4d74a..9246ccefdc6 100644
--- a/code/game/turfs/space/transit.dm
+++ b/code/game/turfs/space/transit.dm
@@ -5,7 +5,7 @@
var/pushdirection
//Overwrite because we dont want people building rods in space.
-/turf/space/transit/attackby(obj/O, mob/user)
+/turf/space/transit/attackby(obj/item/attacking_item, mob/user)
return FALSE
//generates a list used to randomize transit animations so they aren't in lockstep
diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm
index 852d8617829..c06a4464785 100644
--- a/code/game/turfs/turf.dm
+++ b/code/game/turfs/turf.dm
@@ -320,12 +320,12 @@ var/const/enterloopsanity = 100
/turf/proc/can_lay_cable()
return can_have_cabling()
-/turf/attackby(obj/item/C, mob/user)
- if(istype(C, /obj/item/grab))
- var/obj/item/grab/grab = C
+/turf/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/grab))
+ var/obj/item/grab/grab = attacking_item
step(grab.affecting, get_dir(grab.affecting, src))
- if (can_lay_cable() && C.iscoil())
- var/obj/item/stack/cable_coil/coil = C
+ if (can_lay_cable() && attacking_item.iscoil())
+ var/obj/item/stack/cable_coil/coil = attacking_item
coil.turf_place(src, user)
else
..()
diff --git a/code/modules/assembly/assembly.dm b/code/modules/assembly/assembly.dm
index 14a7f6d4141..f10bf48e4fb 100644
--- a/code/modules/assembly/assembly.dm
+++ b/code/modules/assembly/assembly.dm
@@ -89,13 +89,13 @@
return TRUE
return FALSE
-/obj/item/device/assembly/attackby(obj/item/W, mob/user)
- if(isassembly(W))
- var/obj/item/device/assembly/A = W
+/obj/item/device/assembly/attackby(obj/item/attacking_item, mob/user)
+ if(isassembly(attacking_item))
+ var/obj/item/device/assembly/A = attacking_item
if(!A.secured && !secured)
attach_assembly(A, user)
return
- if(W.isscrewdriver())
+ if(attacking_item.isscrewdriver())
if(toggle_secure())
to_chat(user, SPAN_NOTICE("\The [src] is ready!"))
else
diff --git a/code/modules/assembly/bomb.dm b/code/modules/assembly/bomb.dm
index f71d2f7b123..295e875a364 100644
--- a/code/modules/assembly/bomb.dm
+++ b/code/modules/assembly/bomb.dm
@@ -23,11 +23,11 @@
add_overlay(bombassembly)
add_overlay("bomb_assembly")
-/obj/item/device/onetankbomb/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/device/analyzer))
- bombtank.attackby(W, user)
+/obj/item/device/onetankbomb/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/device/analyzer))
+ bombtank.attackby(attacking_item, user)
return
- if(!status && (W.iswrench() || istype(W, /obj/item/wirecutters/bomb))) //This is basically bomb assembly code inverted. apparently it works.
+ if(!status && (attacking_item.iswrench() || istype(attacking_item, /obj/item/wirecutters/bomb))) //This is basically bomb assembly code inverted. apparently it works.
to_chat(user, SPAN_NOTICE("You disassemble \the [src]."))
bombassembly.forceMove(get_turf(user))
@@ -41,8 +41,8 @@
qdel(src)
return
- if(W.iswelder())
- var/obj/item/weldingtool/WT = W
+ if(attacking_item.iswelder())
+ var/obj/item/weldingtool/WT = attacking_item
if(!WT.welding)
return
if(!status)
diff --git a/code/modules/assembly/holder.dm b/code/modules/assembly/holder.dm
index 546a3361e57..1ab471904e2 100644
--- a/code/modules/assembly/holder.dm
+++ b/code/modules/assembly/holder.dm
@@ -123,8 +123,8 @@
a_right.holder_movement()
return ..()
-/obj/item/device/assembly_holder/attackby(obj/item/W, mob/user)
- if(W.isscrewdriver())
+/obj/item/device/assembly_holder/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.isscrewdriver())
if(!a_left || !a_right)
to_chat(user, SPAN_DANGER("BUG: Assembly part missing, please report this!"))
return
@@ -137,8 +137,8 @@
to_chat(user, SPAN_NOTICE("\The [src] can now be taken apart!"))
update_icon()
return
- else if(W.IsSpecialAssembly())
- attach_special(W, user)
+ else if(attacking_item.IsSpecialAssembly())
+ attach_special(attacking_item, user)
else
return ..()
diff --git a/code/modules/atmospherics/atmospherics.dm b/code/modules/atmospherics/atmospherics.dm
index 88af869ef36..22bc949ee16 100644
--- a/code/modules/atmospherics/atmospherics.dm
+++ b/code/modules/atmospherics/atmospherics.dm
@@ -54,8 +54,8 @@ Pipelines + Other Objects -> Pipe network
/obj/machinery/atmospherics/LateInitialize()
atmos_init()
-/obj/machinery/atmospherics/attackby(atom/A, mob/user as mob)
- if(istype(A, /obj/item/device/pipe_painter))
+/obj/machinery/atmospherics/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/device/pipe_painter))
return FALSE
..()
diff --git a/code/modules/atmospherics/components/binary_devices/circulator.dm b/code/modules/atmospherics/components/binary_devices/circulator.dm
index 55dc309c6ba..baf32ac7cb9 100644
--- a/code/modules/atmospherics/components/binary_devices/circulator.dm
+++ b/code/modules/atmospherics/components/binary_devices/circulator.dm
@@ -93,9 +93,9 @@
return TRUE
-/obj/machinery/atmospherics/binary/circulator/attackby(obj/item/W as obj, mob/user as mob)
- if(W.iswrench())
- playsound(src.loc, W.usesound, 50, 1)
+/obj/machinery/atmospherics/binary/circulator/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.iswrench())
+ playsound(src.loc, attacking_item.usesound, 50, 1)
anchored = !anchored
user.visible_message("[user.name] [anchored ? "secures" : "unsecures"] the bolts holding [src.name] to the floor.", \
"You [anchored ? "secure" : "unsecure"] the bolts holding [src] to the floor.", \
diff --git a/code/modules/atmospherics/components/binary_devices/oxyregenerator.dm b/code/modules/atmospherics/components/binary_devices/oxyregenerator.dm
index 8c0290c7f08..d45fa1d5a41 100644
--- a/code/modules/atmospherics/components/binary_devices/oxyregenerator.dm
+++ b/code/modules/atmospherics/components/binary_devices/oxyregenerator.dm
@@ -57,8 +57,8 @@
. = ..()
. += "Its outlet port is to the [dir2text(dir)]."
-/obj/machinery/atmospherics/binary/oxyregenerator/attackby(obj/item/O as obj, mob/user as mob)
- if(O.iswrench())
+/obj/machinery/atmospherics/binary/oxyregenerator/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.iswrench())
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
anchored = !anchored
user.visible_message("[user.name] [anchored ? "secures" : "unsecures"] the bolts holding [src.name] to the floor.", \
diff --git a/code/modules/atmospherics/components/binary_devices/passive_gate.dm b/code/modules/atmospherics/components/binary_devices/passive_gate.dm
index b3a903a962c..478478ad395 100644
--- a/code/modules/atmospherics/components/binary_devices/passive_gate.dm
+++ b/code/modules/atmospherics/components/binary_devices/passive_gate.dm
@@ -321,8 +321,8 @@
src.add_fingerprint(usr)
return
-/obj/machinery/atmospherics/binary/passive_gate/attackby(var/obj/item/W as obj, var/mob/user as mob)
- if (!W.iswrench())
+/obj/machinery/atmospherics/binary/passive_gate/attackby(obj/item/attacking_item, mob/user)
+ if (!attacking_item.iswrench())
return ..()
if (unlocked)
to_chat(user, "You cannot unwrench \the [src], turn it off first.")
@@ -335,7 +335,7 @@
add_fingerprint(user)
return TRUE
to_chat(user, "You begin to unfasten \the [src]...")
- if(W.use_tool(src, user, istype(W, /obj/item/pipewrench) ? 80 : 40, volume = 50))
+ if(attacking_item.use_tool(src, user, istype(attacking_item, /obj/item/pipewrench) ? 80 : 40, volume = 50))
user.visible_message( \
"\The [user] unfastens \the [src].", \
"You have unfastened \the [src].", \
diff --git a/code/modules/atmospherics/components/binary_devices/pump.dm b/code/modules/atmospherics/components/binary_devices/pump.dm
index a7f0f3c3589..41798ebecd1 100644
--- a/code/modules/atmospherics/components/binary_devices/pump.dm
+++ b/code/modules/atmospherics/components/binary_devices/pump.dm
@@ -249,8 +249,8 @@ Thus, the two variables affect pump operation are set in New():
if(old_stat != stat)
update_icon()
-/obj/machinery/atmospherics/binary/pump/attackby(var/obj/item/W as obj, var/mob/user as mob)
- if (!W.iswrench() && !istype(W, /obj/item/pipewrench))
+/obj/machinery/atmospherics/binary/pump/attackby(obj/item/attacking_item, mob/user)
+ if (!attacking_item.iswrench() && !istype(attacking_item, /obj/item/pipewrench))
return ..()
if (!(stat & NOPOWER) && use_power)
to_chat(user, "You cannot unwrench this [src], turn it off first.")
@@ -258,14 +258,14 @@ Thus, the two variables affect pump operation are set in New():
var/datum/gas_mixture/int_air = return_air()
if (!loc) return FALSE
var/datum/gas_mixture/env_air = loc.return_air()
- if ((int_air.return_pressure()-env_air.return_pressure()) > PRESSURE_EXERTED && !istype(W, /obj/item/pipewrench))
+ if ((int_air.return_pressure()-env_air.return_pressure()) > PRESSURE_EXERTED && !istype(attacking_item, /obj/item/pipewrench))
to_chat(user, "You cannot unwrench this [src], it's too exerted due to internal pressure.")
add_fingerprint(user)
return TRUE
else
to_chat(user, "You struggle to unwrench \the [src] with your pipe wrench.")
to_chat(user, "You begin to unfasten \the [src]...")
- if(W.use_tool(src, user, istype(W, /obj/item/pipewrench) ? 80 : 40, volume = 50))
+ if(attacking_item.use_tool(src, user, istype(attacking_item, /obj/item/pipewrench) ? 80 : 40, volume = 50))
user.visible_message( \
"\The [user] unfastens \the [src].", \
"You have unfastened \the [src].", \
diff --git a/code/modules/atmospherics/components/omni_devices/omni_base.dm b/code/modules/atmospherics/components/omni_devices/omni_base.dm
index 480a58d3592..df0dd862159 100644
--- a/code/modules/atmospherics/components/omni_devices/omni_base.dm
+++ b/code/modules/atmospherics/components/omni_devices/omni_base.dm
@@ -81,8 +81,8 @@
if(old_stat != stat)
update_icon()
-/obj/machinery/atmospherics/omni/attackby(var/obj/item/W as obj, var/mob/user as mob)
- if(!W.iswrench())
+/obj/machinery/atmospherics/omni/attackby(obj/item/attacking_item, mob/user)
+ if(!attacking_item.iswrench())
return ..()
var/int_pressure = 0
@@ -95,7 +95,7 @@
add_fingerprint(user)
return TRUE
to_chat(user, "You begin to unfasten \the [src]...")
- if(W.use_tool(src, user, 40, volume = 50))
+ if(attacking_item.use_tool(src, user, 40, volume = 50))
user.visible_message( \
"\The [user] unfastens \the [src].", \
"You have unfastened \the [src].", \
diff --git a/code/modules/atmospherics/components/portables_connector.dm b/code/modules/atmospherics/components/portables_connector.dm
index 6e861bab1da..4724b8892ae 100644
--- a/code/modules/atmospherics/components/portables_connector.dm
+++ b/code/modules/atmospherics/components/portables_connector.dm
@@ -142,8 +142,8 @@
return null
-/obj/machinery/atmospherics/portables_connector/attackby(var/obj/item/W as obj, var/mob/user as mob)
- if (!W.iswrench())
+/obj/machinery/atmospherics/portables_connector/attackby(obj/item/attacking_item, mob/user)
+ if (!attacking_item.iswrench())
return ..()
if (connected_device)
to_chat(user, "You cannot unwrench \the [src], dettach \the [connected_device] first.")
@@ -158,7 +158,7 @@
add_fingerprint(user)
return TRUE
to_chat(user, "You begin to unfasten \the [src]...")
- if(W.use_tool(src, user, istype(W, /obj/item/pipewrench) ? 80 : 40, volume = 50))
+ if(attacking_item.use_tool(src, user, istype(attacking_item, /obj/item/pipewrench) ? 80 : 40, volume = 50))
user.visible_message( \
"\The [user] unfastens \the [src].", \
"You have unfastened \the [src].", \
diff --git a/code/modules/atmospherics/components/tvalve.dm b/code/modules/atmospherics/components/tvalve.dm
index ba145719610..ffb07a7b87a 100644
--- a/code/modules/atmospherics/components/tvalve.dm
+++ b/code/modules/atmospherics/components/tvalve.dm
@@ -343,8 +343,8 @@
else
go_to_side()
-/obj/machinery/atmospherics/tvalve/attackby(var/obj/item/W as obj, var/mob/user as mob)
- if (!W.iswrench())
+/obj/machinery/atmospherics/tvalve/attackby(obj/item/attacking_item, mob/user)
+ if (!attacking_item.iswrench())
return ..()
if (istype(src, /obj/machinery/atmospherics/tvalve/digital))
to_chat(user, "You cannot unwrench \the [src], it's too complicated.")
@@ -357,7 +357,7 @@
add_fingerprint(user)
return TRUE
to_chat(user, "You begin to unfasten \the [src]...")
- if(W.use_tool(src, user, istype(W, /obj/item/pipewrench) ? 80 : 40, volume = 50))
+ if(attacking_item.use_tool(src, user, istype(attacking_item, /obj/item/pipewrench) ? 80 : 40, volume = 50))
user.visible_message( \
"\The [user] unfastens \the [src].", \
"You have unfastened \the [src].", \
diff --git a/code/modules/atmospherics/components/unary/cold_sink.dm b/code/modules/atmospherics/components/unary/cold_sink.dm
index add19e545c2..330ae509527 100644
--- a/code/modules/atmospherics/components/unary/cold_sink.dm
+++ b/code/modules/atmospherics/components/unary/cold_sink.dm
@@ -171,12 +171,12 @@
power_setting = new_power_setting
power_rating = max_power_rating * (power_setting/100)
-/obj/machinery/atmospherics/unary/freezer/attackby(var/obj/item/O as obj, var/mob/user as mob)
- if(default_deconstruction_screwdriver(user, O))
+/obj/machinery/atmospherics/unary/freezer/attackby(obj/item/attacking_item, mob/user)
+ if(default_deconstruction_screwdriver(user, attacking_item))
return TRUE
- if(default_deconstruction_crowbar(user, O))
+ if(default_deconstruction_crowbar(user, attacking_item))
return TRUE
- if(default_part_replacement(user, O))
+ if(default_part_replacement(user, attacking_item))
return TRUE
return ..()
diff --git a/code/modules/atmospherics/components/unary/heat_exchanger.dm b/code/modules/atmospherics/components/unary/heat_exchanger.dm
index d31e31d5921..09b6f4a1caf 100644
--- a/code/modules/atmospherics/components/unary/heat_exchanger.dm
+++ b/code/modules/atmospherics/components/unary/heat_exchanger.dm
@@ -63,8 +63,8 @@
return TRUE
-/obj/machinery/atmospherics/unary/heat_exchanger/attackby(var/obj/item/W as obj, var/mob/user as mob)
- if(!W.iswrench())
+/obj/machinery/atmospherics/unary/heat_exchanger/attackby(obj/item/attacking_item, mob/user)
+ if(!attacking_item.iswrench())
return ..()
var/turf/T = src.loc
if(level == 1 && isturf(T) && !T.is_plating())
@@ -78,7 +78,7 @@
add_fingerprint(user)
return TRUE
to_chat(user, SPAN_NOTICE("You begin to unfasten \the [src]..."))
- if(W.use_tool(src, user, istype(W, /obj/item/pipewrench) ? 80 : 40, volume = 50))
+ if(attacking_item.use_tool(src, user, istype(attacking_item, /obj/item/pipewrench) ? 80 : 40, volume = 50))
user.visible_message(
SPAN_NOTICE("\The [user] unfastens \the [src]."),
SPAN_NOTICE("You have unfastened \the [src]."),
diff --git a/code/modules/atmospherics/components/unary/heat_source.dm b/code/modules/atmospherics/components/unary/heat_source.dm
index ab255fa5585..352fe777d37 100644
--- a/code/modules/atmospherics/components/unary/heat_source.dm
+++ b/code/modules/atmospherics/components/unary/heat_source.dm
@@ -159,12 +159,12 @@
power_setting = new_power_setting
power_rating = max_power_rating * (power_setting/100)
-/obj/machinery/atmospherics/unary/heater/attackby(var/obj/item/O as obj, var/mob/user as mob)
- if(default_deconstruction_screwdriver(user, O))
+/obj/machinery/atmospherics/unary/heater/attackby(obj/item/attacking_item, mob/user)
+ if(default_deconstruction_screwdriver(user, attacking_item))
return TRUE
- if(default_deconstruction_crowbar(user, O))
+ if(default_deconstruction_crowbar(user, attacking_item))
return TRUE
- if(default_part_replacement(user, O))
+ if(default_part_replacement(user, attacking_item))
return TRUE
return ..()
diff --git a/code/modules/atmospherics/components/unary/vent_pump.dm b/code/modules/atmospherics/components/unary/vent_pump.dm
index 9698c2d10b1..b436c22448d 100644
--- a/code/modules/atmospherics/components/unary/vent_pump.dm
+++ b/code/modules/atmospherics/components/unary/vent_pump.dm
@@ -373,14 +373,14 @@
broadcast_status_next_process = TRUE
update_icon()
-/obj/machinery/atmospherics/unary/vent_pump/attackby(obj/item/W, mob/user)
- if(W.iswelder())
- var/obj/item/weldingtool/WT = W
+/obj/machinery/atmospherics/unary/vent_pump/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.iswelder())
+ var/obj/item/weldingtool/WT = attacking_item
if (!WT.welding)
to_chat(user, SPAN_DANGER("\The [WT] must be turned on!"))
else if (WT.use(0,user))
to_chat(user, SPAN_NOTICE("Now welding the vent."))
- if(W.use_tool(src, user, 30, volume = 50))
+ if(attacking_item.use_tool(src, user, 30, volume = 50))
if(!src || !WT.isOn())
return TRUE
welded = !welded
@@ -394,19 +394,19 @@
else
to_chat(user, SPAN_WARNING("You need more welding fuel to complete this task."))
return TRUE
- else if(istype(W, /obj/item/melee/arm_blade))
+ else if(istype(attacking_item, /obj/item/melee/arm_blade))
if(!welded)
- to_chat(user, SPAN_WARNING("\The [W] can only be used to tear open welded air vents!"))
+ to_chat(user, SPAN_WARNING("\The [attacking_item] can only be used to tear open welded air vents!"))
return TRUE
- user.visible_message(SPAN_WARNING("\The [user] starts using \the [W] to hack open \the [src]!"), SPAN_NOTICE("You start hacking open \the [src] with \the [W]..."))
- user.do_attack_animation(src, W)
+ user.visible_message(SPAN_WARNING("\The [user] starts using \the [attacking_item] to hack open \the [src]!"), SPAN_NOTICE("You start hacking open \the [src] with \the [attacking_item]..."))
+ user.do_attack_animation(src, attacking_item)
playsound(loc, 'sound/weapons/smash.ogg', 60, TRUE)
var/cut_amount = 3
for(var/i = 0; i <= cut_amount; i++)
- if(!W || !do_after(user, 30, src))
+ if(!attacking_item || !do_after(user, 30, src))
return TRUE
- user.do_attack_animation(src, W)
- user.visible_message(SPAN_WARNING("\The [user] smashes \the [W] into \the [src]!"), SPAN_NOTICE("You smash \the [W] into \the [src]."))
+ user.do_attack_animation(src, attacking_item)
+ user.visible_message(SPAN_WARNING("\The [user] smashes \the [attacking_item] into \the [src]!"), SPAN_NOTICE("You smash \the [attacking_item] into \the [src]."))
playsound(loc, 'sound/weapons/smash.ogg', 60, TRUE)
if(i == cut_amount)
welded = FALSE
@@ -431,8 +431,8 @@
if(old_stat != stat)
update_icon()
-/obj/machinery/atmospherics/unary/vent_pump/attackby(var/obj/item/W as obj, var/mob/user as mob)
- if (!W.iswrench())
+/obj/machinery/atmospherics/unary/vent_pump/attackby(obj/item/attacking_item, mob/user)
+ if (!attacking_item.iswrench())
return ..()
if (!(stat & NOPOWER) && use_power)
to_chat(user, SPAN_WARNING("You cannot unwrench \the [src], turn it off first."))
@@ -449,7 +449,7 @@
add_fingerprint(user)
return TRUE
to_chat(user, SPAN_NOTICE("You begin to unfasten \the [src]..."))
- if(W.use_tool(src, user, istype(W, /obj/item/pipewrench) ? 80 : 40, volume = 50))
+ if(attacking_item.use_tool(src, user, istype(attacking_item, /obj/item/pipewrench) ? 80 : 40, volume = 50))
user.visible_message( \
SPAN_NOTICE("\The [user] unfastens \the [src]."), \
SPAN_NOTICE("You have unfastened \the [src]."), \
diff --git a/code/modules/atmospherics/components/unary/vent_scrubber.dm b/code/modules/atmospherics/components/unary/vent_scrubber.dm
index b3de367f47d..1b20fd508a6 100644
--- a/code/modules/atmospherics/components/unary/vent_scrubber.dm
+++ b/code/modules/atmospherics/components/unary/vent_scrubber.dm
@@ -344,8 +344,8 @@
if(old_stat != stat)
update_icon()
-/obj/machinery/atmospherics/unary/vent_scrubber/attackby(var/obj/item/W as obj, var/mob/user as mob)
- if (W.iswrench())
+/obj/machinery/atmospherics/unary/vent_scrubber/attackby(obj/item/attacking_item, mob/user)
+ if (attacking_item.iswrench())
if (!(stat & NOPOWER) && use_power)
to_chat(user, SPAN_WARNING("You cannot unwrench \the [src], turn it off first."))
return TRUE
@@ -361,7 +361,7 @@
add_fingerprint(user)
return TRUE
to_chat(user, SPAN_NOTICE("You begin to unfasten \the [src]..."))
- if(W.use_tool(src, user, 40, volume = 50))
+ if(attacking_item.use_tool(src, user, 40, volume = 50))
user.visible_message( \
SPAN_NOTICE("\The [user] unfastens \the [src]."), \
SPAN_NOTICE("You have unfastened \the [src]."), \
@@ -370,8 +370,8 @@
qdel(src)
return TRUE
- if(W.iswelder())
- var/obj/item/weldingtool/WT = W
+ if(attacking_item.iswelder())
+ var/obj/item/weldingtool/WT = attacking_item
if(!WT.isOn())
to_chat(user, SPAN_NOTICE("\The [WT] needs to be on to start this task."))
@@ -394,19 +394,19 @@
"You hear welding.")
return TRUE
- if(istype(W, /obj/item/melee/arm_blade))
+ if(istype(attacking_item, /obj/item/melee/arm_blade))
if(!welded)
- to_chat(user, SPAN_WARNING("\The [W] can only be used to tear open welded scrubbers!"))
+ to_chat(user, SPAN_WARNING("\The [attacking_item] can only be used to tear open welded scrubbers!"))
return TRUE
- user.visible_message(SPAN_WARNING("\The [user] starts using \the [W] to hack open \the [src]!"), SPAN_NOTICE("You start hacking open \the [src] with \the [W]..."))
- user.do_attack_animation(src, W)
+ user.visible_message(SPAN_WARNING("\The [user] starts using \the [attacking_item] to hack open \the [src]!"), SPAN_NOTICE("You start hacking open \the [src] with \the [attacking_item]..."))
+ user.do_attack_animation(src, attacking_item)
playsound(loc, 'sound/weapons/smash.ogg', 60, TRUE)
var/cut_amount = 3
for(var/i = 0; i <= cut_amount; i++)
- if(!W || !do_after(user, 30, src))
+ if(!attacking_item || !do_after(user, 30, src))
return TRUE
- user.do_attack_animation(src, W)
- user.visible_message(SPAN_WARNING("\The [user] smashes \the [W] into \the [src]!"), SPAN_NOTICE("You smash \the [W] into \the [src]."))
+ user.do_attack_animation(src, attacking_item)
+ user.visible_message(SPAN_WARNING("\The [user] smashes \the [attacking_item] into \the [src]!"), SPAN_NOTICE("You smash \the [attacking_item] into \the [src]."))
playsound(loc, 'sound/weapons/smash.ogg', 60, TRUE)
if(i == cut_amount)
welded = FALSE
diff --git a/code/modules/atmospherics/components/valve.dm b/code/modules/atmospherics/components/valve.dm
index 78668e0378f..478da8609ee 100644
--- a/code/modules/atmospherics/components/valve.dm
+++ b/code/modules/atmospherics/components/valve.dm
@@ -301,8 +301,8 @@
else
open()
-/obj/machinery/atmospherics/valve/attackby(var/obj/item/W as obj, var/mob/user as mob)
- if (!W.iswrench())
+/obj/machinery/atmospherics/valve/attackby(obj/item/attacking_item, mob/user)
+ if (!attacking_item.iswrench())
return ..()
if (istype(src, /obj/machinery/atmospherics/valve/digital))
to_chat(user, "You cannot unwrench \the [src], it's too complicated.")
@@ -315,7 +315,7 @@
add_fingerprint(user)
return TRUE
to_chat(user, "You begin to unfasten \the [src]...")
- if(W.use_tool(src, user, istype(W, /obj/item/pipewrench) ? 80 : 40, volume = 50))
+ if(attacking_item.use_tool(src, user, istype(attacking_item, /obj/item/pipewrench) ? 80 : 40, volume = 50))
user.visible_message( \
"\The [user] unfastens \the [src].", \
"You have unfastened \the [src].", \
diff --git a/code/modules/atmospherics/pipes.dm b/code/modules/atmospherics/pipes.dm
index dc5bd0fe485..b68fc5ba307 100644
--- a/code/modules/atmospherics/pipes.dm
+++ b/code/modules/atmospherics/pipes.dm
@@ -74,19 +74,19 @@
return ..()
-/obj/machinery/atmospherics/pipe/attackby(var/obj/item/W as obj, var/mob/user as mob)
+/obj/machinery/atmospherics/pipe/attackby(obj/item/attacking_item, mob/user)
if (istype(src, /obj/machinery/atmospherics/pipe/tank))
return ..()
- if(istype(W,/obj/item/device/pipe_painter))
+ if(istype(attacking_item,/obj/item/device/pipe_painter))
return FALSE
- if(istype(W, /obj/item/device/analyzer) && Adjacent(user))
- var/obj/item/device/analyzer/A = W
+ if(istype(attacking_item, /obj/item/device/analyzer) && Adjacent(user))
+ var/obj/item/device/analyzer/A = attacking_item
A.analyze_gases(src, user)
return FALSE
- if (!W.iswrench() && !istype(W, /obj/item/pipewrench))
+ if (!attacking_item.iswrench() && !istype(attacking_item, /obj/item/pipewrench))
return ..()
var/turf/T = src.loc
if (level==1 && isturf(T) && !T.is_plating())
@@ -96,14 +96,14 @@
if(!loc) return FALSE
var/datum/gas_mixture/env_air = loc.return_air()
if ((int_air.return_pressure()-env_air.return_pressure()) > PRESSURE_EXERTED)
- if(!istype(W, /obj/item/pipewrench))
+ if(!istype(attacking_item, /obj/item/pipewrench))
to_chat(user, "You cannot unwrench \the [src], it is too exerted due to internal pressure.")
add_fingerprint(user)
return TRUE
else
to_chat(user, "You struggle to unwrench \the [src] with your pipe wrench.")
to_chat(user, "You begin to unfasten \the [src]...")
- if(W.use_tool(src, user, istype(W, /obj/item/pipewrench) ? 80 : 40, volume = 50))
+ if(attacking_item.use_tool(src, user, istype(attacking_item, /obj/item/pipewrench) ? 80 : 40, volume = 50))
user.visible_message( \
"\The [user] unfastens \the [src].", \
"You have unfastened \the [src].", \
@@ -1369,12 +1369,12 @@
return null
-/obj/machinery/atmospherics/pipe/tank/attackby(var/obj/item/W as obj, var/mob/user as mob)
- if(istype(W, /obj/item/device/pipe_painter))
+/obj/machinery/atmospherics/pipe/tank/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/device/pipe_painter))
return FALSE
- if(istype(W, /obj/item/device/analyzer) && in_range(user, src))
- var/obj/item/device/analyzer/A = W
+ if(istype(attacking_item, /obj/item/device/analyzer) && in_range(user, src))
+ var/obj/item/device/analyzer/A = attacking_item
A.analyze_gases(src, user)
return TRUE
diff --git a/code/modules/awaymissions/gateway.dm b/code/modules/awaymissions/gateway.dm
index ad846b77491..b526f90d3ab 100644
--- a/code/modules/awaymissions/gateway.dm
+++ b/code/modules/awaymissions/gateway.dm
@@ -132,8 +132,8 @@
return
-/obj/machinery/gateway/centerstation/attackby(obj/item/device/W as obj, mob/user as mob)
- if(W.ismultitool())
+/obj/machinery/gateway/centerstation/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.ismultitool())
to_chat(user, "\black The gate is already calibrated, there is no work for you to do here.")
return
@@ -228,8 +228,8 @@
M.set_dir(SOUTH)
-/obj/machinery/gateway/centeraway/attackby(obj/item/device/W as obj, mob/user as mob)
- if(W.ismultitool())
+/obj/machinery/gateway/centeraway/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.ismultitool())
if(calibrated)
to_chat(user, "\black The gate is already calibrated, there is no work for you to do here.")
return
diff --git a/code/modules/battlemonsters/items/card.dm b/code/modules/battlemonsters/items/card.dm
index a1394d0d9df..8b9e68f89a3 100644
--- a/code/modules/battlemonsters/items/card.dm
+++ b/code/modules/battlemonsters/items/card.dm
@@ -19,9 +19,9 @@
. = ..()
Generate_Card(prefix, root, title, trap, spell)
-/obj/item/battle_monsters/card/attackby(var/obj/item/attacking, var/mob/user)
- if(istype(attacking,/obj/item/battle_monsters/card) && attacking != src)
- var/obj/item/battle_monsters/card/adding_card = attacking
+/obj/item/battle_monsters/card/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item,/obj/item/battle_monsters/card) && attacking_item != src)
+ var/obj/item/battle_monsters/card/adding_card = attacking_item
make_deck(user,adding_card)
/obj/item/battle_monsters/card/resolve_attackby(atom/A, mob/user, var/click_parameters)
diff --git a/code/modules/battlemonsters/items/deck.dm b/code/modules/battlemonsters/items/deck.dm
index eab95edcdf2..db2bd3f51f0 100644
--- a/code/modules/battlemonsters/items/deck.dm
+++ b/code/modules/battlemonsters/items/deck.dm
@@ -136,9 +136,9 @@
else
. = ..()
-/obj/item/battle_monsters/deck/attackby(var/obj/item/attacking, var/mob/user)
- if(istype(attacking,/obj/item/battle_monsters/card) && attacking != src)
- var/obj/item/battle_monsters/card/adding_card = attacking
+/obj/item/battle_monsters/deck/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item,/obj/item/battle_monsters/card) && attacking_item != src)
+ var/obj/item/battle_monsters/card/adding_card = attacking_item
add_card(user,adding_card)
/obj/item/battle_monsters/deck/attack_self(mob/user)
diff --git a/code/modules/battlemonsters/items/furniture/dueling_area.dm b/code/modules/battlemonsters/items/furniture/dueling_area.dm
index 7425f204720..37f63a94e23 100644
--- a/code/modules/battlemonsters/items/furniture/dueling_area.dm
+++ b/code/modules/battlemonsters/items/furniture/dueling_area.dm
@@ -23,16 +23,16 @@
#define CELLS 8
#define CELLSIZE (world.icon_size/CELLS)
-/obj/structure/dueling_table/attackby(obj/item/W as obj, mob/user as mob, var/click_parameters)
- if(user.unEquip(W, 0, src.loc))
- if(!W.center_of_mass)
- W.randpixel_xy()
+/obj/structure/dueling_table/attackby(obj/item/attacking_item, mob/user , params)
+ if(user.unEquip(attacking_item, 0, src.loc))
+ if(!attacking_item.center_of_mass)
+ attacking_item.randpixel_xy()
return
- if(!click_parameters)
+ if(!params)
return
- var/list/mouse_control = mouse_safe_xy(click_parameters)
+ var/list/mouse_control = mouse_safe_xy(params)
var/mouse_x = mouse_control["icon-x"]
var/mouse_y = mouse_control["icon-y"]
@@ -40,10 +40,10 @@
var/cell_x = max(0, min(CELLS-1, round(mouse_x/CELLSIZE)))
var/cell_y = max(0, min(CELLS-1, round(mouse_y/CELLSIZE)))
- W.pixel_x = (CELLSIZE * (0.5 + cell_x)) - W.center_of_mass["x"]
- W.pixel_y = (CELLSIZE * (0.5 + cell_y)) - W.center_of_mass["y"]
+ attacking_item.pixel_x = (CELLSIZE * (0.5 + cell_x)) - attacking_item.center_of_mass["x"]
+ attacking_item.pixel_y = (CELLSIZE * (0.5 + cell_y)) - attacking_item.center_of_mass["y"]
- W.layer = src.layer + 0.1
+ attacking_item.layer = src.layer + 0.1
#undef CELLS
#undef CELLSIZE
diff --git a/code/modules/blob/blob.dm b/code/modules/blob/blob.dm
index ff485dcedd3..2d34e701a76 100644
--- a/code/modules/blob/blob.dm
+++ b/code/modules/blob/blob.dm
@@ -201,11 +201,11 @@
take_damage((Proj.damage / laser_resist) / fire_resist)
return FALSE
-/obj/effect/blob/attackby(obj/item/W, mob/user)
+/obj/effect/blob/attackby(obj/item/attacking_item, mob/user)
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
user.do_attack_animation(src)
playsound(get_turf(src), 'sound/effects/attackblob.ogg', 50, TRUE)
- if(W.iswirecutter())
+ if(attacking_item.iswirecutter())
if(!pruned)
to_chat(user, SPAN_NOTICE("You collect a sample from \the [src]."))
var/obj/P = new product(get_turf(user))
@@ -217,13 +217,13 @@
return
var/damage = 0
- switch(W.damtype)
+ switch(attacking_item.damtype)
if(DAMAGE_BURN)
- damage = (W.force / fire_resist)
- if(W.iswelder())
+ damage = (attacking_item.force / fire_resist)
+ if(attacking_item.iswelder())
playsound(get_turf(src), 'sound/items/Welder.ogg', 100, TRUE)
if(DAMAGE_BRUTE)
- damage = (W.force / brute_resist)
+ damage = (attacking_item.force / brute_resist)
take_damage(damage)
diff --git a/code/modules/cargo/delivery/backpack.dm b/code/modules/cargo/delivery/backpack.dm
index cccb627b723..8f9f847d679 100644
--- a/code/modules/cargo/delivery/backpack.dm
+++ b/code/modules/cargo/delivery/backpack.dm
@@ -99,24 +99,24 @@
LAZYREMOVE(contained_packages, package)
update_state()
-/obj/item/cargo_backpack/attackby(obj/item/item, mob/living/carbon/human/user)
+/obj/item/cargo_backpack/attackby(obj/item/attacking_item, mob/user)
if(!ishuman(user))
return ..()
if(user.back != src)
- if(istype(item, /obj/item/cargo_package))
+ if(istype(attacking_item, /obj/item/cargo_package))
to_chat(user, SPAN_WARNING("Put \the [src] on your back before you load packages onto it!"))
return
return ..()
- if(!istype(item, /obj/item/cargo_package))
+ if(!istype(attacking_item, /obj/item/cargo_package))
return ..()
if(LAZYLEN(contained_packages) >= 2)
to_chat(user, SPAN_WARNING("\The [src] is already fully loaded!"))
return
- user.visible_message("[user] starts loading \the [item] onto \the [src]...", SPAN_NOTICE("You start loading \the [item] onto \the [src]..."))
+ user.visible_message("[user] starts loading \the [attacking_item] onto \the [src]...", SPAN_NOTICE("You start loading \the [attacking_item] onto \the [src]..."))
if(do_after(user, 1 SECONDS, src, DO_UNIQUE))
- user.visible_message("[user] loads \the [item] onto \the [src]!", SPAN_NOTICE("You load \the [item] onto \the [src]!"))
- user.drop_from_inventory(item, src)
- LAZYADD(contained_packages, item)
+ user.visible_message("[user] loads \the [attacking_item] onto \the [src]!", SPAN_NOTICE("You load \the [attacking_item] onto \the [src]!"))
+ user.drop_from_inventory(attacking_item, src)
+ LAZYADD(contained_packages, attacking_item)
update_state()
diff --git a/code/modules/cargo/delivery/receptacle.dm b/code/modules/cargo/delivery/receptacle.dm
index c61901b7a46..4010a41c769 100644
--- a/code/modules/cargo/delivery/receptacle.dm
+++ b/code/modules/cargo/delivery/receptacle.dm
@@ -51,9 +51,9 @@ var/global/list/all_cargo_receptacles = list()
all_cargo_receptacles -= src
return ..()
-/obj/structure/cargo_receptacle/attackby(obj/item/item, mob/user)
- if(istype(item, /obj/item/cargo_package))
- var/obj/item/cargo_package/package = item
+/obj/structure/cargo_receptacle/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/cargo_package))
+ var/obj/item/cargo_package/package = attacking_item
if(!package.associated_delivery_point)
to_chat(user, SPAN_WARNING("Something's wrong with the cargo package, submit a bug report. ERRCODE: 0"))
return
@@ -63,11 +63,11 @@ var/global/list/all_cargo_receptacles = list()
visible_message(SPAN_WARNING("\The [src] buzzes harshly, \"Invalid package! Check the delivery ID!\""))
return
- user.visible_message("[user] starts heaving \the [item] into \the [src]...", SPAN_NOTICE("You start heaving \the [item] into \the [src]..."))
+ user.visible_message("[user] starts heaving \the [attacking_item] into \the [src]...", SPAN_NOTICE("You start heaving \the [attacking_item] into \the [src]..."))
if(do_after(user, 1 SECONDS, src, DO_UNIQUE))
- user.drop_from_inventory(item, src)
- pay_account(user, item)
- qdel(item)
+ user.drop_from_inventory(attacking_item, src)
+ pay_account(user, attacking_item)
+ qdel(attacking_item)
return
return ..()
diff --git a/code/modules/client/preference_setup/loadout/items/accessories.dm b/code/modules/client/preference_setup/loadout/items/accessories.dm
index b0c216f4d6f..263f1c0ba44 100644
--- a/code/modules/client/preference_setup/loadout/items/accessories.dm
+++ b/code/modules/client/preference_setup/loadout/items/accessories.dm
@@ -1,8 +1,11 @@
/datum/gear/accessory
+ abstract_type = /datum/gear/accessory
+ sort_category = "Accessories"
+
+/datum/gear/accessory/locket
display_name = "silver locket"
path = /obj/item/clothing/accessory/locket
slot = slot_tie
- sort_category = "Accessories"
/datum/gear/accessory/suspenders
display_name = "suspenders"
diff --git a/code/modules/client/preference_setup/loadout/items/computer.dm b/code/modules/client/preference_setup/loadout/items/computer.dm
index 1f58de84074..fed3e136e59 100644
--- a/code/modules/client/preference_setup/loadout/items/computer.dm
+++ b/code/modules/client/preference_setup/loadout/items/computer.dm
@@ -4,6 +4,9 @@
sort_category = "Modular Computers"
cost = 2
+/datum/gear/computer/handheld
+ abstract_type = /datum/gear/computer/handheld
+
/datum/gear/computer/handheld/tablet
display_name = "tablet"
path = /obj/item/modular_computer/handheld/preset
@@ -23,6 +26,9 @@
tablets["machinist tablet"] = /obj/item/modular_computer/handheld/preset/supply/machinist
gear_tweaks += new /datum/gear_tweak/path(tablets)
+/datum/gear/computer/handheld/wristbound
+ abstract_type = /datum/gear/computer/handheld/wristbound
+
/datum/gear/computer/handheld/wristbound/selection
display_name = "wristbound computer selection"
path = /obj/item/modular_computer/handheld/wristbound/preset
diff --git a/code/modules/client/preference_setup/loadout/items/religion.dm b/code/modules/client/preference_setup/loadout/items/religion.dm
index 776102a4300..0b2e6ddad13 100644
--- a/code/modules/client/preference_setup/loadout/items/religion.dm
+++ b/code/modules/client/preference_setup/loadout/items/religion.dm
@@ -1,14 +1,20 @@
/datum/gear/religion
- display_name = "trinary perfection mask"
- path = /obj/item/clothing/mask/trinary_mask
- slot = slot_wear_mask
+ abstract_type = /datum/gear/religion
sort_category = "Religion"
flags = GEAR_HAS_DESC_SELECTION
+/datum/gear/religion/shaman_staff
+ display_name = "shaman staff"
+ path = /obj/item/cane/shaman
+ slot = slot_l_hand
+
/datum/gear/religion/trinary
- display_name = "trinary perfection brooch"
- path = /obj/item/clothing/accessory/badge/trinary
- slot = slot_tie
+ abstract_type = /datum/gear/religion/trinary
+
+/datum/gear/religion/trinary/mask
+ display_name = "trinary perfection mask"
+ path = /obj/item/clothing/mask/trinary_mask
+ slot = slot_wear_mask
/datum/gear/religion/trinary/coif
display_name = "trinary perfection coif"
@@ -98,6 +104,9 @@
slot = slot_tie
flags = GEAR_HAS_DESC_SELECTION | GEAR_HAS_COLOR_SELECTION
+/datum/gear/religion/dominia
+ abstract_type = /datum/gear/religion/dominia
+
/datum/gear/religion/dominia/robe
display_name = "dominian robe selection"
description = "A selection of robes belonging to Dominia's Moroz Holy Tribunal."
@@ -142,21 +151,6 @@
cape["tribunalist surcoat"] = /obj/item/clothing/accessory/poncho/dominia/red/surcoat
gear_tweaks += new /datum/gear_tweak/path(cape)
-/datum/gear/religion/assunzione/robe
- display_name = "assunzione robe selection"
- description = "A selection of robes worn by adherents to Luceism."
- path = /obj/item/clothing/accessory/poncho/assunzione
- slot = slot_wear_suit
- origin_restriction = list(/singleton/origin_item/origin/assunzione, /singleton/origin_item/origin/ipc_assunzione)
-
-/datum/gear/religion/assunzione/robe/New()
- ..()
- var/list/assunzionerobe = list()
- assunzionerobe["assunzione robe"] = /obj/item/clothing/accessory/poncho/assunzione
- assunzionerobe["assunzione vine-inlaid robe"] = /obj/item/clothing/accessory/poncho/assunzione/vine
- assunzionerobe["assunzione gold-inlaid robe"] = /obj/item/clothing/accessory/poncho/assunzione/gold
- gear_tweaks += new /datum/gear_tweak/path(assunzionerobe)
-
/datum/gear/religion/dominia/accessory
display_name = "tribunal necklace"
path = /obj/item/clothing/accessory/dominia
@@ -186,11 +180,6 @@
allowed_roles = list("Chief Medical Officer", "Physician", "Surgeon", "Pharmacist", "First Responder", "Medical Intern", "Medical Personnel")
culture_restriction = list(/singleton/origin_item/culture/dominia, /singleton/origin_item/culture/dominian_unathi)
-/datum/gear/religion/shaman_staff
- display_name = "shaman staff"
- path = /obj/item/cane/shaman
- slot = slot_l_hand
-
/datum/gear/religion/dominia/robe_consular
display_name = "tribunalist consular uniform"
description = "The traditional red-black-gold uniform of a priestly member of His Majesty's Diplomatic Service."
@@ -215,24 +204,6 @@
allowed_roles = list("Consular Officer")
culture_restriction = list(/singleton/origin_item/culture/dominia, /singleton/origin_item/culture/dominian_unathi)
-/datum/gear/religion/assunzione/accessory
- display_name = "luceian amulet"
- path = /obj/item/clothing/accessory/assunzione
- slot = slot_tie
- origin_restriction = list(/singleton/origin_item/origin/assunzione, /singleton/origin_item/origin/ipc_assunzione)
-
-/datum/gear/religion/assunzioneorb
- display_name = "assunzione warding sphere"
- description = "A religious artefact commonly associated with Luceism."
- path = /obj/item/assunzioneorb
- origin_restriction = list(/singleton/origin_item/origin/assunzione, /singleton/origin_item/origin/ipc_assunzione)
-
-/datum/gear/religion/assunzionesheath
- display_name = "assunzione warding sphere sheath"
- description = "A small metal shell designed to hold a warding sphere."
- path = /obj/item/storage/assunzionesheath
- origin_restriction = list(/singleton/origin_item/origin/assunzione, /singleton/origin_item/origin/ipc_assunzione)
-
/datum/gear/religion/dominia/codex
display_name = "tribunal codex"
path = /obj/item/device/versebook/tribunal
@@ -254,3 +225,36 @@
dominiaicon["icon of the martyr, matteo"] = /obj/item/sign/painting_frame/martyr/matteo
dominiaicon["icon of the martyr, valeria"] = /obj/item/sign/painting_frame/martyr/valeria
gear_tweaks += new /datum/gear_tweak/path(dominiaicon)
+
+/datum/gear/religion/assunzione
+ abstract_type = /datum/gear/religion/assunzione
+ origin_restriction = list(/singleton/origin_item/origin/assunzione, /singleton/origin_item/origin/ipc_assunzione)
+
+/datum/gear/religion/assunzione/robe
+ display_name = "assunzione robe selection"
+ description = "A selection of robes worn by adherents to Luceism."
+ path = /obj/item/clothing/accessory/poncho/assunzione
+ slot = slot_wear_suit
+
+/datum/gear/religion/assunzione/robe/New()
+ ..()
+ var/list/assunzionerobe = list()
+ assunzionerobe["assunzione robe"] = /obj/item/clothing/accessory/poncho/assunzione
+ assunzionerobe["assunzione vine-inlaid robe"] = /obj/item/clothing/accessory/poncho/assunzione/vine
+ assunzionerobe["assunzione gold-inlaid robe"] = /obj/item/clothing/accessory/poncho/assunzione/gold
+ gear_tweaks += new /datum/gear_tweak/path(assunzionerobe)
+
+/datum/gear/religion/assunzione/accessory
+ display_name = "luceian amulet"
+ path = /obj/item/clothing/accessory/assunzione
+ slot = slot_tie
+
+/datum/gear/religion/assunzione/orb
+ display_name = "assunzione warding sphere"
+ description = "A religious artefact commonly associated with Luceism."
+ path = /obj/item/assunzioneorb
+
+/datum/gear/religion/assunzione/sheath
+ display_name = "assunzione warding sphere sheath"
+ description = "A small metal shell designed to hold a warding sphere."
+ path = /obj/item/storage/assunzionesheath
diff --git a/code/modules/client/preference_setup/loadout/items/suit.dm b/code/modules/client/preference_setup/loadout/items/suit.dm
index 36352c7ad88..46cfe6ebe95 100644
--- a/code/modules/client/preference_setup/loadout/items/suit.dm
+++ b/code/modules/client/preference_setup/loadout/items/suit.dm
@@ -375,6 +375,8 @@
jacket["departmental jacket, service"] = /obj/item/clothing/suit/storage/toggle/serv_dep_jacket
gear_tweaks += new /datum/gear_tweak/path(jacket)
+/datum/gear/suit/miscellaneous
+ abstract_type = /datum/gear/suit/miscellaneous
/datum/gear/suit/miscellaneous/peacoat
display_name = "peacoat"
diff --git a/code/modules/client/preference_setup/loadout/items/xeno/diona.dm b/code/modules/client/preference_setup/loadout/items/xeno/diona.dm
index 0939ce06ee9..c9815e532fd 100644
--- a/code/modules/client/preference_setup/loadout/items/xeno/diona.dm
+++ b/code/modules/client/preference_setup/loadout/items/xeno/diona.dm
@@ -8,6 +8,9 @@
flags = GEAR_NO_SELECTION
culture_restriction = list(/singleton/origin_item/culture/diona_sol)
+/datum/gear/suit/diona
+ abstract_type = /datum/gear/suit/diona
+
/datum/gear/suit/diona/eternal
display_name = "mesh weave robes"
description = "A set of mesh weave robes worn almost exclusively by priests of the Orthodox Eternal faith."
@@ -122,8 +125,9 @@
whitelisted = list(SPECIES_DIONA, SPECIES_DIONA_COEUS)
sort_category = "Xenowear - Diona"
culture_restriction = list(/singleton/origin_item/culture/dionae_nralakk, /singleton/origin_item/culture/eum, /singleton/origin_item/culture/xrim)
-
-/datum/gear/accessory/skrell_passport/diona
+/datum/gear/accessory/diona
+ abstract_type = /datum/gear/accessory/diona
+/datum/gear/accessory/diona/skrell_passport
display_name = "dionae nralakk federation passport"
path = /obj/item/clothing/accessory/badge/passport/nralakk
whitelisted = list(SPECIES_DIONA, SPECIES_DIONA_COEUS)
diff --git a/code/modules/client/preference_setup/loadout/items/xeno/machine.dm b/code/modules/client/preference_setup/loadout/items/xeno/machine.dm
index 55668aec408..ffa5f9cecb1 100644
--- a/code/modules/client/preference_setup/loadout/items/xeno/machine.dm
+++ b/code/modules/client/preference_setup/loadout/items/xeno/machine.dm
@@ -140,6 +140,9 @@
goldendeep["golden deep skirtsuit"] = /obj/item/clothing/under/goldendeep/skirtsuit
gear_tweaks += new /datum/gear_tweak/path(goldendeep)
+/datum/gear/augment/machine
+ abstract_type = /datum/gear/augment/machine
+
/datum/gear/augment/machine/gustatorial
display_name = "gustatorial centre (tongue)"
description = "An extremely complex augment, capable of translating taste into binary code, allowing synthetic beings to experience food."
diff --git a/code/modules/client/preference_setup/loadout/items/xeno/skrell.dm b/code/modules/client/preference_setup/loadout/items/xeno/skrell.dm
index 662dead4a4d..556287fe684 100644
--- a/code/modules/client/preference_setup/loadout/items/xeno/skrell.dm
+++ b/code/modules/client/preference_setup/loadout/items/xeno/skrell.dm
@@ -1,3 +1,6 @@
+/datum/gear/ears/skrell
+ abstract_type = /datum/gear/ears/skrell
+
/datum/gear/ears/skrell/chains //Chains
display_name = "headtail chain selection"
path = /obj/item/clothing/ears/skrell/chain
@@ -295,6 +298,9 @@ var/datum/gear_tweak/social_credit/social_credit_tweak = new()
outfit["iqi medical"] = /obj/item/clothing/under/skrell/nralakk/iqi/med
gear_tweaks += new /datum/gear_tweak/path(outfit)
+/datum/gear/suit/skrell
+ abstract_type = /datum/gear/suit/skrell
+
/datum/gear/suit/skrell/jacket
display_name = "work jackets"
path = /obj/item/clothing/suit/storage/toggle/skrell
@@ -327,6 +333,8 @@ var/datum/gear_tweak/social_credit/social_credit_tweak = new()
jacket["iqi medical"] = /obj/item/clothing/suit/storage/toggle/skrell/iqi/med
gear_tweaks += new /datum/gear_tweak/path(jacket)
+/datum/gear/accessory/skrell
+ abstract_type = /datum/gear/accessory/skrell
/datum/gear/accessory/skrell/starcoat
display_name = "star coat"
path = /obj/item/clothing/suit/storage/toggle/skrell/starcoat
diff --git a/code/modules/client/preference_setup/loadout/items/xeno/tajara.dm b/code/modules/client/preference_setup/loadout/items/xeno/tajara.dm
index b1dca0efba1..921db40c2ce 100644
--- a/code/modules/client/preference_setup/loadout/items/xeno/tajara.dm
+++ b/code/modules/client/preference_setup/loadout/items/xeno/tajara.dm
@@ -1,3 +1,6 @@
+/datum/gear/shoes/tajara
+ abstract_type = /datum/gear/shoes/tajara
+
/datum/gear/shoes/tajara/boots
display_name = "tajaran boots selection"
description = "A selection of boots fitted for Tajara."
diff --git a/code/modules/client/preference_setup/loadout/items/xeno/vaurca.dm b/code/modules/client/preference_setup/loadout/items/xeno/vaurca.dm
index b33a664a55f..a69846d5604 100644
--- a/code/modules/client/preference_setup/loadout/items/xeno/vaurca.dm
+++ b/code/modules/client/preference_setup/loadout/items/xeno/vaurca.dm
@@ -230,6 +230,9 @@
gear_tweaks += new /datum/gear_tweak/path(lunchboxes)
gear_tweaks += new /datum/gear_tweak/contents(lunchables_vaurca(), lunchables_vaurca_snack(), lunchables_drinks(), lunchables_utensil())
+/datum/gear/ears/vaurca
+ abstract_type = /datum/gear/ears/vaurca
+
/datum/gear/ears/vaurca/rings
display_name = "bulwark horn rings"
description = "Rings worn by Bulwarks to decorate their horns."
diff --git a/code/modules/client/preference_setup/loadout/loadout.dm b/code/modules/client/preference_setup/loadout/loadout.dm
index 22b3953350d..9e99ce1ecfc 100644
--- a/code/modules/client/preference_setup/loadout/loadout.dm
+++ b/code/modules/client/preference_setup/loadout/loadout.dm
@@ -15,6 +15,10 @@ var/list/gear_datums = list()
for(var/geartype in subtypesof(/datum/gear))
var/datum/gear/G = geartype
+ //We do not want placeholders
+ if(G.type == G.abstract_type)
+ continue
+
var/use_name = initial(G.display_name)
var/use_category = initial(G.sort_category)
@@ -406,19 +410,74 @@ var/list/gear_datums = list()
return ..()
/datum/gear
- var/display_name //Name/index. Must be unique.
- var/description //Description of this gear. If left blank will default to the description of the pathed item.
- var/path //Path to item.
- var/cost = 1 //Number of points used. Items in general cost 1 point, storage/armor/gloves/special use costs 2 points.
- var/slot //Slot to equip to.
- var/list/allowed_roles //Roles that can spawn with this item.
- var/whitelisted //Term to check the whitelist for..
- var/faction //Is this item whitelisted for a faction?
- var/list/culture_restriction //Is this item restricted to certain cultures? The contents are paths.
- var/list/origin_restriction //Is this item restricted to certain origins? The contents are paths.
+ /**
+ * Name and index, _must be unique_
+ *
+ * Otherwise, if this is just a placeholder, set the `abstract_type` variable to the path of itself
+ */
+ var/display_name
+
+ /**
+ * Description of this gear
+ *
+ * If left blank will default to the description of the pathed item.
+ */
+ var/description
+
+ ///The path to item to spawn
+ var/path
+
+ ///Number of points used. Items in general cost 1 point, storage/armor/gloves/special use costs 2 points.
+ var/cost = 1
+
+ /**
+ * Slot to equip to, one of the `slot_*` defines, see `code\__DEFINES\items_clothing.dm`
+ *
+ * If `null`, it will be sent to the storage (eg. backpack)
+ */
+ var/slot
+
+ /**
+ * A `/list` of roles that can spawn with this item
+ *
+ * If left `null`, any role can spawn with this item
+ */
+ var/list/allowed_roles
+
+ /**
+ * A `/list` of `SPECIES_*` that can spawn with this item
+ *
+ * If left `null`, any specie can spawn with this item
+ */
+ var/list/whitelisted
+
+ /**
+ * A string of the faction that can use this item
+ *
+ * If left `null`, any faction can spawn with this item
+ */
+ var/faction
+
+ /**
+ * A `/list` of [/singleton/origin_item/culture] paths that can use this item
+ */
+ var/list/singleton/origin_item/culture/culture_restriction
+
+ /**
+ * A `/list` of [/singleton/origin_item/origin] paths that can use this item
+ */
+ var/list/singleton/origin_item/origin/origin_restriction
+
+ ///A string of the category this item will be listed in
var/sort_category = "General"
- var/list/gear_tweaks = list() //List of datums which will alter the item after it has been spawned.
+
+ ///A `/list` of [/datum/gear_tweak] to apply
+ var/list/datum/gear_tweak/gear_tweaks = list()
+
+ ///Bitflag field of `GEAR_*`, see `code\modules\client\preference_setup\loadout\_defines.dm`
var/flags = GEAR_HAS_NAME_SELECTION | GEAR_HAS_DESC_SELECTION
+
+ ///Boolean, if this gear is an augment
var/augment = FALSE
/datum/gear/New()
diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm
index 59d0354c3de..c9f9bdfb051 100644
--- a/code/modules/clothing/clothing.dm
+++ b/code/modules/clothing/clothing.dm
@@ -397,10 +397,10 @@
OE.attack_hand(H)
qdel(src)
-/obj/item/clothing/ears/offear/attackby(obj/item/I, mob/user)
+/obj/item/clothing/ears/offear/attackby(obj/item/attacking_item, mob/user)
var/mob/living/carbon/human/H = loc // we will never not be on a humanoid
var/obj/item/clothing/ears/OE = (H.l_ear == src ? H.r_ear : H.l_ear)
- OE.attackby(I, user)
+ OE.attackby(attacking_item, user)
///////////////////////////////////////////////////////////////////////
//Gloves
@@ -458,9 +458,9 @@
/obj/item/clothing/gloves/proc/Touch(var/atom/A, mob/user, var/proximity)
return 0 // return 1 to cancel attack_hand()
-/obj/item/clothing/gloves/attackby(obj/item/W, mob/user)
+/obj/item/clothing/gloves/attackby(obj/item/attacking_item, mob/user)
..()
- if(is_sharp(W))
+ if(is_sharp(attacking_item))
if(clipped)
to_chat(user, SPAN_NOTICE("\The [src] have already been clipped!"))
update_icon()
@@ -879,15 +879,15 @@
return
-/obj/item/clothing/shoes/attackby(var/obj/item/I, var/mob/user)
- if(can_hold_knife && is_type_in_list(I, list(/obj/item/material/shard, /obj/item/material/kitchen/utensil, /obj/item/material/knife)))
+/obj/item/clothing/shoes/attackby(obj/item/attacking_item, mob/user)
+ if(can_hold_knife && is_type_in_list(attacking_item, list(/obj/item/material/shard, /obj/item/material/kitchen/utensil, /obj/item/material/knife)))
if(holding)
to_chat(user, SPAN_WARNING("\The [src] is already holding \a [holding]."))
return
- user.unEquip(I)
- I.forceMove(src)
- holding = I
- user.visible_message(SPAN_NOTICE("\The [user] shoves \the [I] into \the [src]."))
+ user.unEquip(attacking_item)
+ attacking_item.forceMove(src)
+ holding = attacking_item
+ user.visible_message(SPAN_NOTICE("\The [user] shoves \the [attacking_item] into \the [src]."))
playsound(get_turf(src), 'sound/weapons/holster/holster_knife.ogg', 25)
verbs |= /obj/item/clothing/shoes/proc/draw_knife
update_icon()
diff --git a/code/modules/clothing/clothing_accessories.dm b/code/modules/clothing/clothing_accessories.dm
index 0d9873d0053..fa8f07d8f1d 100644
--- a/code/modules/clothing/clothing_accessories.dm
+++ b/code/modules/clothing/clothing_accessories.dm
@@ -8,14 +8,14 @@
if (AC.slot == A.slot)
return 0
-/obj/item/clothing/attackby(var/obj/item/I, var/mob/user)
- if(istype(I, /obj/item/clothing/accessory))
+/obj/item/clothing/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/clothing/accessory))
if(!valid_accessory_slots || !valid_accessory_slots.len)
to_chat(usr, "You cannot attach accessories of any kind to \the [src].")
return
- var/obj/item/clothing/accessory/A = I
+ var/obj/item/clothing/accessory/A = attacking_item
if(can_attach_accessory(A))
user.drop_item()
attach_accessory(user, A)
@@ -26,7 +26,7 @@
if(LAZYLEN(accessories))
for(var/obj/item/clothing/accessory/A in accessories)
- A.attackby(I, user)
+ A.attackby(attacking_item, user)
return
..()
diff --git a/code/modules/clothing/glasses/glasses.dm b/code/modules/clothing/glasses/glasses.dm
index 2cc9d75350f..0e7e34e7f7e 100644
--- a/code/modules/clothing/glasses/glasses.dm
+++ b/code/modules/clothing/glasses/glasses.dm
@@ -525,19 +525,19 @@ BLIND // can't see anything
prescription = 7
body_parts_covered = 0
-/obj/item/clothing/glasses/regular/attackby(obj/item/W as obj, mob/user as mob)
- if(istype(W, /obj/item/clothing/glasses/hud/health))
- user.drop_item(W)
- qdel(W)
+/obj/item/clothing/glasses/regular/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/clothing/glasses/hud/health))
+ user.drop_item(attacking_item)
+ qdel(attacking_item)
to_chat(user, SPAN_NOTICE("You attach a set of medical HUDs to your glasses."))
playsound(src.loc, 'sound/weapons/blade_open.ogg', 50, 1)
var/obj/item/clothing/glasses/hud/health/prescription/P = new /obj/item/clothing/glasses/hud/health/prescription(user.loc)
P.glasses_type = src.type
user.put_in_hands(P)
qdel(src)
- if(istype(W, /obj/item/clothing/glasses/hud/security))
- user.drop_item(W)
- qdel(W)
+ if(istype(attacking_item, /obj/item/clothing/glasses/hud/security))
+ user.drop_item(attacking_item)
+ qdel(attacking_item)
to_chat(user, SPAN_NOTICE("You attach a set of security HUDs to your glasses."))
playsound(src.loc, 'sound/weapons/blade_open.ogg', 50, 1)
var/obj/item/clothing/glasses/hud/security/prescription/P = new /obj/item/clothing/glasses/hud/security/prescription(user.loc)
diff --git a/code/modules/clothing/gloves/attackby.dm b/code/modules/clothing/gloves/attackby.dm
index 214616bd581..e75bb7f5ba7 100644
--- a/code/modules/clothing/gloves/attackby.dm
+++ b/code/modules/clothing/gloves/attackby.dm
@@ -1,6 +1,6 @@
-/obj/item/clothing/gloves/attackby(obj/item/W, mob/user)
- if(W.ismultitool())
+/obj/item/clothing/gloves/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.ismultitool())
var/siemens_percentage = 100 * siemens_coefficient
- to_chat(user, SPAN_NOTICE("You probe \the [src] with \the [W]. The gloves will let [siemens_percentage]% of an electric shock through."))
+ to_chat(user, SPAN_NOTICE("You probe \the [src] with \the [attacking_item]. The gloves will let [siemens_percentage]% of an electric shock through."))
return
return ..()
diff --git a/code/modules/clothing/gloves/boxing.dm b/code/modules/clothing/gloves/boxing.dm
index 5511c5c2d1d..74ef5141f70 100644
--- a/code/modules/clothing/gloves/boxing.dm
+++ b/code/modules/clothing/gloves/boxing.dm
@@ -5,8 +5,8 @@
item_state = "boxing"
species_restricted = list("exclude",BODYTYPE_VAURCA_BREEDER,BODYTYPE_VAURCA_WARFORM,BODYTYPE_VAURCA_BULWARK)
-/obj/item/clothing/gloves/boxing/attackby(obj/item/W, mob/user)
- if(W.iswirecutter() || istype(W, /obj/item/surgery/scalpel))
+/obj/item/clothing/gloves/boxing/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.iswirecutter() || istype(attacking_item, /obj/item/surgery/scalpel))
to_chat(user, "That won't work.") //Nope)
return
..()
diff --git a/code/modules/clothing/gloves/miscellaneous.dm b/code/modules/clothing/gloves/miscellaneous.dm
index a259eb2e21c..d2e31561551 100644
--- a/code/modules/clothing/gloves/miscellaneous.dm
+++ b/code/modules/clothing/gloves/miscellaneous.dm
@@ -67,9 +67,9 @@
pickup_sound = 'sound/items/pickup/rubber.ogg'
var/balloon = /obj/item/toy/balloon/latex
-/obj/item/clothing/gloves/latex/attackby(var/obj/O, mob/user as mob)
- if(istype(O, /obj/item/stack/cable_coil))
- var/obj/item/stack/cable_coil/C = O
+/obj/item/clothing/gloves/latex/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/stack/cable_coil))
+ var/obj/item/stack/cable_coil/C = attacking_item
if(C.use(1))
var/obj/item/L = new src.balloon
user.drop_from_inventory(L,get_turf(src))
@@ -335,10 +335,10 @@
spark(user, 3, GLOB.alldirs)
mounted.Fire(L, user)
-/obj/item/clothing/gloves/ballistic/attackby(obj/item/W, mob/user)
+/obj/item/clothing/gloves/ballistic/attackby(obj/item/attacking_item, mob/user)
..()
if(mounted)
- mounted.load_ammo(W, user)
+ mounted.load_ammo(attacking_item, user)
return
/obj/item/clothing/gloves/ballistic/verb/unload_shells()
diff --git a/code/modules/clothing/gloves/stungloves.dm b/code/modules/clothing/gloves/stungloves.dm
index c2b1018a66d..795973c7ed9 100644
--- a/code/modules/clothing/gloves/stungloves.dm
+++ b/code/modules/clothing/gloves/stungloves.dm
@@ -1,4 +1,4 @@
-/obj/item/clothing/gloves/attackby(obj/item/W, mob/user)
+/obj/item/clothing/gloves/attackby(obj/item/attacking_item, mob/user)
if(istype(src, /obj/item/clothing/gloves/boxing)) //quick fix for stunglove overlay not working nicely with boxing gloves.
to_chat(user, "That won't work.") //i'm not putting my lips on that!)
..()
@@ -9,8 +9,8 @@
return
//add wires
- if(W.iscoil())
- var/obj/item/stack/cable_coil/C = W
+ if(attacking_item.iscoil())
+ var/obj/item/stack/cable_coil/C = attacking_item
if (clipped)
to_chat(user, "The [src] are too badly mangled for wiring.")
return
@@ -31,18 +31,18 @@
return
//add cell
- else if(wired && istype(W, /obj/item/cell))
+ else if(wired && istype(attacking_item, /obj/item/cell))
if(cell)
to_chat(user, "\A [cell] is already attached to the [src].")
return
- user.drop_from_inventory(W,src)
- cell = W
+ user.drop_from_inventory(attacking_item, src)
+ cell = attacking_item
w_class = ITEMSIZE_NORMAL
to_chat(user, "You attach \the [cell] to the [src].")
update_icon()
return
- else if((cell || wired) && (W.iswirecutter() || istype(W, /obj/item/surgery/scalpel)))
+ else if((cell || wired) && (attacking_item.iswirecutter() || istype(attacking_item, /obj/item/surgery/scalpel)))
//stunglove stuff
if(cell)
diff --git a/code/modules/clothing/head/helmet.dm b/code/modules/clothing/head/helmet.dm
index 1654458127d..023d259b474 100644
--- a/code/modules/clothing/head/helmet.dm
+++ b/code/modules/clothing/head/helmet.dm
@@ -65,11 +65,11 @@
return TRUE
return FALSE
-/obj/item/clothing/head/helmet/attackby(obj/item/W, mob/user)
+/obj/item/clothing/head/helmet/attackby(obj/item/attacking_item, mob/user)
. = ..()
- if(!has_storage || istype(W, /obj/item/clothing/accessory))
+ if(!has_storage || istype(attacking_item, /obj/item/clothing/accessory))
return
- hold.attackby(W, user)
+ hold.attackby(attacking_item, user)
/obj/item/clothing/head/helmet/emp_act(severity)
. = ..()
diff --git a/code/modules/clothing/head/misc_special.dm b/code/modules/clothing/head/misc_special.dm
index 4097f2925a2..b679c5b6ea6 100644
--- a/code/modules/clothing/head/misc_special.dm
+++ b/code/modules/clothing/head/misc_special.dm
@@ -134,16 +134,16 @@
throwforce = 1
throw_speed = 0.5
-/obj/item/clothing/head/pumpkin/attackby(var/obj/O, mob/user as mob)
- if(istype(O, /obj/item/flame/candle))
- var/obj/item/flame/candle/c = O
+/obj/item/clothing/head/pumpkin/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/flame/candle))
+ var/obj/item/flame/candle/c = attacking_item
var/candle_wax = c.wax
if(c.lit)
- to_chat(user, SPAN_NOTICE("You should extinguish \the [O] first!"))
+ to_chat(user, SPAN_NOTICE("You should extinguish \the [attacking_item] first!"))
return
- to_chat(user, "You add \the [O] to \the [src].")
+ to_chat(user, "You add \the [attacking_item] to \the [src].")
playsound(src.loc, 'sound/items/drop/gloves.ogg', 50, 1)
- qdel(O)
+ qdel(attacking_item)
var/obj/item/clothing/head/pumpkin/lantern/L = new /obj/item/clothing/head/pumpkin/lantern(user.loc)
L.wax = candle_wax
user.put_in_hands(L)
@@ -165,18 +165,18 @@
M.update_inv_l_hand(0)
M.update_inv_r_hand(1)
-/obj/item/clothing/head/pumpkin/lantern/attackby(obj/item/W as obj, mob/user as mob)
+/obj/item/clothing/head/pumpkin/lantern/attackby(obj/item/attacking_item, mob/user)
..()
- if(W.iswelder())
- var/obj/item/weldingtool/WT = W
+ if(attacking_item.iswelder())
+ var/obj/item/weldingtool/WT = attacking_item
if(WT.isOn()) //Badasses dont get blinded by lighting their candle with a welding tool
light()
- to_chat(user, SPAN_NOTICE("\The [user] casually lights \the [name] with [W]."))
- else if(W.isFlameSource())
+ to_chat(user, SPAN_NOTICE("\The [user] casually lights \the [name] with [attacking_item]."))
+ else if(attacking_item.isFlameSource())
light()
to_chat(user, SPAN_NOTICE("\The [user] lights \the [name]."))
- else if(istype(W, /obj/item/flame/candle))
- var/obj/item/flame/candle/C = W
+ else if(istype(attacking_item, /obj/item/flame/candle))
+ var/obj/item/flame/candle/C = attacking_item
if(C.lit)
light()
to_chat(user, SPAN_NOTICE("\The [user] lights \the [name]."))
diff --git a/code/modules/clothing/sets/laser_tag.dm b/code/modules/clothing/sets/laser_tag.dm
index 235ad1dbf4f..c0a2f13baa5 100644
--- a/code/modules/clothing/sets/laser_tag.dm
+++ b/code/modules/clothing/sets/laser_tag.dm
@@ -45,9 +45,9 @@
return
return ..()
-/obj/item/clothing/suit/armor/riot/laser_tag/attackby(obj/item/I, mob/user)
- if(I.ismultitool())
- var/chosen_color = input(user, "Which color do you wish your vest to be?", "Color Selection") as null|anything in list("blue", "red")
+/obj/item/clothing/suit/armor/riot/laser_tag/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.ismultitool())
+ var/chosen_color = tgui_input_list(user, "Which color do you wish your vest to be?", "Color Selection", list("blue", "red"))
if(!chosen_color)
return
laser_tag_color = chosen_color
@@ -85,9 +85,9 @@
. = ..()
get_tag_color(laser_tag_color)
-/obj/item/clothing/head/helmet/riot/laser_tag/attackby(obj/item/I, mob/user)
- if(I.ismultitool())
- var/chosen_color = input(user, "Which color do you wish your helmet to be?", "Color Selection") as null|anything in list("blue", "red")
+/obj/item/clothing/head/helmet/riot/laser_tag/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.ismultitool())
+ var/chosen_color = tgui_input_list(user, "Which color do you wish your helmet to be?", "Color Selection", list("blue", "red"))
if(!chosen_color)
return
laser_tag_color = chosen_color
diff --git a/code/modules/clothing/shoes/sneakers.dm b/code/modules/clothing/shoes/sneakers.dm
index 9770dde5160..7292e17cede 100644
--- a/code/modules/clothing/shoes/sneakers.dm
+++ b/code/modules/clothing/shoes/sneakers.dm
@@ -47,10 +47,10 @@
..()
remove_cuffs(user)
-/obj/item/clothing/shoes/sneakers/orange/attackby(H as obj, mob/user as mob)
+/obj/item/clothing/shoes/sneakers/orange/attackby(obj/item/attacking_item, mob/user)
..()
- if (istype(H, /obj/item/handcuffs))
- attach_cuffs(H, user)
+ if (istype(attacking_item, /obj/item/handcuffs))
+ attach_cuffs(attacking_item, user)
/obj/item/clothing/shoes/sneakers/yellow
name = "yellow shoes"
diff --git a/code/modules/clothing/spacesuits/breaches.dm b/code/modules/clothing/spacesuits/breaches.dm
index a890b24feb6..38c09b0b45d 100644
--- a/code/modules/clothing/spacesuits/breaches.dm
+++ b/code/modules/clothing/spacesuits/breaches.dm
@@ -177,10 +177,10 @@ var/global/list/breach_burn_descriptors = list(
//Handles repairs (and also upgrades).
-/obj/item/clothing/suit/space/attackby(obj/item/W as obj, mob/user as mob)
- if(istype(W,/obj/item/stack/material))
+/obj/item/clothing/suit/space/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/stack/material))
var/repair_power = 0
- switch(W.get_material_name())
+ switch(attacking_item.get_material_name())
if(DEFAULT_WALL_MATERIAL)
repair_power = 2
if("plastic")
@@ -197,13 +197,13 @@ var/global/list/breach_burn_descriptors = list(
to_chat(user, "There is no surface damage on \the [src] to repair.")
return
- var/obj/item/stack/P = W
+ var/obj/item/stack/P = attacking_item
var/use_amt = min(P.get_amount(), 3)
if(use_amt && P.use(use_amt))
repair_breaches(DAMAGE_BURN, use_amt * repair_power, user)
return
- else if(W.iswelder())
+ else if(attacking_item.iswelder())
if(istype(src.loc,/mob/living))
to_chat(user, "How do you intend to patch a voidsuit while someone is wearing it?")
@@ -213,7 +213,7 @@ var/global/list/breach_burn_descriptors = list(
to_chat(user, "There is no structural damage on \the [src] to repair.")
return
- var/obj/item/weldingtool/WT = W
+ var/obj/item/weldingtool/WT = attacking_item
if(!WT.use(5))
to_chat(user, "You need more welding fuel to repair this suit.")
return
diff --git a/code/modules/clothing/spacesuits/rig/modules/modules.dm b/code/modules/clothing/spacesuits/rig/modules/modules.dm
index 324504dfdcb..80c2f17bad6 100644
--- a/code/modules/clothing/spacesuits/rig/modules/modules.dm
+++ b/code/modules/clothing/spacesuits/rig/modules/modules.dm
@@ -71,23 +71,23 @@
if(2)
. += SPAN_DANGER("It is almost completely destroyed.")
-/obj/item/rig_module/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/stack/nanopaste))
+/obj/item/rig_module/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/stack/nanopaste))
if(damage == 0)
to_chat(user, SPAN_WARNING("There is no damage to mend."))
return
to_chat(user, SPAN_NOTICE("You start mending the damaged portions of \the [src]..."))
- if(!do_after(user,30) || !W || !src)
+ if(!do_after(user,30) || !attacking_item || !src)
return
- var/obj/item/stack/nanopaste/paste = W
+ var/obj/item/stack/nanopaste/paste = attacking_item
damage = 0
- to_chat(user, SPAN_NOTICE("You mend the damage to \the [src] with \the [W]."))
+ to_chat(user, SPAN_NOTICE("You mend the damage to \the [src] with \the [attacking_item]."))
paste.use(1)
return
- else if(W.iscoil())
+ else if(attacking_item.iscoil())
switch(damage)
if(0)
to_chat(user, SPAN_WARNING("There is no damage to mend."))
@@ -96,17 +96,17 @@
to_chat(user, SPAN_WARNING("\The [src] is too damaged to repair with cable coil, it needs nanopaste."))
return
- var/obj/item/stack/cable_coil/cable = W
+ var/obj/item/stack/cable_coil/cable = attacking_item
if(!cable.amount >= 5)
to_chat(user, SPAN_WARNING("You need five units of cable to repair \the [src]."))
return
to_chat(user, SPAN_NOTICE("You start mending the damaged portions of \the [src]..."))
- if(!do_after(user, 30) || !W || !src)
+ if(!do_after(user, 30) || !attacking_item || !src)
return
damage = 1
- to_chat(user, SPAN_NOTICE("You mend some of damage to \the [src] with \the [W], but you will need more advanced tools to fix it completely."))
+ to_chat(user, SPAN_NOTICE("You mend some of damage to \the [src] with \the [attacking_item], but you will need more advanced tools to fix it completely."))
cable.use(5)
return
..()
diff --git a/code/modules/clothing/spacesuits/rig/rig_attackby.dm b/code/modules/clothing/spacesuits/rig/rig_attackby.dm
index a4f130c7cb9..e910821f6ad 100644
--- a/code/modules/clothing/spacesuits/rig/rig_attackby.dm
+++ b/code/modules/clothing/spacesuits/rig/rig_attackby.dm
@@ -1,4 +1,4 @@
-/obj/item/rig/attackby(obj/item/W as obj, mob/user as mob)
+/obj/item/rig/attackby(obj/item/attacking_item, mob/user)
if(!istype(user,/mob/living)) return 0
@@ -7,11 +7,11 @@
return
// Pass repair items on to the chestpiece.
- if(chest && (istype(W,/obj/item/stack/material) || W.iswelder()))
- return chest.attackby(W,user)
+ if(chest && (istype(attacking_item, /obj/item/stack/material) || attacking_item.iswelder()))
+ return chest.attackby(attacking_item,user)
// Lock or unlock the access panel.
- if(W.GetID())
+ if(attacking_item.GetID())
if(subverted)
locked = 0
to_chat(user, "It looks like the locking system has been shorted out.")
@@ -30,7 +30,7 @@
to_chat(user, "You [locked ? "lock" : "unlock"] \the [src] access panel.")
return
- else if(W.iscrowbar())
+ else if(attacking_item.iscrowbar())
if(!open && locked)
to_chat(user, "The access panel is locked shut.")
@@ -43,7 +43,7 @@
if(open)
// Hacking.
- if(W.iswirecutter() || W.ismultitool())
+ if(attacking_item.iswirecutter() || attacking_item.ismultitool())
if(open)
wires.interact(user)
@@ -52,22 +52,22 @@
return
// Air tank.
- if(istype(W,/obj/item/tank)) //Todo, some kind of check for suits without integrated air supplies.
+ if(istype(attacking_item,/obj/item/tank)) //Todo, some kind of check for suits without integrated air supplies.
if(air_supply)
to_chat(user, "\The [src] already has a tank installed.")
return
- if(!user.unEquip(W)) return
- air_supply = W
- W.forceMove(src)
- to_chat(user, "You slot [W] into [src] and tighten the connecting valve.")
+ if(!user.unEquip(attacking_item)) return
+ air_supply = attacking_item
+ attacking_item.forceMove(src)
+ to_chat(user, "You slot [attacking_item] into [src] and tighten the connecting valve.")
return
// Check if this is a hardsuit upgrade or a modification.
- else if(istype(W,/obj/item/rig_module))
+ else if(istype(attacking_item,/obj/item/rig_module))
- var/obj/item/rig_module/module = W
+ var/obj/item/rig_module/module = attacking_item
if(istype(src.loc,/mob/living/carbon/human))
var/mob/living/carbon/human/H = src.loc
if(H.back == src)
@@ -83,15 +83,15 @@
if(installed_modules.len)
for(var/obj/item/rig_module/installed_mod in installed_modules)
- if(!installed_mod.redundant && istype(installed_mod,W))
+ if(!installed_mod.redundant && istype(installed_mod, attacking_item))
to_chat(user, "The hardsuit already has a module of that class installed.")
return 1
- var/obj/item/rig_module/mod = W
+ var/obj/item/rig_module/mod = attacking_item
to_chat(user, "You begin installing \the [mod] into \the [src].")
if(!do_after(user,40))
return
- if(!user || !W)
+ if(!user || !attacking_item)
return
if(!user.unEquip(mod)) return
to_chat(user, "You install \the [mod] into \the [src].")
@@ -101,15 +101,15 @@
update_icon()
return 1
- else if(!cell && istype(W,/obj/item/cell))
+ else if(!cell && istype(attacking_item,/obj/item/cell))
- if(!user.unEquip(W)) return
- to_chat(user, "You jack \the [W] into \the [src]'s battery mount.")
- W.forceMove(src)
- src.cell = W
+ if(!user.unEquip(attacking_item)) return
+ to_chat(user, "You jack \the [attacking_item] into \the [src]'s battery mount.")
+ attacking_item.forceMove(src)
+ src.cell = attacking_item
return
- else if(W.iswrench())
+ else if(attacking_item.iswrench())
if(!air_supply)
to_chat(user, "There is not tank to remove.")
@@ -123,7 +123,7 @@
air_supply = null
return
- else if(W.isscrewdriver())
+ else if(attacking_item.isscrewdriver())
var/list/current_mounts = list()
if(cell) current_mounts += "cell"
@@ -178,8 +178,8 @@
installed_modules -= removed
update_icon()
- else if(istype(W,/obj/item/stack/nanopaste)) //EMP repair
- var/obj/item/stack/S = W
+ else if(istype(attacking_item,/obj/item/stack/nanopaste)) //EMP repair
+ var/obj/item/stack/S = attacking_item
if(malfunctioning || malfunction_delay)
if(S.use(1))
to_chat(user, "You pour some of \the [S] over \the [src]'s control circuitry.")
@@ -193,7 +193,7 @@
// If we've gotten this far, all we have left to do before we pass off to root procs
// is check if any of the loaded modules want to use the item we've been given.
for(var/obj/item/rig_module/module in installed_modules)
- if(module.accepts_item(W,user)) //Item is handled in this proc
+ if(module.accepts_item(attacking_item, user)) //Item is handled in this proc
return
..()
diff --git a/code/modules/clothing/spacesuits/rig/rig_construction.dm b/code/modules/clothing/spacesuits/rig/rig_construction.dm
index 6cc4890f946..573f1a5d3d0 100644
--- a/code/modules/clothing/spacesuits/rig/rig_construction.dm
+++ b/code/modules/clothing/spacesuits/rig/rig_construction.dm
@@ -52,8 +52,8 @@
. = ..()
closeToolTip(usr)
-/obj/item/rig_assembly/attackby(obj/item/W as obj, mob/user as mob)
- if(!construct || !construct.action(W, user))
+/obj/item/rig_assembly/attackby(obj/item/attacking_item, mob/user)
+ if(!construct || !construct.action(attacking_item, user))
..()
return
diff --git a/code/modules/clothing/spacesuits/void/void.dm b/code/modules/clothing/spacesuits/void/void.dm
index 7d80791cc68..aeac4536ec2 100644
--- a/code/modules/clothing/spacesuits/void/void.dm
+++ b/code/modules/clothing/spacesuits/void/void.dm
@@ -261,18 +261,18 @@
/obj/item/clothing/suit/space/void/attack_self()
toggle_helmet()
-/obj/item/clothing/suit/space/void/attackby(obj/item/W as obj, mob/user as mob)
+/obj/item/clothing/suit/space/void/attackby(obj/item/attacking_item, mob/user)
if(!istype(user,/mob/living)) return
- if(istype(W,/obj/item/clothing/accessory) || istype(W, /obj/item/device/hand_labeler))
+ if(istype(attacking_item, /obj/item/clothing/accessory) || istype(attacking_item, /obj/item/device/hand_labeler))
return ..()
if(user.get_inventory_slot(src) == slot_wear_suit)
to_chat(user, SPAN_WARNING("You cannot modify \the [src] while it is being worn."))
return
- if(W.isscrewdriver())
+ if(attacking_item.isscrewdriver())
if(helmet || boots || tank || cooler)
var/choice = tgui_input_list(usr, "What component would you like to remove?", "Component Removal", list(helmet,boots,tank,cooler))
if(!choice) return
@@ -297,42 +297,42 @@
else
to_chat(user, "\The [src] does not have anything installed.")
return
- else if(istype(W,/obj/item/clothing/head/helmet/space))
+ else if(istype(attacking_item,/obj/item/clothing/head/helmet/space))
if(helmet)
to_chat(user, "\The [src] already has a helmet installed.")
else
playsound(src, 'sound/items/Deconstruct.ogg', 30, 1)
- to_chat(user, "You attach \the [W] to \the [src]'s helmet mount.")
- user.drop_from_inventory(W,src)
- src.helmet = W
+ to_chat(user, "You attach \the [attacking_item] to \the [src]'s helmet mount.")
+ user.drop_from_inventory(attacking_item, src)
+ src.helmet = attacking_item
return
- else if(istype(W,/obj/item/clothing/shoes/magboots))
+ else if(istype(attacking_item,/obj/item/clothing/shoes/magboots))
if(boots)
to_chat(user, "\The [src] already has magboots installed.")
else
playsound(src, 'sound/items/Deconstruct.ogg', 30, 1)
- to_chat(user, "You attach \the [W] to \the [src]'s boot mounts.")
- user.drop_from_inventory(W,src)
- boots = W
+ to_chat(user, "You attach \the [attacking_item] to \the [src]'s boot mounts.")
+ user.drop_from_inventory(attacking_item, src)
+ boots = attacking_item
return
- else if(istype(W,/obj/item/tank))
+ else if(istype(attacking_item,/obj/item/tank))
if(tank)
to_chat(user, "\The [src] already has an airtank installed.")
- else if(istype(W,/obj/item/tank/phoron))
- to_chat(user, "\The [W] cannot be inserted into \the [src]'s storage compartment.")
+ else if(istype(attacking_item,/obj/item/tank/phoron))
+ to_chat(user, "\The [attacking_item] cannot be inserted into \the [src]'s storage compartment.")
else
playsound(src, 'sound/items/Deconstruct.ogg', 30, 1)
- to_chat(user, "You insert \the [W] into \the [src]'s storage compartment.")
- user.drop_from_inventory(W,src)
- tank = W
+ to_chat(user, "You insert \the [attacking_item] into \the [src]'s storage compartment.")
+ user.drop_from_inventory(attacking_item, src)
+ tank = attacking_item
return
- else if (istype(W, /obj/item/device/suit_cooling_unit))
+ else if (istype(attacking_item, /obj/item/device/suit_cooling_unit))
if(cooler)
to_chat(user, "\The [src] already has a suit cooler installed.")
else
playsound(src, 'sound/items/Deconstruct.ogg', 30, 1)
- to_chat(user, "You insert \the [W] into \the [src]'s storage compartment.")
- user.drop_from_inventory(W,src)
- cooler = W
+ to_chat(user, "You insert \the [attacking_item] into \the [src]'s storage compartment.")
+ user.drop_from_inventory(attacking_item, src)
+ cooler = attacking_item
return
..()
diff --git a/code/modules/clothing/suits/armor.dm b/code/modules/clothing/suits/armor.dm
index 7bc00cbc159..7c1ea13af2a 100644
--- a/code/modules/clothing/suits/armor.dm
+++ b/code/modules/clothing/suits/armor.dm
@@ -45,13 +45,13 @@
else
..(over_object)
-/obj/item/clothing/suit/armor/attackby(obj/item/W, mob/user)
+/obj/item/clothing/suit/armor/attackby(obj/item/attacking_item, mob/user)
..()
- if(istype(W, /obj/item/clothing/accessory/armor_plate))
- if(W in accessories) //We already attached this. Don't try to put it in our pockets
+ if(istype(attacking_item, /obj/item/clothing/accessory/armor_plate))
+ if(attacking_item in accessories) //We already attached this. Don't try to put it in our pockets
return
if(pockets)
- pockets.attackby(W, user)
+ pockets.attackby(attacking_item, user)
/obj/item/clothing/suit/armor/emp_act(severity)
. = ..()
@@ -217,9 +217,9 @@
QDEL_NULL(pockets) //Tactical armor has internal holster instead of pockets, so we null this out
cut_overlays() // Remove the holster's overlay.
-/obj/item/clothing/suit/armor/tactical/attackby(obj/item/W as obj, mob/user as mob)
+/obj/item/clothing/suit/armor/tactical/attackby(obj/item/attacking_item, mob/user)
..()
- holster.attackby(W, user)
+ holster.attackby(attacking_item, user)
/obj/item/clothing/suit/armor/tactical/attack_hand(mob/user as mob)
if (loc == user)//If we're wearing the suit and we click it with an empty hand
diff --git a/code/modules/clothing/suits/storage.dm b/code/modules/clothing/suits/storage.dm
index bfc75fa2fb1..ef737ca1739 100644
--- a/code/modules/clothing/suits/storage.dm
+++ b/code/modules/clothing/suits/storage.dm
@@ -27,11 +27,11 @@
return TRUE
return FALSE
-/obj/item/clothing/suit/storage/attackby(obj/item/W as obj, mob/user as mob)
+/obj/item/clothing/suit/storage/attackby(obj/item/attacking_item, mob/user)
..()
- if(istype(W, /obj/item/clothing/accessory))
+ if(istype(attacking_item, /obj/item/clothing/accessory))
return
- pockets.attackby(W, user)
+ pockets.attackby(attacking_item, user)
/obj/item/clothing/suit/storage/emp_act(severity)
. = ..()
diff --git a/code/modules/clothing/under/accessories/accessory.dm b/code/modules/clothing/under/accessories/accessory.dm
index 67971c2e400..62e339c751d 100644
--- a/code/modules/clothing/under/accessories/accessory.dm
+++ b/code/modules/clothing/under/accessories/accessory.dm
@@ -117,7 +117,7 @@
return ..()
//default attackby behaviour
-/obj/item/clothing/accessory/attackby(obj/item/I, mob/user)
+/obj/item/clothing/accessory/attackby(obj/item/attacking_item, mob/user)
..()
//default attack_hand behaviour
diff --git a/code/modules/clothing/under/accessories/badges.dm b/code/modules/clothing/under/accessories/badges.dm
index 043c5a72381..9b86cdb9032 100644
--- a/code/modules/clothing/under/accessories/badges.dm
+++ b/code/modules/clothing/under/accessories/badges.dm
@@ -141,10 +141,10 @@
to_chat(user, "You crack the holobadge security checks.")
return 1
-/obj/item/clothing/accessory/badge/holo/attackby(var/obj/item/O as obj, var/mob/user as mob)
- if(O.GetID())
+/obj/item/clothing/accessory/badge/holo/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.GetID())
- var/obj/item/card/id/id_card = O.GetID()
+ var/obj/item/card/id/id_card = attacking_item.GetID()
if(!istype(id_card))
return
diff --git a/code/modules/clothing/under/accessories/holster.dm b/code/modules/clothing/under/accessories/holster.dm
index 2a12405e515..65308757a59 100644
--- a/code/modules/clothing/under/accessories/holster.dm
+++ b/code/modules/clothing/under/accessories/holster.dm
@@ -89,8 +89,8 @@
..(user)
-/obj/item/clothing/accessory/holster/attackby(obj/item/W, mob/user)
- holster(W, user)
+/obj/item/clothing/accessory/holster/attackby(obj/item/attacking_item, mob/user)
+ holster(attacking_item, user)
/obj/item/clothing/accessory/holster/emp_act(severity)
. = ..()
diff --git a/code/modules/clothing/under/accessories/lockets.dm b/code/modules/clothing/under/accessories/lockets.dm
index e2af2625e3a..8b67ff02b90 100644
--- a/code/modules/clothing/under/accessories/lockets.dm
+++ b/code/modules/clothing/under/accessories/lockets.dm
@@ -34,17 +34,17 @@
else
icon_state = "[base_icon]"
-/obj/item/clothing/accessory/locket/attackby(var/obj/item/O as obj, mob/user as mob)
+/obj/item/clothing/accessory/locket/attackby(obj/item/attacking_item, mob/user)
if(!open)
to_chat(user, "You have to open it first.")
return
- if(istype(O,/obj/item/paper) || istype(O, /obj/item/photo))
+ if(istype(attacking_item,/obj/item/paper) || istype(attacking_item, /obj/item/photo))
if(held)
to_chat(usr, "\The [src] already has something inside it.")
else
- to_chat(usr, "You slip [O] into [src].")
- user.drop_from_inventory(O,src)
- src.held = O
+ to_chat(usr, "You slip [attacking_item] into [src].")
+ user.drop_from_inventory(attacking_item, src)
+ src.held = attacking_item
return
..()
diff --git a/code/modules/clothing/under/accessories/storage.dm b/code/modules/clothing/under/accessories/storage.dm
index 88cd0382017..6cea6456756 100644
--- a/code/modules/clothing/under/accessories/storage.dm
+++ b/code/modules/clothing/under/accessories/storage.dm
@@ -29,8 +29,8 @@
if (hold.handle_mousedrop(usr, over_object))
..(over_object)
-/obj/item/clothing/accessory/storage/attackby(obj/item/W as obj, mob/user as mob)
- return hold.attackby(W, user)
+/obj/item/clothing/accessory/storage/attackby(obj/item/attacking_item, mob/user)
+ return hold.attackby(attacking_item, user)
/obj/item/clothing/accessory/storage/emp_act(severity)
. = ..()
diff --git a/code/modules/clothing/wrists/watches.dm b/code/modules/clothing/wrists/watches.dm
index ff215b7127c..0bffcea3911 100644
--- a/code/modules/clothing/wrists/watches.dm
+++ b/code/modules/clothing/wrists/watches.dm
@@ -74,16 +74,17 @@
else
usr.visible_message (SPAN_NOTICE("[usr] taps their foot on the floor, arrogantly pointing at the [src] on their wrist with a look of derision in their eyes, not noticing it's broken."), SPAN_NOTICE("You point down at the [src] with an arrogant look about your eyes."))
-/obj/item/clothing/wrists/watch/attackby(obj/item/W, mob/user)
- if(W.isscrewdriver())
- user.visible_message(SPAN_NOTICE("[user] [screwed ? "unscrews" : "screws"] the cover of the [src] [screwed ? "open" : "closed"]."), SPAN_NOTICE("You [screwed ? "unscrews" : "screws"] the cover of the [src] [screwed ? "open" : "closed"]."))
+/obj/item/clothing/wrists/watch/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.isscrewdriver())
+ user.visible_message(SPAN_NOTICE("[user] [screwed ? "unscrews" : "screws"] the cover of the [src] [screwed ? "open" : "closed"]."),
+ SPAN_NOTICE("You [screwed ? "unscrews" : "screws"] the cover of the [src] [screwed ? "open" : "closed"]."))
playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1)
screwed = !screwed
return
if(wired)
return
- if(W.iscoil())
- var/obj/item/stack/cable_coil/C = W
+ if(attacking_item.iscoil())
+ var/obj/item/stack/cable_coil/C = attacking_item
if(screwed)
to_chat(user, SPAN_NOTICE("The [src] is not open."))
return
diff --git a/code/modules/cooking/machinery/cooking_machines/_appliance.dm b/code/modules/cooking/machinery/cooking_machines/_appliance.dm
index bd8d24ced46..249a4486ce6 100644
--- a/code/modules/cooking/machinery/cooking_machines/_appliance.dm
+++ b/code/modules/cooking/machinery/cooking_machines/_appliance.dm
@@ -198,29 +198,29 @@
return FALSE
return TRUE
-/obj/machinery/appliance/attackby(var/obj/item/I, var/mob/user)
+/obj/machinery/appliance/attackby(obj/item/attacking_item, mob/user)
if(!cook_type || (stat & (BROKEN)))
to_chat(user, SPAN_WARNING("[src] is not working."))
return
- var/result = can_insert(I, user)
+ var/result = can_insert(attacking_item, user)
if(result == CANNOT_INSERT)
- if(default_deconstruction_screwdriver(user, I))
+ if(default_deconstruction_screwdriver(user, attacking_item))
return
- else if(default_part_replacement(user, I))
+ else if(default_part_replacement(user, attacking_item))
return
- else if(default_deconstruction_crowbar(user, I))
+ else if(default_deconstruction_crowbar(user, attacking_item))
return
return
if(result == INSERT_GRABBED)
- var/obj/item/grab/G = I
+ var/obj/item/grab/G = attacking_item
if (G && istype(G) && G.affecting)
cook_mob(G.affecting, user)
return
//From here we can start cooking food
- add_content(I, user)
+ add_content(attacking_item, user)
update_icon()
diff --git a/code/modules/cooking/machinery/cooking_machines/container.dm b/code/modules/cooking/machinery/cooking_machines/container.dm
index 5ece7806291..2c216d01bdc 100644
--- a/code/modules/cooking/machinery/cooking_machines/container.dm
+++ b/code/modules/cooking/machinery/cooking_machines/container.dm
@@ -71,16 +71,16 @@
. = ..()
closeToolTip(usr)
-/obj/item/reagent_containers/cooking_container/attackby(var/obj/item/I, var/mob/user)
- if(is_type_in_list(I, insertable))
- if (!can_fit(I))
+/obj/item/reagent_containers/cooking_container/attackby(obj/item/attacking_item, mob/user)
+ if(is_type_in_list(attacking_item, insertable))
+ if (!can_fit(attacking_item))
to_chat(user, SPAN_WARNING("There's no more space in [src] for that!"))
return FALSE
- if(!user.unEquip(I))
+ if(!user.unEquip(attacking_item))
return
- I.forceMove(src)
- to_chat(user, SPAN_NOTICE("You put [I] [place_verb] [src]."))
+ attacking_item.forceMove(src)
+ to_chat(user, SPAN_NOTICE("You put [attacking_item] [place_verb] [src]."))
update_icon()
return
diff --git a/code/modules/cooking/machinery/cooking_machines/fryer.dm b/code/modules/cooking/machinery/cooking_machines/fryer.dm
index 8f96b19af9d..2a1ca3b9e50 100644
--- a/code/modules/cooking/machinery/cooking_machines/fryer.dm
+++ b/code/modules/cooking/machinery/cooking_machines/fryer.dm
@@ -203,11 +203,11 @@
//Coat the victim in some oil
oil.trans_to(victim, 40)
-/obj/machinery/appliance/cooker/fryer/attackby(var/obj/item/I, var/mob/user)
- if(istype(I, /obj/item/reagent_containers/glass) && I.reagents)
- if (I.reagents.total_volume <= 0 && oil)
+/obj/machinery/appliance/cooker/fryer/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/reagent_containers/glass) && attacking_item.reagents)
+ if (attacking_item.reagents.total_volume <= 0 && oil)
//Its empty, handle scooping some hot oil out of the fryer
- oil.trans_to(I, I.reagents.maximum_volume)
+ oil.trans_to(attacking_item, attacking_item.reagents.maximum_volume)
user.visible_message("[user] scoops some oil out of [src].", SPAN_NOTICE("You scoop some oil out of [src]."))
return TRUE
//It contains stuff, handle pouring any oil into the fryer
@@ -215,12 +215,12 @@
//That would really require coding some sort of filter or better replacement mechanism first
//So for now, restrict to oil only
var/amount = 0
- for (var/_R in I.reagents.reagent_volumes)
+ for (var/_R in attacking_item.reagents.reagent_volumes)
if (ispath(_R, /singleton/reagent/nutriment/triglyceride/oil))
var/delta = REAGENTS_FREE_SPACE(oil)
- delta = min(delta, I.reagents.reagent_volumes[_R])
+ delta = min(delta, attacking_item.reagents.reagent_volumes[_R])
oil.add_reagent(_R, delta)
- I.reagents.remove_reagent(_R, delta)
+ attacking_item.reagents.remove_reagent(_R, delta)
amount += delta
if (amount > 0)
user.visible_message("[user] pours some oil into [src].", SPAN_NOTICE("You pour [amount]u of oil into [src]."), SPAN_NOTICE("You hear something viscous being poured into a metal container."))
diff --git a/code/modules/cooking/machinery/gibber.dm b/code/modules/cooking/machinery/gibber.dm
index 25a1566bae1..d4c6681b63e 100644
--- a/code/modules/cooking/machinery/gibber.dm
+++ b/code/modules/cooking/machinery/gibber.dm
@@ -86,20 +86,20 @@
to_chat(user, SPAN_DANGER("You [emagged ? "disable" : "enable"] [src]'s safety guard."))
return TRUE
-/obj/machinery/gibber/attackby(var/obj/item/W, var/mob/user)
- if(istype(W, /obj/item/grab))
- var/obj/item/grab/G = W
+/obj/machinery/gibber/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/grab))
+ var/obj/item/grab/G = attacking_item
if(G.state < GRAB_AGGRESSIVE)
to_chat(user, SPAN_DANGER("You need a better grip to do that!"))
return
move_into_gibber(user,G.affecting)
user.drop_from_inventory(G)
- else if(isorgan(W))
- user.drop_from_inventory(W)
+ else if(isorgan(attacking_item))
+ user.drop_from_inventory(attacking_item)
//TODO: Gibber Animations
- qdel(W)
- user.visible_message(SPAN_DANGER("[user] feeds [W] into [src], obliterating it."))
+ qdel(attacking_item)
+ user.visible_message(SPAN_DANGER("[user] feeds [attacking_item] into [src], obliterating it."))
do_hair_pull(user)
diff --git a/code/modules/cooking/machinery/icecream.dm b/code/modules/cooking/machinery/icecream.dm
index 017cd70b65e..afdd5a4a93d 100644
--- a/code/modules/cooking/machinery/icecream.dm
+++ b/code/modules/cooking/machinery/icecream.dm
@@ -102,9 +102,9 @@
popup.set_content(dat)
popup.open()
-/obj/machinery/icecream_vat/attackby(var/obj/item/O as obj, var/mob/user as mob)
- if(istype(O, /obj/item/reagent_containers/food/snacks/icecream))
- var/obj/item/reagent_containers/food/snacks/icecream/I = O
+/obj/machinery/icecream_vat/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/reagent_containers/food/snacks/icecream))
+ var/obj/item/reagent_containers/food/snacks/icecream/I = attacking_item
if(!I.ice_creamed)
if(product_types[dispense_flavour] > 0)
visible_message("\icon[src] [user] scoops [flavour_name] icecream into [I].")
@@ -118,9 +118,9 @@
else
to_chat(user, SPAN_WARNING("There is not enough icecream left!"))
else
- to_chat(user, SPAN_NOTICE("[O] already has icecream in it."))
+ to_chat(user, SPAN_NOTICE("[attacking_item] already has icecream in it."))
return TRUE
- else if(O.is_open_container())
+ else if(attacking_item.is_open_container())
return
..()
diff --git a/code/modules/cooking/machinery/smartfridge.dm b/code/modules/cooking/machinery/smartfridge.dm
index 58ecba40ad6..cc32bda249d 100644
--- a/code/modules/cooking/machinery/smartfridge.dm
+++ b/code/modules/cooking/machinery/smartfridge.dm
@@ -287,21 +287,23 @@
* Item Adding
********************/
-/obj/machinery/smartfridge/attackby(obj/item/O, mob/user)
- if(O.isscrewdriver())
+/obj/machinery/smartfridge/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.isscrewdriver())
panel_open = !panel_open
- user.visible_message("\The [user] [panel_open ? "opens" : "closes"] the maintenance panel of \the [src].", "You [panel_open ? "open" : "close"] the maintenance panel of \the [src].")
+ user.visible_message("\The [user] [panel_open ? "opens" : "closes"] the maintenance panel of \the [src].",
+ "You [panel_open ? "open" : "close"] the maintenance panel of \the [src].")
update_icon()
return
- if(O.iswrench())
+ if(attacking_item.iswrench())
anchored = !anchored
- user.visible_message("\The [user] [anchored ? "secures" : "unsecures"] the bolts holding \the [src] to the floor.", "You [anchored ? "secure" : "unsecure"] the bolts holding \the [src] to the floor.")
- playsound(get_turf(src), O.usesound, 50, 1)
+ user.visible_message("\The [user] [anchored ? "secures" : "unsecures"] the bolts holding \the [src] to the floor.",
+ "You [anchored ? "secure" : "unsecure"] the bolts holding \the [src] to the floor.")
+ playsound(get_turf(src), attacking_item.usesound, 50, 1)
power_change()
return
- if(O.ismultitool()||O.iswirecutter())
+ if(attacking_item.ismultitool() || attacking_item.iswirecutter())
if(panel_open)
switch(input(user, "What would you like to select?", "Machine Debug Software") as null|anything in list("SmartHeater", "MegaSeed Storage", "Slime Extract Storage", "Refrigerated Chemical Storage", "Refrigerated Virus Storage", "Drink Showcase", "Drying Rack"))
if("SmartHeater")
@@ -340,19 +342,19 @@
to_chat(user, SPAN_NOTICE("[src] is unpowered and useless."))
return
- if(accept_check(O))
+ if(accept_check(attacking_item))
if(length(contents) >= max_n_of_items)
to_chat(user, SPAN_NOTICE("[src] is full."))
return TRUE
- user.remove_from_mob(O)
- O.forceMove(src)
- item_quants[O.name]++
- user.visible_message("[user] adds \a [O] to [src].", SPAN_NOTICE("You add [O] to [src]."))
+ user.remove_from_mob(attacking_item)
+ attacking_item.forceMove(src)
+ item_quants[attacking_item.name]++
+ user.visible_message("[user] adds \a [attacking_item] to [src].", SPAN_NOTICE("You add [attacking_item] to [src]."))
update_overlays()
return
- if(istype(O, /obj/item/storage))
- var/obj/item/storage/P = O
+ if(istype(attacking_item, /obj/item/storage))
+ var/obj/item/storage/P = attacking_item
var/plants_loaded = 0
for(var/obj/G in P.contents)
if(accept_check(G))
@@ -367,7 +369,7 @@
to_chat(user, SPAN_NOTICE("Some items are refused."))
update_overlays()
return TRUE
- to_chat(user, SPAN_NOTICE("[src] smartly refuses [O]."))
+ to_chat(user, SPAN_NOTICE("[src] smartly refuses [attacking_item]."))
return TRUE
/obj/machinery/smartfridge/secure/emag_act(var/remaining_charges, var/mob/user)
diff --git a/code/modules/cooking/plates.dm b/code/modules/cooking/plates.dm
index 0d0aee67463..6ea162ba3ab 100644
--- a/code/modules/cooking/plates.dm
+++ b/code/modules/cooking/plates.dm
@@ -24,10 +24,10 @@ Plates that can hold your cooking stuff
if(grease)
. += SPAN_WARNING("\The [name] looks a little unclean.")
-/obj/item/reagent_containers/bowl/attackby(obj/item/W, mob/user)
- if(istype(W,/obj/item/material/kitchen/utensil))
- var/obj/item/material/kitchen/utensil/U = W
- if(istype(W,/obj/item/material/kitchen/utensil/fork))
+/obj/item/reagent_containers/bowl/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/material/kitchen/utensil))
+ var/obj/item/material/kitchen/utensil/U = attacking_item
+ if(istype(attacking_item,/obj/item/material/kitchen/utensil/fork))
to_chat(user, SPAN_NOTICE("You uselessly pass \the [U] through \the [src]'s contents."))
playsound(user.loc, /singleton/sound_category/generic_pour_sound, 50, 1)
return
@@ -117,19 +117,19 @@ Plates that can hold your cooking stuff
. += "It looks like there is \a [SPAN_INFO(holding.name)] on \the [src]."
. += SPAN_INFO(" - [holding.desc]")
-/obj/item/reagent_containers/bowl/plate/attackby(obj/item/I, mob/user)
- if((istype(I, /obj/item/reagent_containers/food/snacks) || istype(I, /obj/item/trash)) && !holding)
- user.unEquip(I)
- I.forceMove(src)
- holding = I
+/obj/item/reagent_containers/bowl/plate/attackby(obj/item/attacking_item, mob/user)
+ if((istype(attacking_item, /obj/item/reagent_containers/food/snacks) || istype(attacking_item, /obj/item/trash)) && !holding)
+ user.unEquip(attacking_item)
+ attacking_item.forceMove(src)
+ holding = attacking_item
to_chat(user, SPAN_NOTICE("You place \the [holding.name] on \the [src]."))
update_icon()
return
- if(istype(I, /obj/item/reagent_containers/food/snacks) || istype(I, /obj/item/trash))
+ if(istype(attacking_item, /obj/item/reagent_containers/food/snacks) || istype(attacking_item, /obj/item/trash))
to_chat(user, SPAN_WARNING("\The [src] already has something on it!"))
return
- if(istype(I, /obj/item/material/kitchen/utensil) && istype(holding, /obj/item/reagent_containers/food/snacks))
- var/obj/item/temp_hold = holding.attackby(I, user)
+ if(istype(attacking_item, /obj/item/material/kitchen/utensil) && istype(holding, /obj/item/reagent_containers/food/snacks))
+ var/obj/item/temp_hold = holding.attackby(attacking_item, user)
if(temp_hold != holding)
user.unEquip(temp_hold)
temp_hold.forceMove(src)
@@ -138,9 +138,9 @@ Plates that can hold your cooking stuff
grease = TRUE
update_icon()
return
- if(istype(I, /obj/item/material/kitchen/utensil) && istype(holding, /obj/item/trash))
+ if(istype(attacking_item, /obj/item/material/kitchen/utensil) && istype(holding, /obj/item/trash))
to_chat(user, SPAN_WARNING("You're not sure you should try to eat \the [holding.name]."))
- if(istype(I, /obj/item/material/kitchen/utensil))
+ if(istype(attacking_item, /obj/item/material/kitchen/utensil))
to_chat(user, SPAN_WARNING("There isn't any food on \the [name]."))
update_icon()
return
diff --git a/code/modules/cooking/trays.dm b/code/modules/cooking/trays.dm
index cf8c263c4bc..c6c325cd797 100644
--- a/code/modules/cooking/trays.dm
+++ b/code/modules/cooking/trays.dm
@@ -32,17 +32,17 @@
return
spill(user, target.loc)
-/obj/item/tray/attackby(obj/item/I, mob/user, var/click_params)
- if (isrobot(I.loc))//safety to stop robots losing their items
+/obj/item/tray/attackby(obj/item/attacking_item, mob/user, params)
+ if (isrobot(attacking_item.loc))//safety to stop robots losing their items
return TRUE
- if(istype(I, /obj/item/material/kitchen/rollingpin))
+ if(istype(attacking_item, /obj/item/material/kitchen/rollingpin))
if(cooldown < world.time - 25)
- user.visible_message(SPAN_DANGER("[user] bashes [src] with [I]!"))
+ user.visible_message(SPAN_DANGER("[user] bashes [src] with [attacking_item]!"))
playsound(user.loc, 'sound/effects/shieldbash.ogg', 50, 1)
cooldown = world.time
return TRUE
- attempt_load_item(I, user, click_params=click_params)
+ attempt_load_item(attacking_item, user, click_params=params)
/*
============~~~~~======================~~~~~=============
diff --git a/code/modules/custom_ka/cells.dm b/code/modules/custom_ka/cells.dm
index a9de0daf6f2..23c54c3b10d 100644
--- a/code/modules/custom_ka/cells.dm
+++ b/code/modules/custom_ka/cells.dm
@@ -204,28 +204,28 @@
var/type_to_take = "phoron"
var/charge_per_sheet = 100
-/obj/item/custom_ka_upgrade/cells/loader/attackby(var/obj/item/I as obj, var/mob/user as mob)
+/obj/item/custom_ka_upgrade/cells/loader/attackby(obj/item/attacking_item, mob/user)
- var/obj/item/stack/material/the_sheet = I
+ var/obj/item/stack/material/the_sheet = attacking_item
if(istype(the_sheet) && the_sheet.default_type == type_to_take)
var/amount_to_take = 1
if(stored_charge + charge_per_sheet > cell_increase)
- to_chat(user,"You can't put any more [I] into \the [src].")
+ to_chat(user,"You can't put any more [attacking_item] into \the [src].")
return
amount_to_take = min(amount_to_take,the_sheet.amount)
the_sheet.amount -= amount_to_take
stored_charge += amount_to_take*charge_per_sheet
- user.visible_message("\The [user] inserts a sheet [I] into \the [src].", \
- "You insert a sheet of [I]s into \the [src].", \
+ user.visible_message("\The [user] inserts a sheet [attacking_item] into \the [src].", \
+ "You insert a sheet of [attacking_item]s into \the [src].", \
"You hear mechanical whirring.")
if(the_sheet.amount <= 0)
- qdel(I)
+ qdel(attacking_item)
/obj/item/custom_ka_upgrade/cells/loader/uranium
name = "uranium loading KA cell"
diff --git a/code/modules/custom_ka/core.dm b/code/modules/custom_ka/core.dm
index 84e7e920843..aa0ec69f405 100644
--- a/code/modules/custom_ka/core.dm
+++ b/code/modules/custom_ka/core.dm
@@ -399,18 +399,18 @@
if(installed_upgrade_chip)
installed_upgrade_chip.attack_self(user)
-/obj/item/gun/custom_ka/attackby(var/obj/item/I as obj, var/mob/user as mob)
+/obj/item/gun/custom_ka/attackby(obj/item/attacking_item, mob/user)
. = ..()
- if(istype(I,/obj/item/pen))
- custom_name = sanitize(input("Enter a custom name for your [name]", "Set Name") as text|null)
+ if(istype(attacking_item, /obj/item/pen))
+ custom_name = sanitize( tgui_input_text(user, "Enter a custom name for your [name]", "Set Name") )
to_chat(user,"You label \the [name] as \"[custom_name]\"")
update_icon()
return TRUE
- else if(I.iswrench())
+ else if(attacking_item.iswrench())
if(installed_upgrade_chip)
- playsound(src,I.usesound, 50, 0)
+ playsound(src,attacking_item.usesound, 50, 0)
to_chat(user,"You remove \the [installed_upgrade_chip].")
installed_upgrade_chip.forceMove(user.loc)
installed_upgrade_chip.update_icon()
@@ -418,7 +418,7 @@
update_stats()
update_icon()
else if(installed_barrel && can_disassemble_barrel)
- playsound(src,I.usesound, 50, 0)
+ playsound(src,attacking_item.usesound, 50, 0)
to_chat(user,"You remove \the [installed_barrel].")
installed_barrel.forceMove(user.loc)
installed_barrel.update_icon()
@@ -426,7 +426,7 @@
update_stats()
update_icon()
else if(installed_cell && can_disassemble_cell)
- playsound(src,I.usesound, 50, 0)
+ playsound(src,attacking_item.usesound, 50, 0)
to_chat(user,"You remove \the [installed_cell].")
installed_cell.forceMove(user.loc)
installed_cell.update_icon()
@@ -436,11 +436,11 @@
else
to_chat(user,"There is nothing to remove from \the [src].")
return TRUE
- else if(istype(I,/obj/item/custom_ka_upgrade/cells))
+ else if(istype(attacking_item,/obj/item/custom_ka_upgrade/cells))
if(installed_cell)
to_chat(user,"There is already \an [installed_cell] installed.")
else
- var/obj/item/custom_ka_upgrade/cells/tempvar = I
+ var/obj/item/custom_ka_upgrade/cells/tempvar = attacking_item
installed_cell = tempvar
user.remove_from_mob(installed_cell)
installed_cell.forceMove(src)
@@ -448,13 +448,13 @@
update_icon()
playsound(src,'sound/items/Wirecutter.ogg', 50, 0)
return TRUE
- else if(istype(I,/obj/item/custom_ka_upgrade/barrels))
+ else if(istype(attacking_item,/obj/item/custom_ka_upgrade/barrels))
if(!installed_cell)
- to_chat(user,"You must install a power cell before installing \the [I].")
+ to_chat(user,"You must install a power cell before installing \the [attacking_item].")
else if(installed_barrel)
to_chat(user,"There is already \an [installed_barrel] installed.")
else
- var/obj/item/custom_ka_upgrade/barrels/tempvar = I
+ var/obj/item/custom_ka_upgrade/barrels/tempvar = attacking_item
installed_barrel = tempvar
user.remove_from_mob(installed_barrel)
installed_barrel.forceMove(src)
@@ -462,17 +462,17 @@
update_icon()
playsound(src,'sound/items/Wirecutter.ogg', 50, 0)
return TRUE
- else if(istype(I,/obj/item/custom_ka_upgrade/upgrade_chips))
+ else if(istype(attacking_item,/obj/item/custom_ka_upgrade/upgrade_chips))
if(!installed_cell || !installed_barrel)
- to_chat(user,"A barrel and a cell need to be installed before you install \the [I].")
+ to_chat(user,"A barrel and a cell need to be installed before you install \the [attacking_item].")
else if(installed_upgrade_chip)
to_chat(user,"There is already \an [installed_upgrade_chip] installed.")
else if(installed_cell.disallow_chip == TRUE)
- to_chat(user,"\The [installed_cell] prevents you from installing \the [I]!")
+ to_chat(user,"\The [installed_cell] prevents you from installing \the [attacking_item]!")
else if(installed_barrel.disallow_chip == TRUE)
- to_chat(user,"\The [installed_barrel] prevents you from installing \the [I]!")
+ to_chat(user,"\The [installed_barrel] prevents you from installing \the [attacking_item]!")
else
- var/obj/item/custom_ka_upgrade/upgrade_chips/tempvar = I
+ var/obj/item/custom_ka_upgrade/upgrade_chips/tempvar = attacking_item
installed_upgrade_chip = tempvar
user.remove_from_mob(installed_upgrade_chip)
installed_upgrade_chip.forceMove(src)
@@ -482,13 +482,13 @@
return TRUE
if(installed_cell)
- installed_cell.attackby(I,user)
+ installed_cell.attackby(attacking_item,user)
return TRUE
if(installed_barrel)
- installed_barrel.attackby(I,user)
+ installed_barrel.attackby(attacking_item,user)
return TRUE
if(installed_upgrade_chip)
- installed_upgrade_chip.attackby(I,user)
+ installed_upgrade_chip.attackby(attacking_item,user)
return TRUE
/obj/item/custom_ka_upgrade //base item
diff --git a/code/modules/detectivework/microscope/dnascanner.dm b/code/modules/detectivework/microscope/dnascanner.dm
index 2c6ab09d06a..ebc303ab0a4 100644
--- a/code/modules/detectivework/microscope/dnascanner.dm
+++ b/code/modules/detectivework/microscope/dnascanner.dm
@@ -15,7 +15,7 @@
var/last_process_worldtime = 0
var/report_num = 0
-/obj/machinery/dnaforensics/attackby(var/obj/item/W, mob/user as mob)
+/obj/machinery/dnaforensics/attackby(obj/item/attacking_item, mob/user)
if(bloodsamp)
to_chat(user, "There is already a sample in the machine.")
@@ -25,12 +25,12 @@
to_chat(user, "Open the cover before inserting the sample.")
return
- var/obj/item/forensics/swab/swab = W
+ var/obj/item/forensics/swab/swab = attacking_item
if(istype(swab) && swab.is_used())
- user.unEquip(W)
+ user.unEquip(attacking_item)
src.bloodsamp = swab
swab.forceMove(src)
- to_chat(user, "You insert \the [W] into \the [src].")
+ to_chat(user, "You insert \the [attacking_item] into \the [src].")
else
to_chat(user, "\The [src] only accepts used swabs.")
return
diff --git a/code/modules/detectivework/microscope/microscope.dm b/code/modules/detectivework/microscope/microscope.dm
index de471cd25da..73c0b730fb9 100644
--- a/code/modules/detectivework/microscope/microscope.dm
+++ b/code/modules/detectivework/microscope/microscope.dm
@@ -14,17 +14,17 @@
var/report_print_num = 0
var/report_gsr_num = 0
-/obj/machinery/microscope/attackby(obj/item/W as obj, mob/user as mob)
+/obj/machinery/microscope/attackby(obj/item/attacking_item, mob/user)
if(sample)
to_chat(user, SPAN_WARNING("There is already a slide in the microscope."))
return
- if(istype(W, /obj/item/forensics/slide) || istype(W, /obj/item/sample/print))
- to_chat(user, SPAN_NOTICE("You insert \the [W] into the microscope."))
- user.unEquip(W)
- W.forceMove(src)
- sample = W
+ if(istype(attacking_item, /obj/item/forensics/slide) || istype(attacking_item, /obj/item/sample/print))
+ to_chat(user, SPAN_NOTICE("You insert \the [attacking_item] into the microscope."))
+ user.unEquip(attacking_item)
+ attacking_item.forceMove(src)
+ sample = attacking_item
update_icon()
return
diff --git a/code/modules/detectivework/microscope/slides.dm b/code/modules/detectivework/microscope/slides.dm
index 4ba80b3b4ea..d9f63c1bfae 100644
--- a/code/modules/detectivework/microscope/slides.dm
+++ b/code/modules/detectivework/microscope/slides.dm
@@ -6,20 +6,20 @@
var/obj/item/forensics/swab/has_swab
var/obj/item/sample/fibers/has_sample
-/obj/item/forensics/slide/attackby(var/obj/item/W, var/mob/user)
+/obj/item/forensics/slide/attackby(obj/item/attacking_item, mob/user)
if(has_swab || has_sample)
to_chat(user, SPAN_WARNING("There is already a sample in the slide."))
return
- if(istype (W, /obj/item/forensics/swab))
- has_swab = W
- else if(istype(W, /obj/item/sample/fibers))
- has_sample = W
+ if(istype (attacking_item, /obj/item/forensics/swab))
+ has_swab = attacking_item
+ else if(istype(attacking_item, /obj/item/sample/fibers))
+ has_sample = attacking_item
else
to_chat(user, SPAN_WARNING("You don't think this will fit."))
return
to_chat(user, SPAN_NOTICE("You insert the sample into the slide."))
- user.unEquip(W)
- W.forceMove(src)
+ user.unEquip(attacking_item)
+ attacking_item.forceMove(src)
update_icon()
/obj/item/forensics/slide/attack_self(var/mob/user)
diff --git a/code/modules/detectivework/tools/evidencebag.dm b/code/modules/detectivework/tools/evidencebag.dm
index ed4168b2c58..65ace309ef3 100644
--- a/code/modules/detectivework/tools/evidencebag.dm
+++ b/code/modules/detectivework/tools/evidencebag.dm
@@ -100,9 +100,9 @@
if (stored_item)
examinate(user, stored_item)
-/obj/item/evidencebag/attackby(obj/item/W as obj, mob/user as mob)
- if(W.ispen() || istype(W, /obj/item/device/flashlight/pen))
- var/tmp_label = sanitizeSafe(input(user, "Enter a label for [name]", "Label", label_text), MAX_NAME_LEN)
+/obj/item/evidencebag/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.ispen() || istype(attacking_item, /obj/item/device/flashlight/pen))
+ var/tmp_label = sanitizeSafe( tgui_input_text(user, "Enter a label for [name]", "Label", label_text, MAX_NAME_LEN), MAX_NAME_LEN )
if(length(tmp_label) > MAX_NAME_LEN)
to_chat(user, SPAN_NOTICE("The label can be at most [MAX_NAME_LEN] characters long."))
else
diff --git a/code/modules/detectivework/tools/rag.dm b/code/modules/detectivework/tools/rag.dm
index 68523499055..fed1dbb44e0 100644
--- a/code/modules/detectivework/tools/rag.dm
+++ b/code/modules/detectivework/tools/rag.dm
@@ -53,11 +53,11 @@
else
remove_contents(user)
-/obj/item/reagent_containers/glass/rag/attackby(obj/item/W, mob/user)
- if(!on_fire && W.isFlameSource())
+/obj/item/reagent_containers/glass/rag/attackby(obj/item/attacking_item, mob/user)
+ if(!on_fire && attacking_item.isFlameSource())
ignite()
if(on_fire)
- visible_message(SPAN_WARNING("\The [user] lights \the [src] with \the [W]."))
+ visible_message(SPAN_WARNING("\The [user] lights \the [src] with \the [attacking_item]."))
else
to_chat(user, SPAN_WARNING("You manage to singe \the [src], but fail to light it."))
return TRUE
diff --git a/code/modules/detectivework/tools/sample_kits.dm b/code/modules/detectivework/tools/sample_kits.dm
index 59bed868519..03b23c56fe5 100644
--- a/code/modules/detectivework/tools/sample_kits.dm
+++ b/code/modules/detectivework/tools/sample_kits.dm
@@ -45,14 +45,14 @@
to_chat(user, SPAN_NOTICE("You overlay \the [src] and \the [initial(supplied.name)], combining the print records."))
return 1
-/obj/item/sample/attackby(var/obj/O, var/mob/user)
- if(O.type == src.type)
- user.unEquip(O)
- if(merge_evidence(O, user))
- qdel(O)
+/obj/item/sample/attackby(obj/item/attacking_item, var/mob/user)
+ if(attacking_item.type == src.type)
+ user.unEquip(attacking_item)
+ if(merge_evidence(attacking_item, user))
+ qdel(attacking_item)
return TRUE
- else if (O.ispen())
- var/tmp_label = sanitizeSafe(input(user, "Enter a label for [name]", "Label", label_text), MAX_NAME_LEN)
+ else if (attacking_item.ispen())
+ var/tmp_label = sanitizeSafe( tgui_input_text(user, "Enter a label for [name]", "Label", label_text, MAX_NAME_LEN), MAX_NAME_LEN )
if(length(tmp_label) > MAX_NAME_LEN)
to_chat(user, SPAN_WARNING("The label can be at most [MAX_NAME_LEN] characters long."))
else
diff --git a/code/modules/economy/ATM.dm b/code/modules/economy/ATM.dm
index d3342b731ed..94f93240874 100644
--- a/code/modules/economy/ATM.dm
+++ b/code/modules/economy/ATM.dm
@@ -85,17 +85,17 @@
intent_message(MACHINE_SOUND)
return 1
-/obj/machinery/atm/attackby(obj/item/I, mob/user)
- if(istype(I, /obj/item/card))
+/obj/machinery/atm/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/card))
if(emagged)
//prevent inserting id into an emagged ATM
to_chat(user, SPAN_WARNING("[icon2html(src, user)] CARD READER ERROR. This system has been compromised!"))
return
- else if(istype(I,/obj/item/card/emag))
- I.resolve_attackby(src, user)
+ else if(istype(attacking_item,/obj/item/card/emag))
+ attacking_item.resolve_attackby(src, user)
return
- var/obj/item/card/id/idcard = I
+ var/obj/item/card/id/idcard = attacking_item
if(!held_card)
usr.drop_from_inventory(idcard,src)
held_card = idcard
@@ -103,25 +103,26 @@
authenticated_account = null
update_icon()
else if(authenticated_account)
- if(istype(I,/obj/item/spacecash))
+ if(istype(attacking_item,/obj/item/spacecash))
+ var/obj/item/spacecash/cash = attacking_item
//consume the money
- authenticated_account.money += I:worth
+ authenticated_account.money += cash.worth
playsound(loc, /singleton/sound_category/print_sound, 50, 1)
//create a transaction log entry
var/datum/transaction/T = new()
T.target_name = authenticated_account.owner_name
T.purpose = "Credit deposit"
- T.amount = I:worth
+ T.amount = cash.worth
T.source_terminal = machine_id
T.date = worlddate2text()
T.time = worldtime2text()
SSeconomy.add_transaction_log(authenticated_account,T)
intent_message(MACHINE_SOUND)
- to_chat(user, SPAN_NOTICE("You insert [I] into [src]."))
+ to_chat(user, SPAN_NOTICE("You insert [attacking_item] into [src]."))
src.attack_hand(user)
- qdel(I)
+ qdel(attacking_item)
else
..()
diff --git a/code/modules/economy/EFTPOS.dm b/code/modules/economy/EFTPOS.dm
index 489c4b248cc..f637bcc5d15 100644
--- a/code/modules/economy/EFTPOS.dm
+++ b/code/modules/economy/EFTPOS.dm
@@ -111,17 +111,17 @@
else
user << browse(null,"window=eftpos")
-/obj/item/device/eftpos/attackby(var/obj/item/O, var/mob/user)
+/obj/item/device/eftpos/attackby(obj/item/attacking_item, mob/user)
- var/obj/item/card/id/I = O.GetID()
+ var/obj/item/card/id/I = attacking_item.GetID()
if(I)
if(linked_account)
- scan_card(I, O)
+ scan_card(I, attacking_item)
else
to_chat(user, "[icon2html(src, user)]Unable to connect to linked account.")
- else if (istype(O, /obj/item/spacecash/ewallet))
- var/obj/item/spacecash/ewallet/E = O
+ else if (istype(attacking_item, /obj/item/spacecash/ewallet))
+ var/obj/item/spacecash/ewallet/E = attacking_item
if (linked_account)
if(!linked_account.suspended)
if(transaction_locked && !transaction_paid)
@@ -144,7 +144,7 @@
T.time = worldtime2text()
SSeconomy.add_transaction_log(linked_account,T)
else
- to_chat(user, "[icon2html(src, user)]\The [O] doesn't have that much money!")
+ to_chat(user, "[icon2html(src, user)]\The [attacking_item] doesn't have that much money!")
else
to_chat(user, "[icon2html(src, user)]Connected account has been suspended.")
else
diff --git a/code/modules/economy/OrderTerminal.dm b/code/modules/economy/OrderTerminal.dm
index 806c8125b1f..e2249c05f34 100644
--- a/code/modules/economy/OrderTerminal.dm
+++ b/code/modules/economy/OrderTerminal.dm
@@ -79,11 +79,11 @@
R.add_overlay(stampoverlay)
R.stamps += "
This paper has been stamped by the Idris Ordering Terminal."
-/obj/machinery/orderterminal/attackby(obj/O, mob/user)
- var/obj/item/card/id/I = O.GetID()
+/obj/machinery/orderterminal/attackby(obj/item/attacking_item, mob/user)
+ var/obj/item/card/id/I = attacking_item.GetID()
if (!I)
return
- if (!istype(O))
+ if (!istype(attacking_item))
return
else if (confirmorder)
diff --git a/code/modules/economy/cash.dm b/code/modules/economy/cash.dm
index 88d25ff5c8e..a12cbc9f723 100644
--- a/code/modules/economy/cash.dm
+++ b/code/modules/economy/cash.dm
@@ -18,18 +18,18 @@
drop_sound = 'sound/items/drop/card.ogg'
pickup_sound = 'sound/items/pickup/card.ogg'
-/obj/item/spacecash/attackby(obj/item/W as obj, mob/user as mob)
- if(istype(W, /obj/item/spacecash))
- if(istype(W, /obj/item/spacecash/ewallet)) return 0
+/obj/item/spacecash/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/spacecash))
+ if(istype(attacking_item, /obj/item/spacecash/ewallet)) return 0
var/obj/item/spacecash/bundle/bundle
- if(!istype(W, /obj/item/spacecash/bundle))
- var/obj/item/spacecash/cash = W
+ if(!istype(attacking_item, /obj/item/spacecash/bundle))
+ var/obj/item/spacecash/cash = attacking_item
bundle = new(src.loc)
bundle.worth += cash.worth
qdel(cash)
else //is bundle
- bundle = W
+ bundle = attacking_item
bundle.worth += src.worth
bundle.update_icon()
if(istype(user, /mob/living/carbon/human))
diff --git a/code/modules/economy/quikpay.dm b/code/modules/economy/quikpay.dm
index d0e36892f10..2d913c81511 100644
--- a/code/modules/economy/quikpay.dm
+++ b/code/modules/economy/quikpay.dm
@@ -69,9 +69,9 @@
R.add_overlay(stampoverlay)
R.stamps += "
This paper has been stamped by the Quik-Pay device."
-/obj/item/device/quikpay/attackby(obj/O, mob/user)
- if (istype(O, /obj/item/spacecash/ewallet))
- var/obj/item/spacecash/ewallet/E = O
+/obj/item/device/quikpay/attackby(obj/item/attacking_item, mob/user)
+ if (istype(attacking_item, /obj/item/spacecash/ewallet))
+ var/obj/item/spacecash/ewallet/E = attacking_item
var/transaction_amount = sum
var/transaction_purpose = "[destinationact] Payment"
var/transaction_terminal = machine_id
@@ -90,8 +90,8 @@
to_chat(user, SPAN_WARNING("[icon2html(src, user)]\The [E] doesn't have that much money!"))
return
- var/obj/item/card/id/I = O.GetID()
- if (!istype(O))
+ var/obj/item/card/id/I = attacking_item.GetID()
+ if (!istype(attacking_item))
return
var/transaction_amount = sum
diff --git a/code/modules/games/cards.dm b/code/modules/games/cards.dm
index d5316598600..332ac8df778 100644
--- a/code/modules/games/cards.dm
+++ b/code/modules/games/cards.dm
@@ -60,12 +60,12 @@
else
..()
-/obj/item/deck/attackby(obj/O as obj, mob/user as mob)
- if(istype(O,/obj/item/hand))
- var/obj/item/hand/H = O
+/obj/item/deck/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/hand))
+ var/obj/item/hand/H = attacking_item
for(var/datum/playingcard/P in H.cards)
cards += P
- qdel(O)
+ qdel(attacking_item)
to_chat(user, SPAN_NOTICE("You place your cards at the bottom of \the [src]."))
return
..()
@@ -148,9 +148,9 @@
user.visible_message("\The [user] deals a card to \the [target].")
H.throw_at(get_step(target,target.dir),10,1,H)
-/obj/item/hand/attackby(obj/O as obj, mob/user as mob)
- if(istype(O,/obj/item/hand))
- var/obj/item/hand/H = O
+/obj/item/hand/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/hand))
+ var/obj/item/hand/H = attacking_item
user.visible_message("\The [user] adds \the [H] to their hand.", SPAN_NOTICE("You add \the [H] to your hand."))
for(var/datum/playingcard/P in cards)
H.cards += P
diff --git a/code/modules/heavy_vehicle/components/_components.dm b/code/modules/heavy_vehicle/components/_components.dm
index 03db5ac1c8e..cb2620a4061 100644
--- a/code/modules/heavy_vehicle/components/_components.dm
+++ b/code/modules/heavy_vehicle/components/_components.dm
@@ -96,8 +96,8 @@
qdel(RC)
update_components()
-/obj/item/mech_component/attackby(var/obj/item/thing, var/mob/user)
- if(thing.isscrewdriver())
+/obj/item/mech_component/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.isscrewdriver())
if(contents.len)
var/obj/item/removed = pick(contents)
user.visible_message(SPAN_NOTICE("\The [user] removes \the [removed] from \the [src]."))
@@ -107,11 +107,11 @@
else
to_chat(user, SPAN_WARNING("There is nothing to remove."))
return
- if(thing.iswelder())
- repair_brute_generic(thing, user)
+ if(attacking_item.iswelder())
+ repair_brute_generic(attacking_item, user)
return
- if(thing.iscoil())
- repair_burn_generic(thing, user)
+ if(attacking_item.iscoil())
+ repair_burn_generic(attacking_item, user)
return
return ..()
diff --git a/code/modules/heavy_vehicle/components/arms.dm b/code/modules/heavy_vehicle/components/arms.dm
index 0dc938cef3d..0d2f8775be5 100644
--- a/code/modules/heavy_vehicle/components/arms.dm
+++ b/code/modules/heavy_vehicle/components/arms.dm
@@ -41,12 +41,13 @@
/obj/item/mech_component/manipulators/prebuild()
motivator = new(src)
-/obj/item/mech_component/manipulators/attackby(var/obj/item/thing, var/mob/user)
- if(istype(thing,/obj/item/robot_parts/robot_component/actuator))
+/obj/item/mech_component/manipulators/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/robot_parts/robot_component/actuator))
if(motivator)
to_chat(user, SPAN_WARNING("\The [src] already has an actuator installed."))
return
- if(install_component(thing, user)) motivator = thing
+ if(install_component(attacking_item, user))
+ motivator = attacking_item
else
return ..()
diff --git a/code/modules/heavy_vehicle/components/body.dm b/code/modules/heavy_vehicle/components/body.dm
index 7f4d52372c9..a36dbcef513 100644
--- a/code/modules/heavy_vehicle/components/body.dm
+++ b/code/modules/heavy_vehicle/components/body.dm
@@ -123,23 +123,25 @@
cell = new /obj/item/cell/mecha(src)
cell.charge = cell.maxcharge
-/obj/item/mech_component/chassis/attackby(var/obj/item/thing, var/mob/user)
- if(istype(thing,/obj/item/robot_parts/robot_component/diagnosis_unit))
+/obj/item/mech_component/chassis/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/robot_parts/robot_component/diagnosis_unit))
if(diagnostics)
to_chat(user, SPAN_WARNING("\The [src] already has a diagnostic system installed."))
return
- if(install_component(thing, user)) diagnostics = thing
- else if(istype(thing, /obj/item/cell))
+ if(install_component(attacking_item, user))
+ diagnostics = attacking_item
+ else if(istype(attacking_item, /obj/item/cell))
if(cell)
to_chat(user, SPAN_WARNING("\The [src] already has a cell installed."))
return
- if(install_component(thing,user)) cell = thing
- else if(istype(thing, /obj/item/robot_parts/robot_component/armor/mech))
+ if(install_component(attacking_item,user))
+ cell = attacking_item
+ else if(istype(attacking_item, /obj/item/robot_parts/robot_component/armor/mech))
if(mech_armor)
to_chat(user, SPAN_WARNING("\The [src] already has mech armor installed."))
return
- if(install_component(thing, user))
- mech_armor = thing
+ if(install_component(attacking_item, user))
+ mech_armor = attacking_item
else
return ..()
diff --git a/code/modules/heavy_vehicle/components/frame.dm b/code/modules/heavy_vehicle/components/frame.dm
index be8f058c841..ffd87063f59 100644
--- a/code/modules/heavy_vehicle/components/frame.dm
+++ b/code/modules/heavy_vehicle/components/frame.dm
@@ -108,10 +108,10 @@
/obj/structure/heavy_vehicle_frame/set_dir()
..(SOUTH)
-/obj/structure/heavy_vehicle_frame/attackby(var/obj/item/thing, var/mob/user)
+/obj/structure/heavy_vehicle_frame/attackby(obj/item/attacking_item, mob/user)
// Removing components.
- if(thing.iscrowbar())
+ if(attacking_item.iscrowbar())
if(is_reinforced == FRAME_REINFORCED)
user.visible_message(SPAN_NOTICE("\The [user] crowbars the reinforcement off \the [src]."))
new /obj/item/stack/material/steel(loc, 15)
@@ -138,7 +138,7 @@
return
// Final construction step.
- else if(thing.isscrewdriver())
+ else if(attacking_item.isscrewdriver())
// Check for basic components.
if(!(arms && legs && head && body))
@@ -180,13 +180,13 @@
return
// Installing wiring.
- else if(thing.iscoil())
+ else if(attacking_item.iscoil())
if(is_wired)
to_chat(user, SPAN_WARNING("\The [src] has already been wired."))
return
- var/obj/item/stack/cable_coil/CC = thing
+ var/obj/item/stack/cable_coil/CC = attacking_item
if(CC.amount < 10)
to_chat(user, SPAN_WARNING("You need at least ten units of cable to complete the exosuit."))
return
@@ -204,17 +204,17 @@
playsound(user.loc, 'sound/items/Deconstruct.ogg', 50, 1)
is_wired = FRAME_WIRED
// Securing wiring.
- else if(thing.iswirecutter())
+ else if(attacking_item.iswirecutter())
if(!is_wired)
to_chat(user, "There is no wiring in \the [src] to neaten.")
return
visible_message("\The [user] [(is_wired == FRAME_WIRED_ADJUSTED) ? "snips some of" : "neatens"] the wiring in \the [src].")
- playsound(user.loc, thing.usesound, 100, 1)
+ playsound(user.loc, attacking_item.usesound, 100, 1)
is_wired = (is_wired == FRAME_WIRED_ADJUSTED) ? FRAME_WIRED : FRAME_WIRED_ADJUSTED
// Installing metal.
- else if(istype(thing, /obj/item/stack/material))
- var/obj/item/stack/material/M = thing
+ else if(istype(attacking_item, /obj/item/stack/material))
+ var/obj/item/stack/material/M = attacking_item
if(M.material?.name == MATERIAL_STEEL)
if(is_reinforced)
to_chat(user, SPAN_WARNING("There is already metal reinforcement installed in \the [src]."))
@@ -229,7 +229,7 @@
else
return ..()
// Securing metal.
- else if(thing.iswrench())
+ else if(attacking_item.iswrench())
if(!is_reinforced)
to_chat(user, SPAN_WARNING("There is no metal to secure inside \the [src]."))
return
@@ -237,11 +237,11 @@
to_chat(user, SPAN_WARNING("\The [src]'s internal reinforcement has been welded in."))
return
visible_message("\The [user] [(is_reinforced == 2) ? "unsecures" : "secures"] the metal reinforcement in \the [src].")
- playsound(user.loc, thing.usesound, 100, 1)
+ playsound(user.loc, attacking_item.usesound, 100, 1)
is_reinforced = (is_reinforced == FRAME_REINFORCED_SECURE) ? FRAME_REINFORCED : FRAME_REINFORCED_SECURE
// Welding metal.
- else if(thing.iswelder())
- var/obj/item/weldingtool/WT = thing
+ else if(attacking_item.iswelder())
+ var/obj/item/weldingtool/WT = attacking_item
if(!is_reinforced)
to_chat(user, SPAN_WARNING("There is no metal to secure inside \the [src]."))
return
@@ -254,47 +254,47 @@
if(WT.use(1, user))
visible_message("\The [user] [(is_reinforced == 3) ? "unwelds the reinforcement from" : "welds the reinforcement into"] \the [src].")
is_reinforced = (is_reinforced == FRAME_REINFORCED_WELDED) ? FRAME_REINFORCED_SECURE : FRAME_REINFORCED_WELDED
- playsound(user.loc, thing.usesound, 50, 1)
+ playsound(user.loc, attacking_item.usesound, 50, 1)
else
to_chat(user, SPAN_WARNING("Not enough fuel!"))
return
// Installing basic components.
- else if(istype(thing,/obj/item/mech_component/manipulators))
+ else if(istype(attacking_item,/obj/item/mech_component/manipulators))
if(arms)
to_chat(user, SPAN_WARNING("\The [src] already has manipulators installed."))
return
- if(install_component(thing, user))
+ if(install_component(attacking_item, user))
if(arms)
- thing.dropInto(loc)
+ attacking_item.dropInto(loc)
return
- arms = thing
- else if(istype(thing,/obj/item/mech_component/propulsion))
+ arms = attacking_item
+ else if(istype(attacking_item,/obj/item/mech_component/propulsion))
if(legs)
to_chat(user, SPAN_WARNING("\The [src] already has a propulsion system installed."))
return
- if(install_component(thing, user))
+ if(install_component(attacking_item, user))
if(legs)
- thing.dropInto(loc)
+ attacking_item.dropInto(loc)
return
- legs = thing
- else if(istype(thing,/obj/item/mech_component/sensors))
+ legs = attacking_item
+ else if(istype(attacking_item,/obj/item/mech_component/sensors))
if(head)
to_chat(user, SPAN_WARNING("\The [src] already has a sensor array installed."))
return
- if(install_component(thing, user))
+ if(install_component(attacking_item, user))
if(head)
- thing.dropInto(loc)
+ attacking_item.dropInto(loc)
return
- head = thing
- else if(istype(thing,/obj/item/mech_component/chassis))
+ head = attacking_item
+ else if(istype(attacking_item,/obj/item/mech_component/chassis))
if(body)
to_chat(user, SPAN_WARNING("\The [src] already has an outer chassis installed."))
return
- if(install_component(thing, user))
+ if(install_component(attacking_item, user))
if(body)
- thing.dropInto(loc)
+ attacking_item.dropInto(loc)
return
- body = thing
+ body = attacking_item
else
return ..()
update_icon()
diff --git a/code/modules/heavy_vehicle/components/head.dm b/code/modules/heavy_vehicle/components/head.dm
index a1387adfbf6..7b1a617a02d 100644
--- a/code/modules/heavy_vehicle/components/head.dm
+++ b/code/modules/heavy_vehicle/components/head.dm
@@ -80,22 +80,22 @@
/obj/item/mech_component/sensors/ready_to_install()
return (radio && camera)
-/obj/item/mech_component/sensors/attackby(var/obj/item/thing, var/mob/user)
- if(istype(thing, /obj/item/mech_component/control_module))
+/obj/item/mech_component/sensors/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/mech_component/control_module))
if(software)
to_chat(user, SPAN_WARNING("\The [src] already has a control modules installed."))
return
- if(install_component(thing, user)) software = thing
- else if(istype(thing,/obj/item/robot_parts/robot_component/radio))
+ if(install_component(attacking_item, user)) software = attacking_item
+ else if(istype(attacking_item,/obj/item/robot_parts/robot_component/radio))
if(radio)
to_chat(user, SPAN_WARNING("\The [src] already has a radio installed."))
return
- if(install_component(thing, user)) radio = thing
- else if(istype(thing,/obj/item/robot_parts/robot_component/camera))
+ if(install_component(attacking_item, user)) radio = attacking_item
+ else if(istype(attacking_item,/obj/item/robot_parts/robot_component/camera))
if(camera)
to_chat(user, SPAN_WARNING("\The [src] already has a camera installed."))
return
- if(install_component(thing, user)) camera = thing
+ if(install_component(attacking_item, user)) camera = attacking_item
else
return ..()
@@ -120,11 +120,11 @@
if("software")
to_chat(usr, SPAN_NOTICE("Software for \the [src] can be created at the circuit imprinter."))
-/obj/item/mech_component/control_module/attackby(var/obj/item/thing, var/mob/user)
- if(istype(thing, /obj/item/circuitboard/exosystem))
- install_software(thing, user)
+/obj/item/mech_component/control_module/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/circuitboard/exosystem))
+ install_software(attacking_item, user)
return
- else if(thing.isscrewdriver())
+ else if(attacking_item.isscrewdriver())
var/result = ..()
update_software()
return result
diff --git a/code/modules/heavy_vehicle/components/legs.dm b/code/modules/heavy_vehicle/components/legs.dm
index fc5d79ccc40..d8aaaf236ae 100644
--- a/code/modules/heavy_vehicle/components/legs.dm
+++ b/code/modules/heavy_vehicle/components/legs.dm
@@ -40,13 +40,13 @@
/obj/item/mech_component/propulsion/update_components()
motivator = locate() in src
-/obj/item/mech_component/propulsion/attackby(var/obj/item/thing, var/mob/user)
- if(istype(thing,/obj/item/robot_parts/robot_component/actuator))
+/obj/item/mech_component/propulsion/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/robot_parts/robot_component/actuator))
if(motivator)
to_chat(user, SPAN_WARNING("\The [src] already has an actuator installed."))
return
- motivator = thing
- install_component(thing, user)
+ motivator = attacking_item
+ install_component(attacking_item, user)
else
return ..()
diff --git a/code/modules/heavy_vehicle/equipment/medical.dm b/code/modules/heavy_vehicle/equipment/medical.dm
index 2fbb4524270..f6d487a2f98 100644
--- a/code/modules/heavy_vehicle/equipment/medical.dm
+++ b/code/modules/heavy_vehicle/equipment/medical.dm
@@ -32,8 +32,8 @@
/obj/item/mecha_equipment/sleeper/attack()
return
-/obj/item/mecha_equipment/sleeper/attackby(var/obj/item/I, var/mob/user)
- return sleeper.attackby(I, user)
+/obj/item/mecha_equipment/sleeper/attackby(obj/item/attacking_item, mob/user)
+ return sleeper.attackby(attacking_item, user)
/obj/item/mecha_equipment/sleeper/afterattack(var/atom/target, var/mob/living/user, var/inrange, var/params)
. = ..()
@@ -87,16 +87,16 @@
return S.owner
return null
-/obj/machinery/sleeper/mounted/attackby(var/obj/item/I, var/mob/user)
- if(istype(I, /obj/item/reagent_containers/glass))
- if(!user.unEquip(I, src))
+/obj/machinery/sleeper/mounted/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/reagent_containers/glass))
+ if(!user.unEquip(attacking_item, src))
return TRUE
if(beaker)
beaker.forceMove(get_turf(src))
user.visible_message("\The [user] removes \the [beaker] from \the [src].", "You remove \the [beaker] from \the [src].")
- beaker = I
- user.visible_message("\The [user] adds \a [I] to \the [src].", "You add \a [I] to \the [src].")
+ beaker = attacking_item
+ user.visible_message("\The [user] adds \a [attacking_item] to \the [src].", "You add \a [attacking_item] to \the [src].")
return TRUE
/obj/item/mecha_equipment/crisis_drone
diff --git a/code/modules/heavy_vehicle/equipment/utility.dm b/code/modules/heavy_vehicle/equipment/utility.dm
index 22eb232df12..fd2ca0cac35 100644
--- a/code/modules/heavy_vehicle/equipment/utility.dm
+++ b/code/modules/heavy_vehicle/equipment/utility.dm
@@ -552,9 +552,9 @@
owner.visible_message(SPAN_NOTICE("\The [owner] loads \the [target] into \the [src]."))
lathe.attackby(target, owner)
-/obj/item/mecha_equipment/autolathe/attackby(obj/item/W, mob/user)
- if(W.isscrewdriver() || W.ismultitool() || W.iswirecutter() || istype(W, /obj/item/storage/part_replacer))
- lathe.attackby(W, user)
+/obj/item/mecha_equipment/autolathe/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.isscrewdriver() || attacking_item.ismultitool() || attacking_item.iswirecutter() || istype(attacking_item, /obj/item/storage/part_replacer))
+ lathe.attackby(attacking_item, user)
update_icon()
return TRUE
return ..()
@@ -663,25 +663,25 @@
var/obj/item/anomaly_core/AC
var/image/anomaly_overlay
-/obj/item/mecha_equipment/phazon/attackby(obj/item/I, mob/user)
- if(istype(I, /obj/item/anomaly_core))
+/obj/item/mecha_equipment/phazon/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/anomaly_core))
if(AC)
to_chat(user, SPAN_WARNING("\The [src] already has an anomaly core installed!"))
return TRUE
- user.drop_from_inventory(I, src)
- AC = I
+ user.drop_from_inventory(attacking_item, src)
+ AC = attacking_item
to_chat(user, SPAN_NOTICE("You insert \the [AC] into \the [src]."))
desc_info = "\The [src] has an anomaly core installed! You can use a wrench to remove it."
anomaly_overlay = image(AC.icon, null, AC.icon_state)
anomaly_overlay.pixel_y = 3
add_overlay(anomaly_overlay)
return TRUE
- if(I.iswrench())
+ if(attacking_item.iswrench())
if(!AC)
to_chat(user, SPAN_WARNING("\The [src] doesn't have an anomaly core installed!"))
return TRUE
to_chat(user, SPAN_NOTICE("You remove \the [AC] from \the [src]."))
- playsound(loc, I.usesound, 50, TRUE)
+ playsound(loc, attacking_item.usesound, 50, TRUE)
user.put_in_hands(AC)
cut_overlay(anomaly_overlay)
qdel(anomaly_overlay)
diff --git a/code/modules/heavy_vehicle/mech_interaction.dm b/code/modules/heavy_vehicle/mech_interaction.dm
index 0d3074b9502..c8b4f707e68 100644
--- a/code/modules/heavy_vehicle/mech_interaction.dm
+++ b/code/modules/heavy_vehicle/mech_interaction.dm
@@ -329,13 +329,13 @@
use_cell_power(PZ.active_power_use * CELLRATE)
return ..()
-/mob/living/heavy_vehicle/attackby(var/obj/item/thing, var/mob/user)
- if(user.a_intent != I_HURT && istype(thing, /obj/item/mecha_equipment))
+/mob/living/heavy_vehicle/attackby(obj/item/attacking_item, mob/user)
+ if(user.a_intent != I_HURT && istype(attacking_item, /obj/item/mecha_equipment))
if(hardpoints_locked)
to_chat(user, "Hardpoint system access is disabled.")
return
- var/obj/item/mecha_equipment/realThing = thing
+ var/obj/item/mecha_equipment/realThing = attacking_item
if(realThing.owner)
return
@@ -344,21 +344,21 @@
if(hardpoints[hardpoint] == null)
free_hardpoints += hardpoint
var/to_place = tgui_input_list(user, "Where would you like to install it?", "Install Hardpoint", (realThing.restricted_hardpoints & free_hardpoints))
- if(install_system(thing, to_place, user))
+ if(install_system(attacking_item, to_place, user))
return
- to_chat(user, "\The [thing] could not be installed in that hardpoint.")
+ to_chat(user, "\The [attacking_item] could not be installed in that hardpoint.")
return
else
if(user.a_intent != I_HURT)
- if(istype(thing, /obj/item/remote_mecha))
+ if(istype(attacking_item, /obj/item/remote_mecha))
if(length(pilots))
to_chat(user, SPAN_WARNING("You can't apply this upgrade while \the [src] has occupants!"))
return
if(!maintenance_protocols)
to_chat(user, SPAN_WARNING("You are unable to apply this upgrade while \the [src]'s maintenance protocols are not active."))
return
- user.visible_message(SPAN_NOTICE("\The [user] begins installing \the [thing] into \the [src]..."), SPAN_NOTICE("You begin installing the [thing] into \the [src]..."))
+ user.visible_message(SPAN_NOTICE("\The [user] begins installing \the [attacking_item] into \the [src]..."), SPAN_NOTICE("You begin installing the [attacking_item] into \the [src]..."))
if(do_after(user, 30, src))
if(length(pilots))
to_chat(user, SPAN_WARNING("You can't apply this upgrade while \the [src] has occupants!"))
@@ -366,15 +366,15 @@
if(!maintenance_protocols)
to_chat(user, SPAN_WARNING("You are unable to apply this upgrade while \the [src]'s maintenance protocols are not active."))
return
- var/obj/item/remote_mecha/RM = thing
- user.visible_message(SPAN_NOTICE("\The [user] installs \the [thing] into \the [src]."), SPAN_NOTICE("You install the [thing] into \the [src]."))
+ var/obj/item/remote_mecha/RM = attacking_item
+ user.visible_message(SPAN_NOTICE("\The [user] installs \the [attacking_item] into \the [src]."), SPAN_NOTICE("You install the [attacking_item] into \the [src]."))
remote_network = RM.mech_remote_network
does_hardpoint_lock = RM.hardpoint_lock
dummy_type = RM.dummy_path
remote_type = RM.type
become_remote()
- qdel(thing)
- else if(thing.ismultitool())
+ qdel(attacking_item)
+ else if(attacking_item.ismultitool())
if(hardpoints_locked)
to_chat(user, "Hardpoint system access is disabled.")
return
@@ -391,7 +391,7 @@
to_chat(user, "\The [src] has no hardpoint systems to remove.")
return
- else if(thing.iswrench())
+ else if(attacking_item.iswrench())
if(!remote && length(pilots))
to_chat(user, SPAN_WARNING("You can't disassemble \the [src] while it has a pilot!"))
return
@@ -417,7 +417,7 @@
new remote_type(get_turf(src))
dismantle()
return
- else if(thing.iswelder())
+ else if(attacking_item.iswelder())
if(!getBruteLoss())
return
var/list/damaged_parts = list()
@@ -426,9 +426,9 @@
damaged_parts += MC
var/obj/item/mech_component/to_fix = tgui_input_list(user, "Which component would you like to fix?", "Fix Component", damaged_parts)
if(CanInteract(user, physical_state) && !QDELETED(to_fix) && (to_fix in src) && to_fix.brute_damage)
- to_fix.repair_brute_generic(thing, user)
+ to_fix.repair_brute_generic(attacking_item, user)
return
- else if(thing.iscoil())
+ else if(attacking_item.iscoil())
if(!getFireLoss())
return
var/list/damaged_parts = list()
@@ -437,9 +437,9 @@
damaged_parts += MC
var/obj/item/mech_component/to_fix = tgui_input_list(user, "Which component would you like to fix?", "Fix Component", damaged_parts)
if(CanInteract(user, physical_state) && !QDELETED(to_fix) && (to_fix in src) && to_fix.burn_damage)
- to_fix.repair_burn_generic(thing, user)
+ to_fix.repair_burn_generic(attacking_item, user)
return
- else if(thing.iscrowbar())
+ else if(attacking_item.iscrowbar())
if(!maintenance_protocols)
to_chat(user, "The cell compartment remains locked while maintenance protocols are disabled.")
return
@@ -452,13 +452,13 @@
user.put_in_hands(body.cell)
to_chat(user, "You remove \the [body.cell] from \the [src].")
- playsound(user.loc, thing.usesound, 50, 1)
- visible_message("\The [user] pries out \the [body.cell] using the \the [thing].")
+ playsound(user.loc, attacking_item.usesound, 50, 1)
+ visible_message("\The [user] pries out \the [body.cell] using the \the [attacking_item].")
power = MECH_POWER_OFF
hud_power_control.update_icon()
body.cell = null
return
- else if(istype(thing, /obj/item/cell))
+ else if(istype(attacking_item, /obj/item/cell))
if(!maintenance_protocols)
to_chat(user, "The cell compartment remains locked while maintenance protocols are disabled.")
return
@@ -466,14 +466,14 @@
to_chat(user, "There is already a cell in there!")
return
- if(user.unEquip(thing))
- thing.forceMove(body)
- body.cell = thing
+ if(user.unEquip(attacking_item))
+ attacking_item.forceMove(body)
+ body.cell = attacking_item
to_chat(user, "You install \the [body.cell] into \the [src].")
playsound(user.loc, 'sound/items/Screwdriver.ogg', 50, 1)
visible_message("\The [user] installs \the [body.cell] into \the [src].")
return
- else if(istype(thing, /obj/item/device/robotanalyzer))
+ else if(istype(attacking_item, /obj/item/device/robotanalyzer))
to_chat(user, SPAN_NOTICE("Diagnostic Report for \the [src]:"))
for(var/obj/item/mech_component/limb in list (head, body, arms, legs))
if(limb)
diff --git a/code/modules/heavy_vehicle/mech_wreckage.dm b/code/modules/heavy_vehicle/mech_wreckage.dm
index bc069e39503..9b2b0e63ca1 100644
--- a/code/modules/heavy_vehicle/mech_wreckage.dm
+++ b/code/modules/heavy_vehicle/mech_wreckage.dm
@@ -42,16 +42,16 @@
return
return ..()
-/obj/structure/mech_wreckage/attackby(var/obj/item/W, var/mob/user)
+/obj/structure/mech_wreckage/attackby(obj/item/attacking_item, mob/user)
var/cutting
- if(W.iswelder())
- var/obj/item/weldingtool/WT = W
+ if(attacking_item.iswelder())
+ var/obj/item/weldingtool/WT = attacking_item
if(WT.isOn())
cutting = TRUE
else
to_chat(user, "Turn the torch on, first.")
return
- else if(istype(W, /obj/item/gun/energy/plasmacutter))
+ else if(istype(attacking_item, /obj/item/gun/energy/plasmacutter))
cutting = TRUE
if(cutting)
@@ -62,7 +62,7 @@
to_chat(user, "\The [src] has already been weakened.")
return 1
- else if(W.iswrench())
+ else if(attacking_item.iswrench())
if(prepared)
to_chat(user, "You finish dismantling \the [src].")
new /obj/item/stack/material/steel(get_turf(src),rand(5,10))
@@ -70,8 +70,8 @@
else
to_chat(user, "It's too solid to dismantle. Try cutting through some of the bigger bits.")
return 1
- else if(istype(W) && W.force > 20)
- visible_message("\The [src] has been smashed with \the [W] by \the [user]!")
+ else if(istype(attacking_item) && attacking_item.force > 20)
+ visible_message("\The [src] has been smashed with \the [attacking_item] by \the [user]!")
if(prob(20))
new /obj/item/stack/material/steel(get_turf(src),rand(1,3))
qdel(src)
diff --git a/code/modules/holidays/christmas/props.dm b/code/modules/holidays/christmas/props.dm
index c1a08a5def2..e59155ff82d 100644
--- a/code/modules/holidays/christmas/props.dm
+++ b/code/modules/holidays/christmas/props.dm
@@ -78,10 +78,10 @@
return
to_chat(user, "You can't move.")
-/obj/effect/spresent/attackby(obj/item/W as obj, mob/user as mob)
+/obj/effect/spresent/attackby(obj/item/attacking_item, mob/user)
..()
- if (!W.iswirecutter())
+ if (!attacking_item.iswirecutter())
to_chat(user, "I need wirecutters for that.")
return
diff --git a/code/modules/holidays/halloween/costumes.dm b/code/modules/holidays/halloween/costumes.dm
index c5ffca61ca0..1c010dbeba2 100644
--- a/code/modules/holidays/halloween/costumes.dm
+++ b/code/modules/holidays/halloween/costumes.dm
@@ -307,7 +307,7 @@
if(len == 2)
item_state = "target_costume_two"
-/obj/item/clothing/suit/storage/target_costume/attackby(obj/item/W, mob/user)
+/obj/item/clothing/suit/storage/target_costume/attackby(obj/item/attacking_item, mob/user)
. = ..()
var/len = length(pockets.contents)
if(!len)
diff --git a/code/modules/holodeck/HolodeckObjects.dm b/code/modules/holodeck/HolodeckObjects.dm
index 7b7a416edb6..8df93978eb9 100644
--- a/code/modules/holodeck/HolodeckObjects.dm
+++ b/code/modules/holodeck/HolodeckObjects.dm
@@ -6,7 +6,7 @@
/turf/simulated/floor/holofloor
thermal_conductivity = 0
-/turf/simulated/floor/holofloor/attackby(obj/item/W as obj, mob/user as mob)
+/turf/simulated/floor/holofloor/attackby(obj/item/attacking_item, mob/user)
return
// HOLOFLOOR DOES NOT GIVE A FUCK
@@ -161,25 +161,27 @@
/obj/structure/window/reinforced/holowindow/Destroy()
return ..()
-/obj/structure/window/reinforced/holowindow/attackby(obj/item/W as obj, mob/user as mob)
- if(!istype(W)) return//I really wish I did not need this
- if (istype(W, /obj/item/grab) && get_dist(src,user)<2)
- var/obj/item/grab/G = W
+/obj/structure/window/reinforced/holowindow/attackby(obj/item/attacking_item, mob/user)
+ if(!istype(attacking_item))
+ return//I really wish I did not need this
+
+ if (istype(attacking_item, /obj/item/grab) && get_dist(src,user)<2)
+ var/obj/item/grab/G = attacking_item
if(istype(G.affecting,/mob/living))
grab_smash_attack(G, DAMAGE_PAIN)
return
- if(W.item_flags & ITEM_FLAG_NO_BLUDGEON) return
+ if(attacking_item.item_flags & ITEM_FLAG_NO_BLUDGEON) return
- if(W.isscrewdriver())
+ if(attacking_item.isscrewdriver())
to_chat(user, ("It's a holowindow, you can't unfasten it!"))
- else if(W.iscrowbar() && reinf && state <= 1)
+ else if(attacking_item.iscrowbar() && reinf && state <= 1)
to_chat(user, ("It's a holowindow, you can't pry it!"))
- else if(W.iswrench() && !anchored && (!state || !reinf))
+ else if(attacking_item.iswrench() && !anchored && (!state || !reinf))
to_chat(user, ("It's a holowindow, you can't dismantle it!"))
else
- if(W.damtype == DAMAGE_BRUTE || W.damtype == DAMAGE_BURN)
- hit(W.force)
+ if(attacking_item.damtype == DAMAGE_BRUTE || attacking_item.damtype == DAMAGE_BURN)
+ hit(attacking_item.force)
if(health <= 7)
anchored = 0
update_nearby_icons()
@@ -202,16 +204,16 @@
/obj/machinery/door/window/holowindoor/Destroy()
return ..()
-/obj/machinery/door/window/holowindoor/attackby(obj/item/I as obj, mob/user as mob)
+/obj/machinery/door/window/holowindoor/attackby(obj/item/attacking_item, mob/user)
if (src.operating == 1)
return
- if(src.density && istype(I, /obj/item) && !istype(I, /obj/item/card))
- var/aforce = I.force
+ if(src.density && istype(attacking_item, /obj/item) && !istype(attacking_item, /obj/item/card))
+ var/aforce = attacking_item.force
playsound(src.loc, 'sound/effects/glass_hit.ogg', 75, 1)
- visible_message("[src] was hit by [I].")
- if(I.damtype == DAMAGE_BRUTE || I.damtype == DAMAGE_BURN)
+ visible_message("[src] was hit by [attacking_item].")
+ if(attacking_item.damtype == DAMAGE_BRUTE || attacking_item.damtype == DAMAGE_BURN)
take_damage(aforce)
return
@@ -243,8 +245,8 @@
/obj/structure/bed/stool/chair/holochair/Destroy()
return ..()
-/obj/structure/bed/stool/chair/holochair/attackby(obj/item/W as obj, mob/user as mob)
- if(W.iswrench())
+/obj/structure/bed/stool/chair/holochair/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.iswrench())
to_chat(user, ("It's a holochair, you can't dismantle it!"))
return
@@ -333,20 +335,20 @@
density = 1
throwpass = 1
-/obj/structure/holohoop/attackby(obj/item/W as obj, mob/user as mob)
- if (istype(W, /obj/item/grab) && get_dist(src,user)<2)
- var/obj/item/grab/G = W
+/obj/structure/holohoop/attackby(obj/item/attacking_item, mob/user)
+ if (istype(attacking_item, /obj/item/grab) && get_dist(src,user)<2)
+ var/obj/item/grab/G = attacking_item
if(G.state<2)
to_chat(user, "You need a better grip to do that!")
return
G.affecting.forceMove(src.loc)
G.affecting.Weaken(5)
visible_message("[G.assailant] dunks [G.affecting] into the [src]!", range = 3)
- qdel(W)
+ qdel(attacking_item)
return
- else if (istype(W, /obj/item) && get_dist(src,user)<2)
- user.drop_from_inventory(W,get_turf(src))
- visible_message("[user] dunks [W] into the [src]!", range = 3)
+ else if (istype(attacking_item, /obj/item) && get_dist(src,user)<2)
+ user.drop_from_inventory(attacking_item, get_turf(src))
+ visible_message("[user] dunks [attacking_item] into the [src]!", range = 3)
return
/obj/structure/holohoop/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
@@ -380,7 +382,7 @@
to_chat(user, "The station AI is not to interact with these devices!")
return
-/obj/machinery/readybutton/attackby(obj/item/W as obj, mob/user as mob)
+/obj/machinery/readybutton/attackby(obj/item/attacking_item, mob/user)
to_chat(user, "The device is a solid button, there's nothing you can do with it!")
/obj/machinery/readybutton/attack_hand(mob/user as mob)
diff --git a/code/modules/hydroponics/beekeeping/beehive.dm b/code/modules/hydroponics/beekeeping/beehive.dm
index 347196691b5..ee7e2ef1b30 100644
--- a/code/modules/hydroponics/beekeeping/beehive.dm
+++ b/code/modules/hydroponics/beekeeping/beehive.dm
@@ -64,37 +64,37 @@
if(honeycombs / 100 > 1)
. += SPAN_NOTICE("\The [src] has a frame full of honeycombs which you can harvest.")
-/obj/machinery/beehive/attackby(obj/item/I, mob/user)
- if(I.iscrowbar())
+/obj/machinery/beehive/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.iscrowbar())
closed = !closed
user.visible_message(SPAN_NOTICE("\The [user] [closed ? "closes" : "opens"] \the [src]."), SPAN_NOTICE("You [closed ? "close" : "open"] \the [src]."))
update_icon()
return
- else if(I.iswrench())
+ else if(attacking_item.iswrench())
anchored = !anchored
user.visible_message(SPAN_NOTICE("\The [user] [anchored ? "wrenches" : "unwrenches"] \the [src]."), SPAN_NOTICE("You [anchored ? "wrench" : "unwrench"] \the [src]."))
if(!smoked && !anchored && (bee_count > 10))
visible_message(SPAN_WARNING("The bees don't like their home being moved!"))
release_bees(0.1, 5)
return
- else if(istype(I, /obj/item/honey_frame))
+ else if(istype(attacking_item, /obj/item/honey_frame))
if(closed)
- to_chat(user, SPAN_WARNING("You need to open \the [src] with a crowbar before inserting \the [I]."))
+ to_chat(user, SPAN_WARNING("You need to open \the [src] with a crowbar before inserting \the [attacking_item]."))
return
if(frames >= maxFrames)
to_chat(user, SPAN_WARNING("\The [src] cannot fit more frames."))
return
- var/obj/item/honey_frame/H = I
+ var/obj/item/honey_frame/H = attacking_item
if(H.honey)
- to_chat(user, SPAN_WARNING("\The [I] is full with beeswax and honey, empty it into the extractor first."))
+ to_chat(user, SPAN_WARNING("\The [attacking_item] is full with beeswax and honey, empty it into the extractor first."))
return
frames++
- user.visible_message(SPAN_NOTICE("\The [user] loads \the [I] into \the [src]."), SPAN_NOTICE("You load \the [I] into \the [src]."))
+ user.visible_message(SPAN_NOTICE("\The [user] loads \the [attacking_item] into \the [src]."), SPAN_NOTICE("You load \the [attacking_item] into \the [src]."))
update_icon()
- qdel(I)
+ qdel(attacking_item)
return
- else if(istype(I, /obj/item/bee_pack))
- var/obj/item/bee_pack/B = I
+ else if(istype(attacking_item, /obj/item/bee_pack))
+ var/obj/item/bee_pack/B = attacking_item
if(B.full && bee_count)
to_chat(user, SPAN_WARNING("\The [B] is already full of bees."))
return
@@ -117,7 +117,7 @@
B.fill()
update_icon()
return
- else if(istype(I, /obj/item/device/analyzer/plant_analyzer))
+ else if(istype(attacking_item, /obj/item/device/analyzer/plant_analyzer))
to_chat(user, SPAN_NOTICE("Scan result of \the [src]:"))
to_chat(user, SPAN_NOTICE("Beehive is [bee_count ? "[round(bee_count)]% full" : "empty"].[bee_count > 90 ? " Colony is ready to split." : ""]"))
if(frames)
@@ -129,9 +129,9 @@
if(smoked)
to_chat(user, SPAN_NOTICE("The hive is smoked."))
return
- else if(I.isscrewdriver())
+ else if(attacking_item.isscrewdriver())
to_chat(user, SPAN_NOTICE("You start dismantling \the [src]. This will take a while..."))
- if(I.use_tool(src, user, 150, volume = 50))
+ if(attacking_item.use_tool(src, user, 150, volume = 50))
user.visible_message(SPAN_NOTICE("\The [user] dismantles \the [src]."), SPAN_NOTICE("You dismantle \the [src]."))
if(bee_count)
visible_message(SPAN_WARNING("The bees are furious over the destruction of their home!"))
diff --git a/code/modules/hydroponics/beekeeping/honey_extractor.dm b/code/modules/hydroponics/beekeeping/honey_extractor.dm
index 94c7c6e8eeb..17057662a0f 100644
--- a/code/modules/hydroponics/beekeeping/honey_extractor.dm
+++ b/code/modules/hydroponics/beekeeping/honey_extractor.dm
@@ -14,12 +14,12 @@
. += SPAN_NOTICE("It's holding \the [contained_frame].")
. += SPAN_NOTICE("It contains [honey] units of honey for collection.")
-/obj/machinery/honey_extractor/attackby(obj/item/I, mob/user)
+/obj/machinery/honey_extractor/attackby(obj/item/attacking_item, mob/user)
if(contained_frame)
to_chat(user, SPAN_WARNING("\The [src] is currently spinning, wait until it's finished."))
return
- else if(istype(I, /obj/item/honey_frame))
- var/obj/item/honey_frame/H = I
+ else if(istype(attacking_item, /obj/item/honey_frame))
+ var/obj/item/honey_frame/H = attacking_item
if(!H.honey)
to_chat(user, SPAN_NOTICE("\The [H] is empty, put it into a beehive."))
return
@@ -28,11 +28,11 @@
contained_frame = H
icon_state = "centrifuge_moving"
addtimer(CALLBACK(src, PROC_REF(do_process)), 100)
- else if(istype(I, /obj/item/reagent_containers/glass))
+ else if(istype(attacking_item, /obj/item/reagent_containers/glass))
if(!honey)
to_chat(user, SPAN_NOTICE("There is no honey in \the [src]."))
return
- var/obj/item/reagent_containers/glass/G = I
+ var/obj/item/reagent_containers/glass/G = attacking_item
var/transferred = min(G.reagents.maximum_volume - G.reagents.total_volume, honey)
G.reagents.add_reagent(/singleton/reagent/nutriment/honey, transferred)
honey -= transferred
diff --git a/code/modules/hydroponics/grown.dm b/code/modules/hydroponics/grown.dm
index 7ea83f3a9e7..0c4960c7115 100644
--- a/code/modules/hydroponics/grown.dm
+++ b/code/modules/hydroponics/grown.dm
@@ -172,11 +172,11 @@
if(seed) seed.thrown_at(src,hit_atom)
..()
-/obj/item/reagent_containers/food/snacks/grown/attackby(var/obj/item/W, var/mob/user)
+/obj/item/reagent_containers/food/snacks/grown/attackby(obj/item/attacking_item, mob/user)
if(seed)
- if(seed.get_trait(TRAIT_PRODUCES_POWER) && W.iscoil())
- var/obj/item/stack/cable_coil/C = W
+ if(seed.get_trait(TRAIT_PRODUCES_POWER) && attacking_item.iscoil())
+ var/obj/item/stack/cable_coil/C = attacking_item
if(C.use(5))
//TODO: generalize this.
to_chat(user, "You add some cable to the [src.name] and slide it inside the battery casing.")
@@ -187,14 +187,14 @@
pocell.charge = pocell.maxcharge
qdel(src)
return
- else if(W.sharp && !W.noslice)
+ else if(attacking_item.sharp && !attacking_item.noslice)
if(seed.kitchen_tag == "pumpkin") // Ugggh these checks are awful.
user.show_message("You carve a face into [src]!", 1)
user.put_in_hands(new /obj/item/clothing/head/pumpkin)
qdel(src)
return
else if(seed.chems)
- if(istype(W,/obj/item/material/hatchet) && !isnull(seed.chems[/singleton/reagent/woodpulp]))
+ if(istype(attacking_item,/obj/item/material/hatchet) && !isnull(seed.chems[/singleton/reagent/woodpulp]))
user.show_message("You make planks out of \the [src]!", 1)
playsound(loc, 'sound/effects/woodcutting.ogg', 50, 1)
var/flesh_colour = seed.get_trait(TRAIT_FLESH_COLOUR)
diff --git a/code/modules/hydroponics/grown_inedible.dm b/code/modules/hydroponics/grown_inedible.dm
index 463838d2e00..3070209ce8f 100644
--- a/code/modules/hydroponics/grown_inedible.dm
+++ b/code/modules/hydroponics/grown_inedible.dm
@@ -46,10 +46,12 @@
throw_speed = 4
throw_range = 20
-/obj/item/corncob/attackby(obj/item/W as obj, mob/user as mob)
+/obj/item/corncob/attackby(obj/item/attacking_item, mob/user)
..()
- if(istype(W, /obj/item/surgery/circular_saw) || istype(W, /obj/item/material/hatchet) || istype(W, /obj/item/material/kitchen/utensil/knife) || istype(W, /obj/item/material/knife) || istype(W, /obj/item/material/knife/ritual))
- to_chat(user, "You use [W] to fashion a pipe out of the corn cob!")
+ if(istype(attacking_item, /obj/item/surgery/circular_saw) || istype(attacking_item, /obj/item/material/hatchet) || \
+ istype(attacking_item, /obj/item/material/kitchen/utensil/knife) || istype(attacking_item, /obj/item/material/knife) || \
+ istype(attacking_item, /obj/item/material/knife/ritual))
+ to_chat(user, "You use [attacking_item] to fashion a pipe out of the corn cob!")
new /obj/item/clothing/mask/smokable/pipe/cobpipe (user.loc)
qdel(src)
return
diff --git a/code/modules/hydroponics/seed_machines.dm b/code/modules/hydroponics/seed_machines.dm
index 479989a9dbc..56a6273492a 100644
--- a/code/modules/hydroponics/seed_machines.dm
+++ b/code/modules/hydroponics/seed_machines.dm
@@ -80,36 +80,36 @@
visible_message("[icon2html(src, viewers(get_turf(src)))] [src] beeps and spits out [loaded_disk].")
loaded_disk = null
-/obj/machinery/botany/attackby(obj/item/W as obj, mob/user as mob)
- if(istype(W,/obj/item/seeds))
+/obj/machinery/botany/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/seeds))
if(seed)
to_chat(user, "There is already a seed loaded.")
return
- var/obj/item/seeds/S =W
+ var/obj/item/seeds/S = attacking_item
if(S.seed && S.seed.get_trait(TRAIT_IMMUTABLE) > 0)
to_chat(user, "That seed is not compatible with our genetics technology.")
else
- user.drop_from_inventory(W,src)
- seed = W
- to_chat(user, "You load [W] into [src].")
+ user.drop_from_inventory(attacking_item,src)
+ seed = attacking_item
+ to_chat(user, "You load [attacking_item] into [src].")
return
- if(W.isscrewdriver())
+ if(attacking_item.isscrewdriver())
open = !open
to_chat(user, "You [open ? "open" : "close"] the maintenance panel.")
return
if(open)
- if(W.iscrowbar())
+ if(attacking_item.iscrowbar())
dismantle()
return
- if(istype(W,/obj/item/disk/botany))
+ if(istype(attacking_item,/obj/item/disk/botany))
if(loaded_disk)
to_chat(user, "There is already a data disk loaded.")
return
else
- var/obj/item/disk/botany/B = W
+ var/obj/item/disk/botany/B = attacking_item
if(B.genes && B.genes.len)
if(!disk_needs_genes)
@@ -120,9 +120,9 @@
to_chat(user, "That disk does not have any gene data loaded.")
return
- user.drop_from_inventory(W,src)
- loaded_disk = W
- to_chat(user, "You load [W] into [src].")
+ user.drop_from_inventory(attacking_item,src)
+ loaded_disk = attacking_item
+ to_chat(user, "You load [attacking_item] into [src].")
return
..()
diff --git a/code/modules/hydroponics/seed_storage.dm b/code/modules/hydroponics/seed_storage.dm
index b2f1fb2a1da..78fdb5611a9 100644
--- a/code/modules/hydroponics/seed_storage.dm
+++ b/code/modules/hydroponics/seed_storage.dm
@@ -368,24 +368,25 @@
qdel(N)
. = TRUE
-/obj/machinery/seed_storage/attackby(var/obj/item/O, var/mob/user)
- if (istype(O, /obj/item/seeds))
- add(O)
- user.visible_message(SPAN_NOTICE("[user] puts \the [O.name] into \the [src]."), SPAN_NOTICE("You put \the [O] into \the [src]."))
+/obj/machinery/seed_storage/attackby(obj/item/attacking_item, mob/user)
+ if (istype(attacking_item, /obj/item/seeds))
+ add(attacking_item)
+ user.visible_message(SPAN_NOTICE("[user] puts \the [attacking_item.name] into \the [src]."), SPAN_NOTICE("You put \the [attacking_item] into \the [src]."))
return
- else if (istype(O, /obj/item/storage/bag/plants))
- var/obj/item/storage/P = O
+ else if (istype(attacking_item, /obj/item/storage/bag/plants))
+ var/obj/item/storage/P = attacking_item
var/loaded = 0
for(var/obj/item/seeds/G in P.contents)
++loaded
add(G)
if (loaded)
- user.visible_message(SPAN_NOTICE("[user] puts the seeds from \the [O.name] into \the [src]."), SPAN_NOTICE("You put the seeds from \the [O.name] into \the [src]."))
+ user.visible_message(SPAN_NOTICE("[user] puts the seeds from \the [attacking_item.name] into \the [src]."),
+ SPAN_NOTICE("You put the seeds from \the [attacking_item.name] into \the [src]."))
else
- to_chat(user, SPAN_WARNING("There are no seeds in \the [O.name]."))
+ to_chat(user, SPAN_WARNING("There are no seeds in \the [attacking_item.name]."))
return
- else if(O.iswrench())
- playsound(loc, O.usesound, 50, 1)
+ else if(attacking_item.iswrench())
+ playsound(loc, attacking_item.usesound, 50, 1)
anchored = !anchored
to_chat(user, SPAN_NOTICE("You [anchored ? "wrench" : "unwrench"] \the [src]."))
diff --git a/code/modules/hydroponics/spreading/spreading.dm b/code/modules/hydroponics/spreading/spreading.dm
index b2e5f58b436..c37429eb651 100644
--- a/code/modules/hydroponics/spreading/spreading.dm
+++ b/code/modules/hydroponics/spreading/spreading.dm
@@ -229,12 +229,12 @@
floor = 1
return 1
-/obj/effect/plant/attackby(var/obj/item/W, var/mob/user)
+/obj/effect/plant/attackby(obj/item/attacking_item, mob/user)
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
user.do_attack_animation(src)
SSplants.add_plant(src)
- if(W.iswirecutter() || istype(W, /obj/item/surgery/scalpel))
+ if(attacking_item.iswirecutter() || istype(attacking_item, /obj/item/surgery/scalpel))
if(sampled)
to_chat(user, "\The [src] has already been sampled recently.")
return
@@ -254,8 +254,8 @@
sampled = 1
else
playsound(loc, /singleton/sound_category/wood_break_sound, 50, TRUE)
- var/damage = W.force ? W.force : 1 //always do at least a little damage
- if(W.edge || W.sharp)
+ var/damage = attacking_item.force ? attacking_item.force : 1 //always do at least a little damage
+ if(attacking_item.edge || attacking_item.sharp)
damage *= 2
health -= damage
check_health()
diff --git a/code/modules/hydroponics/trays/tray.dm b/code/modules/hydroponics/trays/tray.dm
index 8255c9890f9..877f410b37f 100644
--- a/code/modules/hydroponics/trays/tray.dm
+++ b/code/modules/hydroponics/trays/tray.dm
@@ -454,11 +454,11 @@
return
-/obj/machinery/portable_atmospherics/hydroponics/attackby(var/obj/item/O as obj, var/mob/user as mob)
+/obj/machinery/portable_atmospherics/hydroponics/attackby(obj/item/attacking_item, mob/user)
//A special case for if the container has only water, for manual watering with buckets
- if (istype(O,/obj/item/reagent_containers))
- var/obj/item/reagent_containers/RC = O
+ if (istype(attacking_item, /obj/item/reagent_containers))
+ var/obj/item/reagent_containers/RC = attacking_item
if(!RC.is_open_container())
to_chat(user, SPAN_WARNING("You need to open \the [RC] first!"))
return
@@ -473,10 +473,10 @@
to_chat(user, SPAN_WARNING("This tray is full of water already."))
return TRUE
- if (O.is_open_container())
+ if (attacking_item.is_open_container())
return FALSE
- if(O.iswirecutter() || istype(O, /obj/item/surgery/scalpel))
+ if(attacking_item.iswirecutter() || istype(attacking_item, /obj/item/surgery/scalpel))
if(!seed)
to_chat(user, "There is nothing to take a sample from in \the [src].")
@@ -504,9 +504,9 @@
return
- else if(istype(O, /obj/item/reagent_containers/syringe))
+ else if(istype(attacking_item, /obj/item/reagent_containers/syringe))
- var/obj/item/reagent_containers/syringe/S = O
+ var/obj/item/reagent_containers/syringe/S = attacking_item
if (S.mode == 1)
if(seed)
@@ -522,16 +522,16 @@
to_chat(user, "There's nothing to draw something from.")
return TRUE
- else if (istype(O, /obj/item/seeds))
+ else if (istype(attacking_item, /obj/item/seeds))
if(!seed)
- var/obj/item/seeds/S = O
- user.remove_from_mob(O)
+ var/obj/item/seeds/S = attacking_item
+ user.remove_from_mob(attacking_item)
if(!S.seed)
to_chat(user, "The packet seems to be empty. You throw it away.")
- qdel(O)
+ qdel(attacking_item)
return
if(S.seed.hydrotray_only && !mechanical)
@@ -547,14 +547,14 @@
health = (istype(S, /obj/item/seeds/cutting) ? round(seed.get_trait(TRAIT_ENDURANCE)/rand(2,5)) : seed.get_trait(TRAIT_ENDURANCE))
lastcycle = world.time
- qdel(O)
+ qdel(attacking_item)
check_health()
else
to_chat(user, "\The [src] already has seeds in it!")
- else if (istype(O, /obj/item/material/minihoe)) // The minihoe
+ else if (istype(attacking_item, /obj/item/material/minihoe)) // The minihoe
if(weedlevel > 0)
user.visible_message("[user] starts uprooting the weeds.", "You remove the weeds from the [src].")
@@ -563,45 +563,45 @@
else
to_chat(user, "This plot is completely devoid of weeds. It doesn't need uprooting.")
- else if (istype(O, /obj/item/storage/bag/plants))
+ else if (istype(attacking_item, /obj/item/storage/bag/plants))
attack_hand(user)
- var/obj/item/storage/bag/plants/S = O
+ var/obj/item/storage/bag/plants/S = attacking_item
for (var/obj/item/reagent_containers/food/snacks/grown/G in locate(user.x,user.y,user.z))
if(!S.can_be_inserted(G))
return
S.handle_item_insertion(G, 1)
- else if ( istype(O, /obj/item/plantspray) )
+ else if ( istype(attacking_item, /obj/item/plantspray) )
- var/obj/item/plantspray/spray = O
- user.remove_from_mob(O)
+ var/obj/item/plantspray/spray = attacking_item
+ user.remove_from_mob(attacking_item)
toxins += spray.toxicity
pestlevel -= spray.pest_kill_str
weedlevel -= spray.weed_kill_str
- to_chat(user, "You spray [src] with [O].")
+ to_chat(user, "You spray [src] with [attacking_item].")
playsound(loc, 'sound/effects/spray3.ogg', 50, 1, -6)
- qdel(O)
+ qdel(attacking_item)
check_health()
- else if(mechanical && O.iswrench())
+ else if(mechanical && attacking_item.iswrench())
//If there's a connector here, the portable_atmospherics setup can handle it.
if(locate(/obj/machinery/atmospherics/portables_connector/) in loc)
return ..()
- playsound(loc, O.usesound, 50, 1)
+ playsound(loc, attacking_item.usesound, 50, 1)
anchored = !anchored
to_chat(user, "You [anchored ? "wrench" : "unwrench"] \the [src].")
- else if(O.force && seed)
+ else if(attacking_item.force && seed)
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
- user.visible_message("\The [seed.display_name] has been attacked by [user] with \the [O]!")
+ user.visible_message("\The [seed.display_name] has been attacked by [user] with \the [attacking_item]!")
if(!dead)
- var/total_damage = O.force
- if ((O.sharp) || (O.damtype == "fire")) //fire and sharp things are more effective when dealing with plants
- total_damage = 2*O.force
+ var/total_damage = attacking_item.force
+ if ((attacking_item.sharp) || (attacking_item.damtype == "fire")) //fire and sharp things are more effective when dealing with plants
+ total_damage = 2*attacking_item.force
health -= total_damage
check_health()
return
diff --git a/code/modules/hydroponics/trays/tray_soil.dm b/code/modules/hydroponics/trays/tray_soil.dm
index ba4de0ca541..f8e50f417e7 100644
--- a/code/modules/hydroponics/trays/tray_soil.dm
+++ b/code/modules/hydroponics/trays/tray_soil.dm
@@ -9,10 +9,11 @@
waterlevel = 0
nutrilevel = 0 // So they don't spawn with water or nutrient when built. Soil's hard mode, baby.
maxWeedLevel = 10 // Retains the ability for soil to grow weeds, as it should.
-/obj/machinery/portable_atmospherics/hydroponics/soil/attackby(var/obj/item/O as obj, var/mob/user as mob)
+
+/obj/machinery/portable_atmospherics/hydroponics/soil/attackby(obj/item/attacking_item, mob/user)
//A special case for if the container has only water, for manual watering with buckets
- if (istype(O,/obj/item/reagent_containers))
- var/obj/item/reagent_containers/RC = O
+ if (istype(attacking_item, /obj/item/reagent_containers))
+ var/obj/item/reagent_containers/RC = attacking_item
if (LAZYLEN(RC.reagents.reagent_volumes) == 1)
if (RC.reagents.has_reagent(/singleton/reagent/water, 1))
if (waterlevel < maxWaterLevel)
@@ -24,10 +25,10 @@
to_chat(user, "The soil is saturated with water already.")
return 1
- if(istype(O,/obj/item/tank))
+ if(istype(attacking_item, /obj/item/tank))
return
- if(istype(O,/obj/item/shovel))
- if(O.use_tool(src, user, 50, volume = 50))
+ if(istype(attacking_item, /obj/item/shovel))
+ if(attacking_item.use_tool(src, user, 50, volume = 50))
new /obj/item/stack/material/sandstone{amount = 3}(loc)
to_chat(user, "You remove the soil from the bed and dismantle the sandstone base.")
playsound(src, 'sound/effects/stonedoor_openclose.ogg', 40, 1)
diff --git a/code/modules/integrated_electronics/core/assemblies.dm b/code/modules/integrated_electronics/core/assemblies.dm
index b7d18ba6af6..3c9f811ae87 100644
--- a/code/modules/integrated_electronics/core/assemblies.dm
+++ b/code/modules/integrated_electronics/core/assemblies.dm
@@ -236,19 +236,19 @@
for(var/obj/item/integrated_circuit/input/sensor/S in contents)
S.sense(target, user)
-/obj/item/device/electronic_assembly/attackby(obj/item/I, mob/user)
- if(istype(I, /obj/item/integrated_circuit))
- if(!user.unEquip(I))
+/obj/item/device/electronic_assembly/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/integrated_circuit))
+ if(!user.unEquip(attacking_item))
return FALSE
- if(add_circuit(I, user))
- to_chat(user, "You slide \the [I] inside \the [src].")
+ if(add_circuit(attacking_item, user))
+ to_chat(user, "You slide \the [attacking_item] inside \the [src].")
playsound(get_turf(src), 'sound/items/Deconstruct.ogg', 50, 1)
interact(user)
return TRUE
- else if(I.iswrench() && can_anchor)
- playsound(src.loc, I.usesound, 50, 1)
+ else if(attacking_item.iswrench() && can_anchor)
+ playsound(src.loc, attacking_item.usesound, 50, 1)
anchored = !anchored
if(anchored)
on_anchored()
@@ -257,14 +257,14 @@
user.visible_message("[user] has wrenched [src]'s anchoring bolts [anchored ? "into" : "out of"] place.", "You wrench [src]'s anchoring bolts [anchored ? "into" : "out of"] place.", "You hear the sound of a ratcheting wrench turning.")
return TRUE
- else if(I.iscrowbar())
- playsound(get_turf(src), I.usesound, 50, 1)
+ else if(attacking_item.iscrowbar())
+ playsound(get_turf(src), attacking_item.usesound, 50, 1)
opened = !opened
to_chat(user, "You [opened ? "open" : "close"] \the [src].")
update_icon()
return TRUE
- else if(istype(I, /obj/item/device/integrated_electronics/wirer) || istype(I, /obj/item/device/integrated_electronics/debugger) || I.ismultitool() || I.isscrewdriver())
+ else if(istype(attacking_item, /obj/item/device/integrated_electronics/wirer) || istype(attacking_item, /obj/item/device/integrated_electronics/debugger) || attacking_item.ismultitool() || attacking_item.isscrewdriver())
if(opened)
interact(user)
else
@@ -272,38 +272,38 @@
Try using a crowbar.")
return TRUE
- else if(istype(I, /obj/item/cell/device))
+ else if(istype(attacking_item, /obj/item/cell/device))
if(!opened)
to_chat(user, "\The [src] isn't open, so you can't put anything inside. Try using a crowbar.")
for(var/obj/item/integrated_circuit/input/S in contents)
- S.attackby_react(I,user,user.a_intent)
+ S.attackby_react(attacking_item,user,user.a_intent)
return FALSE
if(battery)
to_chat(user, "\The [src] already has \a [battery] inside. Remove it first if you want to replace it.")
for(var/obj/item/integrated_circuit/input/S in contents)
- S.attackby_react(I,user,user.a_intent)
+ S.attackby_react(attacking_item,user,user.a_intent)
return FALSE
- var/obj/item/cell/device/cell = I
+ var/obj/item/cell/device/cell = attacking_item
user.drop_from_inventory(cell,src)
battery = cell
playsound(get_turf(src), 'sound/items/Deconstruct.ogg', 50, 1)
to_chat(user, "You slot \the [cell] inside \the [src]'s power supply.")
interact(user)
return TRUE
- else if(istype(I, /obj/item/device/integrated_electronics/detailer))
- var/obj/item/device/integrated_electronics/detailer/D = I
+ else if(istype(attacking_item, /obj/item/device/integrated_electronics/detailer))
+ var/obj/item/device/integrated_electronics/detailer/D = attacking_item
detail_color = D.detail_color
update_icon()
return TRUE
else
for(var/obj/item/integrated_circuit/insert_slot/S in contents) //Attempt to insert the item into any contained insert_slots
- if(S.insert(I, user))
+ if(S.insert(attacking_item, user))
return TRUE
for(var/obj/item/integrated_circuit/input/S in contents) // Attempt to swipe on scanners
- if(S.attackby_react(I,user,user.a_intent))
+ if(S.attackby_react(attacking_item,user,user.a_intent))
return TRUE
return ..()
diff --git a/code/modules/integrated_electronics/core/assemblies/clothing.dm b/code/modules/integrated_electronics/core/assemblies/clothing.dm
index 28ec97d8815..abd152aaac2 100644
--- a/code/modules/integrated_electronics/core/assemblies/clothing.dm
+++ b/code/modules/integrated_electronics/core/assemblies/clothing.dm
@@ -61,9 +61,12 @@
examinate(user, IC)
. = ..()
-/obj/item/clothing/attackby(obj/item/I, mob/user)
- if(IC && (istype(I, /obj/item/integrated_circuit) || I.iswrench() || I.iscrowbar() || istype(I, /obj/item/device/integrated_electronics/wirer) || istype(I, /obj/item/device/integrated_electronics/debugger) || I.ismultitool() || I.isscrewdriver() || istype(I, /obj/item/cell/device)))
- IC.attackby(I, user)
+/obj/item/clothing/attackby(obj/item/attacking_item, mob/user)
+ if(IC && (istype(attacking_item, /obj/item/integrated_circuit) || attacking_item.iswrench() || attacking_item.iscrowbar() || \
+ istype(attacking_item, /obj/item/device/integrated_electronics/wirer) || istype(attacking_item, /obj/item/device/integrated_electronics/debugger) || \
+ attacking_item.ismultitool() || attacking_item.isscrewdriver() || istype(attacking_item, /obj/item/cell/device)))
+
+ IC.attackby(attacking_item, user)
else
..()
diff --git a/code/modules/integrated_electronics/core/device.dm b/code/modules/integrated_electronics/core/device.dm
index 63b3f92fead..b96a3815d57 100644
--- a/code/modules/integrated_electronics/core/device.dm
+++ b/code/modules/integrated_electronics/core/device.dm
@@ -17,11 +17,11 @@
. = ..()
-/obj/item/device/assembly/electronic_assembly/attackby(obj/item/I, mob/user)
- if (I.iscrowbar())
+/obj/item/device/assembly/electronic_assembly/attackby(obj/item/attacking_item, mob/user)
+ if (attacking_item.iscrowbar())
toggle_open(user)
else if (opened)
- EA.attackby(I, user)
+ EA.attackby(attacking_item, user)
else
..()
diff --git a/code/modules/integrated_electronics/core/printer.dm b/code/modules/integrated_electronics/core/printer.dm
index b01f722d8c2..1cb616a126b 100644
--- a/code/modules/integrated_electronics/core/printer.dm
+++ b/code/modules/integrated_electronics/core/printer.dm
@@ -16,9 +16,9 @@
upgraded = TRUE
can_clone = TRUE
-/obj/item/device/integrated_circuit_printer/attackby(var/obj/item/O, var/mob/user)
- if(istype(O,/obj/item/stack/material))
- var/obj/item/stack/material/stack = O
+/obj/item/device/integrated_circuit_printer/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item,/obj/item/stack/material))
+ var/obj/item/stack/material/stack = attacking_item
if(stack.material.name == DEFAULT_WALL_MATERIAL)
var/num = min((max_metal - metal) / metal_per_sheet, stack.amount)
if(num < 1)
@@ -29,26 +29,26 @@
metal += num * metal_per_sheet
return TRUE
- if(istype(O,/obj/item/integrated_circuit))
+ if(istype(attacking_item,/obj/item/integrated_circuit))
to_chat(user, "You insert the circuit into \the [src]. ")
- user.unEquip(O)
- metal = min(metal + O.w_class, max_metal)
- qdel(O)
+ user.unEquip(attacking_item)
+ metal = min(metal + attacking_item.w_class, max_metal)
+ qdel(attacking_item)
return TRUE
- if(istype(O,/obj/item/disk/integrated_circuit/upgrade/advanced))
+ if(istype(attacking_item,/obj/item/disk/integrated_circuit/upgrade/advanced))
if(upgraded)
to_chat(user, "\The [src] already has this upgrade. ")
return TRUE
- to_chat(user, "You install \the [O] into \the [src]. ")
+ to_chat(user, "You install \the [attacking_item] into \the [src]. ")
upgraded = TRUE
return TRUE
- if(istype(O,/obj/item/disk/integrated_circuit/upgrade/clone))
+ if(istype(attacking_item,/obj/item/disk/integrated_circuit/upgrade/clone))
if(can_clone)
to_chat(user, "\The [src] already has this upgrade. ")
return TRUE
- to_chat(user, "You install \the [O] into \the [src]. ")
+ to_chat(user, "You install \the [attacking_item] into \the [src]. ")
can_clone = TRUE
return TRUE
diff --git a/code/modules/integrated_electronics/subtypes/manipulation.dm b/code/modules/integrated_electronics/subtypes/manipulation.dm
index 92e0dfafb55..3e7d005f904 100644
--- a/code/modules/integrated_electronics/subtypes/manipulation.dm
+++ b/code/modules/integrated_electronics/subtypes/manipulation.dm
@@ -28,9 +28,9 @@
QDEL_NULL(installed_gun)
. = ..()
-/obj/item/integrated_circuit/manipulation/weapon_firing/attackby(var/obj/O, var/mob/user)
- if(istype(O, /obj/item/gun))
- var/obj/item/gun/gun = O
+/obj/item/integrated_circuit/manipulation/weapon_firing/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/gun))
+ var/obj/item/gun/gun = attacking_item
if(installed_gun)
to_chat(user, "There's already a weapon installed.")
return
@@ -138,7 +138,8 @@
detach_grenade()
. = ..()
-/obj/item/integrated_circuit/manipulation/grenade/attackby(var/obj/item/grenade/G, var/mob/user)
+/obj/item/integrated_circuit/manipulation/grenade/attackby(obj/item/attacking_item, mob/user)
+ var/obj/item/grenade/G = attacking_item
if(istype(G))
if(attached_grenade)
to_chat(user, "There is already a grenade attached!")
diff --git a/code/modules/library/lib_items.dm b/code/modules/library/lib_items.dm
index 80f4a955476..2293d208813 100644
--- a/code/modules/library/lib_items.dm
+++ b/code/modules/library/lib_items.dm
@@ -27,23 +27,23 @@
I.forceMove(src)
update_icon()
-/obj/structure/bookcase/attackby(obj/item/O as obj, mob/user as mob)
- if(istype(O, /obj/item/book))
- user.drop_from_inventory(O,src)
+/obj/structure/bookcase/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/book))
+ user.drop_from_inventory(attacking_item,src)
update_icon()
- else if(O.ispen())
+ else if(attacking_item.ispen())
var/newname = sanitizeSafe(input("What would you like to title this bookshelf?"), MAX_NAME_LEN)
if(!newname)
return
else
name = ("bookcase ([newname])")
- else if(O.iswrench())
- playsound(src.loc, O.usesound, 100, 1)
+ else if(attacking_item.iswrench())
+ playsound(src.loc, attacking_item.usesound, 100, 1)
to_chat(user, (anchored ? "You unfasten \the [src] from the floor." : "You secure \the [src] to the floor."))
anchored = !anchored
- else if(O.isscrewdriver())
+ else if(attacking_item.isscrewdriver())
to_chat(user, "You begin dismantling \the [src].")
- if(O.use_tool(src, user, 25, volume = 50))
+ if(attacking_item.use_tool(src, user, 25, volume = 50))
to_chat(user, "You dismantle \the [src].")
for(var/obj/item/book/b in contents)
b.forceMove((get_turf(src)))
@@ -225,21 +225,21 @@
else
to_chat(user, "This book is completely blank!")
-/obj/item/book/attackby(obj/item/W as obj, mob/user as mob)
+/obj/item/book/attackby(obj/item/attacking_item, mob/user)
if(carved)
if(!store)
- if(W.w_class < 3)
- user.drop_from_inventory(W,src)
- store = W
- to_chat(user, "You put [W] in [title].")
+ if(attacking_item.w_class < 3)
+ user.drop_from_inventory(attacking_item,src)
+ store = attacking_item
+ to_chat(user, "You put [attacking_item] in [title].")
return
else
- to_chat(user, "[W] won't fit in [title].")
+ to_chat(user, "[attacking_item] won't fit in [title].")
return
else
to_chat(user, "There's already something in [title]!")
return
- if(W.ispen())
+ if(attacking_item.ispen())
if(unique)
to_chat(user, "These pages don't seem to take the ink well. Looks like you can't modify it.")
return
@@ -269,39 +269,39 @@
src.author = newauthor
else
return
- else if(istype(W, /obj/item/barcodescanner))
- var/obj/item/barcodescanner/scanner = W
+ else if(istype(attacking_item, /obj/item/barcodescanner))
+ var/obj/item/barcodescanner/scanner = attacking_item
if(!scanner.computer)
- to_chat(user, "[W]'s screen flashes: 'No associated computer found!'")
+ to_chat(user, "[attacking_item]'s screen flashes: 'No associated computer found!'")
else
switch(scanner.mode)
if(0)
scanner.book = src
- to_chat(user, "[W]'s screen flashes: 'Book stored in buffer.'")
+ to_chat(user, "[attacking_item]'s screen flashes: 'Book stored in buffer.'")
if(1)
scanner.book = src
scanner.computer.buffer_book = src.name
- to_chat(user, "[W]'s screen flashes: 'Book stored in buffer. Book title stored in associated computer buffer.'")
+ to_chat(user, "[attacking_item]'s screen flashes: 'Book stored in buffer. Book title stored in associated computer buffer.'")
if(2)
scanner.book = src
for(var/datum/borrowbook/b in scanner.computer.checkouts)
if(b.bookname == src.name)
scanner.computer.checkouts.Remove(b)
- to_chat(user, "[W]'s screen flashes: 'Book stored in buffer. Book has been checked in.'")
+ to_chat(user, "[attacking_item]'s screen flashes: 'Book stored in buffer. Book has been checked in.'")
return
- to_chat(user, "[W]'s screen flashes: 'Book stored in buffer. No active check-out record found for current title.'")
+ to_chat(user, "[attacking_item]'s screen flashes: 'Book stored in buffer. No active check-out record found for current title.'")
if(3)
scanner.book = src
for(var/obj/item/book in scanner.computer.inventory)
if(book == src)
- to_chat(user, "[W]'s screen flashes: 'Book stored in buffer. Title already present in inventory, aborting to avoid duplicate entry.'")
+ to_chat(user, "[attacking_item]'s screen flashes: 'Book stored in buffer. Title already present in inventory, aborting to avoid duplicate entry.'")
return
scanner.computer.inventory.Add(src)
- to_chat(user, "[W]'s screen flashes: 'Book stored in buffer. Title added to general inventory.'")
- else if(istype(W, /obj/item/material/knife) || W.iswirecutter())
+ to_chat(user, "[attacking_item]'s screen flashes: 'Book stored in buffer. Title added to general inventory.'")
+ else if(istype(attacking_item, /obj/item/material/knife) || attacking_item.iswirecutter())
if(carved) return
to_chat(user, "You begin to carve out [title].")
- if(W.use_tool(src, user, 30, volume = 50))
+ if(attacking_item.use_tool(src, user, 30, volume = 50))
to_chat(user, "You carve out the pages from [title]! You didn't want to read it anyway.")
playsound(loc, 'sound/bureaucracy/papercrumple.ogg', 50, 1)
new /obj/item/shreddedp(get_turf(src))
diff --git a/code/modules/library/lib_machines.dm b/code/modules/library/lib_machines.dm
index d63e830c15b..51be6807023 100644
--- a/code/modules/library/lib_machines.dm
+++ b/code/modules/library/lib_machines.dm
@@ -246,9 +246,9 @@
src.emagged = 1
return 1
-/obj/machinery/librarycomp/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/barcodescanner))
- var/obj/item/barcodescanner/scanner = W
+/obj/machinery/librarycomp/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/barcodescanner))
+ var/obj/item/barcodescanner/scanner = attacking_item
scanner.computer = src
to_chat(user, "[scanner]'s associated machine has been set to [src].")
for (var/mob/V in hearers(src))
@@ -411,22 +411,22 @@
density = TRUE
var/obj/item/book/cache // Last scanned book
-/obj/machinery/libraryscanner/attackby(obj/item/O, mob/user)
- if(istype(O, /obj/item/book))
+/obj/machinery/libraryscanner/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/book))
if(!anchored)
to_chat(user, SPAN_WARNING("\The [src] must be secured to the floor first!"))
return
- user.drop_from_inventory(O,src)
- if(O.iswrench())
- playsound(get_turf(src), O.usesound, 75, TRUE)
+ user.drop_from_inventory(attacking_item,src)
+ if(attacking_item.iswrench())
+ playsound(get_turf(src), attacking_item.usesound, 75, TRUE)
if(anchored)
- user.visible_message(SPAN_NOTICE("\The [user] unsecures \the [src] from the floor."), \
- SPAN_NOTICE("You unsecure \the [src] from the floor."), \
- SPAN_WARNING("You hear a ratcheting noise."))
+ user.visible_message(SPAN_NOTICE("\The [user] unsecures \the [src] from the floor."),
+ SPAN_NOTICE("You unsecure \the [src] from the floor."),
+ SPAN_WARNING("You hear a ratcheting noise."))
else
- user.visible_message(SPAN_NOTICE("\The [user] secures \the [src] to the floor."), \
- SPAN_NOTICE("You secure \the [src] to the floor."), \
- SPAN_WARNING("You hear a ratcheting noise."))
+ user.visible_message(SPAN_NOTICE("\The [user] secures \the [src] to the floor."),
+ SPAN_NOTICE("You secure \the [src] to the floor."),
+ SPAN_WARNING("You hear a ratcheting noise."))
anchored = !anchored
/obj/machinery/libraryscanner/attack_hand(var/mob/user)
@@ -477,8 +477,8 @@
density = TRUE
var/binding = FALSE
-/obj/machinery/bookbinder/attackby(var/obj/O, mob/user)
- if(istype(O, /obj/item/paper))
+/obj/machinery/bookbinder/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/paper))
if(!anchored)
to_chat(user, SPAN_WARNING("\The [src] must be secured to the floor first!"))
return
@@ -486,7 +486,7 @@
to_chat(user, SPAN_WARNING("You must wait for \the [src] to finish its current operation!"))
return
var/turf/T = get_turf(src)
- user.drop_from_inventory(O,src)
+ user.drop_from_inventory(attacking_item,src)
user.visible_message(SPAN_NOTICE("\The [user] loads some paper into \the [src]."), SPAN_NOTICE("You load some paper into \the [src]."))
visible_message(SPAN_NOTICE("\The [src] begins to hum as it warms up its printing drums."))
playsound(T, 'sound/bureaucracy/binder.ogg', 75, 1)
@@ -495,18 +495,18 @@
binding = FALSE
if(!anchored)
visible_message(SPAN_WARNING("\The [src] buzzes and flashes an error light."))
- O.forceMove(T)
+ attacking_item.forceMove(T)
return
visible_message(SPAN_NOTICE("\The [src] whirs as it prints and binds a new book."))
playsound(T, 'sound/bureaucracy/print.ogg', 75, 1)
var/obj/item/book/b = new(T)
- b.dat = O:info
+ b.dat = attacking_item:info
b.name = "blank book"
b.icon_state = "book[rand(1,7)]"
- qdel(O)
+ qdel(attacking_item)
return
- if(O.iswrench())
- playsound(get_turf(src), O.usesound, 75, TRUE)
+ if(attacking_item.iswrench())
+ playsound(get_turf(src), attacking_item.usesound, 75, TRUE)
if(anchored)
user.visible_message(SPAN_NOTICE("\The [user] unsecures \the [src] from the floor."), \
SPAN_NOTICE("You unsecure \the [src] from the floor."), \
diff --git a/code/modules/lock/lock_construct.dm b/code/modules/lock/lock_construct.dm
index e69f0a61ef3..0cfc8c11934 100644
--- a/code/modules/lock/lock_construct.dm
+++ b/code/modules/lock/lock_construct.dm
@@ -12,14 +12,14 @@
throwforce = 0
lock_data = generateRandomString(round(material.integrity/50))
-/obj/item/material/lock_construct/attackby(var/obj/item/I, var/mob/user)
- if(istype(I,/obj/item/key))
- var/obj/item/key/K = I
+/obj/item/material/lock_construct/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/key))
+ var/obj/item/key/K = attacking_item
if(!K.key_data)
- to_chat(user, "You fashion \the [I] to unlock \the [src]")
+ to_chat(user, "You fashion \the [attacking_item] to unlock \the [src]")
K.key_data = lock_data
else
- to_chat(user, "\The [I] already unlocks something.")
+ to_chat(user, "\The [attacking_item] already unlocks something.")
return
..()
diff --git a/code/modules/makeshift/makeshift_reagents.dm b/code/modules/makeshift/makeshift_reagents.dm
index 54a593c86ef..6e8bdd49ec8 100644
--- a/code/modules/makeshift/makeshift_reagents.dm
+++ b/code/modules/makeshift/makeshift_reagents.dm
@@ -131,17 +131,17 @@
analyzer = null
qdel(src)
-/obj/structure/chemkit/attackby(obj/item/W, mob/user)
- if(W.iscrowbar())
+/obj/structure/chemkit/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.iscrowbar())
dismantle()
return
- if(!istype(W, /obj/item/reagent_containers/food/snacks) && W.is_open_container())
- trans_item(W, user)
+ if(!istype(attacking_item, /obj/item/reagent_containers/food/snacks) && attacking_item.is_open_container())
+ trans_item(attacking_item, user)
return
- if(W.isFlameSource())
- heat_item(W, user)
+ if(attacking_item.isFlameSource())
+ heat_item(attacking_item, user)
return
- if(istype(W) && W.force >= 5 && !has_edge(W) && LAZYLEN(contents - analyzer))
+ if(istype(attacking_item) && attacking_item.force >= 5 && !has_edge(attacking_item) && LAZYLEN(contents - analyzer))
var/obj/item/smashed = pick(contents - analyzer)
if(!smashed.reagents && !sheet_reagents[smashed.type])
return // should never happen anyway, but still
@@ -150,7 +150,7 @@
return
smash(smashed, user)
return
- if(has_edge(W) && LAZYLEN(contents - analyzer))
+ if(has_edge(attacking_item) && LAZYLEN(contents - analyzer))
var/obj/item/chopped = pick(contents - analyzer)
if(!chopped.reagents)
return
@@ -158,14 +158,14 @@
return
chop(chopped, user)
return
- if(!analyzer && istype(W, /obj/item/device/analyzer))
- user.drop_from_inventory(W)
- analyzer = W
- W.forceMove(src)
+ if(!analyzer && istype(attacking_item, /obj/item/device/analyzer))
+ user.drop_from_inventory(attacking_item)
+ analyzer = attacking_item
+ attacking_item.forceMove(src)
return
- if(!is_type_in_list(W, forbidden) && (W.w_class <= 3.0) && (W.reagents || sheet_reagents[W.type]))
- user.drop_from_inventory(W)
- W.forceMove(src)
+ if(!is_type_in_list(attacking_item, forbidden) && (attacking_item.w_class <= 3.0) && (attacking_item.reagents || sheet_reagents[attacking_item.type]))
+ user.drop_from_inventory(attacking_item)
+ attacking_item.forceMove(src)
return
. = ..()
@@ -229,24 +229,24 @@
reagents.remove_reagent(_R, ARvol)
icon_state = "distillery-off"
-/obj/structure/distillery/attackby(obj/item/W, mob/user)
- if(W.iscrowbar())
+/obj/structure/distillery/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.iscrowbar())
dismantle()
return
- if(!welder && istype(W, /obj/item/weldingtool))
- user.drop_from_inventory(W)
- src.welder = W
- W.forceMove(src)
+ if(!welder && istype(attacking_item, /obj/item/weldingtool))
+ user.drop_from_inventory(attacking_item)
+ src.welder = attacking_item
+ attacking_item.forceMove(src)
icon_state = "distillery-off"
return
- if(!istype(W, /obj/item/reagent_containers/food/snacks) && W.is_open_container())
- trans_item(W, user)
+ if(!istype(attacking_item, /obj/item/reagent_containers/food/snacks) && attacking_item.is_open_container())
+ trans_item(attacking_item, user)
return
- if(W.isscrewdriver())
+ if(attacking_item.isscrewdriver())
transfer_out = !transfer_out
to_chat(user, SPAN_NOTICE("You [transfer_out ? "open" : "close"] the spigot on the keg, ready to [transfer_out ? "remove" : "add"] reagents."))
return
- if(W.isFlameSource() && istype(welder))
+ if(attacking_item.isFlameSource() && istype(welder))
to_chat(user, SPAN_NOTICE("You light \the [src] and begin the distillation process."))
addtimer(CALLBACK(src, PROC_REF(distill)), 60 SECONDS)
src.icon_state = "distillery-active"
diff --git a/code/modules/maps/planet_types/desert.dm b/code/modules/maps/planet_types/desert.dm
index dafad52b3a5..30d3991b702 100644
--- a/code/modules/maps/planet_types/desert.dm
+++ b/code/modules/maps/planet_types/desert.dm
@@ -121,8 +121,8 @@
exposed = 1
update_icon()
-/obj/structure/quicksand/attackby(obj/item/W, mob/user)
- if(!exposed && W.force)
+/obj/structure/quicksand/attackby(obj/item/attacking_item, mob/user)
+ if(!exposed && attacking_item.force)
expose()
else
..()
diff --git a/code/modules/materials/material_sheets.dm b/code/modules/materials/material_sheets.dm
index 2f5abae48e7..62764f71e94 100644
--- a/code/modules/materials/material_sheets.dm
+++ b/code/modules/materials/material_sheets.dm
@@ -90,12 +90,12 @@
if(!material.build_windows(user, src))
..()
-/obj/item/stack/material/attackby(var/obj/item/W, var/mob/user)
- if(iscoil(W))
- material.build_wired_product(user, W, src)
+/obj/item/stack/material/attackby(obj/item/attacking_item, mob/user)
+ if(iscoil(attacking_item))
+ material.build_wired_product(user, attacking_item, src)
return
- else if(istype(W, /obj/item/stack/rods))
- material.build_rod_product(user, W, src)
+ else if(istype(attacking_item, /obj/item/stack/rods))
+ material.build_rod_product(user, attacking_item, src)
return
return ..()
@@ -265,9 +265,9 @@
default_type = DEFAULT_WALL_MATERIAL
icon_has_variants = TRUE
-/obj/item/stack/material/steel/attackby(obj/item/W, mob/user)
+/obj/item/stack/material/steel/attackby(obj/item/attacking_item, mob/user)
. = ..()
- if(is_sharp(W))
+ if(is_sharp(attacking_item))
if(amount < 5)
to_chat(user, SPAN_WARNING("You need at least five sheets of steel to do this!"))
return
@@ -396,8 +396,8 @@
amount = max_amount
update_icon()
-/obj/item/stack/material/wood/log/attackby(obj/item/I, mob/user)
- if(I.can_woodcut() && isturf(loc) && !chopping)
+/obj/item/stack/material/wood/log/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.can_woodcut() && isturf(loc) && !chopping)
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
chopping = TRUE
visible_message(SPAN_NOTICE("\The [user] begins chopping \the [src] into planks."),
@@ -438,10 +438,11 @@
amount = max_amount
update_icon()
-/obj/item/stack/material/cloth/attackby(obj/item/I, mob/user)
- if(is_sharp(I))
- user.visible_message("\The [user] begins cutting up [src] with [I].", "You begin cutting up [src] with [I].")
- if(I.use_tool(src, user, 20, volume = 50)) // takes less time than bedsheets, a second per rag produced on average
+/obj/item/stack/material/cloth/attackby(obj/item/attacking_item, mob/user)
+ if(is_sharp(attacking_item))
+ user.visible_message("\The [user] begins cutting up [src] with [attacking_item].",
+ "You begin cutting up [src] with [attacking_item].")
+ if(attacking_item.use_tool(src, user, 20, volume = 50)) // takes less time than bedsheets, a second per rag produced on average
to_chat(user, "You cut [src] into pieces!")
for(var/i in 1 to rand(1,3)) // average of 2 per
new /obj/item/reagent_containers/glass/rag(get_turf(src))
diff --git a/code/modules/mining/abandonedcrates.dm b/code/modules/mining/abandonedcrates.dm
index 4b572825b2b..0cf2c047018 100644
--- a/code/modules/mining/abandonedcrates.dm
+++ b/code/modules/mining/abandonedcrates.dm
@@ -174,9 +174,9 @@
if(guesschar != code[i])
. = 0
-/obj/structure/closet/crate/secure/loot/attackby(obj/item/W, mob/user)
+/obj/structure/closet/crate/secure/loot/attackby(obj/item/attacking_item, mob/user)
if(locked)
- if(W.ismultitool()) // Greetings Urist McProfessor, how about a nice game of cows and bulls?
+ if(attacking_item.ismultitool()) // Greetings Urist McProfessor, how about a nice game of cows and bulls?
to_chat(user, SPAN_NOTICE("DECA-CODE LOCK ANALYSIS:"))
if(attempts == 1)
to_chat(user, SPAN_WARNING("* Anti-Tamper system will activate on the next failed access attempt."))
diff --git a/code/modules/mining/coins.dm b/code/modules/mining/coins.dm
index a8a56485aa7..1aa18d0c98a 100644
--- a/code/modules/mining/coins.dm
+++ b/code/modules/mining/coins.dm
@@ -72,9 +72,9 @@
icon_state = "coin_mining_heads"
cmineral = "mining"
-/obj/item/coin/attackby(obj/item/W, mob/user)
- if(W.iscoil())
- var/obj/item/stack/cable_coil/CC = W
+/obj/item/coin/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.iscoil())
+ var/obj/item/stack/cable_coil/CC = attacking_item
if(string_attached)
to_chat(user, SPAN_NOTICE("There already is a string attached to this coin."))
return
@@ -85,7 +85,7 @@
else
to_chat(user, SPAN_NOTICE("This cable coil appears to be empty."))
return
- else if(W.iswirecutter())
+ else if(attacking_item.iswirecutter())
if(!string_attached)
..()
return
diff --git a/code/modules/mining/drilling/drill.dm b/code/modules/mining/drilling/drill.dm
index 3359bb755e7..66dc4fafc80 100644
--- a/code/modules/mining/drilling/drill.dm
+++ b/code/modules/mining/drilling/drill.dm
@@ -206,21 +206,21 @@
return
return src.attack_hand(user)
-/obj/machinery/mining/drill/attackby(obj/item/O, mob/user)
- if(istype(O, /obj/item/mecha_equipment/drill_mover)) // the drill mover afterattack handles it
+/obj/machinery/mining/drill/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/mecha_equipment/drill_mover)) // the drill mover afterattack handles it
return
if(!active)
- if(default_deconstruction_screwdriver(user, O))
+ if(default_deconstruction_screwdriver(user, attacking_item))
return
- if(default_part_replacement(user, O))
+ if(default_part_replacement(user, attacking_item))
return
- if(istype(O, /obj/item/mining_scanner))
+ if(istype(attacking_item, /obj/item/mining_scanner))
if(!length(resource_field))
to_chat(user, SPAN_WARNING("\The [src] has no resource field to draw data from!"))
return
to_chat(user, SPAN_NOTICE("You start drawing the data from \the [src]..."))
- if(O.use_tool(src, user, 50, volume = 50))
+ if(attacking_item.use_tool(src, user, 50, volume = 50))
if(!length(resource_field))
to_chat(user, SPAN_WARNING("\The [src] has no resource field to draw data from!"))
return
@@ -242,8 +242,8 @@
if(active)
return ..()
- if(istype(O, /obj/item/storage/bag/ore))
- var/obj/item/storage/bag/ore/S = O
+ if(istype(attacking_item, /obj/item/storage/bag/ore))
+ var/obj/item/storage/bag/ore/S = attacking_item
if(attached_satchel)
to_chat(user, SPAN_WARNING("\The [src] already has a satchel attached to it!"))
return
@@ -260,12 +260,12 @@
attached_satchel.insert_into_storage(ore)
return
- if(O.iswrench())
+ if(attacking_item.iswrench())
if(!attached_satchel)
to_chat(user, SPAN_WARNING("\The [src] doesn't have a satchel attached to it!"))
return
user.visible_message(SPAN_NOTICE("\The [user] starts detaching \the [attached_satchel]."), SPAN_NOTICE("You start detaching \the [attached_satchel]."))
- if(O.use_tool(src, user, 30, volume = 50))
+ if(attacking_item.use_tool(src, user, 30, volume = 50))
if(!attached_satchel)
return
attached_satchel.forceMove(get_turf(user))
@@ -274,7 +274,7 @@
attached_satchel = null
return
- if(O.iscrowbar())
+ if(attacking_item.iscrowbar())
if(panel_open)
if(cell)
to_chat(user, SPAN_NOTICE("You shimmy out \the [cell]."))
@@ -290,8 +290,8 @@
to_chat(user, SPAN_WARNING("The hatch must be open to take out a power cell."))
return
- if(istype(O, /obj/item/gripper/miner)) // the gripper will always be empty, because it passes its wrapped object's attack if it has one
- var/obj/item/gripper/miner/M = O
+ if(istype(attacking_item, /obj/item/gripper/miner)) // the gripper will always be empty, because it passes its wrapped object's attack if it has one
+ var/obj/item/gripper/miner/M = attacking_item
if(panel_open)
if(cell)
to_chat(user, SPAN_NOTICE("You use your gripper to squeeze the cell out of its case."))
@@ -307,17 +307,17 @@
to_chat(user, SPAN_WARNING("The hatch must be open to take out a power cell."))
return
- if(istype(O, /obj/item/cell))
+ if(istype(attacking_item, /obj/item/cell))
if(panel_open)
if(cell)
to_chat(user, SPAN_WARNING("There is already a power cell inside."))
return
else
// insert cell
- user.drop_from_inventory(O, src)
- cell = O
- component_parts += O
- O.add_fingerprint(user)
+ user.drop_from_inventory(attacking_item, src)
+ cell = attacking_item
+ component_parts += attacking_item
+ attacking_item.add_fingerprint(user)
visible_message("\The [user] inserts a power cell into \the [src].",
SPAN_NOTICE("You insert the power cell into \the [src]."))
power_change()
@@ -488,7 +488,7 @@
/obj/item/circuitboard/miningdrillbrace
)
-/obj/machinery/mining/brace/attackby(obj/item/W, mob/user)
+/obj/machinery/mining/brace/attackby(obj/item/attacking_item, mob/user)
if(connected?.active)
to_chat(user, SPAN_WARNING("You know you ought not work with the brace of a running drill, but you do anyways."))
sleep(5)
@@ -513,12 +513,12 @@
var/mob/living/M = user
M.apply_damage(25, DAMAGE_BRUTE, damage_flags = DAMAGE_FLAG_SHARP|DAMAGE_FLAG_EDGE)
- if(default_deconstruction_screwdriver(user, W))
+ if(default_deconstruction_screwdriver(user, attacking_item))
return
- if(default_deconstruction_crowbar(user, W))
+ if(default_deconstruction_crowbar(user, attacking_item))
return
- if(W.iswrench())
+ if(attacking_item.iswrench())
if(istype(get_turf(src), /turf/space))
to_chat(user, SPAN_NOTICE("You send \the [src] careening into space. Idiot."))
var/inertia = rand(10, 30)
@@ -540,7 +540,7 @@
connected.system_error("Unexpected user interface error.")
return
- playsound(get_turf(src), W.usesound, 100, 1)
+ playsound(get_turf(src), attacking_item.usesound, 100, 1)
to_chat(user, SPAN_NOTICE("You [anchored ? "un" : ""]anchor the brace."))
anchored = !anchored
diff --git a/code/modules/mining/machine_processing.dm b/code/modules/mining/machine_processing.dm
index 01464db4974..f50cfd80aba 100644
--- a/code/modules/mining/machine_processing.dm
+++ b/code/modules/mining/machine_processing.dm
@@ -59,12 +59,12 @@
return machine
-/obj/machinery/mineral/processing_unit_console/attackby(obj/item/I, mob/user)
- if(default_deconstruction_screwdriver(user, I))
+/obj/machinery/mineral/processing_unit_console/attackby(obj/item/attacking_item, mob/user)
+ if(default_deconstruction_screwdriver(user, attacking_item))
return
- if(default_deconstruction_crowbar(user, I))
+ if(default_deconstruction_crowbar(user, attacking_item))
return
- if(default_part_replacement(user, I))
+ if(default_part_replacement(user, attacking_item))
return
return ..()
@@ -326,12 +326,12 @@
console.machine = null
return ..()
-/obj/machinery/mineral/processing_unit/attackby(obj/item/I, mob/user)
- if(default_deconstruction_screwdriver(user, I))
+/obj/machinery/mineral/processing_unit/attackby(obj/item/attacking_item, mob/user)
+ if(default_deconstruction_screwdriver(user, attacking_item))
return
- if(default_deconstruction_crowbar(user, I))
+ if(default_deconstruction_crowbar(user, attacking_item))
return
- if(default_part_replacement(user, I))
+ if(default_part_replacement(user, attacking_item))
return
return ..()
diff --git a/code/modules/mining/machine_rigpress.dm b/code/modules/mining/machine_rigpress.dm
index bcf978dc40a..3968cca6531 100644
--- a/code/modules/mining/machine_rigpress.dm
+++ b/code/modules/mining/machine_rigpress.dm
@@ -32,11 +32,11 @@
else
icon_state = "coinpress0"
-/obj/machinery/mineral/rigpress/attackby(obj/item/W, mob/user)
+/obj/machinery/mineral/rigpress/attackby(obj/item/attacking_item, mob/user)
if(!pressing)
var/outcome_path
for(var/press_type in press_types)
- if(istype(W, press_type))
+ if(istype(attacking_item, press_type))
outcome_path = press_types[press_type]
break
@@ -44,13 +44,13 @@
..()
return
- to_chat(user, SPAN_NOTICE("You start feeding [W] into \the [src]"))
+ to_chat(user, SPAN_NOTICE("You start feeding [attacking_item] into \the [src]"))
if(do_after(user, 30))
src.visible_message(SPAN_NOTICE("\The [src] begins to print out a modsuit."))
pressing = TRUE
update_icon()
use_power_oneoff(500)
- qdel(W)
+ qdel(attacking_item)
spawn(300)
ping("\The [src] pings, \"Module successfuly produced!\"")
diff --git a/code/modules/mining/machine_stacking.dm b/code/modules/mining/machine_stacking.dm
index 31f3ae53987..36042c0a8f3 100644
--- a/code/modules/mining/machine_stacking.dm
+++ b/code/modules/mining/machine_stacking.dm
@@ -50,12 +50,12 @@
return machine
-/obj/machinery/mineral/stacking_unit_console/attackby(obj/item/I, mob/user)
- if(default_deconstruction_screwdriver(user, I))
+/obj/machinery/mineral/stacking_unit_console/attackby(obj/item/attacking_item, mob/user)
+ if(default_deconstruction_screwdriver(user, attacking_item))
return
- if(default_deconstruction_crowbar(user, I))
+ if(default_deconstruction_crowbar(user, attacking_item))
return
- if(default_part_replacement(user, I))
+ if(default_part_replacement(user, attacking_item))
return
return ..()
@@ -164,12 +164,12 @@
console.machine = null
return ..()
-/obj/machinery/mineral/stacking_machine/attackby(obj/item/I, mob/user)
- if(default_deconstruction_screwdriver(user, I))
+/obj/machinery/mineral/stacking_machine/attackby(obj/item/attacking_item, mob/user)
+ if(default_deconstruction_screwdriver(user, attacking_item))
return
- if(default_deconstruction_crowbar(user, I))
+ if(default_deconstruction_crowbar(user, attacking_item))
return
- if(default_part_replacement(user, I))
+ if(default_part_replacement(user, attacking_item))
return
return ..()
diff --git a/code/modules/mining/machine_unloading.dm b/code/modules/mining/machine_unloading.dm
index bf244f007fe..e268dc82e63 100644
--- a/code/modules/mining/machine_unloading.dm
+++ b/code/modules/mining/machine_unloading.dm
@@ -38,12 +38,12 @@
if(!output)
output = get_step(src, dir)
-/obj/machinery/mineral/unloading_machine/attackby(obj/item/I, mob/user)
- if(default_deconstruction_screwdriver(user, I))
+/obj/machinery/mineral/unloading_machine/attackby(obj/item/attacking_item, mob/user)
+ if(default_deconstruction_screwdriver(user, attacking_item))
return
- if(default_deconstruction_crowbar(user, I))
+ if(default_deconstruction_crowbar(user, attacking_item))
return
- if(default_part_replacement(user, I))
+ if(default_part_replacement(user, attacking_item))
return
return ..()
diff --git a/code/modules/mining/machine_vending.dm b/code/modules/mining/machine_vending.dm
index 976dc69921a..93b7b6fc5fd 100644
--- a/code/modules/mining/machine_vending.dm
+++ b/code/modules/mining/machine_vending.dm
@@ -158,27 +158,27 @@ var/global/list/minevendor_list = list( //keep in order of price
intent_message(MACHINE_SOUND)
return TRUE
-/obj/machinery/mineral/equipment_vendor/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/coin/mining))
+/obj/machinery/mineral/equipment_vendor/attackby(obj/item/attacking_item, mob/user, params)
+ if(istype(attacking_item, /obj/item/coin/mining))
var/list/equipment_choices = list(
"Kinetic Accelerator Kit" = /obj/item/storage/toolbox/ka,
"Industrial Drilling Kit" = /obj/item/storage/toolbox/drill,
"Autonomous Mining Drone" = /mob/living/silicon/robot/drone/mining
)
var/choice = input(user, "Which special equipment would you like to dispense from \the [src]?", capitalize_first_letters(name)) as null|anything in equipment_choices
- if(!choice || QDELETED(I) || !Adjacent(user))
+ if(!choice || QDELETED(attacking_item) || !Adjacent(user))
return
var/equipment_path = equipment_choices[choice]
var/obj/dispensed_equipment = new equipment_path(get_turf(src))
if(dispensed_equipment)
to_chat(user, SPAN_NOTICE("\The [src] accepts your coin and dispenses \a [dispensed_equipment]."))
- qdel(I)
+ qdel(attacking_item)
if(dispensed_equipment && isobj(dispensed_equipment))
user.put_in_hands(dispensed_equipment)
return
- if(default_deconstruction_screwdriver(user, "mining-open", "mining", I))
+ if(default_deconstruction_screwdriver(user, "mining-open", "mining", attacking_item))
updateUsrDialog()
return
- if(default_deconstruction_crowbar(I))
+ if(default_deconstruction_crowbar(attacking_item))
return
return ..()
diff --git a/code/modules/mining/mine_items.dm b/code/modules/mining/mine_items.dm
index 747027e8168..56309e5358a 100644
--- a/code/modules/mining/mine_items.dm
+++ b/code/modules/mining/mine_items.dm
@@ -425,8 +425,8 @@
icon_state = "purpflag"
light_color = LIGHT_COLOR_PURPLE
-/obj/item/stack/flag/attackby(obj/item/W, mob/user)
- if(upright && istype(W, src.type))
+/obj/item/stack/flag/attackby(obj/item/attacking_item, mob/user)
+ if(upright && istype(attacking_item, src.type))
src.attack_hand(user)
else
..()
@@ -508,13 +508,13 @@
qdel(src)
return
-/obj/structure/track/attackby(obj/item/C, mob/user)
- if(istype(C, /obj/item/stack/tile/floor))
+/obj/structure/track/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/stack/tile/floor))
var/turf/T = get_turf(src)
- T.attackby(C, user)
+ T.attackby(attacking_item, user)
return
- if(C.iswelder())
- var/obj/item/weldingtool/WT = C
+ if(attacking_item.iswelder())
+ var/obj/item/weldingtool/WT = attacking_item
if(WT.use(0, user))
to_chat(user, SPAN_NOTICE("You slice apart the track."))
new /obj/item/stack/rods(get_turf(src))
@@ -560,11 +560,11 @@
add_overlay(I)
turn_off()
-/obj/vehicle/train/cargo/engine/mining/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/key/minecarts))
+/obj/vehicle/train/cargo/engine/mining/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/key/minecarts))
if(!key)
- user.drop_from_inventory(W, src)
- key = W
+ user.drop_from_inventory(attacking_item, src)
+ key = attacking_item
return
..()
@@ -865,10 +865,10 @@
icon_state = "data"
var/points = 500
-/obj/item/card/mining_point_card/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/card/id))
+/obj/item/card/mining_point_card/attackby(obj/item/attacking_item, mob/user, params)
+ if(istype(attacking_item, /obj/item/card/id))
if(points)
- var/obj/item/card/id/C = I
+ var/obj/item/card/id/C = attacking_item
C.mining_points += points
to_chat(user, SPAN_INFO("You transfer [points] points to \the [C]."))
points = 0
@@ -1184,13 +1184,13 @@ var/list/total_extraction_beacons = list()
var/times_carved = 0
var/busy_sculpting = FALSE
-/obj/structure/sculpting_block/attackby(obj/item/C, mob/user)
- if(C.iswrench())
+/obj/structure/sculpting_block/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.iswrench())
visible_message("[user] starts to [anchored ? "un" : ""]anchor \the [src].", SPAN_NOTICE("You start to [anchored ? "un" : ""]anchor \the [src]."))
- if(C.use_tool(src, user, 50, volume = 50))
+ if(attacking_item.use_tool(src, user, 50, volume = 50))
anchored = !anchored
- else if(istype(C, /obj/item/autochisel))
+ else if(istype(attacking_item, /obj/item/autochisel))
if(sculpted)
to_chat(user, SPAN_WARNING("\The [src] has already been sculpted!"))
return
diff --git a/code/modules/mining/mine_turfs.dm b/code/modules/mining/mine_turfs.dm
index f4bc7e2ac6e..e75d3c40e7a 100644
--- a/code/modules/mining/mine_turfs.dm
+++ b/code/modules/mining/mine_turfs.dm
@@ -230,23 +230,23 @@ var/list/mineral_can_smooth_with = list(
new /obj/effect/mineral(src, mineral)
//Not even going to touch this pile of spaghetti //motherfucker - geeves
-/turf/simulated/mineral/attackby(obj/item/W, mob/user)
+/turf/simulated/mineral/attackby(obj/item/attacking_item, mob/user)
if(!user.IsAdvancedToolUser())
to_chat(user, SPAN_WARNING("You don't have the dexterity to do this!"))
return
- if(istype(W, /obj/item/device/core_sampler))
- var/obj/item/device/core_sampler/C = W
+ if(istype(attacking_item, /obj/item/device/core_sampler))
+ var/obj/item/device/core_sampler/C = attacking_item
C.sample_item(src, user)
return
- if(istype(W, /obj/item/device/depth_scanner))
- var/obj/item/device/depth_scanner/C = W
+ if(istype(attacking_item, /obj/item/device/depth_scanner))
+ var/obj/item/device/depth_scanner/C = attacking_item
C.scan_atom(user, src)
return
- if(istype(W, /obj/item/device/measuring_tape))
- var/obj/item/device/measuring_tape/P = W
+ if(istype(attacking_item, /obj/item/device/measuring_tape))
+ var/obj/item/device/measuring_tape/P = attacking_item
user.visible_message(SPAN_NOTICE("\The [user] extends \the [P] towards \the [src].") , SPAN_NOTICE("You extend \the [P] towards \the [src]."))
if(do_after(user,25))
if(!istype(src, /turf/simulated/mineral))
@@ -254,11 +254,11 @@ var/list/mineral_can_smooth_with = list(
to_chat(user, SPAN_NOTICE("[icon2html(P, user)] \The [src] has been excavated to a depth of [2 * excavation_level]cm."))
return
- if(istype(W, /obj/item/pickaxe) && W.simulated) // Pickaxe offhand is not simulated.
+ if(istype(attacking_item, /obj/item/pickaxe) && attacking_item.simulated) // Pickaxe offhand is not simulated.
var/turf/T = user.loc
if(!(istype(T, /turf)))
return
- var/obj/item/pickaxe/P = W
+ var/obj/item/pickaxe/P = attacking_item
if(last_act + P.digspeed > world.time)//prevents message spam
return
if(P.drilling)
@@ -275,7 +275,8 @@ var/list/mineral_can_smooth_with = list(
var/datum/find/F = finds[1]
if(excavation_level + P.excavation_amount > F.excavation_required)
//Chance to destroy / extract any finds here
- fail_message = ". [pick("There is a crunching noise","[W] collides with some different rock","Part of the rock face crumbles away","Something breaks under [W]")]"
+ fail_message = ". [pick("There is a crunching noise","[attacking_item] collides with some different rock","Part of the rock face crumbles away",\
+ "Something breaks under [attacking_item]")]"
if(fail_message)
to_chat(user, SPAN_WARNING("You start [P.drill_verb][fail_message ? fail_message : ""]."))
@@ -345,14 +346,14 @@ var/list/mineral_can_smooth_with = list(
to_chat(user, SPAN_NOTICE("You stop [P.drill_verb] \the [src]."))
P.drilling = FALSE
- if(istype(W, /obj/item/autochisel))
+ if(istype(attacking_item, /obj/item/autochisel))
if(last_act + 80 > world.time)//prevents message spam
return
last_act = world.time
to_chat(user, SPAN_NOTICE("You start chiselling \the [src] into a sculptable block."))
- if(!W.use_tool(src, user, 80, volume = 50))
+ if(!attacking_item.use_tool(src, user, 80, volume = 50))
return
if(!istype(src, /turf/simulated/mineral))
@@ -701,25 +702,25 @@ var/list/asteroid_floor_smooth = list(
/turf/unsimulated/floor/asteroid/is_plating()
return FALSE
-/turf/unsimulated/floor/asteroid/attackby(obj/item/W, mob/user)
- if(!W || !user)
+/turf/unsimulated/floor/asteroid/attackby(obj/item/attacking_item, mob/user)
+ if(!attacking_item || !user)
return FALSE
- if(istype(W, /obj/item/stack/rods))
+ if(istype(attacking_item, /obj/item/stack/rods))
var/obj/structure/lattice/L = locate(/obj/structure/lattice, src)
if(L)
return
- var/obj/item/stack/rods/R = W
+ var/obj/item/stack/rods/R = attacking_item
if(R.use(1))
to_chat(user, SPAN_NOTICE("Constructing support lattice..."))
playsound(src, 'sound/weapons/Genhit.ogg', 50, 1)
ReplaceWithLattice()
return
- if(istype(W, /obj/item/stack/tile/floor))
+ if(istype(attacking_item, /obj/item/stack/tile/floor))
var/obj/structure/lattice/L = locate(/obj/structure/lattice, src)
if(L)
- var/obj/item/stack/tile/floor/S = W
+ var/obj/item/stack/tile/floor/S = attacking_item
if(S.get_amount() < 1)
return
qdel(L)
@@ -738,7 +739,7 @@ var/list/asteroid_floor_smooth = list(
/obj/item/pickaxe/borgdrill
))
- if(is_type_in_typecache(W, usable_tools))
+ if(is_type_in_typecache(attacking_item, usable_tools))
var/turf/T = get_turf(user)
if(!istype(T))
return
@@ -750,7 +751,7 @@ var/list/asteroid_floor_smooth = list(
to_chat(user, SPAN_NOTICE("You start digging deeper."))
playsound(get_turf(user), 'sound/effects/stonedoor_openclose.ogg', 50, TRUE)
digging = TRUE
- if(!W.use_tool(src, user, 60, volume = 50))
+ if(!attacking_item.use_tool(src, user, 60, volume = 50))
if(istype(src, /turf/unsimulated/floor/asteroid))
digging = FALSE
return
@@ -814,22 +815,22 @@ var/list/asteroid_floor_smooth = list(
gets_dug(user)
- else if(istype(W,/obj/item/storage/bag/ore))
- var/obj/item/storage/bag/ore/S = W
+ else if(istype(attacking_item,/obj/item/storage/bag/ore))
+ var/obj/item/storage/bag/ore/S = attacking_item
if(S.collection_mode)
for(var/obj/item/ore/O in contents)
- O.attackby(W, user)
+ O.attackby(attacking_item, user)
CHECK_TICK
return
- else if(istype(W,/obj/item/storage/bag/fossils))
- var/obj/item/storage/bag/fossils/S = W
+ else if(istype(attacking_item,/obj/item/storage/bag/fossils))
+ var/obj/item/storage/bag/fossils/S = attacking_item
if(S.collection_mode)
for(var/obj/item/fossil/F in contents)
- F.attackby(W, user)
+ F.attackby(attacking_item, user)
CHECK_TICK
return
else
- ..(W, user)
+ ..()
return
/turf/unsimulated/floor/asteroid/proc/gets_dug(mob/user)
diff --git a/code/modules/mining/minebot.dm b/code/modules/mining/minebot.dm
index 3ecaf70b025..6d8fbf9e535 100644
--- a/code/modules/mining/minebot.dm
+++ b/code/modules/mining/minebot.dm
@@ -83,22 +83,23 @@
to_chat(src, SPAN_DANGER("You have little individual will, some personality, and no drives or urges other than your laws and the art of mining."))
to_chat(src, SPAN_DANGER("Remember, you DO NOT take orders from the AI."))
-/mob/living/silicon/robot/drone/mining/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/borg/upgrade))
- to_chat(user, SPAN_WARNING("\The [src] is not compatible with \the [W]."))
+/mob/living/silicon/robot/drone/mining/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/borg/upgrade))
+ to_chat(user, SPAN_WARNING("\The [src] is not compatible with \the [attacking_item]."))
return
- if(istype(W, /obj/item/device/mine_bot_upgrade))
- var/obj/item/device/mine_bot_upgrade/MBU = W
+ if(istype(attacking_item, /obj/item/device/mine_bot_upgrade))
+ var/obj/item/device/mine_bot_upgrade/MBU = attacking_item
MBU.upgrade_bot(src, user)
return
- else if (W.GetID())
+ else if (attacking_item.GetID())
if(!allowed(user))
to_chat(user, SPAN_WARNING("Access denied."))
return
if(ckey || client)
- user.visible_message(SPAN_WARNING("\The [user] swipes [user.get_pronoun("his")] ID card through \the [src] shutting it down."), SPAN_NOTICE("You swipe your ID over \the [src], shutting it down! You can swipe it again to make it search for a new intelligence."))
+ user.visible_message(SPAN_WARNING("\The [user] swipes [user.get_pronoun("his")] ID card through \the [src] shutting it down."),
+ SPAN_NOTICE("You swipe your ID over \the [src], shutting it down! You can swipe it again to make it search for a new intelligence."))
shut_down()
return
if(seeking_player)
@@ -108,7 +109,8 @@
to_chat(user, SPAN_WARNING("The interface is fried, and a distressing burned smell wafts from the robot's interior. You're not rebooting this one."))
return
- user.visible_message(SPAN_WARNING("\The [user] swipes [user.get_pronoun("his")] ID card through \the [src], attempting to reboot it."), SPAN_WARNING("You swipe your ID card through \the [src], attempting to reboot it."))
+ user.visible_message(SPAN_WARNING("\The [user] swipes [user.get_pronoun("his")] ID card through \the [src], attempting to reboot it."),
+ SPAN_WARNING("You swipe your ID card through \the [src], attempting to reboot it."))
request_player()
return
..()
diff --git a/code/modules/mining/ore.dm b/code/modules/mining/ore.dm
index a480d0a810e..7b54d20f60f 100644
--- a/code/modules/mining/ore.dm
+++ b/code/modules/mining/ore.dm
@@ -8,16 +8,6 @@
var/datum/geosample/geologic_data
var/material
-/obj/item/ore/Crossed(AM as mob|obj)
- ..()
- if(ishuman(AM))
- var/mob/living/carbon/human/H = AM
- var/obj/item/storage/bag/ore/S = locate() in H
- if(S && (S == H.l_store || S == H.r_store || S == H.l_hand || S == H.r_hand))
- if(S.collection_mode)
- attackby(S, H)
- return
-
/obj/item/ore/uranium
name = "pitchblende"
icon_state = "ore_uranium"
@@ -95,9 +85,9 @@
icon_state = "slag"
material = null
-/obj/item/ore/attackby(obj/item/W, mob/user)
- if(istype(W,/obj/item/device/core_sampler))
- var/obj/item/device/core_sampler/C = W
+/obj/item/ore/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item,/obj/item/device/core_sampler))
+ var/obj/item/device/core_sampler/C = attacking_item
C.sample_item(src, user)
else
return ..()
diff --git a/code/modules/mining/ore_satchel.dm b/code/modules/mining/ore_satchel.dm
index 19e47b6b65f..4caaec3e4dd 100644
--- a/code/modules/mining/ore_satchel.dm
+++ b/code/modules/mining/ore_satchel.dm
@@ -8,9 +8,44 @@
max_storage_space = 100
can_hold = list(/obj/item/ore)
var/obj/structure/ore_box/linked_box
+
+ ///The mob we're listening to
+ var/mob/listeningTo
+
var/linked_beacon = FALSE // can't hold an actual beacon beclause storage code a shit
var/linked_beacon_uses = 3 // to hold the amount of uses the beacon had, storage code a shit.
+/obj/item/storage/bag/ore/Destroy()
+ if(listeningTo)
+ UnregisterSignal(listeningTo, COMSIG_MOVABLE_MOVED)
+ listeningTo = null
+
+ linked_box = null
+ . = ..()
+
+/obj/item/storage/bag/ore/equipped(mob/user, slot)
+ . = ..()
+ if(listeningTo == user)
+ return
+ if(listeningTo)
+ UnregisterSignal(listeningTo, COMSIG_MOVABLE_MOVED)
+ RegisterSignal(user, COMSIG_MOVABLE_MOVED, PROC_REF(pickup_ores))
+ listeningTo = user
+
+/obj/item/storage/bag/ore/dropped(mob/user)
+ . = ..()
+ if(listeningTo)
+ UnregisterSignal(listeningTo, COMSIG_MOVABLE_MOVED)
+ listeningTo = null
+
+/obj/item/storage/bag/ore/proc/pickup_ores(mob/living/user)
+ SIGNAL_HANDLER
+
+ var/turf/location = get_turf(user)
+
+ if(location)
+ pickup_items_from_loc_and_feedback(user, location)
+
/obj/item/storage/bag/ore/get_examine_text(mob/user, distance, is_adjacent, infix, suffix)
. = ..()
if(is_adjacent && linked_beacon)
@@ -29,9 +64,9 @@
linked_beacon = FALSE
return ..()
-/obj/item/storage/bag/ore/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/extraction_pack))
- var/obj/item/extraction_pack/E = W
+/obj/item/storage/bag/ore/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/extraction_pack))
+ var/obj/item/extraction_pack/E = attacking_item
if(linked_beacon)
to_chat(user, SPAN_WARNING("\The [src] already has a warp extraction pack!"))
return
@@ -39,7 +74,7 @@
linked_beacon_uses = E.uses_left
to_chat(user, SPAN_NOTICE("You attach \the [E] to \the [src]."))
qdel(E)
- else if(W.isscrewdriver())
+ else if(attacking_item.isscrewdriver())
if(!linked_beacon)
to_chat(user, SPAN_WARNING("\The [src] doesn't have a linked extraction pack!"))
return
diff --git a/code/modules/mining/satchel_ore_boxdm.dm b/code/modules/mining/satchel_ore_boxdm.dm
index 554ff978321..16efae6e112 100644
--- a/code/modules/mining/satchel_ore_boxdm.dm
+++ b/code/modules/mining/satchel_ore_boxdm.dm
@@ -13,12 +13,12 @@
var/obj/item/warp_core/warp_core // to set up the bluespace network
var/list/stored_ore = list()
-/obj/structure/ore_box/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/ore))
- user.drop_from_inventory(W, src)
- else if(istype(W, /obj/item/storage))
- if(istype(W, /obj/item/storage/bag/ore))
- var/obj/item/storage/bag/ore/satchel = W
+/obj/structure/ore_box/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/ore))
+ user.drop_from_inventory(attacking_item, src)
+ else if(istype(attacking_item, /obj/item/storage))
+ if(istype(attacking_item, /obj/item/storage/bag/ore))
+ var/obj/item/storage/bag/ore/satchel = attacking_item
if(satchel.linked_beacon)
if(!warp_core)
to_chat(user, SPAN_WARNING("\The [src] doesn't have a warp beacon!"))
@@ -26,22 +26,22 @@
satchel.linked_box = src
to_chat(user, SPAN_NOTICE("You link \the [satchel] to \the [src]."))
return
- var/obj/item/storage/S = W
+ var/obj/item/storage/S = attacking_item
S.hide_from(user)
for(var/obj/item/ore/O in S.contents)
S.remove_from_storage_deferred(O, src, user) //This will move the item to this item's contents
CHECK_TICK
S.post_remove_from_storage_deferred(loc, user)
to_chat(user, SPAN_NOTICE("You empty the satchel into the box."))
- else if(istype(W, /obj/item/warp_core))
+ else if(istype(attacking_item, /obj/item/warp_core))
if(warp_core)
to_chat(user, SPAN_WARNING("\The [src] already has a warp core attached!"))
return
- user.drop_from_inventory(W, src)
- warp_core = W
- to_chat(user, SPAN_NOTICE("You carefully attach \the [W] to \the [src], connecting it to the bluespace network."))
- else if(istype(W, /obj/item/gripper/miner)) // myazaki's gonna be so mad at me
- var/obj/item/gripper/miner/GM = W
+ user.drop_from_inventory(attacking_item, src)
+ warp_core = attacking_item
+ to_chat(user, SPAN_NOTICE("You carefully attach \the [attacking_item] to \the [src], connecting it to the bluespace network."))
+ else if(istype(attacking_item, /obj/item/gripper/miner)) // myazaki's gonna be so mad at me
+ var/obj/item/gripper/miner/GM = attacking_item
if(!warp_core)
to_chat(user, SPAN_WARNING("\The [src] has no warp core to detach."))
return
diff --git a/code/modules/mob/abstract/observer/observer.dm b/code/modules/mob/abstract/observer/observer.dm
index 1db71850315..66782f7c795 100644
--- a/code/modules/mob/abstract/observer/observer.dm
+++ b/code/modules/mob/abstract/observer/observer.dm
@@ -132,8 +132,8 @@
if (!get_death_time(CREW))
set_death_time(CREW, world.time)
-/mob/abstract/observer/attackby(obj/item/W, mob/user)
- if(istype(W,/obj/item/book/tome))
+/mob/abstract/observer/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/book/tome))
var/mob/abstract/observer/M = src
M.manifest(user)
diff --git a/code/modules/mob/holder.dm b/code/modules/mob/holder.dm
index 2eedee78f24..dfab076d4b1 100644
--- a/code/modules/mob/holder.dm
+++ b/code/modules/mob/holder.dm
@@ -112,9 +112,9 @@ var/list/holder_mob_icon_cache = list()
qdel(src)
-/obj/item/holder/attackby(obj/item/W as obj, mob/user as mob)
+/obj/item/holder/attackby(obj/item/attacking_item, mob/user)
for(var/mob/M in src.contents)
- M.attackby(W,user)
+ M.attackby(attacking_item, user)
/obj/item/holder/dropped(mob/user)
. = ..()
diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm
index 5881f75f56a..d911935630a 100644
--- a/code/modules/mob/inventory.dm
+++ b/code/modules/mob/inventory.dm
@@ -17,37 +17,65 @@
return 1
return 0
-//This is a SAFE proc. Use this instead of equip_to_slot()!
-//set del_on_fail to have it delete W if it fails to equip
-//set disable_warning to disable the 'you are unable to equip that' warning.
-//unset redraw_mob to prevent the mob from being redrawn at the end.
-/mob/proc/equip_to_slot_if_possible(obj/item/W as obj, slot, del_on_fail = FALSE, disable_warning = FALSE, redraw_mob = TRUE, ignore_blocked = FALSE, assisted_equip = FALSE)
- if(!istype(W))
+/**
+ * Equips an item to a slot if possible
+ *
+ * Returns `FALSE` if it's not possible, `TRUE` otherwise
+ *
+ * This is a SAFE proc to equip items with
+ *
+ * * item_to_equip - An `obj/item` to try to equip
+ * * slot - The slot to equip it to, one of the `slot_*` defines in `code\__DEFINES\items_clothing.dm`
+ * * delete_on_fail - A boolean, if the item should be deleted if the equipping fails
+ * * disable_warning - A boolean, if `TRUE` it does not send the eventual equipping failure feedback message to the mob
+ * * redraw_mob - A boolean, if `TRUE` the icon is asked to be redrawn
+ * * bypass_blocked_check - A boolean, if `TRUE` it does not check if the slot is accessible
+ * * assisted_equip - A boolean, I have no idea wtf this is supposed to do, seems unused but, you're on your own here
+ */
+/mob/proc/equip_to_slot_if_possible(obj/item/item_to_equip, slot, delete_on_fail = FALSE, disable_warning = FALSE, redraw_mob = TRUE, bypass_blocked_check = FALSE, assisted_equip = FALSE)
+ SHOULD_NOT_SLEEP(TRUE)
+
+ if(!istype(item_to_equip))
return FALSE
- if(W.item_flags & ITEM_FLAG_NO_MOVE) //Cannot move ITEM_FLAG_NO_MOVE items from one inventory slot to another. Cannot do canremove here because then BSTs spawn naked.
+ if(item_to_equip.item_flags & ITEM_FLAG_NO_MOVE) //Cannot move ITEM_FLAG_NO_MOVE items from one inventory slot to another. Cannot do canremove here because then BSTs spawn naked.
return FALSE
- if(!W.mob_can_equip(src, slot, disable_warning, ignore_blocked))
- if(del_on_fail)
- qdel(W)
+ if(!item_to_equip.mob_can_equip(src, slot, disable_warning, bypass_blocked_check))
+ if(delete_on_fail)
+ qdel(item_to_equip)
else
if(!disable_warning)
- to_chat(src, "You are unable to equip [W].") //Only print if del_on_fail is false
- return 0
+ to_chat(src, SPAN_WARNING("You are unable to equip [item_to_equip].")) //Only print if delete_on_fail is false
+ return FALSE
- equip_to_slot(W, slot, redraw_mob, assisted_equip) //This proc should not ever fail.
- return 1
+ equip_to_slot(item_to_equip, slot, redraw_mob, assisted_equip) //This proc should not ever fail.
+ return TRUE
//This is an UNSAFE proc. It merely handles the actual job of equipping. All the checks on whether you can or can't eqip need to be done before! Use mob_can_equip() for that task.
//In most cases you will want to use equip_to_slot_if_possible()
-/mob/proc/equip_to_slot(obj/item/W, slot, redraw_mob, assisted_equip)
- W.on_slotmove(src, slot)
-
-//This is just a commonly used configuration for the equip_to_slot_if_possible() proc, used to equip people when the rounds tarts and when events happen and such.
-/mob/proc/equip_to_slot_or_del(obj/item/W as obj, slot)
+/**
+ * Equips an item to a slot
+ *
+ * This is an _UNSAFE_ proc that does not perform any check, it merely handles the movement of the item,
+ * all the prerequisite checks are left to the caller of this, therefore _DO NOT_ use it if you don't know what you're doing
+ */
+/mob/proc/equip_to_slot(obj/item/item_to_equip, slot, redraw_mob, assisted_equip)
SHOULD_NOT_SLEEP(TRUE)
- . = equip_to_slot_if_possible(W, slot, TRUE, TRUE, FALSE, TRUE)
+ item_to_equip.on_slotmove(src, slot)
+
+/**
+ * Equips an item to the mob if possible, delete it otherwise
+ *
+ * Returns `TRUE` if the equipping was successful, `FALSE` otherwise
+ *
+ * * item_to_equip - An `/obj/item` to try to equip
+ * * slot - The slot to equip it to, one of the `slot_*` defines in `code\__DEFINES\items_clothing.dm`
+ */
+/mob/proc/equip_to_slot_or_del(obj/item/item_to_equip, slot)
+ SHOULD_NOT_SLEEP(TRUE)
+
+ . = equip_to_slot_if_possible(item_to_equip, slot, TRUE, TRUE, FALSE, TRUE)
// Convinience proc. Collects crap that fails to equip either onto the mob's back, or drops it.
// Used in job equipping so shit doesn't pile up at the start loc.
@@ -102,7 +130,7 @@ var/list/slot_equipment_priority = list( \
if(!istype(W)) return 0
for(var/slot in slot_equipment_priority)
- if(equip_to_slot_if_possible(W, slot, del_on_fail=0, disable_warning=1, redraw_mob=1))
+ if(equip_to_slot_if_possible(W, slot, delete_on_fail = FALSE, disable_warning = TRUE, redraw_mob = TRUE))
return 1
return 0
diff --git a/code/modules/mob/living/bot/bot.dm b/code/modules/mob/living/bot/bot.dm
index f78326173c8..23347e735b9 100644
--- a/code/modules/mob/living/bot/bot.dm
+++ b/code/modules/mob/living/bot/bot.dm
@@ -93,9 +93,9 @@
return TRUE
return FALSE
-/mob/living/bot/attackby(var/obj/item/O, var/mob/user)
- if(O.GetID())
- if((has_master_access(O) || access_scanner.allowed(user)) && !open && !emagged)
+/mob/living/bot/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.GetID())
+ if((has_master_access(attacking_item) || access_scanner.allowed(user)) && !open && !emagged)
locked = !locked
to_chat(user, SPAN_NOTICE("You [locked ? "lock" : "unlock"] the controls."))
else
@@ -106,14 +106,14 @@
else
to_chat(user, SPAN_WARNING("As you swipe your ID, it reads: \"Access denied.\""))
return
- else if(O.isscrewdriver())
+ else if(attacking_item.isscrewdriver())
if(!locked)
open = !open
to_chat(user, SPAN_NOTICE("You [open ? "open" : "close"] the maintenance panel."))
else
to_chat(user, SPAN_WARNING("You need to unlock the controls first."))
return
- else if(O.iswelder())
+ else if(attacking_item.iswelder())
if(health < maxHealth)
if(open)
health = min(maxHealth, health + 10)
@@ -123,7 +123,7 @@
else
to_chat(user, SPAN_WARNING("[src] does not need a repair."))
return
- else if(O.iscrowbar())
+ else if(attacking_item.iscrowbar())
if(!pAI)
to_chat(user, SPAN_WARNING("\The [src] does not have a pAI installed!"))
return
@@ -133,19 +133,19 @@
user.put_in_hands(pAI)
user.visible_message(SPAN_NOTICE("\The [user] pries \the [pAI.pai] out of \the [src]."), SPAN_NOTICE("You pry \the [pAI.pai] out of \the [src]."))
pAI = null
- else if(istype(O, /obj/item/device/paicard))
+ else if(istype(attacking_item, /obj/item/device/paicard))
if(!can_take_pai)
to_chat(user, SPAN_WARNING("\The [src] cannot take a pAI!"))
return
if(pAI)
to_chat(user, SPAN_WARNING("\The [src] already has a pAI installed!"))
return
- var/obj/item/device/paicard/P = O
+ var/obj/item/device/paicard/P = attacking_item
P.pai.open_up(FALSE)
P.pai.close_up()
user.drop_from_inventory(P, src)
pAI = P
- user.visible_message(SPAN_NOTICE("\The [user] places \the [pAI.pai] into \the [src]."), SPAN_NOTICE("You place \the [O] into \the [src]."))
+ user.visible_message(SPAN_NOTICE("\The [user] places \the [pAI.pai] into \the [src]."), SPAN_NOTICE("You place \the [attacking_item] into \the [src]."))
old_name = src.name
name = pAI.pai.name
else
diff --git a/code/modules/mob/living/bot/cleanbot.dm b/code/modules/mob/living/bot/cleanbot.dm
index 5f5b5eb5861..e5361bdf2e9 100644
--- a/code/modules/mob/living/bot/cleanbot.dm
+++ b/code/modules/mob/living/bot/cleanbot.dm
@@ -373,18 +373,18 @@ var/list/cleanbot_types // Going to use this to generate a list of types once th
throw_range = 5
var/created_name = "Cleanbot"
-/obj/item/bucket_sensor/attackby(var/obj/item/O, var/mob/user)
+/obj/item/bucket_sensor/attackby(obj/item/attacking_item, mob/user)
..()
- if(istype(O, /obj/item/robot_parts/l_arm) || istype(O, /obj/item/robot_parts/r_arm))
- user.drop_from_inventory(O, get_turf(src))
- qdel(O)
+ if(istype(attacking_item, /obj/item/robot_parts/l_arm) || istype(attacking_item, /obj/item/robot_parts/r_arm))
+ user.drop_from_inventory(attacking_item, get_turf(src))
+ qdel(attacking_item)
var/turf/T = get_turf(src)
var/mob/living/bot/cleanbot/A = new /mob/living/bot/cleanbot(T)
A.name = created_name
to_chat(user, SPAN_NOTICE("You add the robot arm to the bucket and sensor assembly. Beep boop!"))
qdel(src)
- else if(O.ispen())
- var/t = sanitizeSafe(input(user, "Enter new robot name", name, created_name), MAX_NAME_LEN)
+ else if(attacking_item.ispen())
+ var/t = sanitizeSafe( tgui_input_text(user, "Enter new robot name", name, created_name, MAX_NAME_LEN), MAX_NAME_LEN )
if(!t)
return
if(!in_range(src, usr) && src.loc != usr)
diff --git a/code/modules/mob/living/bot/farmbot.dm b/code/modules/mob/living/bot/farmbot.dm
index 939c25e80b0..85bb37e1a16 100644
--- a/code/modules/mob/living/bot/farmbot.dm
+++ b/code/modules/mob/living/bot/farmbot.dm
@@ -341,7 +341,8 @@
var/build_step = 0
var/created_name = "Farmbot"
-/obj/structure/reagent_dispensers/watertank/attackby(obj/item/robot_parts/S, mob/user)
+/obj/structure/reagent_dispensers/watertank/attackby(obj/item/attacking_item, mob/user)
+ var/obj/item/robot_parts/S = attacking_item
if ((!istype(S, /obj/item/robot_parts/l_arm)) && (!istype(S, /obj/item/robot_parts/r_arm)))
..()
return
@@ -352,28 +353,28 @@
loc = A //Place the water tank into the assembly, it will be needed for the finished bot
qdel(S)
-/obj/item/farmbot_arm_assembly/attackby(obj/item/W, mob/user)
+/obj/item/farmbot_arm_assembly/attackby(obj/item/attacking_item, mob/user)
..()
- if(istype(W, /obj/item/device/analyzer/plant_analyzer) && build_step == 0)
+ if(istype(attacking_item, /obj/item/device/analyzer/plant_analyzer) && build_step == 0)
build_step++
to_chat(user, SPAN_NOTICE("You add the plant analyzer to [src]."))
name = "farmbot assembly"
- qdel(W)
+ qdel(attacking_item)
return TRUE
- else if(istype(W, /obj/item/reagent_containers/glass/bucket) && build_step == 1)
+ else if(istype(attacking_item, /obj/item/reagent_containers/glass/bucket) && build_step == 1)
build_step++
to_chat(user, SPAN_NOTICE("You add a bucket to [src]."))
name = "farmbot assembly with bucket"
- qdel(W)
+ qdel(attacking_item)
return TRUE //Prevents the object's afterattack from executing and causing runtime errors
- else if(istype(W, /obj/item/material/minihoe) && build_step == 2)
+ else if(istype(attacking_item, /obj/item/material/minihoe) && build_step == 2)
build_step++
to_chat(user, SPAN_NOTICE("You add a minihoe to [src]."))
name = "farmbot assembly with bucket and minihoe"
- user.remove_from_mob(W)
- qdel(W)
+ user.remove_from_mob(attacking_item)
+ qdel(attacking_item)
return TRUE
- else if(isprox(W) && build_step == 3)
+ else if(isprox(attacking_item) && build_step == 3)
build_step++
to_chat(user, SPAN_NOTICE("You complete the Farmbot! Beep boop."))
var/mob/living/bot/farmbot/S = new /mob/living/bot/farmbot(get_turf(src))
@@ -382,12 +383,12 @@
wTank.forceMove(S)
S.tank = wTank
S.name = created_name
- user.remove_from_mob(W)
- qdel(W)
+ user.remove_from_mob(attacking_item)
+ qdel(attacking_item)
qdel(src)
return TRUE
- else if(W.ispen())
- var/t = input(user, "Enter new robot name", name, created_name) as text
+ else if(attacking_item.ispen())
+ var/t = tgui_input_text(user, "Enter new robot name", name, created_name)
t = sanitize(t, MAX_NAME_LEN)
if(!t)
return
diff --git a/code/modules/mob/living/bot/medbot.dm b/code/modules/mob/living/bot/medbot.dm
index 601aa5a1106..663079f9e77 100644
--- a/code/modules/mob/living/bot/medbot.dm
+++ b/code/modules/mob/living/bot/medbot.dm
@@ -176,8 +176,8 @@
bot_win.set_content(dat)
bot_win.open()
-/mob/living/bot/medbot/attackby(var/obj/item/O, var/mob/user)
- if(istype(O, /obj/item/reagent_containers/glass))
+/mob/living/bot/medbot/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/reagent_containers/glass))
if(locked)
to_chat(user, SPAN_NOTICE("You cannot insert a beaker because the panel is locked."))
return
@@ -185,9 +185,9 @@
to_chat(user, SPAN_NOTICE("There is already a beaker loaded."))
return
- user.drop_from_inventory(O,src)
- reagent_glass = O
- to_chat(user, SPAN_NOTICE("You insert [O]."))
+ user.drop_from_inventory(attacking_item, src)
+ reagent_glass = attacking_item
+ to_chat(user, SPAN_NOTICE("You insert [attacking_item]."))
return 1
else
..()
@@ -328,7 +328,8 @@
/* Construction */
-/obj/item/storage/firstaid/attackby(var/obj/item/robot_parts/S, mob/user as mob)
+/obj/item/storage/firstaid/attackby(obj/item/attacking_item, mob/user)
+ var/obj/item/robot_parts/S = attacking_item
if ((!istype(S, /obj/item/robot_parts/l_arm)) && (!istype(S, /obj/item/robot_parts/r_arm)))
..()
return
@@ -356,10 +357,10 @@
var/created_name = "Medibot" //To preserve the name if it's a unique medbot I guess
var/obj/item/storage/firstaid/firstaid_item // store the firstaid type if it blows up
-/obj/item/firstaid_arm_assembly/attackby(obj/item/W as obj, mob/user as mob)
+/obj/item/firstaid_arm_assembly/attackby(obj/item/attacking_item, mob/user)
..()
- if(W.ispen())
- var/t = sanitizeSafe(input(user, "Enter new robot name", name, created_name), MAX_NAME_LEN)
+ if(attacking_item.ispen())
+ var/t = sanitizeSafe( tgui_input_text(user, "Enter new robot name", name, created_name, MAX_NAME_LEN), MAX_NAME_LEN )
if(!t)
return
if(!in_range(src, user) && loc != user)
@@ -368,9 +369,9 @@
else
switch(build_step)
if(0)
- if(istype(W, /obj/item/device/healthanalyzer))
- user.drop_from_inventory(W,get_turf(src))
- qdel(W)
+ if(istype(attacking_item, /obj/item/device/healthanalyzer))
+ user.drop_from_inventory(attacking_item,get_turf(src))
+ qdel(attacking_item)
build_step++
to_chat(user, SPAN_NOTICE("You add the health sensor to [src]."))
name = "first-aid/robot arm/health analyzer assembly"
@@ -382,9 +383,9 @@
return 1
if(1)
- if(isprox(W))
- user.drop_from_inventory(W,get_turf(src))
- qdel(W)
+ if(isprox(attacking_item))
+ user.drop_from_inventory(attacking_item, get_turf(src))
+ qdel(attacking_item)
to_chat(user, SPAN_NOTICE("You complete the Medibot! Beep boop."))
var/turf/T = get_turf(src)
var/mob/living/bot/medbot/S = new /mob/living/bot/medbot(T)
diff --git a/code/modules/mob/living/carbon/alien/diona/diona_attacks.dm b/code/modules/mob/living/carbon/alien/diona/diona_attacks.dm
index 19515e399eb..5055874374a 100644
--- a/code/modules/mob/living/carbon/alien/diona/diona_attacks.dm
+++ b/code/modules/mob/living/carbon/alien/diona/diona_attacks.dm
@@ -27,20 +27,20 @@
else
return ..()
-/mob/living/carbon/alien/diona/attackby(var/obj/item/W, var/mob/user)
- if(user.a_intent == I_HELP && istype(W, /obj/item/clothing/head))
+/mob/living/carbon/alien/diona/attackby(obj/item/attacking_item, mob/user)
+ if(user.a_intent == I_HELP && istype(attacking_item, /obj/item/clothing/head))
if(hat)
to_chat(user, SPAN_WARNING("\The [src] is already wearing \the [hat]."))
return
- user.unEquip(W)
- wear_hat(W)
- user.visible_message(SPAN_NOTICE("\The [user] puts \the [W] on \the [src]."))
+ user.unEquip(attacking_item)
+ wear_hat(attacking_item)
+ user.visible_message(SPAN_NOTICE("\The [user] puts \the [attacking_item] on \the [src]."))
return
- else if(istype(W, /obj/item/reagent_containers) || istype(W, /obj/item/stack/medical) || istype(W,/obj/item/gripper/))
- ..(W, user)
+ else if(istype(attacking_item, /obj/item/reagent_containers) || istype(attacking_item, /obj/item/stack/medical) || istype(attacking_item,/obj/item/gripper/))
+ ..()
return
else if(meat_type && (stat == DEAD)) //if the animal has a meat, and if it is dead.
- if(istype(W, /obj/item/material/knife) || istype(W, /obj/item/material/kitchen/utensil/knife))
+ if(istype(attacking_item, /obj/item/material/knife) || istype(attacking_item, /obj/item/material/kitchen/utensil/knife))
harvest(user)
return
- ..(W, user)
+ ..(attacking_item, user)
diff --git a/code/modules/mob/living/carbon/brain/MMI.dm b/code/modules/mob/living/carbon/brain/MMI.dm
index 0717e3fdf3c..a1184c60ec7 100644
--- a/code/modules/mob/living/carbon/brain/MMI.dm
+++ b/code/modules/mob/living/carbon/brain/MMI.dm
@@ -79,11 +79,11 @@
if(extra_examine_info)
. += SPAN_NOTICE(extra_examine_info)
-/obj/item/device/mmi/attackby(obj/item/I, mob/user)
+/obj/item/device/mmi/attackby(obj/item/attacking_item, mob/user)
switch(cradle_state)
if(STATE_EMPTY)
- if(!brainmob && istype(I, /obj/item/organ/internal/brain)) //Time to stick a brain in it --NEO
- var/obj/item/organ/internal/brain/B = I
+ if(!brainmob && istype(attacking_item, /obj/item/organ/internal/brain)) //Time to stick a brain in it --NEO
+ var/obj/item/organ/internal/brain/B = attacking_item
if(!B.can_prepare)
to_chat(user, SPAN_WARNING("\The [B] is incompatible with [src]!"))
return
@@ -111,28 +111,31 @@
set_cradle_state(STATE_BRAIN)
update_name()
if(STATE_NODIODES)
- if(I.isscrewdriver())
- user.visible_message("[user] tightens the screws on \the [src] with \the [I], [brainobj.prepared ? "the diodes silently sinking into the pre-made holes" : "the diodes plunging into the brain with a wet squelch"].", SPAN_NOTICE("You tighten the screws on \the [src] with \the [I], [brainobj.prepared ? "the diodes silently sinking into the pre-made holes" : "the diodes plunging into the brain with a wet squelch"]."))
+ if(attacking_item.isscrewdriver())
+ user.visible_message("[user] tightens the screws on \the [src] with \the [attacking_item], [brainobj.prepared ? "the diodes silently sinking into the pre-made holes" : "the diodes plunging into the brain with a wet squelch"].",
+ SPAN_NOTICE("You tighten the screws on \the [src] with \the [attacking_item], [brainobj.prepared ? "the diodes silently sinking into the pre-made holes" : "the diodes plunging into the brain with a wet squelch"]."))
brainobj.prepared = TRUE
set_cradle_state(STATE_DIODES)
if(STATE_DIODES)
- if(I.isscrewdriver())
- user.visible_message("[user] undoes the screws on \the [src] with \the [I], the diodes silently rising out of the brain within.", SPAN_NOTICE("You undo the screws on \the [src] with \the [I], the diodes silently rising out of the brain within."))
+ if(attacking_item.isscrewdriver())
+ user.visible_message("[user] undoes the screws on \the [src] with \the [attacking_item], the diodes silently rising out of the brain within.",
+ SPAN_NOTICE("You undo the screws on \the [src] with \the [attacking_item], the diodes silently rising out of the brain within."))
set_cradle_state(STATE_NODIODES)
- else if(I.iswelder())
- var/obj/item/weldingtool/WT = I
+ else if(attacking_item.iswelder())
+ var/obj/item/weldingtool/WT = attacking_item
if(WT.use(0, user))
- user.visible_message("[user] welds the two parts of the braincase together, permanently sealing \the [brainobj] inside.", SPAN_NOTICE("You weld the two parts of the braincase together, permanently sealing \the [brainobj] inside."))
+ user.visible_message("[user] welds the two parts of the braincase together, permanently sealing \the [brainobj] inside.",
+ SPAN_NOTICE("You weld the two parts of the braincase together, permanently sealing \the [brainobj] inside."))
to_chat(brainmob, SPAN_NOTICE("As the braincase comes online, you feel your sense of self ebbing away, your memories suppressed by the onboard software."))
set_cradle_state(STATE_SEALED)
feedback_inc("cyborg_mmis_filled", 1)
if(STATE_SEALED)
- if(I.iswelder())
+ if(attacking_item.iswelder())
to_chat(user, SPAN_WARNING("\The [src] is sealed tight, no welding will be able to undo it."))
return
- else if(istype(I, /obj/item/surgery/circular_saw))
+ else if(istype(attacking_item, /obj/item/surgery/circular_saw))
user.visible_message("[user] starts sawing \the [src] open...", SPAN_NOTICE("You start sawing \the [src] open, [SPAN_WARNING("this WILL destroy the brain inside")]."))
- if(I.use_tool(src, user, 30, volume = 50))
+ if(attacking_item.use_tool(src, user, 30, volume = 50))
user.visible_message("[user] saws \the [src] open, leaving \the [brainobj] a gory mess.", SPAN_NOTICE("You saw \the [src] open, leaving \the [brainobj] a gory mess."))
var/obj/item/organ/internal/brain/brain_holder = brainobj
transfer_mob_to_brain()
diff --git a/code/modules/mob/living/carbon/brain/posibrain.dm b/code/modules/mob/living/carbon/brain/posibrain.dm
index a05b6ca9bb0..56181dfb83c 100644
--- a/code/modules/mob/living/carbon/brain/posibrain.dm
+++ b/code/modules/mob/living/carbon/brain/posibrain.dm
@@ -23,7 +23,7 @@
else
icon_state = initial(icon_state)
-/obj/item/device/mmi/digital/posibrain/attackby(obj/item/I, mob/user)
+/obj/item/device/mmi/digital/posibrain/attackby(obj/item/attacking_item, mob/user)
return
/obj/item/device/mmi/digital/posibrain/attack_self(mob/user)
diff --git a/code/modules/mob/living/carbon/brain/robot.dm b/code/modules/mob/living/carbon/brain/robot.dm
index 2772155f90b..1e5d3ddb609 100644
--- a/code/modules/mob/living/carbon/brain/robot.dm
+++ b/code/modules/mob/living/carbon/brain/robot.dm
@@ -33,7 +33,7 @@
/obj/item/device/mmi/digital/robot/set_cradle_state(var/new_state)
return
-/obj/item/device/mmi/digital/robot/attackby(obj/item/I, mob/user)
+/obj/item/device/mmi/digital/robot/attackby(obj/item/attacking_item, mob/user)
return
/obj/item/device/mmi/digital/robot/attack_self(mob/user)
diff --git a/code/modules/mob/living/carbon/slime/items.dm b/code/modules/mob/living/carbon/slime/items.dm
index a49c39cb98c..2e8e3751f41 100644
--- a/code/modules/mob/living/carbon/slime/items.dm
+++ b/code/modules/mob/living/carbon/slime/items.dm
@@ -13,8 +13,8 @@
var/enhanced = FALSE //has it been enhanced before?
atom_flags = ATOM_FLAG_OPEN_CONTAINER
-/obj/item/slime_extract/attackby(var/obj/item/O, var/mob/user)
- if(istype(O, /obj/item/extract_enhancer))
+/obj/item/slime_extract/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/extract_enhancer))
if(enhanced)
to_chat(user, SPAN_WARNING("This extract has already been enhanced!"))
return ..()
@@ -24,7 +24,7 @@
to_chat(user, SPAN_NOTICE("You apply the enhancer. It now has triple the amount of uses."))
uses *= 3
enhanced = TRUE
- qdel(O)
+ qdel(attacking_item)
return TRUE
. = ..()
diff --git a/code/modules/mob/living/carbon/slime/slime.dm b/code/modules/mob/living/carbon/slime/slime.dm
index ca67656ad13..32dcae10246 100644
--- a/code/modules/mob/living/carbon/slime/slime.dm
+++ b/code/modules/mob/living/carbon/slime/slime.dm
@@ -381,14 +381,14 @@
visible_message(SPAN_DANGER("[M] has attempted to punch [src]!"))
return
-/mob/living/carbon/slime/attackby(obj/item/W, mob/user)
- if(W.force > 0)
+/mob/living/carbon/slime/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.force > 0)
attacked += 10
if(discipline && prob(50)) // wow, buddy, why am I getting attacked??
discipline = FALSE
- if(W.force >= 3)
+ if(attacking_item.force >= 3)
if(is_adult)
- if(prob(5 + round(W.force/2)))
+ if(prob(5 + round(attacking_item.force/2)))
if(victim || target)
if(prob(80) && !client)
discipline++
@@ -405,14 +405,14 @@
if(user)
canmove = FALSE
step_away(src, user)
- if(prob(25 + W.force))
+ if(prob(25 + attacking_item.force))
sleep(2)
if(user)
step_away(src, user)
canmove = TRUE
else
- if(prob(10 + W.force*2))
+ if(prob(10 + attacking_item.force*2))
if(victim || target)
if(prob(80) && !client)
discipline++
@@ -430,7 +430,7 @@
if(user)
canmove = FALSE
step_away(src, user)
- if(prob(25 + W.force*4))
+ if(prob(25 + attacking_item.force*4))
sleep(2)
if(user)
step_away(src, user)
diff --git a/code/modules/mob/living/carbon/slime/slime_extractor.dm b/code/modules/mob/living/carbon/slime/slime_extractor.dm
index 0e90027933b..1dfcf18b5f3 100644
--- a/code/modules/mob/living/carbon/slime/slime_extractor.dm
+++ b/code/modules/mob/living/carbon/slime/slime_extractor.dm
@@ -50,16 +50,16 @@
else if(ismicrolaser(P))
extraction_speed = extraction_speed / P.rating
-/obj/machinery/slime_extractor/attackby(obj/item/O, mob/user)
+/obj/machinery/slime_extractor/attackby(obj/item/attacking_item, mob/user)
if(length(extract_slimes))
to_chat(user, SPAN_WARNING("You can't modify \the [src] while it's busy. Please wait for the completion of previous operation."))
return
- if(default_deconstruction_screwdriver(user, O))
+ if(default_deconstruction_screwdriver(user, attacking_item))
return
- if(default_deconstruction_crowbar(user, O))
+ if(default_deconstruction_crowbar(user, attacking_item))
return
- if(default_part_replacement(user, O))
+ if(default_part_replacement(user, attacking_item))
return
/obj/machinery/slime_extractor/MouseDrop_T(atom/dropping, mob/user)
diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm
index fc459a8022f..a4942b4e1b8 100644
--- a/code/modules/mob/living/silicon/ai/ai.dm
+++ b/code/modules/mob/living/silicon/ai/ai.dm
@@ -726,16 +726,16 @@ var/list/ai_verbs_default = list(
camera_light_on = world.timeofday + 1 * 20 // Update the light every 2 seconds.
-/mob/living/silicon/ai/attackby(obj/item/W as obj, mob/user as mob)
- if(istype(W, /obj/item/aicard))
+/mob/living/silicon/ai/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/aicard))
- var/obj/item/aicard/card = W
+ var/obj/item/aicard/card = attacking_item
card.grab_ai(src, user)
- else if(W.iswrench())
+ else if(attacking_item.iswrench())
if(anchored)
user.visible_message("\The [user] starts to unbolt \the [src] from the plating...")
- if(!W.use_tool(src, user, 40, volume = 50))
+ if(!attacking_item.use_tool(src, user, 40, volume = 50))
user.visible_message("\The [user] decides not to unbolt \the [src].")
return
user.visible_message("\The [user] finishes unfastening \the [src]!")
@@ -744,7 +744,7 @@ var/list/ai_verbs_default = list(
return
else
user.visible_message("\The [user] starts to bolt \the [src] to the plating...")
- if(!W.use_tool(src, user, 40, volume = 50))
+ if(!attacking_item.use_tool(src, user, 40, volume = 50))
user.visible_message("\The [user] decides not to bolt \the [src].")
return
user.visible_message("\The [user] finishes fastening down \the [src]!")
diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm
index fe69e14c8e0..5b0e7230c0f 100644
--- a/code/modules/mob/living/silicon/pai/pai.dm
+++ b/code/modules/mob/living/silicon/pai/pai.dm
@@ -421,9 +421,9 @@
canmove = !resting
//Overriding this will stop a number of headaches down the track.
-/mob/living/silicon/pai/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/stack/nanopaste))
- var/obj/item/stack/nanopaste/N = W
+/mob/living/silicon/pai/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/stack/nanopaste))
+ var/obj/item/stack/nanopaste/N = attacking_item
if(getBruteLoss() || getFireLoss())
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
if(do_mob(user, src, 1 SECOND))
@@ -436,12 +436,12 @@
to_chat(user, SPAN_NOTICE("All [src]'s systems are nominal."))
return
- if(W.force)
- visible_message(SPAN_DANGER("[user.name] attacks [src] with [W]!"))
- src.adjustBruteLoss(W.force)
+ if(attacking_item.force)
+ visible_message(SPAN_DANGER("[user.name] attacks [src] with [attacking_item]!"))
+ src.adjustBruteLoss(attacking_item.force)
src.updatehealth()
else
- visible_message(SPAN_WARNING("[user.name] bonks [src] harmlessly with [W]."))
+ visible_message(SPAN_WARNING("[user.name] bonks [src] harmlessly with [attacking_item]."))
/mob/living/silicon/pai/AltClick(mob/user as mob)
if(!user || user.stat || user.lying || user.restrained() || !Adjacent(user)) return
diff --git a/code/modules/mob/living/silicon/robot/drone/drone.dm b/code/modules/mob/living/silicon/robot/drone/drone.dm
index 162ddad79f5..09c00cc9fb1 100644
--- a/code/modules/mob/living/silicon/robot/drone/drone.dm
+++ b/code/modules/mob/living/silicon/robot/drone/drone.dm
@@ -342,22 +342,22 @@
add_overlay(hat_overlay)
//Drones cannot be upgraded with borg modules so we need to catch some items before they get used in ..().
-/mob/living/silicon/robot/drone/attackby(var/obj/item/W, var/mob/user)
- if(user.a_intent == "help" && istype(W, /obj/item/clothing/head))
+/mob/living/silicon/robot/drone/attackby(obj/item/attacking_item, mob/user)
+ if(user.a_intent == "help" && istype(attacking_item, /obj/item/clothing/head))
if(hat)
to_chat(user, SPAN_WARNING("\The [src] is already wearing \the [hat]."))
return
- user.unEquip(W)
- wear_hat(W)
- user.visible_message(SPAN_NOTICE("\The [user] puts \the [W] on \the [src]."))
+ user.unEquip(attacking_item)
+ wear_hat(attacking_item)
+ user.visible_message(SPAN_NOTICE("\The [user] puts \the [attacking_item] on \the [src]."))
return
- else if(istype(W, /obj/item/borg/upgrade/))
- to_chat(user, SPAN_WARNING("\The [src] is not compatible with \the [W]."))
+ else if(istype(attacking_item, /obj/item/borg/upgrade/))
+ to_chat(user, SPAN_WARNING("\The [src] is not compatible with \the [attacking_item]."))
return
- else if(W.iscrowbar())
+ else if(attacking_item.iscrowbar())
to_chat(user, SPAN_WARNING("\The [src] is hermetically sealed. You can't open the case."))
return
- else if(W.GetID() || istype(W, /obj/item/card/robot))
+ else if(attacking_item.GetID() || istype(attacking_item, /obj/item/card/robot))
if(!can_swipe)
to_chat(user, SPAN_WARNING("\The [src] doesn't have an ID swipe interface."))
return
@@ -371,14 +371,16 @@
if(rebooting)
to_chat(user, SPAN_WARNING("\The [src] is already rebooting!"))
return
- user.visible_message(SPAN_NOTICE("\The [user] swipes [user.get_pronoun("his")] ID card through \the [src], attempting to reboot it."), SPAN_NOTICE("You swipe your ID card through \the [src], attempting to reboot it."))
+ user.visible_message(SPAN_NOTICE("\The [user] swipes [user.get_pronoun("his")] ID card through \the [src], attempting to reboot it."),
+ SPAN_NOTICE("You swipe your ID card through \the [src], attempting to reboot it."))
request_player()
return
else
if(emagged)
return
if(allowed(user))
- user.visible_message(SPAN_WARNING("\The [user] swipes [user.get_pronoun("his")] ID card through \the [src] shutting it down."), SPAN_NOTICE("You swipe your ID over \the [src], shutting it down! You can swipe it again to make it search for a new intelligence."))
+ user.visible_message(SPAN_WARNING("\The [user] swipes [user.get_pronoun("his")] ID card through \the [src] shutting it down."),
+ SPAN_NOTICE("You swipe your ID over \the [src], shutting it down! You can swipe it again to make it search for a new intelligence."))
shut_down()
else
to_chat(user, SPAN_WARNING("Access denied."))
diff --git a/code/modules/mob/living/silicon/robot/items/gripper.dm b/code/modules/mob/living/silicon/robot/items/gripper.dm
index 8011f5ab1d3..57329e1d0dc 100644
--- a/code/modules/mob/living/silicon/robot/items/gripper.dm
+++ b/code/modules/mob/living/silicon/robot/items/gripper.dm
@@ -152,15 +152,15 @@
//Slow,powerful attack for borgs. No spamclicking
return FALSE
-/obj/item/gripper/attackby(obj/item/O, mob/user)
+/obj/item/gripper/attackby(obj/item/attacking_item, mob/user)
var/resolved = FALSE
if(wrapped)
- if(O == wrapped)
+ if(attacking_item == wrapped)
attack_self(user) //Allows gripper to be clicked to use item.
return TRUE
- resolved = wrapped.attackby(O,user)
+ resolved = wrapped.attackby(attacking_item,user)
if(!resolved)
- O.afterattack(wrapped, user, TRUE)//We pass along things targeting the gripper, to objects inside the gripper. So that we can draw chemicals from held beakers for instance
+ attacking_item.afterattack(wrapped, user, TRUE)//We pass along things targeting the gripper, to objects inside the gripper. So that we can draw chemicals from held beakers for instance
return resolved
/obj/item/gripper/afterattack(var/atom/target, var/mob/living/user, proximity, params)
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 42fd3c4228e..5ed3252cb4f 100644
--- a/code/modules/mob/living/silicon/robot/items/inductive_charger.dm
+++ b/code/modules/mob/living/silicon/robot/items/inductive_charger.dm
@@ -111,16 +111,16 @@
/obj/item/inductive_charger/handheld/get_cell()
return cell
-/obj/item/inductive_charger/handheld/attackby(obj/item/I, mob/user)
- if(istype(I, /obj/item/cell))
+/obj/item/inductive_charger/handheld/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/cell))
if(cell)
to_chat(user, SPAN_WARNING("\The [src] already has a cell inserted."))
return TRUE
- user.drop_from_inventory(I, src)
- to_chat(user, SPAN_NOTICE("You put \the [I] into \the [src]."))
- cell = I
+ user.drop_from_inventory(attacking_item, src)
+ to_chat(user, SPAN_NOTICE("You put \the [attacking_item] into \the [src]."))
+ cell = attacking_item
return TRUE
- if(I.isscrewdriver())
+ if(attacking_item.isscrewdriver())
if(!cell)
to_chat(user, SPAN_WARNING("\The [src] doesn't have a cell inserted."))
return TRUE
diff --git a/code/modules/mob/living/silicon/robot/items/robot_parts.dm b/code/modules/mob/living/silicon/robot/items/robot_parts.dm
index 2da2c5f456e..bb82d292e1f 100644
--- a/code/modules/mob/living/silicon/robot/items/robot_parts.dm
+++ b/code/modules/mob/living/silicon/robot/items/robot_parts.dm
@@ -143,51 +143,51 @@
return TRUE
return FALSE
-/obj/item/robot_parts/robot_suit/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/robot_parts/l_leg))
+/obj/item/robot_parts/robot_suit/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/robot_parts/l_leg))
if(l_leg)
to_chat(user, SPAN_WARNING("\The [src] already has \a [l_leg] installed."))
return
- user.drop_from_inventory(W, src)
- l_leg = W
+ user.drop_from_inventory(attacking_item, src)
+ l_leg = attacking_item
update_icon()
return
- if(istype(W, /obj/item/robot_parts/r_leg))
+ if(istype(attacking_item, /obj/item/robot_parts/r_leg))
if(r_leg)
to_chat(user, SPAN_WARNING("\The [src] already has \a [r_leg] installed."))
return
- user.drop_from_inventory(W, src)
- r_leg = W
+ user.drop_from_inventory(attacking_item, src)
+ r_leg = attacking_item
update_icon()
return
- if(istype(W, /obj/item/robot_parts/l_arm))
+ if(istype(attacking_item, /obj/item/robot_parts/l_arm))
if(l_arm)
to_chat(user, SPAN_WARNING("\The [src] already has \a [l_arm] installed."))
return
- user.drop_from_inventory(W, src)
- l_arm = W
+ user.drop_from_inventory(attacking_item, src)
+ l_arm = attacking_item
update_icon()
return
- if(istype(W, /obj/item/robot_parts/r_arm))
+ if(istype(attacking_item, /obj/item/robot_parts/r_arm))
if(r_arm)
to_chat(user, SPAN_WARNING("\The [src] already has \a [r_arm] installed."))
return
- user.drop_from_inventory(W, src)
- r_arm = W
+ user.drop_from_inventory(attacking_item, src)
+ r_arm = attacking_item
update_icon()
return
- if(istype(W, /obj/item/robot_parts/chest))
+ if(istype(attacking_item, /obj/item/robot_parts/chest))
if(chest)
to_chat(user, SPAN_WARNING("\The [src] already has \a [chest] installed."))
return
- var/obj/item/robot_parts/chest/C = W
+ var/obj/item/robot_parts/chest/C = attacking_item
if(C.wires && C.cell)
- user.drop_from_inventory(W, src)
- chest = W
+ user.drop_from_inventory(attacking_item, src)
+ chest = attacking_item
update_icon()
else if(!C.wires)
to_chat(user, SPAN_WARNING("You need to attach wires to it first!"))
@@ -195,21 +195,21 @@
to_chat(user, SPAN_WARNING("You need to attach a cell to it first!"))
return
- if(istype(W, /obj/item/robot_parts/head))
+ if(istype(attacking_item, /obj/item/robot_parts/head))
if(head)
to_chat(user, SPAN_WARNING("\The [src] already has \a [head] installed."))
return
- var/obj/item/robot_parts/head/H = W
+ var/obj/item/robot_parts/head/H = attacking_item
if(H.right_flash && H.left_flash)
- user.drop_from_inventory(W, src)
- head = W
+ user.drop_from_inventory(attacking_item, src)
+ head = attacking_item
update_icon()
else
to_chat(user, SPAN_WARNING("You need to attach a flash to it first!"))
return
- if(istype(W, /obj/item/device/mmi/shell))
- var/obj/item/device/mmi/shell/M = W
+ if(istype(attacking_item, /obj/item/device/mmi/shell))
+ var/obj/item/device/mmi/shell/M = attacking_item
if(check_completion())
var/mob/living/silicon/robot/O = new /mob/living/silicon/robot/shell(get_turf(src), TRUE)
if(!O)
@@ -223,7 +223,7 @@
O.job = "AI Shell"
O.cell = chest.cell
O.cell.forceMove(O)
- W.forceMove(O)
+ attacking_item.forceMove(O)
if(O.cell)
var/datum/robot_component/cell_component = O.components["power cell"]
@@ -232,21 +232,21 @@
qdel(src)
else
- to_chat(user, SPAN_WARNING("\The [W] can only be inserted after everything else is installed."))
+ to_chat(user, SPAN_WARNING("\The [attacking_item] can only be inserted after everything else is installed."))
return
- if(istype(W, /obj/item/device/mmi))
- var/obj/item/device/mmi/M = W
+ if(istype(attacking_item, /obj/item/device/mmi))
+ var/obj/item/device/mmi/M = attacking_item
if(check_completion())
if(!isturf(loc))
- to_chat(user, SPAN_WARNING("You can't put \the [W] in, the frame has to be standing on the ground to be perfectly precise."))
+ to_chat(user, SPAN_WARNING("You can't put \the [attacking_item] in, the frame has to be standing on the ground to be perfectly precise."))
return
if(!M.ready_for_use(user))
return
if(!head.law_manager)
if(!is_alien_whitelisted(M.brainmob, SPECIES_IPC) && GLOB.config.usealienwhitelist)
- to_chat(user, SPAN_WARNING("\The [W] does not seem to fit. (The player lacks the appropriate whitelist.)"))
+ to_chat(user, SPAN_WARNING("\The [attacking_item] does not seem to fit. (The player lacks the appropriate whitelist.)"))
return
if(!M.can_be_ipc)
@@ -262,7 +262,7 @@
M.brainmob.mind.transfer_to(new_shell)
qdel(M)
new_shell.add_language(LANGUAGE_EAL)
- var/newname = sanitizeSafe(input(new_shell, "Enter a name, or leave blank for the default name.", "Name change","") as text, MAX_NAME_LEN)
+ var/newname = sanitizeSafe( tgui_input_text(new_shell, "Enter a name, or leave blank for the default name.", "Name change", "", MAX_NAME_LEN), MAX_NAME_LEN )
if(!newname)
var/datum/language/L = GLOB.all_languages[new_shell.species.default_language]
newname = L.get_random_name()
@@ -276,7 +276,7 @@
else
if(jobban_isbanned(M.brainmob, "Cyborg"))
- to_chat(user, SPAN_WARNING("\The [W] does not seem to fit. (The player has been banned from playing this role)"))
+ to_chat(user, SPAN_WARNING("\The [attacking_item] does not seem to fit. (The player has been banned from playing this role)"))
return
var/mob/living/silicon/robot/O = new /mob/living/silicon/robot(get_turf(src), TRUE)
@@ -284,7 +284,7 @@
return
user.drop_from_inventory(M, O)
- O.mmi = W
+ O.mmi = attacking_item
O.set_invisibility(0)
O.custom_name = created_name
O.updatename("Default")
@@ -294,7 +294,7 @@
O.job = "Cyborg"
O.cell = chest.cell
O.cell.forceMove(O)
- W.forceMove(O) //Should fix cybros run time erroring when blown up. It got deleted before, along with the frame.
+ attacking_item.forceMove(O) //Should fix cybros run time erroring when blown up. It got deleted before, along with the frame.
// Since we "magically" installed a cell, we also have to update the correct component.
if(O.cell)
@@ -307,11 +307,11 @@
O.Namepick()
qdel(src)
else
- to_chat(user, SPAN_WARNING("\The [W] can only be inserted after everything else is installed."))
+ to_chat(user, SPAN_WARNING("\The [attacking_item] can only be inserted after everything else is installed."))
return
- if(W.ispen())
- var/t = sanitizeSafe(input(user, "Enter new robot name", name, created_name), MAX_NAME_LEN)
+ if(attacking_item.ispen())
+ var/t = sanitizeSafe( tgui_input_text(user, "Enter new robot name", name, created_name, MAX_NAME_LEN), MAX_NAME_LEN )
if(!t)
return
if(!in_range(src, usr) && loc != usr)
@@ -328,22 +328,22 @@
if(!wires)
. += FONT_SMALL(SPAN_WARNING("It is lacking wiring."))
-/obj/item/robot_parts/chest/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/cell))
+/obj/item/robot_parts/chest/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/cell))
if(cell)
to_chat(user, SPAN_WARNING("\The [src] already has \a [cell] inserted."))
return
else
- user.drop_from_inventory(W, src)
- cell = W
+ user.drop_from_inventory(attacking_item, src)
+ cell = attacking_item
to_chat(user, SPAN_NOTICE("You insert \the [src]."))
return
- if(W.iscoil())
+ if(attacking_item.iscoil())
if(wires)
to_chat(user, SPAN_WARNING("\The [src] is already wired up correctly."))
return
else
- var/obj/item/stack/cable_coil/coil = W
+ var/obj/item/stack/cable_coil/coil = attacking_item
coil.use(1)
wires = TRUE
to_chat(user, SPAN_NOTICE("You wire up \the [src]."))
@@ -359,9 +359,9 @@
if(!right_flash)
. += FONT_SMALL(SPAN_WARNING("It is lacking its right flash."))
-/obj/item/robot_parts/head/attackby(obj/item/W, mob/user)
+/obj/item/robot_parts/head/attackby(obj/item/attacking_item, mob/user)
..()
- if(W.ismultitool())
+ if(attacking_item.ismultitool())
if(law_manager)
to_chat(user, SPAN_NOTICE("You disable the lawing circuits on \the [src]."))
law_manager = FALSE
@@ -369,21 +369,21 @@
to_chat(user, SPAN_NOTICE("You enable the lawing circuits on \the [src]."))
law_manager = TRUE
- if(istype(W, /obj/item/device/flash))
+ if(istype(attacking_item, /obj/item/device/flash))
if(isrobot(user))
var/mob/living/silicon/robot/R = user
if(istype(R.module_active, /obj/item/device/flash))
to_chat(user, SPAN_WARNING("You cannot detach your own flash and install it into \the [src]."))
return
else
- add_flashes(W,user)
+ add_flashes(attacking_item,user)
else
- add_flashes(W,user)
- else if(istype(W, /obj/item/stock_parts/manipulator))
+ add_flashes(attacking_item,user)
+ else if(istype(attacking_item, /obj/item/stock_parts/manipulator))
to_chat(user, SPAN_NOTICE("You install some manipulators and modify the head, creating a functional spider-bot!"))
new /mob/living/simple_animal/spiderbot(get_turf(src))
- user.drop_from_inventory(W, get_turf(user))
- qdel(W)
+ user.drop_from_inventory(attacking_item, get_turf(user))
+ qdel(attacking_item)
qdel(src)
return
return
diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm
index 29913435672..f89ab7d18bf 100644
--- a/code/modules/mob/living/silicon/robot/robot.dm
+++ b/code/modules/mob/living/silicon/robot/robot.dm
@@ -573,35 +573,35 @@
spark_system.queue()
return 2
-/mob/living/silicon/robot/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/handcuffs)) // fuck i don't even know why isrobot() in handcuff code isn't working so this will have to do
+/mob/living/silicon/robot/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/handcuffs)) // fuck i don't even know why isrobot() in handcuff code isn't working so this will have to do
return
if(opened) // Are they trying to insert something?
- if(istype(W, /obj/item/robot_parts/robot_component/jetpack)) //If they're inserting a jetpack, check that this chassis allows it.
- if(!src.module || !(W.type in src.module.supported_upgrades))
+ if(istype(attacking_item, /obj/item/robot_parts/robot_component/jetpack)) //If they're inserting a jetpack, check that this chassis allows it.
+ if(!src.module || !(attacking_item.type in src.module.supported_upgrades))
to_chat(user, SPAN_WARNING("\The [src]'s module does not support a jetpack."))
return
for(var/V in components)
var/datum/robot_component/C = components[V]
- if(!C.installed && istype(W, C.external_type))
- C.wrapped = W
+ if(!C.installed && istype(attacking_item, C.external_type))
+ C.wrapped = attacking_item
C.install()
user.drop_item()
- W.loc = null
+ attacking_item.loc = null
- var/obj/item/robot_parts/robot_component/WC = W
+ var/obj/item/robot_parts/robot_component/WC = attacking_item
if(istype(WC))
C.brute_damage = WC.brute
C.electronics_damage = WC.burn
- to_chat(user, SPAN_NOTICE("You install the [W.name] into \the [src]."))
+ to_chat(user, SPAN_NOTICE("You install the [attacking_item.name] into \the [src]."))
handle_panel_overlay()
return
- if(istype(W, /obj/item/gripper)) //Code for allowing cyborgs to use rechargers
- var/obj/item/gripper/gripper = W
+ if(istype(attacking_item, /obj/item/gripper)) //Code for allowing cyborgs to use rechargers
+ var/obj/item/gripper/gripper = attacking_item
if(!wires_exposed)
var/datum/robot_component/cell_component = components["power cell"]
if(cell)
@@ -619,14 +619,14 @@
cell_component.installed = 0
to_chat(user, SPAN_NOTICE("You remove \the [cell_component.wrapped]."))
if(user.a_intent == I_HELP)
- if(W.iswelder())
+ if(attacking_item.iswelder())
if(src == user)
to_chat(user, SPAN_WARNING("You lack the reach to be able to repair yourself."))
return
if(!getBruteLoss())
to_chat(user, SPAN_WARNING("There is nothing to fix here!"))
return
- var/obj/item/weldingtool/WT = W
+ var/obj/item/weldingtool/WT = attacking_item
if(!WT.welding)
to_chat(user, SPAN_WARNING("Your welding tool is not lit!")) // it aint lit fam :fire:
return
@@ -637,22 +637,22 @@
add_fingerprint(user)
visible_message(SPAN_WARNING("\The [user] has fixed some of the dents on \the [src]!"))
return
- else if(W.iscoil() && (wires_exposed || istype(src,/mob/living/silicon/robot/drone)))
+ else if(attacking_item.iscoil() && (wires_exposed || istype(src,/mob/living/silicon/robot/drone)))
if(!getFireLoss())
to_chat(user, SPAN_WARNING("There is nothing to fix here!"))
return
- var/obj/item/stack/cable_coil/coil = W
+ var/obj/item/stack/cable_coil/coil = attacking_item
if(coil.use(2))
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
adjustFireLoss(-30)
updatehealth()
visible_message(SPAN_WARNING("\The [user] has fixed some of the burnt wires on \the [src]!"))
return
- else if(W.iscrowbar()) // crowbar means open or close the cover
+ else if(attacking_item.iscrowbar()) // crowbar means open or close the cover
if(opened)
if(cell)
user.visible_message(SPAN_NOTICE("\The [user] begins clasping shut \the [src]'s maintenance hatch."), SPAN_NOTICE("You begin closing up \the [src]'s maintenance hatch."))
- if(W.use_tool(src, user, 50, volume = 50))
+ if(attacking_item.use_tool(src, user, 50, volume = 50))
if(!Adjacent(user))
to_chat(user, SPAN_WARNING("You are too far from \the [src] to close its hatch."))
return
@@ -665,7 +665,7 @@
to_chat(user, SPAN_WARNING("\The [src] has no brain to remove.")) // me irl - geeves
return
user.visible_message(SPAN_NOTICE("\The [user] begins ripping \the [mmi] from \the [src]."), SPAN_NOTICE("You jam the crowbar into the robot and begin levering out \the [mmi]."))
- if(W.use_tool(src, user, 50, volume = 50))
+ if(attacking_item.use_tool(src, user, 50, volume = 50))
to_chat(user, SPAN_NOTICE("You damage some parts of the chassis, but eventually manage to rip out \the [mmi]!"))
new /obj/item/robot_parts/robot_suit/equipped(get_turf(src))
new /obj/item/robot_parts/chest(get_turf(src))
@@ -699,70 +699,70 @@
to_chat(user, SPAN_WARNING("The cover is locked and cannot be opened."))
else
user.visible_message(SPAN_NOTICE("\The [user] begins prying open \the [src]'s maintenance hatch."), SPAN_NOTICE("You start opening \the [src]'s maintenance hatch."))
- if(W.use_tool(src, user, 50, volume = 50))
+ if(attacking_item.use_tool(src, user, 50, volume = 50))
if(!Adjacent(user))
to_chat(user, SPAN_NOTICE("You are too far from \the [src] to open its hatch."))
return
to_chat(user, SPAN_NOTICE("You open \the [src]'s maintenance hatch."))
opened = TRUE
handle_panel_overlay()
- else if(istype(W, /obj/item/stock_parts/matter_bin) && opened) // Installing/swapping a matter bin
+ else if(istype(attacking_item, /obj/item/stock_parts/matter_bin) && opened) // Installing/swapping a matter bin
if(storage)
- to_chat(user, SPAN_NOTICE("You replace \the [storage] with \the [W]"))
+ to_chat(user, SPAN_NOTICE("You replace \the [storage] with \the [attacking_item]"))
storage.forceMove(get_turf(src))
storage = null
else
- to_chat(user, SPAN_NOTICE("You install \the [W]"))
- storage = W
- user.drop_from_inventory(W, src)
+ to_chat(user, SPAN_NOTICE("You install \the [attacking_item]"))
+ storage = attacking_item
+ user.drop_from_inventory(attacking_item, src)
to_chat(src, SPAN_NOTICE("\The [user] has installed \the [storage] into you."))
recalculate_synth_capacities()
- else if(istype(W, /obj/item/cell) && opened) // trying to put a cell inside
+ else if(istype(attacking_item, /obj/item/cell) && opened) // trying to put a cell inside
var/datum/robot_component/C = components["power cell"]
if(wires_exposed)
- to_chat(user, SPAN_WARNING("You cannot install \the [W] while \the [src]'s wires are exposed."))
+ to_chat(user, SPAN_WARNING("You cannot install \the [attacking_item] while \the [src]'s wires are exposed."))
return
else if(cell)
to_chat(user, SPAN_WARNING("There is a power cell already installed."))
return
- else if(W.w_class != 3)
- to_chat(user, SPAN_WARNING("\The [W] is too [W.w_class < 3 ? "small" : "large"] to fit here."))
+ else if(attacking_item.w_class != 3)
+ to_chat(user, SPAN_WARNING("\The [attacking_item] is too [attacking_item.w_class < 3 ? "small" : "large"] to fit here."))
return
else
- user.drop_from_inventory(W, src)
- cell = W
+ user.drop_from_inventory(attacking_item, src)
+ cell = attacking_item
to_chat(user, SPAN_NOTICE("You insert the power cell."))
to_chat(src, SPAN_NOTICE("\The [user] has installed \the [cell] into you."))
C.installed = TRUE
- C.wrapped = W
+ C.wrapped = attacking_item
C.install()
//This will mean that removing and replacing a power cell will repair the mount, but I don't care at this point. ~Z
C.brute_damage = 0
C.electronics_damage = 0
handle_panel_overlay()
- else if(W.iswirecutter() || W.ismultitool())
+ else if(attacking_item.iswirecutter() || attacking_item.ismultitool())
if(wires_exposed)
wires.interact(user)
else
to_chat(user, SPAN_WARNING("\The [src]'s wires aren't exposed."))
return
- else if(W.isscrewdriver() && opened && !cell) // haxing
+ else if(attacking_item.isscrewdriver() && opened && !cell) // haxing
wires_exposed = !wires_exposed
user.visible_message(SPAN_NOTICE("\The [user] [wires_exposed ? "exposes" : "covers"] \the [src]'s wires."), SPAN_NOTICE("You [wires_exposed ? "expose" : "cover"] \the [src]'s wires."))
handle_panel_overlay()
- else if(W.isscrewdriver() && opened && cell) // radio
+ else if(attacking_item.isscrewdriver() && opened && cell) // radio
if(radio)
- radio.attackby(W, user) //Push it to the radio to let it handle everything
+ radio.attackby(attacking_item, user) //Push it to the radio to let it handle everything
else
to_chat(user, SPAN_WARNING("\The [src] does not have a radio installed!"))
return
- else if(istype(W, /obj/item/device/encryptionkey) && opened)
+ else if(istype(attacking_item, /obj/item/device/encryptionkey) && opened)
if(radio) //sanityyyyyy
- radio.attackby(W, user) //GTFO, you have your own procs
+ radio.attackby(attacking_item, user) //GTFO, you have your own procs
else
to_chat(user, SPAN_WARNING("\The [src] does not have a radio installed!"))
return
- else if(W.GetID() || istype(W, /obj/item/card/robot)) // trying to unlock the interface with an ID card
+ else if(attacking_item.GetID() || istype(attacking_item, /obj/item/card/robot)) // trying to unlock the interface with an ID card
if(emagged && !is_traitor()) //still allow them to open the cover. is_traitor() dodges this text as being made traitor sets emagged to TRUE.
to_chat(user, SPAN_NOTICE("You notice that \the [src]'s interface appears to be damaged."))
if(opened)
@@ -776,8 +776,8 @@
else
to_chat(user, SPAN_WARNING("Access denied."))
return
- else if(istype(W, /obj/item/borg/upgrade))
- var/obj/item/borg/upgrade/U = W
+ else if(istype(attacking_item, /obj/item/borg/upgrade))
+ var/obj/item/borg/upgrade/U = attacking_item
if(!opened)
to_chat(user, SPAN_WARNING("You cannot install \the [U] while the maintenance hatch is closed."))
return
@@ -791,7 +791,7 @@
user.drop_from_inventory(U, src)
return
else
- if(W.force && !(istype(W, /obj/item/device/robotanalyzer) || istype(W, /obj/item/device/healthanalyzer)) )
+ if(attacking_item.force && !(istype(attacking_item, /obj/item/device/robotanalyzer) || istype(attacking_item, /obj/item/device/healthanalyzer)) )
spark_system.queue()
return ..()
else
diff --git a/code/modules/mob/living/simple_animal/constructs/soulstone.dm b/code/modules/mob/living/simple_animal/constructs/soulstone.dm
index b3644c074e2..8a0a09e935a 100644
--- a/code/modules/mob/living/simple_animal/constructs/soulstone.dm
+++ b/code/modules/mob/living/simple_animal/constructs/soulstone.dm
@@ -94,9 +94,9 @@
icon_state = "construct-cult"
desc = "This eerie contraption looks like it would come alive if supplied with a missing ingredient."
-/obj/structure/constructshell/attackby(obj/item/O as obj, mob/user as mob)
- if(istype(O, /obj/item/device/soulstone))
- var/obj/item/device/soulstone/S = O;
+/obj/structure/constructshell/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/device/soulstone))
+ var/obj/item/device/soulstone/S = attacking_item
S.transfer_soul("CONSTRUCT",src,user)
diff --git a/code/modules/mob/living/simple_animal/friendly/adhomai.dm b/code/modules/mob/living/simple_animal/friendly/adhomai.dm
index fea5911fd6e..f56008edf16 100644
--- a/code/modules/mob/living/simple_animal/friendly/adhomai.dm
+++ b/code/modules/mob/living/simple_animal/friendly/adhomai.dm
@@ -21,17 +21,17 @@
mob_size = 5
var/eggsleft = 0
-/mob/living/simple_animal/ice_tunneler/attackby(var/obj/item/O as obj, var/mob/user as mob)
- if(istype(O, /obj/item/reagent_containers/food/snacks/grown)) //feedin' dem chickens
- var/obj/item/reagent_containers/food/snacks/grown/G = O
+/mob/living/simple_animal/ice_tunneler/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/reagent_containers/food/snacks/grown)) //feedin' dem chickens
+ var/obj/item/reagent_containers/food/snacks/grown/G = attacking_item
if(G.seed && G.seed.kitchen_tag == "nfrihi")
if(!stat && eggsleft < 8)
user.visible_message(
- SPAN_NOTICE("\The [user] feeds \the [O] to \the [name]! It whistles happily."),
- SPAN_NOTICE("You feed \the [O] to \the [name]! It whistles happily."),
+ SPAN_NOTICE("\The [user] feeds \the [attacking_item] to \the [name]! It whistles happily."),
+ SPAN_NOTICE("You feed \the [attacking_item] to \the [name]! It whistles happily."),
"You hear a cluck.")
- user.drop_from_inventory(O,get_turf(src))
- qdel(O)
+ user.drop_from_inventory(attacking_item,get_turf(src))
+ qdel(attacking_item)
eggsleft += rand(1, 4)
else
to_chat(user, "\The [name] doesn't seem hungry!")
@@ -234,7 +234,7 @@
unburrow()
..()
-/mob/living/simple_animal/ice_catcher/attackby(obj/item/O, mob/user)
+/mob/living/simple_animal/ice_catcher/attackby(obj/item/attacking_item, mob/user)
if(burrowed && (stat != DEAD))
unburrow()
..()
diff --git a/code/modules/mob/living/simple_animal/friendly/cat.dm b/code/modules/mob/living/simple_animal/friendly/cat.dm
index 9442301968e..ddc39f56531 100644
--- a/code/modules/mob/living/simple_animal/friendly/cat.dm
+++ b/code/modules/mob/living/simple_animal/friendly/cat.dm
@@ -171,9 +171,9 @@
flee_target = A
turns_since_move = 5
-/mob/living/simple_animal/cat/attackby(var/obj/item/O, var/mob/user)
+/mob/living/simple_animal/cat/attackby(obj/item/attacking_item, mob/user)
. = ..()
- if(O.force)
+ if(attacking_item.force)
set_flee_target(user? user : src.loc)
/mob/living/simple_animal/cat/attack_hand(mob/living/carbon/human/M as mob)
diff --git a/code/modules/mob/living/simple_animal/friendly/corgi.dm b/code/modules/mob/living/simple_animal/friendly/corgi.dm
index ea57ffd8764..79a23a2e1de 100644
--- a/code/modules/mob/living/simple_animal/friendly/corgi.dm
+++ b/code/modules/mob/living/simple_animal/friendly/corgi.dm
@@ -71,12 +71,12 @@
name = "Corgi meat"
desc = "Tastes like... well you know..."
-/mob/living/simple_animal/corgi/attackby(var/obj/item/O as obj, var/mob/user as mob) //Marker -Agouri
- if(istype(O, /obj/item/newspaper))
+/mob/living/simple_animal/corgi/attackby(obj/item/attacking_item, mob/user) //Marker -Agouri
+ if(istype(attacking_item, /obj/item/newspaper))
if(!stat)
visible_message(
- "[user] baps [src] on the nose with the rolled up [O.name].",
- "[user] baps you on the nose with the rolled up [O.name]!"
+ "[user] baps [src] on the nose with the rolled up [attacking_item.name].",
+ "[user] baps you on the nose with the rolled up [attacking_item.name]!"
)
scan_interval = max_scan_interval
movement_target = null
diff --git a/code/modules/mob/living/simple_animal/friendly/farm_animals.dm b/code/modules/mob/living/simple_animal/friendly/farm_animals.dm
index d46fbfc6936..d9731b93058 100644
--- a/code/modules/mob/living/simple_animal/friendly/farm_animals.dm
+++ b/code/modules/mob/living/simple_animal/friendly/farm_animals.dm
@@ -250,17 +250,17 @@
chicken_count -= 1
desc = "Now it's ready for plucking and cooking!"
-/mob/living/simple_animal/chicken/attackby(var/obj/item/O as obj, var/mob/user as mob)
- if(istype(O, /obj/item/reagent_containers/food/snacks/grown)) //feedin' dem chickens
- var/obj/item/reagent_containers/food/snacks/grown/G = O
+/mob/living/simple_animal/chicken/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/reagent_containers/food/snacks/grown)) //feedin' dem chickens
+ var/obj/item/reagent_containers/food/snacks/grown/G = attacking_item
if(G.seed && G.seed.kitchen_tag == "wheat")
if(!stat && eggsleft < 8)
user.visible_message(
- SPAN_NOTICE("\The [user] feeds \the [O] to \the [name]! It clucks happily."),
- SPAN_NOTICE("You feed \the [O] to \the [name]! It clucks happily."),
+ SPAN_NOTICE("\The [user] feeds \the [attacking_item] to \the [name]! It clucks happily."),
+ SPAN_NOTICE("You feed \the [attacking_item] to \the [name]! It clucks happily."),
"You hear a cluck.")
- user.drop_from_inventory(O,get_turf(src))
- qdel(O)
+ user.drop_from_inventory(attacking_item,get_turf(src))
+ qdel(attacking_item)
eggsleft += rand(1, 4)
else
to_chat(user, "\The [name] doesn't seem hungry!")
diff --git a/code/modules/mob/living/simple_animal/friendly/spiderbot.dm b/code/modules/mob/living/simple_animal/friendly/spiderbot.dm
index b665ee447bc..d7e674b1eab 100644
--- a/code/modules/mob/living/simple_animal/friendly/spiderbot.dm
+++ b/code/modules/mob/living/simple_animal/friendly/spiderbot.dm
@@ -68,10 +68,10 @@
/mob/living/simple_animal/spiderbot/isSynthetic()
return TRUE
-/mob/living/simple_animal/spiderbot/attackby(var/obj/item/O as obj, var/mob/user as mob)
+/mob/living/simple_animal/spiderbot/attackby(obj/item/attacking_item, mob/user)
- if(istype(O, /obj/item/device/mmi))
- var/obj/item/device/mmi/B = O
+ if(istype(attacking_item, /obj/item/device/mmi))
+ var/obj/item/device/mmi/B = attacking_item
if(src.mmi)
to_chat(user, "There's already a brain in [src]!")
return
@@ -86,32 +86,32 @@
ghost_can_reenter = 1
break
if(!ghost_can_reenter)
- to_chat(user, "[O] is completely unresponsive; there's no point.")
+ to_chat(user, "[attacking_item] is completely unresponsive; there's no point.")
return
if(B.brainmob.stat == DEAD)
- to_chat(user, "[O] is dead. Sticking it into the frame would sort of defeat the purpose.")
+ to_chat(user, "[attacking_item] is dead. Sticking it into the frame would sort of defeat the purpose.")
return
if(jobban_isbanned(B.brainmob, "Cyborg"))
- to_chat(user, "\The [O] does not seem to fit.")
+ to_chat(user, "\The [attacking_item] does not seem to fit.")
return
- to_chat(user, "You install \the [O] in \the [src]!")
+ to_chat(user, "You install \the [attacking_item] in \the [src]!")
- if(istype(O, /obj/item/device/mmi/digital))
+ if(istype(attacking_item, /obj/item/device/mmi/digital))
positronic = 1
add_language("Robot Talk")
- src.mmi = O
- src.transfer_personality(O)
+ src.mmi = attacking_item
+ src.transfer_personality(attacking_item)
- user.drop_from_inventory(O,src)
+ user.drop_from_inventory(attacking_item,src)
src.update_icon()
return 1
- if (O.iswelder())
- var/obj/item/weldingtool/WT = O
+ if (attacking_item.iswelder())
+ var/obj/item/weldingtool/WT = attacking_item
if (WT.use(0))
if(health < maxHealth)
health += pick(1,1,1,2,2,3)
@@ -124,12 +124,12 @@
else
to_chat(user, "You need more welding fuel for this task!")
return
- else if(O.GetID())
+ else if(attacking_item.GetID())
if (!mmi)
to_chat(user, "There's no reason to swipe your ID - \the [src] has no brain.")
return 0
- var/obj/item/card/id/id_card = O.GetID()
+ var/obj/item/card/id/id_card = attacking_item.GetID()
if(!istype(id_card))
return 0
@@ -162,7 +162,7 @@
to_chat(src, SPAN_NOTICE("Access codes updated."))
return 1
else
- O.attack(src, user, user.zone_sel.selecting)
+ attacking_item.attack(src, user, user.zone_sel.selecting)
/mob/living/simple_animal/spiderbot/emag_act(var/remaining_charges, var/mob/user)
if (emagged)
diff --git a/code/modules/mob/living/simple_animal/hostile/adhomai.dm b/code/modules/mob/living/simple_animal/hostile/adhomai.dm
index f791c7fa5bb..d9a8bdd0c0e 100644
--- a/code/modules/mob/living/simple_animal/hostile/adhomai.dm
+++ b/code/modules/mob/living/simple_animal/hostile/adhomai.dm
@@ -151,7 +151,7 @@
visible_message(SPAN_WARNING("\The [M] tries to touch \the [src]!"))
tesla_zap(M, 5, 5000)
-/mob/living/simple_animal/hostile/plasmageist/attackby(obj/item/O, mob/user)
+/mob/living/simple_animal/hostile/plasmageist/attackby(obj/item/attacking_item, mob/user)
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
if(isliving(user))
visible_message(SPAN_WARNING("\The [user] tries to touch \the [src]!"))
diff --git a/code/modules/mob/living/simple_animal/hostile/bear.dm b/code/modules/mob/living/simple_animal/hostile/bear.dm
index c6c955b4d4f..0f82df3533f 100644
--- a/code/modules/mob/living/simple_animal/hostile/bear.dm
+++ b/code/modules/mob/living/simple_animal/hostile/bear.dm
@@ -254,7 +254,7 @@
spawn(5)
teleport()//Bluespace bears teleport away to rest
-/mob/living/simple_animal/hostile/bear/attackby(var/obj/item/O as obj, var/mob/user as mob)
+/mob/living/simple_animal/hostile/bear/attackby(obj/item/attacking_item, mob/user)
var/healthbefore = health
..()
spawn(1)
diff --git a/code/modules/mob/living/simple_animal/hostile/morph.dm b/code/modules/mob/living/simple_animal/hostile/morph.dm
index 73306cf90b5..4d6af956df4 100644
--- a/code/modules/mob/living/simple_animal/hostile/morph.dm
+++ b/code/modules/mob/living/simple_animal/hostile/morph.dm
@@ -205,7 +205,7 @@
return
return ..()
-/mob/living/simple_animal/hostile/morph/attackby(obj/item/O, mob/user)
+/mob/living/simple_animal/hostile/morph/attackby(obj/item/attacking_item, mob/user)
..()
if(morphed && user != src)
restore()
diff --git a/code/modules/mob/living/simple_animal/hostile/retaliate/aquatic.dm b/code/modules/mob/living/simple_animal/hostile/retaliate/aquatic.dm
index bf00ecb5072..0b94c5bc6c5 100644
--- a/code/modules/mob/living/simple_animal/hostile/retaliate/aquatic.dm
+++ b/code/modules/mob/living/simple_animal/hostile/retaliate/aquatic.dm
@@ -58,8 +58,8 @@
melee_damage_upper = 90
armor_penetration = 100
-/mob/living/simple_animal/hostile/retaliate/aquatic/thresher/deep_water/attackby(obj/item/O, mob/user)
- if(istype(O, /obj/item/melee/baton))
+/mob/living/simple_animal/hostile/retaliate/aquatic/thresher/deep_water/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/melee/baton))
user.gib()
- user.visible_message(SPAN_DANGER("[user] was torn to shreds by a shark while attempting to attack with \the [O]!"))
+ user.visible_message(SPAN_DANGER("[user] was torn to shreds by a shark while attempting to attack with \the [attacking_item]!"))
return TRUE
diff --git a/code/modules/mob/living/simple_animal/hostile/syndicate.dm b/code/modules/mob/living/simple_animal/hostile/syndicate.dm
index efd09155455..060e4967572 100644
--- a/code/modules/mob/living/simple_animal/hostile/syndicate.dm
+++ b/code/modules/mob/living/simple_animal/hostile/syndicate.dm
@@ -62,20 +62,20 @@
attacktext = "slashed"
status_flags = 0
-/mob/living/simple_animal/hostile/syndicate/melee/attackby(var/obj/item/O as obj, var/mob/user as mob)
- if(O.force)
+/mob/living/simple_animal/hostile/syndicate/melee/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.force)
if(prob(80))
- var/damage = O.force
- if (O.damtype == DAMAGE_PAIN)
+ var/damage = attacking_item.force
+ if (attacking_item.damtype == DAMAGE_PAIN)
damage = 0
health -= damage
- visible_message("[src] has been attacked with the [O] by [user].")
+ visible_message("[src] has been attacked with the [attacking_item] by [user].")
else
- visible_message("[src] blocks the [O] with its shield!")
+ visible_message("[src] blocks the [attacking_item] with its shield!")
//user.do_attack_animation(src)
else
to_chat(usr, "This weapon is ineffective, it does no damage.")
- visible_message("[user] gently taps [src] with the [O].")
+ visible_message("[user] gently taps [src] with the [attacking_item].")
/mob/living/simple_animal/hostile/syndicate/melee/bullet_act(var/obj/item/projectile/Proj)
diff --git a/code/modules/mob/living/simple_animal/hostile/vannatusk.dm b/code/modules/mob/living/simple_animal/hostile/vannatusk.dm
index 72c8b5063d1..2db7f9c64d8 100644
--- a/code/modules/mob/living/simple_animal/hostile/vannatusk.dm
+++ b/code/modules/mob/living/simple_animal/hostile/vannatusk.dm
@@ -72,10 +72,10 @@
icon = 'icons/mob/npc/vannatusk.dmi'
icon_state = "bonedart"
-/mob/living/simple_animal/hostile/vannatusk/attackby(obj/item/O, mob/user)
+/mob/living/simple_animal/hostile/vannatusk/attackby(obj/item/attacking_item, mob/user)
if(stat != DEAD)
return ..()
- if(istype(O, /obj/item/surgery/scalpel))
+ if(istype(attacking_item, /obj/item/surgery/scalpel))
if(crystal_harvested)
to_chat(user, SPAN_WARNING("\The [src]'s crystal has already been harvested!"))
return
diff --git a/code/modules/mob/living/simple_animal/parrot.dm b/code/modules/mob/living/simple_animal/parrot.dm
index 9eaa4355274..f6442672545 100644
--- a/code/modules/mob/living/simple_animal/parrot.dm
+++ b/code/modules/mob/living/simple_animal/parrot.dm
@@ -241,10 +241,10 @@
return
//Mobs with objects
-/mob/living/simple_animal/parrot/attackby(var/obj/item/O as obj, var/mob/user as mob)
+/mob/living/simple_animal/parrot/attackby(obj/item/attacking_item, mob/user)
..()
- if(!stat && !client && !istype(O, /obj/item/stack/medical))
- if(O.force)
+ if(!stat && !client && !istype(attacking_item, /obj/item/stack/medical))
+ if(attacking_item.force)
if(parrot_state == PARROT_PERCH)
parrot_sleep_dur = parrot_sleep_max //Reset it's sleep timer if it was perched
diff --git a/code/modules/mob/living/simple_animal/shade.dm b/code/modules/mob/living/simple_animal/shade.dm
index 7aee4ad3389..3752a2f8997 100644
--- a/code/modules/mob/living/simple_animal/shade.dm
+++ b/code/modules/mob/living/simple_animal/shade.dm
@@ -51,9 +51,9 @@
/mob/living/simple_animal/shade/can_name(var/mob/living/M)
return FALSE
-/mob/living/simple_animal/shade/attackby(var/obj/item/O as obj, var/mob/user as mob) //Marker -Agouri
- if(istype(O, /obj/item/device/soulstone))
- var/obj/item/device/soulstone/S = O;
+/mob/living/simple_animal/shade/attackby(obj/item/attacking_item, mob/user) //Marker -Agouri
+ if(istype(attacking_item, /obj/item/device/soulstone))
+ var/obj/item/device/soulstone/S = attacking_item
S.transfer_soul("SHADE", src, user)
return
return ..()
diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm
index 63d4944a7f5..1dd8e3a4db9 100644
--- a/code/modules/mob/living/simple_animal/simple_animal.dm
+++ b/code/modules/mob/living/simple_animal/simple_animal.dm
@@ -555,48 +555,48 @@
user.do_attack_animation(src, FIST_ATTACK_ANIMATION)
poke(TRUE)
-/mob/living/simple_animal/attackby(obj/item/O, mob/user)
- if(istype(O, /obj/item/saddle) && vehicle_version && (stat != DEAD))
+/mob/living/simple_animal/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/saddle) && vehicle_version && (stat != DEAD))
var/obj/vehicle/V = new vehicle_version (get_turf(src))
V.health = health
V.maxhealth = maxHealth
- to_chat(user, SPAN_WARNING("You place \the [O] on the \the [src]."))
- user.drop_from_inventory(O)
- O.forceMove(get_turf(src))
- qdel(O)
+ to_chat(user, SPAN_WARNING("You place \the [attacking_item] on the \the [src]."))
+ user.drop_from_inventory(attacking_item)
+ attacking_item.forceMove(get_turf(src))
+ qdel(attacking_item)
qdel(src)
- if(istype(O, /obj/item/reagent_containers/glass/rag)) //You can't milk an udder with a rag.
- attacked_with_item(O, user)
+ if(istype(attacking_item, /obj/item/reagent_containers/glass/rag)) //You can't milk an udder with a rag.
+ attacked_with_item(attacking_item, user)
return
if(has_udder)
- var/obj/item/reagent_containers/glass/G = O
+ var/obj/item/reagent_containers/glass/G = attacking_item
if(stat == CONSCIOUS && istype(G) && G.is_open_container())
if(udder.total_volume <= 0)
to_chat(user, SPAN_WARNING("The udder is dry."))
return
if(G.reagents.total_volume >= G.volume)
- to_chat(user, SPAN_WARNING("The [O] is full."))
+ to_chat(user, SPAN_WARNING("The [attacking_item] is full."))
return
- user.visible_message("\The [user] milks \the [src] using \the [O].")
+ user.visible_message("\The [user] milks \the [src] using \the [attacking_item].")
udder.trans_type_to(G, milk_type, rand(5, 10))
return
- if(istype(O, /obj/item/reagent_containers) || istype(O, /obj/item/stack/medical) || istype(O,/obj/item/gripper/))
+ if(istype(attacking_item, /obj/item/reagent_containers) || istype(attacking_item, /obj/item/stack/medical) || istype(attacking_item,/obj/item/gripper/))
..()
poke()
- else if(istype(O, brush) && canbrush) //Brushing animals
- visible_message("\The [user] gently brushes \the [src] with \the [O].")
+ else if(istype(attacking_item, brush) && canbrush) //Brushing animals
+ visible_message("\The [user] gently brushes \the [src] with \the [attacking_item].")
if(prob(15) && !istype(src, /mob/living/simple_animal/hostile)) //Aggressive animals don't purr before biting your face off.
visible_message("[capitalize_first_letters(src.name)] [speak_emote.len ? pick(speak_emote) : "rumbles"].") //purring
return
else if(meat_type && (stat == DEAD)) //if the animal has a meat, and if it is dead.
- if(istype(O, /obj/item/material/knife) || istype(O, /obj/item/material/kitchen/utensil/knife)|| istype(O, /obj/item/material/hatchet))
+ if(istype(attacking_item, /obj/item/material/knife) || istype(attacking_item, /obj/item/material/kitchen/utensil/knife)|| istype(attacking_item, /obj/item/material/hatchet))
harvest(user)
else
- attacked_with_item(O, user)
+ attacked_with_item(attacking_item, user)
//TODO: refactor mob attackby(), attacked_by(), and friends.
/mob/living/simple_animal/proc/attacked_with_item(obj/item/O, mob/user, var/proximity)
diff --git a/code/modules/modular_computers/NTNet/NTNet_relay.dm b/code/modules/modular_computers/NTNet/NTNet_relay.dm
index 34d9923e5b2..67e804eaf08 100644
--- a/code/modules/modular_computers/NTNet/NTNet_relay.dm
+++ b/code/modules/modular_computers/NTNet/NTNet_relay.dm
@@ -121,17 +121,17 @@
GLOB.ntnet_global.add_log("Quantum relay connection severed. Current amount of linked relays: [NTNet.relays.len]")
return ..()
-/obj/machinery/ntnet_relay/attackby(obj/item/W, mob/user)
- if(W.isscrewdriver())
- playsound(get_turf(src), W.usesound, 50, TRUE)
+/obj/machinery/ntnet_relay/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.isscrewdriver())
+ playsound(get_turf(src), attacking_item.usesound, 50, TRUE)
panel_open = !panel_open
to_chat(user, SPAN_NOTICE("You [panel_open ? "open" : "close"] the maintenance hatch."))
return
- if(W.iscrowbar())
+ if(attacking_item.iscrowbar())
if(!panel_open)
to_chat(user, SPAN_WARNING("Open the maintenance panel first."))
return
- playsound(get_turf(src), W.usesound, 50, 1)
+ playsound(get_turf(src), attacking_item.usesound, 50, 1)
to_chat(user, SPAN_NOTICE("You disassemble \the [src]!"))
for(var/atom/movable/A in component_parts)
diff --git a/code/modules/modular_computers/computers/modular_computer/interaction.dm b/code/modules/modular_computers/computers/modular_computer/interaction.dm
index 7d127bdf5a5..95b5b59f34c 100644
--- a/code/modules/modular_computers/computers/modular_computer/interaction.dm
+++ b/code/modules/modular_computers/computers/modular_computer/interaction.dm
@@ -205,8 +205,8 @@
else if(!enabled && screen_on)
turn_on(user)
-/obj/item/modular_computer/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/card/tech_support))
+/obj/item/modular_computer/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/card/tech_support))
if(!can_reset)
to_chat(user, SPAN_WARNING("You cannot reset this type of device."))
return TRUE
@@ -220,8 +220,8 @@
hard_drive.reset_drive()
audible_message("[icon2html(src, viewers(get_turf(src)))] [src] pings, \"Enrollment status reset! Have a NanoTrasen day.\"")
return TRUE
- if(istype(W, /obj/item/card/id)) // ID Card, try to insert it.
- var/obj/item/card/id/I = W
+ if(istype(attacking_item, /obj/item/card/id)) // ID Card, try to insert it.
+ var/obj/item/card/id/I = attacking_item
if(!card_slot)
to_chat(user, SPAN_WARNING("You try to insert \the [I] into \the [src], but it does not have an ID card slot installed."))
return TRUE
@@ -234,54 +234,54 @@
update_uis()
to_chat(user, SPAN_NOTICE("You insert \the [I] into \the [src]."))
return TRUE
- if(is_type_in_list(W, card_slot?.allowed_items))
+ if(is_type_in_list(attacking_item, card_slot?.allowed_items))
if(!card_slot)
- to_chat(user, SPAN_WARNING("You try to insert \the [W] into \the [src], but it does not have an ID card slot installed."))
+ to_chat(user, SPAN_WARNING("You try to insert \the [attacking_item] into \the [src], but it does not have an ID card slot installed."))
return TRUE
if(card_slot.stored_item)
- to_chat(user, SPAN_WARNING("You try to insert \the [W] into \the [src], but its storage slot is occupied."))
+ to_chat(user, SPAN_WARNING("You try to insert \the [attacking_item] into \the [src], but its storage slot is occupied."))
return TRUE
- user.drop_from_inventory(W, src)
- card_slot.stored_item = W
+ user.drop_from_inventory(attacking_item, src)
+ card_slot.stored_item = attacking_item
update_uis()
verbs += /obj/item/modular_computer/proc/eject_item
- to_chat(user, SPAN_NOTICE("You insert \the [W] into \the [src]."))
+ to_chat(user, SPAN_NOTICE("You insert \the [attacking_item] into \the [src]."))
return TRUE
- if(istype(W, /obj/item/paper))
+ if(istype(attacking_item, /obj/item/paper))
if(!nano_printer)
return TRUE
- nano_printer.attackby(W, user)
+ nano_printer.attackby(attacking_item, user)
return TRUE
- if(istype(W, /obj/item/aicard))
+ if(istype(attacking_item, /obj/item/aicard))
if(ai_slot)
- ai_slot.attackby(W, user)
+ ai_slot.attackby(attacking_item, user)
return TRUE
- if(istype(W, /obj/item/computer_hardware))
- var/obj/item/computer_hardware/C = W
+ if(istype(attacking_item, /obj/item/computer_hardware))
+ var/obj/item/computer_hardware/C = attacking_item
if(C.hardware_size <= max_hardware_size)
try_install_component(user, C)
else
to_chat(user, SPAN_WARNING("This component is too large for \the [src]."))
return TRUE
- if(istype(W, /obj/item/device/paicard))
- try_install_component(user, W)
+ if(istype(attacking_item, /obj/item/device/paicard))
+ try_install_component(user, attacking_item)
return TRUE
- if(W.iswrench())
+ if(attacking_item.iswrench())
var/list/components = get_all_components()
if(components.len)
to_chat(user, SPAN_WARNING("You have to remove all the components from \the [src] before disassembling it."))
return TRUE
to_chat(user, SPAN_NOTICE("You begin to disassemble \the [src]."))
- if(W.use_tool(src, user, 20, volume = 50))
+ if(attacking_item.use_tool(src, user, 20, volume = 50))
new /obj/item/stack/material/steel(get_turf(src), steel_sheet_cost)
user.visible_message(SPAN_NOTICE("\The [user] disassembles \the [src]."), SPAN_NOTICE("You disassemble \the [src]."), SPAN_NOTICE("You hear a ratcheting noise."))
qdel(src)
return TRUE
- if(W.iswelder())
- var/obj/item/weldingtool/WT = W
+ if(attacking_item.iswelder())
+ var/obj/item/weldingtool/WT = attacking_item
if(!WT.isOn())
- to_chat(user, SPAN_WARNING("\The [W] is off."))
+ to_chat(user, SPAN_WARNING("\The [attacking_item] is off."))
return TRUE
if(!damage)
@@ -296,7 +296,7 @@
update_icon()
return TRUE
- if(W.isscrewdriver())
+ if(attacking_item.isscrewdriver())
var/list/all_components = get_all_components()
if(!all_components.len)
to_chat(user, SPAN_WARNING("This device doesn't have any components installed."))
diff --git a/code/modules/modular_computers/computers/subtypes/dev_telescreen.dm b/code/modules/modular_computers/computers/subtypes/dev_telescreen.dm
index 9b531f678cc..9ce26733279 100644
--- a/code/modules/modular_computers/computers/subtypes/dev_telescreen.dm
+++ b/code/modules/modular_computers/computers/subtypes/dev_telescreen.dm
@@ -18,8 +18,8 @@
w_class = ITEMSIZE_HUGE
is_holographic = TRUE
-/obj/item/modular_computer/telescreen/attackby(obj/item/W, mob/user)
- if(W.iscrowbar())
+/obj/item/modular_computer/telescreen/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.iscrowbar())
if(anchored)
shutdown_computer()
anchored = FALSE
@@ -28,7 +28,7 @@
pixel_y = 0
to_chat(user, SPAN_NOTICE("You unsecure \the [src]."))
else
- var/choice = input(user, "Where do you want to place \the [src]?", "Offset selection") in list("North", "South", "West", "East", "This tile", "Cancel")
+ var/choice = tgui_input_list(user, "Where do you want to place \the [src]?", "Offset selection", list("North", "South", "West", "East", "This tile", "Cancel"), "Cancel")
var/valid = FALSE
switch(choice)
if("North")
diff --git a/code/modules/modular_computers/hardware/ai_slot.dm b/code/modules/modular_computers/hardware/ai_slot.dm
index 063f9da5bd2..9a9a091966f 100644
--- a/code/modules/modular_computers/hardware/ai_slot.dm
+++ b/code/modules/modular_computers/hardware/ai_slot.dm
@@ -17,17 +17,17 @@
return
power_usage = power_usage_occupied
-/obj/item/computer_hardware/ai_slot/attackby(obj/item/W, mob/user)
+/obj/item/computer_hardware/ai_slot/attackby(obj/item/attacking_item, mob/user)
if(..())
return TRUE
- if(istype(W, /obj/item/aicard))
+ if(istype(attacking_item, /obj/item/aicard))
if(stored_card)
to_chat(user, SPAN_WARNING("\The [src] is already occupied."))
return
- user.drop_from_inventory(W, src)
- stored_card = W
+ user.drop_from_inventory(attacking_item, src)
+ stored_card = attacking_item
update_power_usage()
- if(W.isscrewdriver())
+ if(attacking_item.isscrewdriver())
to_chat(user, SPAN_NOTICE("You manually remove \the [stored_card] from \the [src]."))
stored_card.forceMove(get_turf(src))
stored_card = null
diff --git a/code/modules/modular_computers/hardware/hard_drive.dm b/code/modules/modular_computers/hardware/hard_drive.dm
index 44a856df9ac..214e4364d91 100644
--- a/code/modules/modular_computers/hardware/hard_drive.dm
+++ b/code/modules/modular_computers/hardware/hard_drive.dm
@@ -175,8 +175,8 @@
remove_file(F)
install_default_programs()
-/obj/item/computer_hardware/hard_drive/attackby(obj/item/W, mob/living/user)
- if(istype(W, /obj/item/card/tech_support))
+/obj/item/computer_hardware/hard_drive/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/card/tech_support))
reset_drive()
to_chat(user, SPAN_NOTICE("Drive successfully reset."))
else
diff --git a/code/modules/modular_computers/hardware/hardware.dm b/code/modules/modular_computers/hardware/hardware.dm
index 416acaf775d..a1d7e812142 100644
--- a/code/modules/modular_computers/hardware/hardware.dm
+++ b/code/modules/modular_computers/hardware/hardware.dm
@@ -26,21 +26,21 @@
return disable()
return enable()
-/obj/item/computer_hardware/attackby(obj/item/W, mob/living/user)
+/obj/item/computer_hardware/attackby(obj/item/attacking_item, mob/user)
// Multitool. Runs diagnostics
- if(W.ismultitool())
+ if(attacking_item.ismultitool())
to_chat(user, SPAN_NOTICE("***** DIAGNOSTICS REPORT *****"))
diagnostics(user)
to_chat(user, SPAN_NOTICE("******************************"))
return 1
// Nanopaste. Repair all damage if present for a single unit.
- var/obj/item/stack/S = W
+ var/obj/item/stack/S = attacking_item
if(istype(S, /obj/item/stack/nanopaste))
if(!damage)
to_chat(user, SPAN_WARNING("\The [src] doesn't seem to require repairs."))
return TRUE
if(S.use(1))
- to_chat(user, SPAN_NOTICE("You apply a bit of \the [W] to \the [src], repairing it fully."))
+ to_chat(user, SPAN_NOTICE("You apply a bit of \the [attacking_item] to \the [src], repairing it fully."))
damage = 0
return TRUE
// Cable coil. Works as repair method, but will probably require multiple applications and more cable.
@@ -49,7 +49,7 @@
to_chat(user, SPAN_WARNING("\The [src] doesn't seem to require repairs."))
return TRUE
if(S.use(1))
- to_chat(user, SPAN_NOTICE("You patch up \the [src] with a bit of \the [W]."))
+ to_chat(user, SPAN_NOTICE("You patch up \the [src] with a bit of \the [attacking_item]."))
take_damage(-10)
return TRUE
return ..()
diff --git a/code/modules/modular_computers/hardware/nano_printer.dm b/code/modules/modular_computers/hardware/nano_printer.dm
index 91be2ea1fec..88641dba2d4 100644
--- a/code/modules/modular_computers/hardware/nano_printer.dm
+++ b/code/modules/modular_computers/hardware/nano_printer.dm
@@ -31,13 +31,13 @@
stored_paper--
return P
-/obj/item/computer_hardware/nano_printer/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/paper))
+/obj/item/computer_hardware/nano_printer/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/paper))
if(stored_paper >= max_paper)
- to_chat(user, SPAN_WARNING("You try to add \the [W] to the [src], but its paper bin is full."))
+ to_chat(user, SPAN_WARNING("You try to add \the [attacking_item] to the [src], but its paper bin is full."))
return
- to_chat(user, SPAN_NOTICE("You insert \the [W] into [src]."))
- qdel(W)
+ to_chat(user, SPAN_NOTICE("You insert \the [attacking_item] into [src]."))
+ qdel(attacking_item)
stored_paper++
else
..()
diff --git a/code/modules/modular_computers/items/paper_scanner.dm b/code/modules/modular_computers/items/paper_scanner.dm
index 6a5f0b0447b..fb0b45460c0 100644
--- a/code/modules/modular_computers/items/paper_scanner.dm
+++ b/code/modules/modular_computers/items/paper_scanner.dm
@@ -33,14 +33,14 @@
else
to_chat(user, SPAN_WARNING("You must be holding \the [src] in one of your hands before you can eject a drive."))
-/obj/item/paper_scanner/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/computer_hardware/hard_drive/portable))
+/obj/item/paper_scanner/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/computer_hardware/hard_drive/portable))
if(drive)
to_chat(user, SPAN_WARNING("\The [src] already has a drive installed!"))
return TRUE
- to_chat(user, SPAN_NOTICE("You insert \the [W] into \the [src]."))
- user.drop_from_inventory(W, src)
- drive = W
+ to_chat(user, SPAN_NOTICE("You insert \the [attacking_item] into \the [src]."))
+ user.drop_from_inventory(attacking_item, src)
+ drive = attacking_item
update_icon()
return TRUE
else
diff --git a/code/modules/modular_computers/laptop_vendor.dm b/code/modules/modular_computers/laptop_vendor.dm
index 2e2f4d7bd70..90a285093d2 100644
--- a/code/modules/modular_computers/laptop_vendor.dm
+++ b/code/modules/modular_computers/laptop_vendor.dm
@@ -262,8 +262,8 @@
ui.open()
ui.set_auto_update(1)
-/obj/machinery/lapvend/attackby(obj/item/W, mob/user)
- if(W.iswrench())
+/obj/machinery/lapvend/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.iswrench())
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
if(anchored)
user.visible_message("[user] begins unsecuring \the [src] from the floor.", \
@@ -271,19 +271,19 @@
else
user.visible_message("[user] begins securing \the [src] to the floor.", \
SPAN_NOTICE("You start securing \the [src] to the floor."))
- if(W.use_tool(src, user, 20, volume = 50))
+ if(attacking_item.use_tool(src, user, 20, volume = 50))
if(!src)
return
to_chat(user, SPAN_NOTICE("You [anchored ? "un" : ""]secured \the [src]!"))
anchored = !anchored
return
else if(state == 2) // awaiting payment state
- if(istype(W, /obj/item/card/id))
- var/obj/item/card/id/I = W.GetID()
- if(process_payment(I, W))
+ if(istype(attacking_item, /obj/item/card/id))
+ var/obj/item/card/id/I = attacking_item.GetID()
+ if(process_payment(I, attacking_item))
create_device()
return TRUE
- else if(istype(W, /obj/item/card/tech_support))
+ else if(istype(attacking_item, /obj/item/card/tech_support))
create_device("Have a NanoTrasen day!")
return TRUE
return ..()
diff --git a/code/modules/multiz/structures.dm b/code/modules/multiz/structures.dm
index a0c1fa4f310..b88f852cad5 100644
--- a/code/modules/multiz/structures.dm
+++ b/code/modules/multiz/structures.dm
@@ -55,12 +55,12 @@
target_up = null
return ..()
-/obj/structure/ladder/attackby(obj/item/C, mob/user)
+/obj/structure/ladder/attackby(obj/item/attacking_item, mob/user)
if(LAZYLEN(destroy_tools))
- if(is_type_in_list(C, destroy_tools))
- user.visible_message("[user] starts breaking down \the [src] with \the [C]!", SPAN_NOTICE("You start breaking down \the [src] with \the [C]."))
+ if(is_type_in_list(attacking_item, destroy_tools))
+ user.visible_message("[user] starts breaking down \the [src] with \the [attacking_item]!", SPAN_NOTICE("You start breaking down \the [src] with \the [attacking_item]."))
if(do_after(user, 10 SECONDS, src, DO_REPAIR_CONSTRUCT))
- user.visible_message("[user] breaks down \the [src] with \the [C]!", SPAN_NOTICE("You break down \the [src] with \the [C]."))
+ user.visible_message("[user] breaks down \the [src] with \the [attacking_item]!", SPAN_NOTICE("You break down \the [src] with \the [attacking_item]."))
qdel(src)
return
attack_hand(user)
diff --git a/code/modules/multiz/turfs/open_space.dm b/code/modules/multiz/turfs/open_space.dm
index ea81d6880ce..f7dc66bce1a 100644
--- a/code/modules/multiz/turfs/open_space.dm
+++ b/code/modules/multiz/turfs/open_space.dm
@@ -222,22 +222,22 @@
/turf/simulated/open/update_icon(mapload)
update_mimic(!mapload)
-/turf/simulated/open/attackby(obj/item/C as obj, mob/user as mob)
- if (istype(C, /obj/item/stack/rods))
+/turf/simulated/open/attackby(obj/item/attacking_item, mob/user)
+ if (istype(attacking_item, /obj/item/stack/rods))
var/obj/structure/lattice/L = locate(/obj/structure/lattice, src)
if(L)
return
- var/obj/item/stack/rods/R = C
+ var/obj/item/stack/rods/R = attacking_item
if (R.use(1))
to_chat(user, "You lay down the support lattice.")
playsound(src, 'sound/weapons/Genhit.ogg', 50, 1)
new /obj/structure/lattice(locate(src.x, src.y, src.z))
return
- if (istype(C, /obj/item/stack/tile))
+ if (istype(attacking_item, /obj/item/stack/tile))
var/obj/structure/lattice/L = locate(/obj/structure/lattice, src)
if(L)
- var/obj/item/stack/tile/floor/S = C
+ var/obj/item/stack/tile/floor/S = attacking_item
if (S.get_amount() < 1)
return
qdel(L)
@@ -249,8 +249,8 @@
to_chat(user, "The plating is going to need some support.")
//To lay cable.
- if(C.iscoil())
- var/obj/item/stack/cable_coil/coil = C
+ if(attacking_item.iscoil())
+ var/obj/item/stack/cable_coil/coil = attacking_item
coil.turf_place(src, user)
return
return
diff --git a/code/modules/multiz/zmimic/mimic_movable.dm b/code/modules/multiz/zmimic/mimic_movable.dm
index bf4da8e527c..471bc0593df 100644
--- a/code/modules/multiz/zmimic/mimic_movable.dm
+++ b/code/modules/multiz/zmimic/mimic_movable.dm
@@ -167,7 +167,7 @@
return ..()
-/atom/movable/openspace/mimic/attackby(obj/item/W, mob/user)
+/atom/movable/openspace/mimic/attackby(obj/item/attacking_item, mob/user)
to_chat(user, SPAN_NOTICE("\The [src] is too far away."))
/atom/movable/openspace/mimic/attack_hand(mob/user)
@@ -199,8 +199,8 @@
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
no_z_overlay = TRUE // Only one of these should ever be visible at a time, the mimic logic will handle that.
-/atom/movable/openspace/turf_proxy/attackby(obj/item/W, mob/user)
- loc.attackby(W, user)
+/atom/movable/openspace/turf_proxy/attackby(obj/item/attacking_item, mob/user)
+ loc.attackby(attacking_item, user)
/atom/movable/openspace/turf_proxy/attack_hand(mob/user as mob)
loc.attack_hand(user)
@@ -226,8 +226,8 @@
ASSERT(isturf(loc))
delegate = loc:below
-/atom/movable/openspace/turf_mimic/attackby(obj/item/W, mob/user)
- loc.attackby(W, user)
+/atom/movable/openspace/turf_mimic/attackby(obj/item/attacking_item, mob/user)
+ loc.attackby(attacking_item, user)
/atom/movable/openspace/turf_mimic/attack_hand(mob/user as mob)
to_chat(user, SPAN_NOTICE("You cannot reach \the [src] from here."))
diff --git a/code/modules/organs/internal/brain.dm b/code/modules/organs/internal/brain.dm
index 9c1bf982ece..492b0dea043 100644
--- a/code/modules/organs/internal/brain.dm
+++ b/code/modules/organs/internal/brain.dm
@@ -214,13 +214,13 @@
else
. += "This one seems particularly lifeless. Perhaps it will regain some of its luster later.."
-/obj/item/organ/internal/brain/attackby(obj/item/I, mob/user)
- if(istype(I, /obj/item/surgery/surgicaldrill))
+/obj/item/organ/internal/brain/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/surgery/surgicaldrill))
if(!can_prepare)
to_chat(user, SPAN_WARNING("\The [src] cannot be prepared!"))
return
if(!prepared)
- user.visible_message(SPAN_DANGER("[user] deftly uses \the [I] to drill into \the [src]!"))
+ user.visible_message(SPAN_DANGER("[user] deftly uses \the [attacking_item] to drill into \the [src]!"))
prepared = TRUE
else
to_chat(user, SPAN_WARNING("The brain has already been prepared!"))
diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm
index 1e553d27a06..6b0aff25f0c 100644
--- a/code/modules/organs/organ_external.dm
+++ b/code/modules/organs/organ_external.dm
@@ -243,28 +243,28 @@
continue
. += "There is \a [I] sticking out of it."
-/obj/item/organ/external/attackby(obj/item/W as obj, mob/user as mob)
+/obj/item/organ/external/attackby(obj/item/attacking_item, mob/user)
switch(stage)
if(0)
- if(istype(W,/obj/item/surgery/scalpel))
- user.visible_message("[user] cuts [src] open with [W]!")
+ if(istype(attacking_item, /obj/item/surgery/scalpel))
+ user.visible_message("[user] cuts [src] open with [attacking_item]!")
stage++
return
if(1)
- if(istype(W,/obj/item/surgery/retractor))
- user.visible_message("[user] cracks [src] open like an egg with [W]!")
+ if(istype(attacking_item, /obj/item/surgery/retractor))
+ user.visible_message("[user] cracks [src] open like an egg with [attacking_item]!")
stage++
return
if(2)
- if(istype(W,/obj/item/surgery/hemostat))
+ if(istype(attacking_item, /obj/item/surgery/hemostat))
if(contents.len)
var/obj/item/removing = pick(contents)
removing.forceMove(get_turf(user.loc))
if(!(user.l_hand && user.r_hand))
user.put_in_hands(removing)
- user.visible_message("[user] extracts [removing] from [src] with [W]!")
+ user.visible_message("[user] extracts [removing] from [src] with [attacking_item]!")
else
- user.visible_message("[user] fishes around fruitlessly in [src] with [W].")
+ user.visible_message("[user] fishes around fruitlessly in [src] with [attacking_item].")
return
..()
diff --git a/code/modules/organs/subtypes/machine.dm b/code/modules/organs/subtypes/machine.dm
index da0ef48748f..2599c8a844d 100644
--- a/code/modules/organs/subtypes/machine.dm
+++ b/code/modules/organs/subtypes/machine.dm
@@ -116,8 +116,8 @@
if(cell)
cell.emp_act(severity)
-/obj/item/organ/internal/cell/attackby(obj/item/W, mob/user)
- if(W.isscrewdriver())
+/obj/item/organ/internal/cell/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.isscrewdriver())
if(open)
open = FALSE
to_chat(user, SPAN_NOTICE("You screw the battery panel in place."))
@@ -125,7 +125,7 @@
open = TRUE
to_chat(user, SPAN_NOTICE("You unscrew the battery panel."))
- if(W.iscrowbar())
+ if(attacking_item.iscrowbar())
if(open)
if(cell)
user.put_in_hands(cell)
@@ -136,12 +136,12 @@
else
to_chat(user, SPAN_WARNING("You need to unscrew the battery panel first."))
- if(istype(W, /obj/item/cell))
+ if(istype(attacking_item, /obj/item/cell))
if(open)
if(cell)
to_chat(user, SPAN_WARNING("There is a power cell already installed."))
- else if(user.unEquip(W, src))
- replace_cell(W)
+ else if(user.unEquip(attacking_item, src))
+ replace_cell(attacking_item)
to_chat(user, SPAN_NOTICE("You insert \the [cell]."))
else
to_chat(user, SPAN_WARNING("You need to unscrew the battery panel first."))
@@ -237,12 +237,12 @@
. += SPAN_NOTICE("Ownership Info: [ownership_info]")
. += SPAN_NOTICE("Citizenship Info: [citizenship_info]")
-/obj/item/organ/internal/ipc_tag/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/ipc_tag_scanner))
+/obj/item/organ/internal/ipc_tag/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/ipc_tag_scanner))
if(src.loc != user)
to_chat(user, SPAN_WARNING("You can't scan \the [src] if it's not on your person!"))
return
- var/obj/item/ipc_tag_scanner/S = W
+ var/obj/item/ipc_tag_scanner/S = attacking_item
if(!S.powered)
to_chat(user, SPAN_WARNING("\The [src] reads, \"Scanning failure, please submit scanner for repairs.\""))
return
@@ -254,31 +254,38 @@
if(src.loc != user)
to_chat(user, SPAN_WARNING("You can only modify \the [src] if it's on your person!"))
return
+
var/static/list/modification_options = list("Serial Number", "Ownership Status", "Citizenship")
- var/choice = input(user, "How do you want to modify the IPC tag?", "IPC Tag Modification") as null|anything in modification_options
- if(choice)
- if(choice == "Serial Number")
- var/serial_selection = alert(user, "In what way do you want to modify the serial number?", "Serial Number Selection", "Auto Generation", "Manual Input", "Cancel")
+ var/choice = tgui_input_list(user, "How do you want to modify the IPC tag?", "IPC Tag Modification", modification_options)
+ switch(choice)
+
+ if("Serial Number")
+ var/serial_selection = tgui_input_list(user, "In what way do you want to modify the serial number?","Serial Number Selection",
+ list("Auto Generation", "Manual Input", "Cancel"), default = "Cancel")
if(serial_selection != "Cancel")
if(serial_selection == "Auto Generation")
- var/auto_generation_choice = alert(user, "Do you wish for the IPC tag to automatically generate its serial number based on the IPCs name?", "Serial Autogeneration", "Yes", "No")
+ var/auto_generation_choice = tgui_input_list(user, "Do you wish for the IPC tag to automatically generate its serial number based on the IPCs name?", "Serial Autogeneration",
+ list("Yes", "No"), "No")
if(auto_generation_choice == "Yes")
auto_generate = TRUE
else
auto_generate = FALSE
+
if(serial_selection == "Manual Input")
- var/new_serial = input(user, "What do you wish for the new serial number to be? (Limit of 12 characters)", "Serial Number Modification", serial_number) as text|null
+ var/new_serial = tgui_input_text(user, "What do you wish for the new serial number to be? (Limit of 12 characters)", "Serial Number Modification", serial_number, 12)
new_serial = uppertext(dd_limittext(new_serial, 12))
if(new_serial)
serial_number = new_serial
auto_generate = FALSE
- if(choice == "Ownership Status")
+
+ if("Ownership Status")
var/static/list/ownership_options = list(IPC_OWNERSHIP_COMPANY, IPC_OWNERSHIP_PRIVATE, IPC_OWNERSHIP_SELF)
- var/new_ownership = input(user, "What do you wish for the new ownership status to be?", "Ownership Status Modification") as null|anything in ownership_options
+ var/new_ownership = tgui_input_list(user, "What do you wish for the new ownership status to be?", "Ownership Status Modification", ownership_options)
if(new_ownership)
ownership_info = new_ownership
- if(choice == "Citizenship")
- var/datum/citizenship/citizenship = input(user, "What do you wish for the new citizenship setting to be?", "Citizenship Setting Modification") as null|anything in SSrecords.citizenships
+
+ if("Citizenship")
+ var/datum/citizenship/citizenship = tgui_input_list(user, "What do you wish for the new citizenship setting to be?", "Citizenship Setting Modification", SSrecords.citizenships)
if(citizenship)
citizenship_info = citizenship
else
diff --git a/code/modules/organs/subtypes/vaurca.dm b/code/modules/organs/subtypes/vaurca.dm
index 59bc730e16e..3d356ae5222 100644
--- a/code/modules/organs/subtypes/vaurca.dm
+++ b/code/modules/organs/subtypes/vaurca.dm
@@ -357,12 +357,12 @@
descriptive = "cold"
. += "\The [src] feels [descriptive]."
-/obj/item/organ/internal/vaurca/preserve/attackby(obj/item/W as obj, mob/user as mob)
+/obj/item/organ/internal/vaurca/preserve/attackby(obj/item/attacking_item, mob/user)
..()
var/obj/icon = src
- if ((istype(W, /obj/item/device/analyzer)) && get_dist(user, src) <= 1)
- user.visible_message("[user] has used [W] on [icon2html(icon, viewers(get_turf(user)))] [src].")
+ if ((istype(attacking_item, /obj/item/device/analyzer)) && get_dist(user, src) <= 1)
+ user.visible_message("[user] has used [attacking_item] on [icon2html(icon, viewers(get_turf(user)))] [src].")
var/pressure = air_contents.return_pressure()
manipulated_by = user.real_name //This person is aware of the contents of the tank.
@@ -377,8 +377,8 @@
else
to_chat(user, "Tank is empty!")
src.add_fingerprint(user)
- else if (istype(W,/obj/item/toy/balloon))
- var/obj/item/toy/balloon/B = W
+ else if (istype(attacking_item, /obj/item/toy/balloon))
+ var/obj/item/toy/balloon/B = attacking_item
B.blow(src)
src.add_fingerprint(user)
diff --git a/code/modules/overmap/contacts/contact_sensors.dm b/code/modules/overmap/contacts/contact_sensors.dm
index 0962ceb53a3..3e11a8bcced 100644
--- a/code/modules/overmap/contacts/contact_sensors.dm
+++ b/code/modules/overmap/contacts/contact_sensors.dm
@@ -169,9 +169,9 @@
if(!record.pinged)
addtimer(CALLBACK(record, PROC_REF(ping)), time_delay)
-/obj/machinery/computer/ship/sensors/attackby(var/obj/item/I, var/mob/user)
+/obj/machinery/computer/ship/sensors/attackby(obj/item/attacking_item, mob/user)
. = ..()
- var/obj/item/device/multitool/P = I
+ var/obj/item/device/multitool/P = attacking_item
if(!istype(P))
return
var/obj/item/ship_tracker/tracker = P.get_buffer()
diff --git a/code/modules/overmap/exoplanets/decor/_flora.dm b/code/modules/overmap/exoplanets/decor/_flora.dm
index 202a605d3b6..99e485dba20 100644
--- a/code/modules/overmap/exoplanets/decor/_flora.dm
+++ b/code/modules/overmap/exoplanets/decor/_flora.dm
@@ -15,8 +15,8 @@
/obj/structure/flora/proc/can_dig()
return FALSE
-/obj/structure/flora/attackby(obj/item/I, mob/user)
- if(I.is_shovel() && can_dig())
+/obj/structure/flora/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.is_shovel() && can_dig())
dig_up(user)
return
..()
diff --git a/code/modules/overmap/exoplanets/decor/_turfs.dm b/code/modules/overmap/exoplanets/decor/_turfs.dm
index ec868c8516f..02ed29fcc0c 100644
--- a/code/modules/overmap/exoplanets/decor/_turfs.dm
+++ b/code/modules/overmap/exoplanets/decor/_turfs.dm
@@ -35,23 +35,23 @@
// if not on an exoplanet, instead just keep the default or mapped in atmos
..()
-/turf/simulated/floor/exoplanet/attackby(obj/item/C, mob/user)
- if(diggable && istype(C,/obj/item/shovel))
+/turf/simulated/floor/exoplanet/attackby(obj/item/attacking_item, mob/user)
+ if(diggable && istype(attacking_item, /obj/item/shovel))
visible_message("\The [user] starts digging \the [src]")
- if(C.use_tool(src, user, 50, volume = 50))
+ if(attacking_item.use_tool(src, user, 50, volume = 50))
to_chat(user,"You dig a deep pit.")
new /obj/structure/pit(src)
diggable = 0
else
to_chat(user,"You stop shoveling.")
- else if(istype(C, /obj/item/stack/tile))
- var/obj/item/stack/tile/T = C
+ else if(istype(attacking_item, /obj/item/stack/tile))
+ var/obj/item/stack/tile/T = attacking_item
if(T.use(1))
playsound(src, 'sound/items/Deconstruct.ogg', 80, 1)
ChangeTurf(/turf/simulated/floor, FALSE, FALSE, FALSE, TRUE)
- else if(diggable && istype(C,/obj/item/material/minihoe))
+ else if(diggable && istype(attacking_item,/obj/item/material/minihoe))
visible_message(SPAN_NOTICE("\The [user] starts clearing \the [src]"))
- if(C.use_tool(src, user, 50, volume = 50))
+ if(attacking_item.use_tool(src, user, 50, volume = 50))
to_chat(user, SPAN_NOTICE("You make a small clearing."))
new /obj/structure/clearing(src)
diggable = FALSE
@@ -105,8 +105,8 @@
icon_state = "seashallow"
footstep_sound = /singleton/sound_category/water_footstep
-/turf/simulated/floor/exoplanet/water/shallow/attackby(obj/item/O, var/mob/living/user)
- var/obj/item/reagent_containers/RG = O
+/turf/simulated/floor/exoplanet/water/shallow/attackby(obj/item/attacking_item, mob/user)
+ var/obj/item/reagent_containers/RG = attacking_item
if (reagent_type && istype(RG) && RG.is_open_container() && RG.reagents)
RG.reagents.add_reagent(reagent_type, min(RG.volume - RG.reagents.total_volume, RG.amount_per_transfer_from_this))
user.visible_message("[user] fills \the [RG] from \the [src].","You fill \the [RG] from \the [src].")
diff --git a/code/modules/overmap/exoplanets/decor/flora/_bush.dm b/code/modules/overmap/exoplanets/decor/flora/_bush.dm
index 0c5fcf8d1b4..a07dc1299df 100644
--- a/code/modules/overmap/exoplanets/decor/flora/_bush.dm
+++ b/code/modules/overmap/exoplanets/decor/flora/_bush.dm
@@ -9,10 +9,10 @@
. = ..()
icon_state = "snowbush[rand(1, 6)]"
-/obj/structure/flora/bush/attackby(var/obj/item/W, var/mob/user)
- if(istype(W, /obj/item/material/scythe))
+/obj/structure/flora/bush/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/material/scythe))
shake_animation()
- if(W.use_tool(src, user, 50, volume = 50))
+ if(attacking_item.use_tool(src, user, 50, volume = 50))
if(prob(50))
new /obj/item/stack/material/wood(get_turf(src), 2)
if(prob(40))
@@ -24,9 +24,9 @@
to_chat(user, SPAN_NOTICE("You find some seeds as you hack the bush away."))
to_chat(user, SPAN_NOTICE("You slice at the bush!"))
qdel(src)
- else if(istype(W, /obj/item/material/hatchet))
+ else if(istype(attacking_item, /obj/item/material/hatchet))
shake_animation()
- if(W.use_tool(src, user, 50, volume = 50))
+ if(attacking_item.use_tool(src, user, 50, volume = 50))
to_chat(user, SPAN_NOTICE("You chop at the bush!"))
qdel(src)
diff --git a/code/modules/overmap/exoplanets/decor/flora/_tree.dm b/code/modules/overmap/exoplanets/decor/flora/_tree.dm
index 6bd7c6f1af9..2cf7b645ba1 100644
--- a/code/modules/overmap/exoplanets/decor/flora/_tree.dm
+++ b/code/modules/overmap/exoplanets/decor/flora/_tree.dm
@@ -23,14 +23,14 @@
if(0.76 to 0.95)
desc += " Looks like someone just started cutting it down."
-/obj/structure/flora/tree/attackby(obj/item/I, mob/user)
- if(I.can_woodcut())
+/obj/structure/flora/tree/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.can_woodcut())
if(cutting)
return
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
cutting = TRUE
- if(istype(I, /obj/item/material/twohanded/chainsaw))
- var/obj/item/material/twohanded/chainsaw/C = I
+ if(istype(attacking_item, /obj/item/material/twohanded/chainsaw))
+ var/obj/item/material/twohanded/chainsaw/C = attacking_item
if(C.powered)
user.visible_message(SPAN_NOTICE("\The [user] begins cutting down \the [src]..."), SPAN_NOTICE("You start cutting down \the [src]..."))
playsound(get_turf(user), 'sound/weapons/saw/chainsawhit.ogg', 60, 1)
@@ -41,15 +41,15 @@
to_chat(user, SPAN_WARNING("Try turning \the [C] on first!"))
cutting = FALSE
return
- else if(do_after(user, I.w_class * 5)) //Small windup
+ else if(do_after(user, attacking_item.w_class * 5)) //Small windup
user.do_attack_animation(src)
shake_animation()
playsound(get_turf(src), 'sound/effects/woodcutting.ogg', 50, 1)
- chop_health -= I.force
+ chop_health -= attacking_item.force
update_desc()
if(prob(20))
user.visible_message(SPAN_NOTICE("\The [user] chops at \the [src]."), SPAN_NOTICE("You chop at \the [src]."), SPAN_NOTICE("You hear someone chopping wood."))
- if(prob(I.force/3))
+ if(prob(attacking_item.force/3))
var/list/valid_turfs = list()
for(var/turf/T in circle_range(src, 1))
if(T.contains_dense_objects())
@@ -136,17 +136,17 @@
anchored = FALSE
icon_state = "timber"
-/obj/structure/flora/stump/log/attackby(obj/item/I, mob/user)
- if(I.can_woodcut())
+/obj/structure/flora/stump/log/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.can_woodcut())
if(cutting)
return
cutting = TRUE
- var/chopsound = istype(I, /obj/item/material/twohanded/chainsaw) ? 'sound/weapons/saw/chainsawhit.ogg' : 'sound/effects/woodcutting.ogg'
+ var/chopsound = istype(attacking_item, /obj/item/material/twohanded/chainsaw) ? 'sound/weapons/saw/chainsawhit.ogg' : 'sound/effects/woodcutting.ogg'
playsound(get_turf(user), chopsound, 50, 1)
user.visible_message(SPAN_NOTICE("\The [user] begins chopping \the [src] into log sections."), SPAN_NOTICE("You begin chopping \the [src] into log sections."))
var/chopspeed = 1
- if(istype(I, /obj/item/material/twohanded))
- var/obj/item/material/twohanded/W = I
+ if(istype(attacking_item, /obj/item/material/twohanded))
+ var/obj/item/material/twohanded/W = attacking_item
chopspeed = W.wielded ? 2 : 1
if(do_after(user, 100 / chopspeed))
user.visible_message(SPAN_NOTICE("\The [user] chops \the [src] into log sections."), SPAN_NOTICE("You chop \the [src] into log sections."))
diff --git a/code/modules/overmap/exoplanets/decor/flora/crystal.dm b/code/modules/overmap/exoplanets/decor/flora/crystal.dm
index 80de857e72e..88a72dc24e2 100644
--- a/code/modules/overmap/exoplanets/decor/flora/crystal.dm
+++ b/code/modules/overmap/exoplanets/decor/flora/crystal.dm
@@ -9,7 +9,7 @@
. = ..()
icon_state = "gem[rand(1,2)]"
-/obj/structure/flora/tree/crystal/attackby(obj/item/I, mob/user)
+/obj/structure/flora/tree/crystal/attackby(obj/item/attacking_item, mob/user)
return TRUE // could probably make this mineable but I'm lazy
/obj/structure/flora/rock/spire
diff --git a/code/modules/overmap/exoplanets/decor/flora/potted.dm b/code/modules/overmap/exoplanets/decor/flora/potted.dm
index d8af17a4fb9..1b867695e27 100644
--- a/code/modules/overmap/exoplanets/decor/flora/potted.dm
+++ b/code/modules/overmap/exoplanets/decor/flora/potted.dm
@@ -28,22 +28,22 @@
death()
return ..()
-/obj/structure/flora/pottedplant/attackby(obj/item/W, mob/user)
+/obj/structure/flora/pottedplant/attackby(obj/item/attacking_item, mob/user)
if(!ishuman(user))
return
- if(istype(W, /obj/item/holder))
+ if(istype(attacking_item, /obj/item/holder))
return //no hiding mobs in there
- user.visible_message("[user] begins digging around inside of \the [src].", "You begin digging around in \the [src], trying to hide \the [W].")
+ user.visible_message("[user] begins digging around inside of \the [src].", "You begin digging around in \the [src], trying to hide \the [attacking_item].")
playsound(loc, 'sound/effects/plantshake.ogg', 50, 1)
if(do_after(user, 20, src))
if(!stored_item)
- if(W.w_class <= ITEMSIZE_NORMAL)
- user.drop_from_inventory(W,src)
- stored_item = W
- to_chat(user,"You hide \the [W] in [src].")
+ if(attacking_item.w_class <= ITEMSIZE_NORMAL)
+ user.drop_from_inventory(attacking_item, src)
+ stored_item = attacking_item
+ to_chat(user,"You hide \the [attacking_item] in [src].")
return
else
- to_chat(user,"\The [W] can't be hidden in [src], it's too big.")
+ to_chat(user,"\The [attacking_item] can't be hidden in [src], it's too big.")
return
else
to_chat(user,"There is something hidden in [src].")
diff --git a/code/modules/overmap/exoplanets/decor/flora/snow.dm b/code/modules/overmap/exoplanets/decor/flora/snow.dm
index 99ccc98c243..65afb79d3fe 100644
--- a/code/modules/overmap/exoplanets/decor/flora/snow.dm
+++ b/code/modules/overmap/exoplanets/decor/flora/snow.dm
@@ -5,15 +5,15 @@
icon = 'icons/obj/flora/snowflora.dmi'
density = FALSE
-/obj/structure/flora/grass/attackby(var/obj/item/W, var/mob/user)
- if(istype(W, /obj/item/material/scythe))
+/obj/structure/flora/grass/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/material/scythe))
shake_animation()
- if(W.use_tool(src, user, 10, volume = 50))
+ if(attacking_item.use_tool(src, user, 10, volume = 50))
to_chat(user, SPAN_NOTICE("You slice the grass away with the scythe!"))
qdel(src)
- else if(istype(W, /obj/item/material/hatchet))
+ else if(istype(attacking_item, /obj/item/material/hatchet))
shake_animation()
- if(W.use_tool(src, user, 50, volume = 50))
+ if(attacking_item.use_tool(src, user, 50, volume = 50))
to_chat(user, SPAN_NOTICE("You chop at the grass!"))
qdel(src)
diff --git a/code/modules/overmap/exoplanets/decor/objs/clearing.dm b/code/modules/overmap/exoplanets/decor/objs/clearing.dm
index 1b86bce766a..bf46acc41fd 100644
--- a/code/modules/overmap/exoplanets/decor/objs/clearing.dm
+++ b/code/modules/overmap/exoplanets/decor/objs/clearing.dm
@@ -18,10 +18,10 @@
/turf/simulated/wall
)
-/obj/structure/clearing/attackby(obj/item/W, mob/user)
- if(istype(W,/obj/item/material/minihoe))
+/obj/structure/clearing/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/material/minihoe))
visible_message(SPAN_NOTICE("\The [user] starts adjusting the \the [src]"))
- if(W.use_tool(src, user, 50, volume = 50))
+ if(attacking_item.use_tool(src, user, 50, volume = 50))
visible_message(SPAN_NOTICE("\The [user] adjusts \the [src]!"))
qdel(src)
else
diff --git a/code/modules/overmap/exoplanets/decor/objs/pit.dm b/code/modules/overmap/exoplanets/decor/objs/pit.dm
index b5a42fd43b6..cd76f5b71e9 100644
--- a/code/modules/overmap/exoplanets/decor/objs/pit.dm
+++ b/code/modules/overmap/exoplanets/decor/objs/pit.dm
@@ -8,10 +8,10 @@
anchored = TRUE
var/open = 1
-/obj/structure/pit/attackby(obj/item/W, mob/user)
- if(istype(W,/obj/item/shovel))
+/obj/structure/pit/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/shovel))
visible_message("\The [user] starts [open ? "filling" : "digging open"] \the [src]")
- if(W.use_tool(src, user, 50, volume = 50))
+ if(attacking_item.use_tool(src, user, 50, volume = 50))
visible_message("\The [user] [open ? "fills" : "digs open"] \the [src]!")
if(open)
close(user)
@@ -20,14 +20,14 @@
else
to_chat(user, "You stop shoveling.")
return
- if (!open && istype(W,/obj/item/stack/material/wood))
+ if (!open && istype(attacking_item, /obj/item/stack/material/wood))
if(locate(/obj/structure/gravemarker) in src.loc)
to_chat(user, "There's already a grave marker here.")
else
visible_message("\The [user] starts making a grave marker on top of \the [src]")
if( do_after(user, 50) )
visible_message("\The [user] finishes the grave marker")
- var/obj/item/stack/material/wood/plank = W
+ var/obj/item/stack/material/wood/plank = attacking_item
plank.use(1)
new/obj/structure/gravemarker(src.loc)
else
@@ -178,14 +178,14 @@
var/nam = random_name(MALE, SPECIES_HUMAN)
message = "Here lies [nam]."
-/obj/structure/gravemarker/attackby(obj/item/W, mob/user)
- if(istype(W,/obj/item/material/hatchet))
- visible_message("\The [user] starts hacking away at \the [src] with \the [W].")
+/obj/structure/gravemarker/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/material/hatchet))
+ visible_message("\The [user] starts hacking away at \the [src] with \the [attacking_item].")
if(!do_after(user, 30))
visible_message("\The [user] hacks \the [src] apart.")
new /obj/item/stack/material/wood(src)
qdel(src)
- if(istype(W,/obj/item/pen))
+ if(istype(attacking_item, /obj/item/pen))
var/msg = sanitize(input(user, "What should it say?", "Grave marker", message) as text|null)
if(msg)
message = msg
diff --git a/code/modules/overmap/exoplanets/decor/turfs/water.dm b/code/modules/overmap/exoplanets/decor/turfs/water.dm
index b6fb0fcc404..9b36935b17b 100644
--- a/code/modules/overmap/exoplanets/decor/turfs/water.dm
+++ b/code/modules/overmap/exoplanets/decor/turfs/water.dm
@@ -22,8 +22,8 @@
footstep_sound = /singleton/sound_category/water_footstep
var/reagent_type = /singleton/reagent/water
-/turf/simulated/floor/exoplanet/water/shallow/attackby(obj/item/O, var/mob/living/user)
- var/obj/item/reagent_containers/RG = O
+/turf/simulated/floor/exoplanet/water/shallow/attackby(obj/item/attacking_item, mob/user)
+ var/obj/item/reagent_containers/RG = attacking_item
if (reagent_type && istype(RG) && RG.is_open_container() && RG.reagents)
RG.reagents.add_reagent(reagent_type, min(RG.volume - RG.reagents.total_volume, RG.amount_per_transfer_from_this))
user.visible_message("[user] fills \the [RG] from \the [src].","You fill \the [RG] from \the [src].")
diff --git a/code/modules/overmap/overmap_shuttle.dm b/code/modules/overmap/overmap_shuttle.dm
index 9845277acf2..7493e5b45b8 100644
--- a/code/modules/overmap/overmap_shuttle.dm
+++ b/code/modules/overmap/overmap_shuttle.dm
@@ -139,8 +139,8 @@
else
icon_state = icon_closed
-/obj/structure/fuel_port/attackby(obj/item/W, mob/user)
- if(W.iscrowbar())
+/obj/structure/fuel_port/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.iscrowbar())
if(opened)
to_chat(user, SPAN_NOTICE("You close \the [src]."))
playsound(src.loc, 'sound/effects/closet_close.ogg', 25, 0, -3)
@@ -149,12 +149,12 @@
to_chat(user, SPAN_NOTICE("You pry \the [src] open."))
playsound(src.loc, 'sound/effects/closet_open.ogg', 15, 1, -3)
opened = 1
- else if(istype(W,/obj/item/tank))
+ else if(istype(attacking_item, /obj/item/tank))
if(!opened)
to_chat(user, SPAN_NOTICE("\The [src] isn't open!"))
return
if(contents.len == 0)
- user.unEquip(W, TRUE, src)
+ user.unEquip(attacking_item, TRUE, src)
update_icon()
// Walls hide stuff inside them, but we want to be visible.
diff --git a/code/modules/overmap/ship_weaponry/_ship_ammo_loader.dm b/code/modules/overmap/ship_weaponry/_ship_ammo_loader.dm
index b2d65784baf..faaab9acc8b 100644
--- a/code/modules/overmap/ship_weaponry/_ship_ammo_loader.dm
+++ b/code/modules/overmap/ship_weaponry/_ship_ammo_loader.dm
@@ -41,23 +41,23 @@
if(damage >= max_damage)
qdel(src)
-/obj/machinery/ammunition_loader/attackby(obj/item/W, mob/user)
+/obj/machinery/ammunition_loader/attackby(obj/item/attacking_item, mob/user)
if(isliving(user))
var/mob/living/carbon/human/H = user
- if(istype(W, /obj/item/ship_ammunition))
- var/obj/item/ship_ammunition/SA = W
+ if(istype(attacking_item, /obj/item/ship_ammunition))
+ var/obj/item/ship_ammunition/SA = attacking_item
return load_ammo(SA, H)
if(ismech(user))
var/mob/living/heavy_vehicle/HV = user
- if(istype(W, /obj/item/mecha_equipment/clamp))
- var/obj/item/mecha_equipment/clamp/CL = W
+ if(istype(attacking_item, /obj/item/mecha_equipment/clamp))
+ var/obj/item/mecha_equipment/clamp/CL = attacking_item
if(!length(CL.carrying))
to_chat(user, SPAN_WARNING("\The [CL] is empty."))
return TRUE
if(istype(CL.carrying[1], /obj/item/ship_ammunition))
var/obj/item/ship_ammunition/SA = CL.carrying[1]
return load_ammo(SA, HV)
- if(istype(W, /obj/item/device/multitool))
+ if(istype(attacking_item, /obj/item/device/multitool))
to_chat(user, SPAN_NOTICE("You hook up the tester's wires to \the [src]: its identification tag is [weapon_id]."))
var/new_id = input(user, "Change the identification tag?", "Identification Tag", weapon_id)
if(length(new_id) && !use_check_and_message(user))
diff --git a/code/modules/overmap/ship_weaponry/_ship_ammunition.dm b/code/modules/overmap/ship_weaponry/_ship_ammunition.dm
index 9b9592eed78..4101df081c7 100644
--- a/code/modules/overmap/ship_weaponry/_ship_ammunition.dm
+++ b/code/modules/overmap/ship_weaponry/_ship_ammunition.dm
@@ -42,11 +42,11 @@
original_projectile = null
return ..()
-/obj/item/ship_ammunition/attackby(obj/item/I, mob/user)
- if(I.ispen())
- var/obj/item/pen/P = I
+/obj/item/ship_ammunition/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.ispen())
+ var/obj/item/pen/P = attacking_item
if(!use_check_and_message(user))
- var/friendly_message = sanitizeSafe(input(user, "What do you want to write on \the [src]?", "Personal Message"), 32)
+ var/friendly_message = sanitizeSafe( tgui_input_text(user, "What do you want to write on \the [src]?", "Personal Message", "", 32), 32 )
if(friendly_message)
written_message = friendly_message
visible_message(SPAN_NOTICE("[user] writes something on \the [src] with \the [P]."), SPAN_NOTICE("You leave a nice message on \the [src]!"))
@@ -97,10 +97,10 @@
if(prob(50) && ((ammunition_flags & SHIP_AMMO_FLAG_VERY_FRAGILE) || (ammunition_flags & SHIP_AMMO_FLAG_VULNERABLE)))
cookoff(FALSE)
-/obj/item/ship_ammunition/attackby(obj/item/I, mob/user)
+/obj/item/ship_ammunition/attackby(obj/item/attacking_item, mob/user)
. = ..()
- if(I.force > 10 && (ammunition_flags & SHIP_AMMO_FLAG_VERY_FRAGILE))
- log_and_message_admins("[user] has caused the cookoff of [src] by attacking it with [I]!", user)
+ if(attacking_item.force > 10 && (ammunition_flags & SHIP_AMMO_FLAG_VERY_FRAGILE))
+ log_and_message_admins("[user] has caused the cookoff of [src] by attacking it with [attacking_item]!", user)
cookoff(FALSE)
/obj/item/ship_ammunition/ex_act(severity)
diff --git a/code/modules/overmap/ship_weaponry/_ship_gun.dm b/code/modules/overmap/ship_weaponry/_ship_gun.dm
index e4127af9109..749f20438bc 100644
--- a/code/modules/overmap/ship_weaponry/_ship_gun.dm
+++ b/code/modules/overmap/ship_weaponry/_ship_gun.dm
@@ -92,8 +92,8 @@
. = ..()
. += get_damage_description()
-/obj/machinery/ship_weapon/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/device/multitool))
+/obj/machinery/ship_weapon/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/device/multitool))
to_chat(user, SPAN_NOTICE("You hook up the tester to \the [src]'s wires: its identification tag is [weapon_id]>."))
var/new_id = input(user, "Change the identification tag?", "Identification Tag", weapon_id) as text|null
if(length(new_id) && !use_check_and_message(user))
@@ -106,8 +106,8 @@
weapon_id = new_id
to_chat(user, SPAN_NOTICE("With some finicking, you change the identification tag to [new_id]."))
return TRUE
- if(istype(W, /obj/item/weldingtool) && damage)
- var/obj/item/weldingtool/WT = W
+ if(istype(attacking_item, /obj/item/weldingtool) && damage)
+ var/obj/item/weldingtool/WT = attacking_item
if(WT.get_fuel() >= 20)
user.visible_message(SPAN_NOTICE("[user] starts slowly welding kinks and holes in \the [src] back to working shape..."),
SPAN_NOTICE("You start welding kinks and holes back to working shape. This'll take a long while..."))
@@ -284,9 +284,9 @@
if(connected)
connected.attack_hand(user)
-/obj/structure/ship_weapon_dummy/attackby(obj/item/W, mob/user)
+/obj/structure/ship_weapon_dummy/attackby(obj/item/attacking_item, mob/user)
if(connected)
- connected.attackby(W, user)
+ connected.attackby(attacking_item, user)
/obj/structure/ship_weapon_dummy/hitby(atom/movable/AM, var/speed = THROWFORCE_SPEED_DIVISOR)
if(connected)
diff --git a/code/modules/overmap/ship_weaponry/weaponry/leviathan.dm b/code/modules/overmap/ship_weaponry/weaponry/leviathan.dm
index 82a2b0f5977..0b76cf038e7 100644
--- a/code/modules/overmap/ship_weaponry/weaponry/leviathan.dm
+++ b/code/modules/overmap/ship_weaponry/weaponry/leviathan.dm
@@ -260,13 +260,13 @@
LK = null
icon_state = "key_case-e"
-/obj/item/leviathan_case/attackby(obj/item/I, mob/user)
+/obj/item/leviathan_case/attackby(obj/item/attacking_item, mob/user)
. = ..()
if(use_check_and_message(user))
return
if(!LK && open)
- if(istype(I, /obj/item/leviathan_key))
- var/obj/item/leviathan_key/key = I
+ if(istype(attacking_item, /obj/item/leviathan_key))
+ var/obj/item/leviathan_key/key = attacking_item
user.visible_message(SPAN_NOTICE("[user] puts \the [key] back into \the [src]."))
LK = key
user.drop_from_inventory(key, src)
@@ -322,17 +322,17 @@
flick("safeguard_opening", src)
icon_state = "safeguard_open"
-/obj/machinery/leviathan_safeguard/attackby(obj/item/I, mob/user)
+/obj/machinery/leviathan_safeguard/attackby(obj/item/attacking_item, mob/user)
if(!opened || locked)
return
- if(istype(I, /obj/item/leviathan_key) && !key && !stat)
- var/obj/item/leviathan_key/LK = I
+ if(istype(attacking_item, /obj/item/leviathan_key) && !key && !stat)
+ var/obj/item/leviathan_key/LK = attacking_item
if(use_check_and_message(user))
return
if(do_after(user, 1 SECOND))
visible_message(SPAN_WARNING("[user] places \the [LK] inside \the [src]'s keyhole!"))
key = LK
- user.drop_from_inventory(I, src)
+ user.drop_from_inventory(attacking_item, src)
icon_state = "safeguard_open"
playsound(src, 'sound/effects/ship_weapons/levi_key_insert.ogg')
diff --git a/code/modules/overmap/ship_weaponry/weaponry/longbow_ammo.dm b/code/modules/overmap/ship_weaponry/weaponry/longbow_ammo.dm
index c7dc8b9cb70..f7fb387b138 100644
--- a/code/modules/overmap/ship_weaponry/weaponry/longbow_ammo.dm
+++ b/code/modules/overmap/ship_weaponry/weaponry/longbow_ammo.dm
@@ -9,19 +9,19 @@
var/obj/item/primer/primer
var/obj/item/warhead/longbow/warhead
-/obj/item/ship_ammunition/longbow/attackby(obj/item/I, mob/user)
+/obj/item/ship_ammunition/longbow/attackby(obj/item/attacking_item, mob/user)
if(ishuman(user))
var/mob/living/carbon/human/H = user
- if(istype(I, /obj/item/primer) && !primer)
- var/obj/item/primer/P = I
+ if(istype(attacking_item, /obj/item/primer) && !primer)
+ var/obj/item/primer/P = attacking_item
user.visible_message(SPAN_NOTICE("[H] starts connecting \the [P] to the casing..."), SPAN_NOTICE("You start connecting \the [P] to the casing..."))
if(do_after(H, 3 SECONDS))
visible_message(SPAN_NOTICE("You connect \the [P] to the casing!"), SPAN_NOTICE("[H] connects \the [P] to the casing!"))
H.drop_from_inventory(P)
add_primer(P)
playsound(src, 'sound/machines/rig/rig_deploy.ogg')
- if(istype(I, /obj/item/warhead) && !warhead)
- var/obj/item/warhead/W = I
+ if(istype(attacking_item, /obj/item/warhead) && !warhead)
+ var/obj/item/warhead/W = attacking_item
user.visible_message( SPAN_NOTICE("[H] starts connecting \the [W] to the casing..."), SPAN_NOTICE("You start connecting \the [W] to the casing..."))
if(do_after(H, 5 SECONDS))
visible_message(SPAN_NOTICE("You connect \the [W] to the casing!"), SPAN_NOTICE("[H] connects \the [W] to the casing!"))
@@ -145,9 +145,9 @@
if(P.damage > 5)
cookoff(TRUE)
-/obj/item/warhead/longbow/attackby(obj/item/I, mob/user)
+/obj/item/warhead/longbow/attackby(obj/item/attacking_item, mob/user)
. = ..()
- if(I.force > 10)
+ if(attacking_item.force > 10)
cookoff(FALSE)
/obj/item/warhead/longbow/ex_act(severity)
diff --git a/code/modules/overmap/ships/computers/helm.dm b/code/modules/overmap/ships/computers/helm.dm
index 8490741b2f8..67299ce97ac 100644
--- a/code/modules/overmap/ships/computers/helm.dm
+++ b/code/modules/overmap/ships/computers/helm.dm
@@ -43,17 +43,17 @@
PH.linked_helm = null
return ..()
-/obj/machinery/computer/ship/helm/attackby(obj/item/I, user)
- if(istype(I, /obj/item/clothing/head/helmet/pilot))
+/obj/machinery/computer/ship/helm/attackby(obj/item/attacking_item, user)
+ 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!"))
return
- var/obj/item/clothing/head/helmet/pilot/PH = I
- if(I in linked_helmets)
- to_chat(user, SPAN_NOTICE("You unlink \the [I] from \the [src]."))
+ var/obj/item/clothing/head/helmet/pilot/PH = attacking_item
+ if(attacking_item in linked_helmets)
+ to_chat(user, SPAN_NOTICE("You unlink \the [attacking_item] from \the [src]."))
PH.set_console(null)
else
- to_chat(user, SPAN_NOTICE("You link \the [I] to \the [src]."))
+ to_chat(user, SPAN_NOTICE("You link \the [attacking_item] to \the [src]."))
PH.set_console(src)
PH.set_hud_maptext("| Ship Status | [connected.x]-[connected.y] |
Speed: [connected.get_speed()] | Acceleration: [get_acceleration()]
ETA to Next Grid: [get_eta()]")
check_processing()
diff --git a/code/modules/overmap/ships/computers/sensors.dm b/code/modules/overmap/ships/computers/sensors.dm
index 434218447af..32fc4888ba6 100644
--- a/code/modules/overmap/ships/computers/sensors.dm
+++ b/code/modules/overmap/ships/computers/sensors.dm
@@ -409,11 +409,11 @@
base_icon_state = icon_state
return ..()
-/obj/machinery/shipsensors/attackby(obj/item/W, mob/user)
+/obj/machinery/shipsensors/attackby(obj/item/attacking_item, mob/user)
var/damage = max_health - health
- if(damage && W.iswelder())
+ if(damage && attacking_item.iswelder())
- var/obj/item/weldingtool/WT = W
+ var/obj/item/weldingtool/WT = attacking_item
if(!WT.isOn())
return
diff --git a/code/modules/overmap/ships/identification.dm b/code/modules/overmap/ships/identification.dm
index 48d5a8c57c3..102932d4392 100644
--- a/code/modules/overmap/ships/identification.dm
+++ b/code/modules/overmap/ships/identification.dm
@@ -22,12 +22,12 @@
if (istype(my_sector, /obj/effect/overmap/visitable))
attempt_hook_up(my_sector)
-/obj/machinery/iff_beacon/attackby(obj/item/O, mob/user)
- if(default_deconstruction_screwdriver(user, O))
+/obj/machinery/iff_beacon/attackby(obj/item/attacking_item, mob/user)
+ if(default_deconstruction_screwdriver(user, attacking_item))
return TRUE
if(panel_open)
- if(O.ismultitool() || O.iswirecutter())
+ if(attacking_item.ismultitool() || attacking_item.iswirecutter())
if(panel_open)
wires.interact(user)
else
diff --git a/code/modules/paperwork/clipboard.dm b/code/modules/paperwork/clipboard.dm
index 15f6fa417f2..7961a94fd38 100644
--- a/code/modules/paperwork/clipboard.dm
+++ b/code/modules/paperwork/clipboard.dm
@@ -50,19 +50,19 @@
to_add += "clipboard_over"
add_overlay(to_add)
-/obj/item/clipboard/attackby(obj/item/W as obj, mob/user as mob)
+/obj/item/clipboard/attackby(obj/item/attacking_item, mob/user)
- if(istype(W, /obj/item/paper) || istype(W, /obj/item/photo))
- user.drop_from_inventory(W,src)
- if(istype(W, /obj/item/paper))
- toppaper = W
+ if(istype(attacking_item, /obj/item/paper) || istype(attacking_item, /obj/item/photo))
+ user.drop_from_inventory(attacking_item, src)
+ if(istype(attacking_item, /obj/item/paper))
+ toppaper = attacking_item
r_contents = reverselist(contents)
- to_chat(user, "You clip the [W] onto \the [src].")
+ to_chat(user, "You clip the [attacking_item] onto \the [src].")
- else if(istype(toppaper) && W.ispen())
- toppaper.attackby(W, user)
+ else if(istype(toppaper) && attacking_item.ispen())
+ toppaper.attackby(attacking_item, user)
- else if(W.ispen())
+ else if(attacking_item.ispen())
add_pen(user)
if(ui_open)
diff --git a/code/modules/paperwork/faxmachine.dm b/code/modules/paperwork/faxmachine.dm
index d16be2a598d..7501399c988 100644
--- a/code/modules/paperwork/faxmachine.dm
+++ b/code/modules/paperwork/faxmachine.dm
@@ -76,7 +76,7 @@ var/list/admin_departments
ui = new(user, src, "Fax", "Fax Machine", 400, 500)
ui.open()
-/obj/machinery/photocopier/faxmachine/attackby(obj/item/O as obj, mob/user as mob)
+/obj/machinery/photocopier/faxmachine/attackby(obj/item/attacking_item, mob/user)
. = ..()
SStgui.update_uis(src)
diff --git a/code/modules/paperwork/filingcabinet.dm b/code/modules/paperwork/filingcabinet.dm
index 66e20e28d85..42e387e7b3a 100644
--- a/code/modules/paperwork/filingcabinet.dm
+++ b/code/modules/paperwork/filingcabinet.dm
@@ -54,21 +54,21 @@
I.forceMove(src)
-/obj/structure/filingcabinet/attackby(obj/item/P, mob/user)
- if(is_type_in_list(P, accepted_items))
- to_chat(user, "You put [P] in [src].")
- user.drop_from_inventory(P,src)
- flick("[initial(icon_state)]-open",src)
+/obj/structure/filingcabinet/attackby(obj/item/attacking_item, mob/user)
+ if(is_type_in_list(attacking_item, accepted_items))
+ to_chat(user, "You put [attacking_item] in [src].")
+ user.drop_from_inventory(attacking_item, src)
+ flick("[initial(icon_state)]-open", src)
playsound(loc, 'sound/bureaucracy/filingcabinet.ogg', 50, 1)
sleep(40)
icon_state = initial(icon_state)
updateUsrDialog()
- else if(P.iswrench())
- playsound(loc, P.usesound, 50, 1)
+ else if(attacking_item.iswrench())
+ playsound(loc, attacking_item.usesound, 50, 1)
anchored = !anchored
to_chat(user, "You [anchored ? "wrench" : "unwrench"] \the [src].")
else
- to_chat(user, "You can't put [P] in [src]!")
+ to_chat(user, "You can't put [attacking_item] in [src]!")
/obj/structure/filingcabinet/attack_hand(mob/user as mob)
diff --git a/code/modules/paperwork/folders.dm b/code/modules/paperwork/folders.dm
index 5199a2886ee..0fac3cd53f8 100644
--- a/code/modules/paperwork/folders.dm
+++ b/code/modules/paperwork/folders.dm
@@ -39,13 +39,13 @@
add_overlay("folder_paper")
return
-/obj/item/folder/attackby(obj/item/W as obj, mob/user as mob)
- if(istype(W, /obj/item/paper) || istype(W, /obj/item/photo) || istype(W, /obj/item/paper_bundle) || istype(W, /obj/item/sample))
- user.drop_from_inventory(W,src)
- to_chat(user, "You put the [W] into \the [src].")
+/obj/item/folder/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/paper) || istype(attacking_item, /obj/item/photo) || istype(attacking_item, /obj/item/paper_bundle) || istype(attacking_item, /obj/item/sample))
+ user.drop_from_inventory(attacking_item, src)
+ to_chat(user, "You put the [attacking_item] into \the [src].")
update_icon()
- else if(W.ispen())
- var/n_name = sanitizeSafe(input(usr, "What would you like to label the folder?", "Folder Labelling", null) as text, MAX_NAME_LEN)
+ else if(attacking_item.ispen())
+ var/n_name = sanitizeSafe( tgui_input_text(user, "What would you like to label the folder?", "Folder Labelling", max_length = MAX_NAME_LEN), MAX_NAME_LEN )
if(Adjacent(user) && user.stat == 0)
name = "folder[(n_name ? text("- '[n_name]'") : null)]"
return
@@ -184,7 +184,7 @@
else
..()
-/obj/item/folder/envelope/attackby(obj/item/W, mob/user)
+/obj/item/folder/envelope/attackby(obj/item/attacking_item, mob/user)
if(sealed)
sealcheck(user)
return
diff --git a/code/modules/paperwork/journal.dm b/code/modules/paperwork/journal.dm
index 68742e59e7e..ad4daba8184 100644
--- a/code/modules/paperwork/journal.dm
+++ b/code/modules/paperwork/journal.dm
@@ -61,14 +61,14 @@
var/obj/item/folder/embedded/E = indices[selected_folder]
E.attack_self(user)
-/obj/item/journal/attackby(obj/item/I, mob/user)
- if(is_type_in_list(I, insertables))
+/obj/item/journal/attackby(obj/item/attacking_item, mob/user)
+ if(is_type_in_list(attacking_item, insertables))
if(!open)
to_chat(user, SPAN_WARNING("You can't put anything into \the [src] while it's closed."))
return
var/obj/item/folder/embedded/E
var/list/options = LAZYLEN(indices) ? indices + "New Index" : list("New Index")
- var/selected_folder = input(user, "Select an index to insert this into.", "Index Selection") as null|anything in options
+ var/selected_folder = tgui_input_list(user, "Select an index to insert this into.", "Index Selection", options)
if(isnull(selected_folder))
return
if(selected_folder == "New Index")
@@ -77,13 +77,13 @@
E = indices[selected_folder]
if(!E)
return
- user.drop_from_inventory(I, E)
- to_chat(user, SPAN_NOTICE("You put \the [I] into \the [E] index in \the [src]."))
+ user.drop_from_inventory(attacking_item, E)
+ to_chat(user, SPAN_NOTICE("You put \the [attacking_item] into \the [E] index in \the [src]."))
update_icon()
return
- if(I.ispen())
+ if(attacking_item.ispen())
if(!open)
- to_chat(user, SPAN_NOTICE("You open \the [src] with \the [I]."))
+ to_chat(user, SPAN_NOTICE("You open \the [src] with \the [attacking_item]."))
open = !open
update_icon()
return
diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm
index 5ebb6498a82..331faace0de 100644
--- a/code/modules/paperwork/paper.dm
+++ b/code/modules/paperwork/paper.dm
@@ -575,17 +575,17 @@
if(T.loc == user || T.Adjacent(user))
. = TRUE
-/obj/item/paper/attackby(var/obj/item/P, mob/user)
+/obj/item/paper/attackby(obj/item/attacking_item, mob/user)
..()
- if(istype(P, /obj/item/tape_roll) && !istype(src, /obj/item/paper/business_card))
- var/obj/item/tape_roll/tape = P
+ if(istype(attacking_item, /obj/item/tape_roll) && !istype(src, /obj/item/paper/business_card))
+ var/obj/item/tape_roll/tape = attacking_item
tape.stick(src, user)
return
- if(istype(P, /obj/item/paper) || istype(P, /obj/item/photo))
- if (istype(P, /obj/item/paper/carbon))
- var/obj/item/paper/carbon/C = P
+ if(istype(attacking_item, /obj/item/paper) || istype(attacking_item, /obj/item/photo))
+ if (istype(attacking_item, /obj/item/paper/carbon))
+ var/obj/item/paper/carbon/C = attacking_item
if (!C.iscopy && !C.copied)
to_chat(user, SPAN_NOTICE("Take off the carbon copy first."))
add_fingerprint(user)
@@ -593,9 +593,9 @@
var/obj/item/paper_bundle/B = new(src.loc)
if (name != initial(name))
B.name = name
- else if (P.name != initial(P.name))
- B.name = P.name
- user.drop_from_inventory(P,B)
+ else if (attacking_item.name != initial(attacking_item.name))
+ B.name = attacking_item.name
+ user.drop_from_inventory(attacking_item,B)
//TODO: Look into this stuff
if (istype(user, /mob/living/carbon/human))
var/mob/living/carbon/human/h_user = user
@@ -624,20 +624,20 @@
src.forceMove(get_turf(h_user))
if(h_user.client) h_user.client.screen -= src
h_user.put_in_hands(B)
- to_chat(user, SPAN_NOTICE("You clip the [P.name] to [(src.name == "paper") ? "the paper" : src.name]."))
+ to_chat(user, SPAN_NOTICE("You clip the [attacking_item.name] to [(src.name == "paper") ? "the paper" : src.name]."))
src.forceMove(B)
B.pages.Add(src)
- B.pages.Add(P)
+ B.pages.Add(attacking_item)
B.amount = 2
B.update_icon()
- else if(P.ispen())
+ else if(attacking_item.ispen())
if(icon_state == "scrap")
to_chat(user, SPAN_WARNING("The [src] is too crumpled to write on."))
return
- var/obj/item/pen/robopen/RP = P
+ var/obj/item/pen/robopen/RP = attacking_item
if ( istype(RP) && RP.mode == 2 )
RP.RenamePaper(user,src)
else
@@ -647,16 +647,16 @@
paper_win.open()
return
- else if(istype(P, /obj/item/stamp) || istype(P, /obj/item/clothing/ring/seal))
- if((!in_range(src, usr) && loc != user && !( istype(loc, /obj/item/clipboard) ) && loc.loc != user && user.get_active_hand() != P))
+ else if(istype(attacking_item, /obj/item/stamp) || istype(attacking_item, /obj/item/clothing/ring/seal))
+ if((!in_range(src, usr) && loc != user && !( istype(loc, /obj/item/clipboard) ) && loc.loc != user && user.get_active_hand() != attacking_item))
return
- stamps += (stamps=="" ? "
" : "
") + "This paper has been stamped with the [P.name]."
+ stamps += (stamps=="" ? "
" : "
") + "This paper has been stamped with the [attacking_item.name]."
var/image/stampoverlay = image('icons/obj/bureaucracy.dmi')
var/x
var/y
- if(istype(P, /obj/item/stamp/captain) || istype(P, /obj/item/stamp/centcomm))
+ if(istype(attacking_item, /obj/item/stamp/captain) || istype(attacking_item, /obj/item/stamp/centcomm))
x = rand(-2, 0)
y = rand(-1, 2)
else
@@ -669,19 +669,19 @@
if(!ico)
ico = new
- ico += "paper_[P.icon_state]"
- stampoverlay.icon_state = "paper_[P.icon_state]"
+ ico += "paper_[attacking_item.icon_state]"
+ stampoverlay.icon_state = "paper_[attacking_item.icon_state]"
if(!stamped)
stamped = new
- stamped += P.type
+ stamped += attacking_item.type
add_overlay(stampoverlay)
playsound(src, 'sound/bureaucracy/stamp.ogg', 50, 1)
- to_chat(user, SPAN_NOTICE("You stamp the paper with \the [P]."))
+ to_chat(user, SPAN_NOTICE("You stamp the paper with \the [attacking_item]."))
- else if(P.isFlameSource())
- burnpaper(P, user)
+ else if(attacking_item.isFlameSource())
+ burnpaper(attacking_item, user)
update_icon()
add_fingerprint(user)
diff --git a/code/modules/paperwork/paper_bundle.dm b/code/modules/paperwork/paper_bundle.dm
index 4f8c1cb8f6f..8be8267e3af 100644
--- a/code/modules/paperwork/paper_bundle.dm
+++ b/code/modules/paperwork/paper_bundle.dm
@@ -16,43 +16,43 @@
drop_sound = 'sound/items/drop/paper.ogg'
pickup_sound = 'sound/items/pickup/paper.ogg'
-/obj/item/paper_bundle/attackby(obj/item/W as obj, mob/user as mob)
+/obj/item/paper_bundle/attackby(obj/item/attacking_item, mob/user)
..()
- if (istype(W, /obj/item/paper/carbon))
- var/obj/item/paper/carbon/C = W
+ if (istype(attacking_item, /obj/item/paper/carbon))
+ var/obj/item/paper/carbon/C = attacking_item
if (!C.iscopy && !C.copied)
to_chat(user, "Take off the carbon copy first.")
add_fingerprint(user)
return
// adding sheets
- if(istype(W, /obj/item/paper) || istype(W, /obj/item/photo))
- insert_sheet_at(user, pages.len+1, W)
+ if(istype(attacking_item, /obj/item/paper) || istype(attacking_item, /obj/item/photo))
+ insert_sheet_at(user, pages.len+1, attacking_item)
amount++
attack_self(usr) //Update the browsed page.
// burning
- else if(istype(W, /obj/item/flame))
- burnpaper(W, user)
+ else if(istype(attacking_item, /obj/item/flame))
+ burnpaper(attacking_item, user)
// merging bundles
- else if(istype(W, /obj/item/paper_bundle))
- for(var/obj/O in W)
+ else if(istype(attacking_item, /obj/item/paper_bundle))
+ for(var/obj/O in attacking_item)
O.forceMove(src)
O.add_fingerprint(usr)
pages.Add(O)
amount++
- to_chat(user, "You add \the [W.name] to [(src.name == "paper bundle") ? "the paper bundle" : src.name].")
+ to_chat(user, "You add \the [attacking_item.name] to [(src.name == "paper bundle") ? "the paper bundle" : src.name].")
attack_self(usr) //Update the browsed page.
- qdel(W)
+ qdel(attacking_item)
else
- if(istype(W, /obj/item/tape_roll))
+ if(istype(attacking_item, /obj/item/tape_roll))
return 0
- // if(istype(W, /obj/item/pen))
+ // if(istype(attacking_item, /obj/item/pen))
// usr << browse("", "window=[name]") // TODO: actually does nothing, either fix it so you can write directly to the bundle screen or actually prevent the window from opening until you're done
var/obj/P = pages[page]
- P.attackby(W, user)
+ P.attackby(attacking_item, user)
update_icon()
add_fingerprint(usr)
diff --git a/code/modules/paperwork/paperbin.dm b/code/modules/paperwork/paperbin.dm
index a375bc6aca2..addedebdd68 100644
--- a/code/modules/paperwork/paperbin.dm
+++ b/code/modules/paperwork/paperbin.dm
@@ -77,9 +77,9 @@
return
-/obj/item/paper_bin/attackby(obj/item/O as obj, mob/user as mob)
- if(istype(O, /obj/item/paper))
- var/obj/item/paper/i = O
+/obj/item/paper_bin/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/paper))
+ var/obj/item/paper/i = attacking_item
user.drop_from_inventory(i,src)
to_chat(user, "You put [i] in [src].")
papers.Add(i)
diff --git a/code/modules/paperwork/papershredder.dm b/code/modules/paperwork/papershredder.dm
index c74ee193c5b..ab84e180b2f 100644
--- a/code/modules/paperwork/papershredder.dm
+++ b/code/modules/paperwork/papershredder.dm
@@ -16,13 +16,13 @@
/obj/item/paper_bundle = 3
)// use -1 if it doesn't generate paper
-/obj/machinery/papershredder/attackby(var/obj/item/W, var/mob/user)
- if (istype(W, /obj/item/storage))
- empty_bin(user, W)
+/obj/machinery/papershredder/attackby(obj/item/attacking_item, mob/user)
+ if (istype(attacking_item, /obj/item/storage))
+ empty_bin(user, attacking_item)
return
- else if (W.iswrench())
- playsound(loc, W.usesound, 50, 1)
+ else if (attacking_item.iswrench())
+ playsound(loc, attacking_item.usesound, 50, 1)
anchored = !anchored
user.visible_message(
SPAN_NOTICE("[anchored ? "\The [user] fastens \the [src] to \the [loc]." : "\The unfastens \the [src] from \the [loc]."]"),
@@ -34,7 +34,7 @@
else
var/paper_result
for(var/shred_type in shred_amounts)
- if(istype(W, shred_type))
+ if(istype(attacking_item, shred_type))
paper_result = shred_amounts[shred_type]
if(paper_result)
if (!anchored)
@@ -45,15 +45,15 @@
return
if (paper_result > 0)
paperamount += paper_result
- if(W.icon_state == "scrap")
+ if(attacking_item.icon_state == "scrap")
flick("papershredder_s_on", src)
- else if(W.icon_state == "paper_words")
+ else if(attacking_item.icon_state == "paper_words")
flick("papershredder_w_on", src)
- else if(W.icon_state == "paper_plane")
+ else if(attacking_item.icon_state == "paper_plane")
flick("papershredder_p_on", src)
else
flick("papershredder_on", src)
- qdel(W)
+ qdel(attacking_item)
playsound(src.loc, 'sound/bureaucracy/papershred.ogg', 75, 1)
to_chat(user, SPAN_NOTICE("You shred the paper."))
intent_message(MACHINE_SOUND)
@@ -129,9 +129,9 @@
if(10)
add_overlay("papershredder5")
-/obj/item/shreddedp/attackby(var/obj/item/W as obj, var/mob/user)
- if(istype(W, /obj/item/flame/lighter))
- burnpaper(W, user)
+/obj/item/shreddedp/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/flame/lighter))
+ burnpaper(attacking_item, user)
else
..()
diff --git a/code/modules/paperwork/photocopier.dm b/code/modules/paperwork/photocopier.dm
index 0e89b1317ab..6c20d9a3f9b 100644
--- a/code/modules/paperwork/photocopier.dm
+++ b/code/modules/paperwork/photocopier.dm
@@ -103,33 +103,33 @@
num_copies = clamp(text2num(params["num_copies"]), 1, max_copies)
return TRUE
-/obj/machinery/photocopier/attackby(obj/item/O as obj, mob/user as mob)
- if(istype(O, /obj/item/paper) || istype(O, /obj/item/photo) || istype(O, /obj/item/paper_bundle))
+/obj/machinery/photocopier/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/paper) || istype(attacking_item, /obj/item/photo) || istype(attacking_item, /obj/item/paper_bundle))
if(!copy_item)
- user.drop_from_inventory(O,src)
- copy_item = O
- to_chat(user, SPAN_NOTICE("You insert \the [O] into \the [src]."))
+ user.drop_from_inventory(attacking_item,src)
+ copy_item = attacking_item
+ to_chat(user, SPAN_NOTICE("You insert \the [attacking_item] into \the [src]."))
flick(insert_anim, src)
playsound(loc, 'sound/bureaucracy/scan.ogg', 75, 1)
SStgui.update_uis(src)
else
to_chat(user, SPAN_NOTICE("There is already something in \the [src]."))
- else if(istype(O, /obj/item/device/toner))
+ else if(istype(attacking_item, /obj/item/device/toner))
if(toner <= 10) //allow replacing when low toner is affecting the print darkness
- to_chat(user, SPAN_NOTICE("You insert \the [O] into \the [src]."))
+ to_chat(user, SPAN_NOTICE("You insert \the [attacking_item] into \the [src]."))
flick("photocopier_toner", src)
playsound(loc, /singleton/sound_category/switch_sound, 50, 1)
- var/obj/item/device/toner/T = O
+ var/obj/item/device/toner/T = attacking_item
toner = min(toner + T.toner_amount, max_toner)
- user.drop_from_inventory(O,get_turf(src))
- qdel(O)
+ user.drop_from_inventory(attacking_item, get_turf(src))
+ qdel(attacking_item)
SStgui.update_uis(src)
else
to_chat(user, SPAN_NOTICE("This cartridge is not yet ready for replacement! Use up the rest of the toner."))
flick("photocopier_notoner", src)
playsound(loc, 'sound/machines/buzz-two.ogg', 75, 1)
- else if(O.iswrench())
- playsound(loc, O.usesound, 50, 1)
+ else if(attacking_item.iswrench())
+ playsound(loc, attacking_item.usesound, 50, 1)
anchored = !anchored
to_chat(user, SPAN_NOTICE("You [anchored ? "wrench" : "unwrench"] \the [src]."))
return
diff --git a/code/modules/paperwork/photography.dm b/code/modules/paperwork/photography.dm
index 89193a6354a..f18daf8ace2 100644
--- a/code/modules/paperwork/photography.dm
+++ b/code/modules/paperwork/photography.dm
@@ -51,9 +51,9 @@ var/global/photo_count = 0
/obj/item/photo/attack_self(mob/user as mob)
examinate(user, src)
-/obj/item/photo/attackby(obj/item/P as obj, mob/user as mob)
- if(P.ispen())
- var/txt = sanitize(input(user, "What would you like to write on the back?", "Photo Writing", null) as text, 128)
+/obj/item/photo/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.ispen())
+ var/txt = sanitize( tgui_input_text(user, "What would you like to write on the back?", "Photo Writing", max_length = 128), 128 )
if(loc == user && user.stat == 0)
scribble = txt
..()
@@ -176,14 +176,14 @@ var/global/photo_count = 0
to_chat(user, "You switch the camera [on ? "on" : "off"].")
return
-/obj/item/device/camera/attackby(obj/item/I as obj, mob/user as mob)
- if(istype(I, /obj/item/device/camera_film))
+/obj/item/device/camera/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/device/camera_film))
if(pictures_left)
to_chat(user, "[src] still has some film in it!")
return TRUE
- to_chat(user, "You insert [I] into [src].")
- user.drop_from_inventory(I,get_turf(src))
- qdel(I)
+ to_chat(user, "You insert [attacking_item] into [src].")
+ user.drop_from_inventory(attacking_item, get_turf(src))
+ qdel(attacking_item)
pictures_left = pictures_max
return TRUE
return ..()
diff --git a/code/modules/paperwork/typewriter.dm b/code/modules/paperwork/typewriter.dm
index 365bb40b2b6..691ede70ceb 100644
--- a/code/modules/paperwork/typewriter.dm
+++ b/code/modules/paperwork/typewriter.dm
@@ -83,18 +83,18 @@
update_icon()
return TRUE
-/obj/item/portable_typewriter/attackby(obj/item/W, mob/user, params)
- if(istype(W, /obj/item/paper))
+/obj/item/portable_typewriter/attackby(obj/item/attacking_item, mob/user, params)
+ if(istype(attacking_item, /obj/item/paper))
if(!stored_paper)
- if(W.icon_state == "scrap")
- to_chat(user, SPAN_ALERT("\The [W] is too crumpled to feed correctly!"))
+ if(attacking_item.icon_state == "scrap")
+ to_chat(user, SPAN_ALERT("\The [attacking_item] is too crumpled to feed correctly!"))
return
else
- user.drop_item(W)
- user.unEquip(W)
- W.forceMove(src)
- stored_paper = W
- user.visible_message(SPAN_ALERT("\The [user] sucks up \the [W] into \the [src]."), SPAN_ALERT("You suck up \the [W] into \the [src]."))
+ user.drop_item(attacking_item)
+ user.unEquip(attacking_item)
+ attacking_item.forceMove(src)
+ stored_paper = attacking_item
+ user.visible_message(SPAN_ALERT("\The [user] sucks up \the [attacking_item] into \the [src]."), SPAN_ALERT("You suck up \the [attacking_item] into \the [src]."))
src.update_icon()
else
to_chat(user, SPAN_ALERT("\The [src] already has a paper in it."))
@@ -176,14 +176,14 @@
/obj/item/typewriter_case/MouseDrop(mob/user as mob)
attack_self(user)
-/obj/item/typewriter_case/attackby(obj/item/W, mob/user, params)
- if(istype(W, /obj/item/portable_typewriter))
+/obj/item/typewriter_case/attackby(obj/item/attacking_item, mob/user, params)
+ if(istype(attacking_item, /obj/item/portable_typewriter))
if(!machine)
- user.drop_item(W)
- user.unEquip(W)
- W.forceMove(src)
- src.machine = W
- user.visible_message(SPAN_ALERT("[user] places \the [W] into \the [src]."), SPAN_ALERT ("You store \the [W] in \the [src]."))
+ user.drop_item(attacking_item)
+ user.unEquip(attacking_item)
+ attacking_item.forceMove(src)
+ src.machine = attacking_item
+ user.visible_message(SPAN_ALERT("[user] places \the [attacking_item] into \the [src]."), SPAN_ALERT ("You store \the [attacking_item] in \the [src]."))
src.update_icon()
else
to_chat(user, SPAN_ALERT("\The [src] already has a typewriter in it!"))
diff --git a/code/modules/power/antimatter/control.dm b/code/modules/power/antimatter/control.dm
index 2b90e55598a..a7e4a87aab7 100644
--- a/code/modules/power/antimatter/control.dm
+++ b/code/modules/power/antimatter/control.dm
@@ -132,10 +132,10 @@
else
icon_state = "control"
-/obj/machinery/power/am_control_unit/attackby(obj/item/W, mob/user)
- if(W.iswrench())
+/obj/machinery/power/am_control_unit/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.iswrench())
if(!anchored)
- playsound(get_turf(src), W.usesound, 75, 1)
+ playsound(get_turf(src), attacking_item.usesound, 75, 1)
user.visible_message("[user.name] secures \the [src] to the floor.", \
SPAN_NOTICE("You secure the anchor bolts to the floor."), \
SPAN_NOTICE("You hear a ratcheting noise."))
@@ -144,7 +144,7 @@
check_shield_icons()
connect_to_network()
else if(!LAZYLEN(linked_shielding))
- playsound(get_turf(src), W.usesound, 75, 1)
+ playsound(get_turf(src), attacking_item.usesound, 75, 1)
user.visible_message("[user] unsecures \the [src].", \
SPAN_NOTICE("You remove the anchor bolts."), \
SPAN_NOTICE("You hear a ratcheting noise."))
@@ -154,21 +154,21 @@
to_chat(user, SPAN_WARNING("Once bolted and linked to a shielding unit it \the [src] is unable to be moved!"))
return
- if(istype(W, /obj/item/am_containment))
+ if(istype(attacking_item, /obj/item/am_containment))
if(fueljar)
to_chat(user, SPAN_WARNING("There is already \a [fueljar] loaded!"))
return
- fueljar = W
- user.drop_from_inventory(W, src)
+ fueljar = attacking_item
+ user.drop_from_inventory(attacking_item, src)
message_admins("AME loaded with fuel by [user.real_name] ([user.key]) at ([x],[y],[z] - JMP)",0,1)
- user.visible_message("[user] loads \the [W] into \the [src].", \
- SPAN_NOTICE("You load \the [W] into \the [src]."), \
- SPAN_NOTICE("You hear a thunk."))
+ user.visible_message("[user] loads \the [attacking_item] into \the [src].",
+ SPAN_NOTICE("You load \the [attacking_item] into \the [src]."),
+ SPAN_NOTICE("You hear a thunk."))
return
- if(W.force >= 20)
- user.do_attack_animation(src, W)
- stability -= W.force / 2
+ if(attacking_item.force >= 20)
+ user.do_attack_animation(src, attacking_item)
+ stability -= attacking_item.force / 2
check_stability()
return ..()
diff --git a/code/modules/power/antimatter/shielding.dm b/code/modules/power/antimatter/shielding.dm
index 0fb416f8a5a..1f9abe38f18 100644
--- a/code/modules/power/antimatter/shielding.dm
+++ b/code/modules/power/antimatter/shielding.dm
@@ -160,12 +160,12 @@
else if(processing)
shutdown_core()
-/obj/machinery/am_shielding/attackby(obj/item/W, mob/user)
- if(!istype(W) || !user)
+/obj/machinery/am_shielding/attackby(obj/item/attacking_item, mob/user)
+ if(!istype(attacking_item) || !user)
return
- if(W.force > 10)
- user.do_attack_animation(src, W)
- stability -= W.force / 2
+ if(attacking_item.force > 10)
+ user.do_attack_animation(src, attacking_item)
+ stability -= attacking_item.force / 2
check_stability()
return ..()
@@ -223,8 +223,8 @@
throw_speed = 1
throw_range = 2
-/obj/item/device/am_shielding_container/attackby(var/obj/item/I, var/mob/user)
- if(I.ismultitool() && isturf(loc))
+/obj/item/device/am_shielding_container/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.ismultitool() && isturf(loc))
if(locate(/obj/machinery/am_shielding) in loc)
to_chat(user, SPAN_WARNING("There is already an antimatter reactor section there."))
return
diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm
index e5d38475d88..879190df6c1 100644
--- a/code/modules/power/apc.dm
+++ b/code/modules/power/apc.dm
@@ -731,25 +731,25 @@
//attack with an item - open/close cover, insert cell, or (un)lock interface
-/obj/machinery/power/apc/attackby(obj/item/W, mob/user)
+/obj/machinery/power/apc/attackby(obj/item/attacking_item, mob/user)
if (issilicon(user) && get_dist(src,user)>1)
return attack_hand(user)
- if(!istype(W, /obj/item/forensics))
+ if(!istype(attacking_item, /obj/item/forensics))
add_fingerprint(user)
- if(istype(W, /obj/item/modular_computer))
- var/obj/item/modular_computer/C = W
+ if(istype(attacking_item, /obj/item/modular_computer))
+ var/obj/item/modular_computer/C = attacking_item
if(istype(C.tesla_link, /obj/item/computer_hardware/tesla_link/charging_cable))
var/obj/item/computer_hardware/tesla_link/charging_cable/CC = C.tesla_link
CC.toggle(src, user)
return
- if (W.iscrowbar() && opened)
+ if (attacking_item.iscrowbar() && opened)
if (has_electronics == HAS_ELECTRONICS_CONNECT)
if (terminal)
to_chat(user, SPAN_WARNING("Disconnect wires first."))
return
to_chat(user, "You are trying to remove the power control board...")
- if(W.use_tool(src, user, 50, volume = 50))
+ if(attacking_item.use_tool(src, user, 50, volume = 50))
if (has_electronics == HAS_ELECTRONICS_CONNECT)
has_electronics = HAS_ELECTRONICS_NONE
if ((stat & BROKEN))
@@ -767,7 +767,7 @@
panel_open = FALSE
opened = COVER_CLOSED
update_icon()
- else if (W.iscrowbar() && !((stat & BROKEN) || hacker) )
+ else if (attacking_item.iscrowbar() && !((stat & BROKEN) || hacker) )
if(coverlocked && !(stat & MAINT))
to_chat(user, SPAN_WARNING("The cover is locked and cannot be opened."))
return
@@ -775,8 +775,8 @@
opened = COVER_OPENED
panel_open = TRUE
update_icon()
- else if (istype(W, /obj/item/gripper))//Code for allowing cyborgs to use rechargers
- var/obj/item/gripper/Gri = W
+ else if (istype(attacking_item, /obj/item/gripper))//Code for allowing cyborgs to use rechargers
+ var/obj/item/gripper/Gri = attacking_item
if(opened != COVER_CLOSED && cell)
if (Gri.grip_item(cell, user))
cell.add_fingerprint(user)
@@ -788,25 +788,25 @@
charging = CHARGING_OFF
update_icon()
return
- else if (istype(W, /obj/item/cell) && opened != COVER_CLOSED) // trying to put a cell inside
+ else if (istype(attacking_item, /obj/item/cell) && opened != COVER_CLOSED) // trying to put a cell inside
if(cell)
to_chat(user, "There is a power cell already installed.")
return
if (stat & MAINT)
to_chat(user, SPAN_WARNING("There is no connector for your power cell."))
return
- if(W.w_class != ITEMSIZE_NORMAL)
- to_chat(user, "\The [W] is too [W.w_class < ITEMSIZE_NORMAL? "small" : "large"] to fit here.")
+ if(attacking_item.w_class != ITEMSIZE_NORMAL)
+ to_chat(user, "\The [attacking_item] is too [attacking_item.w_class < ITEMSIZE_NORMAL? "small" : "large"] to fit here.")
return
- user.drop_from_inventory(W,src)
- cell = W
+ user.drop_from_inventory(attacking_item,src)
+ cell = attacking_item
user.visible_message(\
SPAN_WARNING("[user.name] has inserted \the [cell] to [name]!"),\
SPAN_NOTICE("You insert \the [cell]."))
chargecount = 0
update_icon()
- else if (W.isscrewdriver()) // haxing
+ else if (attacking_item.isscrewdriver()) // haxing
if(opened != COVER_CLOSED)
if (cell)
to_chat(user, SPAN_WARNING("Close the APC first.")) //Less hints more mystery!
@@ -815,12 +815,12 @@
if (has_electronics == HAS_ELECTRONICS_CONNECT && terminal)
has_electronics = HAS_ELECTRONICS_SECURED
stat &= ~MAINT
- playsound(loc, W.usesound, 50, 1)
+ playsound(loc, attacking_item.usesound, 50, 1)
to_chat(user, "You screw the circuit electronics into place.")
else if (has_electronics == HAS_ELECTRONICS_SECURED)
has_electronics = HAS_ELECTRONICS_CONNECT
stat |= MAINT
- playsound(loc, W.usesound, 50, 1)
+ playsound(loc, attacking_item.usesound, 50, 1)
to_chat(user, "You unfasten the electronics.")
else /* has_electronics == HAS_ELECTRONICS_NONE */
to_chat(user, SPAN_WARNING("There is nothing to secure."))
@@ -831,7 +831,7 @@
to_chat(user, "The wires have been [wiresexposed ? "exposed" : "unexposed"]")
update_icon()
- else if (W.GetID()) // trying to unlock the interface with an ID card
+ else if (attacking_item.GetID()) // trying to unlock the interface with an ID card
if(emagged)
to_chat(user, "The interface is broken.")
else if(opened != COVER_CLOSED)
@@ -849,18 +849,18 @@
update_icon()
else
to_chat(user, SPAN_WARNING("Access denied."))
- else if (W.iscoil() && !terminal && opened != COVER_CLOSED && has_electronics != HAS_ELECTRONICS_SECURED)
+ else if (attacking_item.iscoil() && !terminal && opened != COVER_CLOSED && has_electronics != HAS_ELECTRONICS_SECURED)
var/turf/T = loc
if(istype(T) && !T.is_plating())
to_chat(user, SPAN_WARNING("You must remove the floor plating in front of the APC first."))
return
- var/obj/item/stack/cable_coil/C = W
+ var/obj/item/stack/cable_coil/C = attacking_item
if(C.get_amount() < 10)
to_chat(user, SPAN_WARNING("You need ten lengths of cable for APC."))
return
user.visible_message(SPAN_WARNING("[user.name] adds cables to the APC frame."), \
"You start adding cables to the APC frame...")
- if(W.use_tool(src, user, 20, volume = 50))
+ if(attacking_item.use_tool(src, user, 20, volume = 50))
if (C.amount >= 10 && !terminal && opened != COVER_CLOSED && has_electronics != HAS_ELECTRONICS_SECURED)
var/obj/structure/cable/N = T.get_cable_node()
if (prob(50) && electrocute_mob(usr, N, N))
@@ -873,14 +873,14 @@
"You add cables to the APC frame.")
make_terminal()
terminal.connect_to_network()
- else if (W.iswirecutter() && terminal && opened != COVER_CLOSED && has_electronics != HAS_ELECTRONICS_SECURED)
+ else if (attacking_item.iswirecutter() && terminal && opened != COVER_CLOSED && has_electronics != HAS_ELECTRONICS_SECURED)
var/turf/T = loc
if(istype(T) && !T.is_plating())
to_chat(user, SPAN_WARNING("You must remove the floor plating in front of the APC first."))
return
user.visible_message(SPAN_WARNING("[user.name] dismantles the power terminal from [src]."), \
"You begin to cut the cables...")
- if(W.use_tool(src, user, 50, volume = 50))
+ if(attacking_item.use_tool(src, user, 50, volume = 50))
if(terminal && opened != COVER_CLOSED && has_electronics != HAS_ELECTRONICS_SECURED)
if (prob(50) && electrocute_mob(usr, terminal.powernet, terminal))
spark(src, 5, GLOB.alldirs)
@@ -889,20 +889,20 @@
new /obj/item/stack/cable_coil(loc,10)
to_chat(user, SPAN_NOTICE("You cut the cables and dismantle the power terminal."))
qdel(terminal)
- else if (istype(W, /obj/item/module/power_control) && opened != COVER_CLOSED && has_electronics == HAS_ELECTRONICS_NONE && !((stat & BROKEN)))
+ else if (istype(attacking_item, /obj/item/module/power_control) && opened != COVER_CLOSED && has_electronics == HAS_ELECTRONICS_NONE && !((stat & BROKEN)))
user.visible_message(SPAN_WARNING("[user.name] inserts the power control board into [src]."), \
"You start to insert the power control board into the frame...")
playsound(loc, 'sound/items/Deconstruct.ogg', 50, 1)
- if(W.use_tool(src, user, 10, volume = 50))
+ if(attacking_item.use_tool(src, user, 10, volume = 50))
if(has_electronics == HAS_ELECTRONICS_NONE)
has_electronics = HAS_ELECTRONICS_CONNECT
to_chat(user, SPAN_NOTICE("You place the power control board inside the frame."))
- qdel(W)
- else if (istype(W, /obj/item/module/power_control) && opened != COVER_CLOSED && has_electronics == HAS_ELECTRONICS_NONE && ((stat & BROKEN)))
+ qdel(attacking_item)
+ else if (istype(attacking_item, /obj/item/module/power_control) && opened != COVER_CLOSED && has_electronics == HAS_ELECTRONICS_NONE && ((stat & BROKEN)))
to_chat(user, SPAN_WARNING("You cannot put the board inside, the frame is damaged."))
return
- else if (W.iswelder() && opened != COVER_CLOSED && has_electronics == HAS_ELECTRONICS_NONE && !terminal)
- var/obj/item/weldingtool/WT = W
+ else if (attacking_item.iswelder() && opened != COVER_CLOSED && has_electronics == HAS_ELECTRONICS_NONE && !terminal)
+ var/obj/item/weldingtool/WT = attacking_item
if (!WT.isOn()) return
if (WT.get_fuel() < 3)
to_chat(user, SPAN_WARNING("You need more welding fuel to complete this task."))
@@ -911,7 +911,7 @@
"You start welding the APC frame...", \
"You hear welding.")
playsound(loc, 'sound/items/Welder.ogg', 50, 1)
- if(W.use_tool(src, user, 50, volume = 50))
+ if(attacking_item.use_tool(src, user, 50, volume = 50))
if(!src || !WT.use(3, user))
return
if (emagged || (stat & BROKEN) || opened == COVER_REMOVED)
@@ -928,26 +928,26 @@
"You hear welding.")
qdel(src)
return
- else if (istype(W, /obj/item/frame/apc) && opened != COVER_CLOSED && emagged)
+ else if (istype(attacking_item, /obj/item/frame/apc) && opened != COVER_CLOSED && emagged)
emagged = FALSE
if (opened == COVER_REMOVED)
opened = COVER_OPENED
user.visible_message(\
SPAN_WARNING("[user.name] has replaced the damaged APC frontal panel with a new one."),\
SPAN_NOTICE("You replace the damaged APC frontal panel with a new one."))
- qdel(W)
+ qdel(attacking_item)
update_icon()
- else if (istype(W, /obj/item/frame/apc) && opened != COVER_CLOSED && ((stat & BROKEN) || hacker))
+ else if (istype(attacking_item, /obj/item/frame/apc) && opened != COVER_CLOSED && ((stat & BROKEN) || hacker))
if (has_electronics == HAS_ELECTRONICS_CONNECT)
to_chat(user, SPAN_WARNING("You cannot repair this APC until you remove the electronics still inside."))
return
user.visible_message(SPAN_WARNING("[user.name] replaces the damaged APC frame with a new one."),\
"You begin to replace the damaged APC frame...")
- if(W.use_tool(src, user, 50, volume = 50))
+ if(attacking_item.use_tool(src, user, 50, volume = 50))
user.visible_message(\
SPAN_NOTICE("[user.name] has replaced the damaged APC frame with new one."),\
"You replace the damaged APC frame with new one.")
- qdel(W)
+ qdel(attacking_item)
stat &= ~BROKEN
// Malf AI, removes the APC from AI's hacked APCs list.
if(hacker?.hacked_apcs && (src in hacker.hacked_apcs))
@@ -956,19 +956,19 @@
if (opened == COVER_REMOVED)
opened = COVER_OPENED
update_icon()
- else if (istype(W, /obj/item/device/debugger))
+ else if (istype(attacking_item, /obj/item/device/debugger))
if(emagged || hacker || infected)
to_chat(user, SPAN_WARNING("There is a software error with the device. Attempting to fix..."))
- if(W.use_tool(src, user, 50, volume = 50))
+ if(attacking_item.use_tool(src, user, 50, volume = 50))
to_chat(user, SPAN_NOTICE("Problem diagnosed, searching for solution..."))
- if(W.use_tool(src, user, 150, volume = 50))
+ if(attacking_item.use_tool(src, user, 150, volume = 50))
to_chat(user, SPAN_NOTICE("Solution found. Applying fixes..."))
- if(W.use_tool(src, user, 300, volume = 50))
+ if(attacking_item.use_tool(src, user, 300, volume = 50))
if(prob(15))
to_chat(user, SPAN_WARNING("Error while applying fixes. Please try again."))
return
to_chat(user, SPAN_NOTICE("Applied default software. Restarting APC..."))
- if(W.use_tool(src, user, 50, volume = 50))
+ if(attacking_item.use_tool(src, user, 50, volume = 50))
to_chat(user, SPAN_NOTICE("APC Reset. Fixes applied."))
if(hacker)
hacker.hacked_apcs -= src
@@ -988,14 +988,14 @@
else
if ((stat & BROKEN) \
&& opened == COVER_CLOSED \
- && W.iswelder() )
- var/obj/item/weldingtool/WT = W
+ && attacking_item.iswelder() )
+ var/obj/item/weldingtool/WT = attacking_item
if (!WT.isOn()) return
if (WT.get_fuel() <1)
to_chat(user, SPAN_WARNING("You need more welding fuel to complete this task."))
return
playsound(loc, 'sound/items/Welder.ogg', 50, 1)
- if(W.use_tool(src, user, 10, volume = 50))
+ if(attacking_item.use_tool(src, user, 10, volume = 50))
if(!src || !WT.use(1, user))
return
if ((stat & BROKEN))
@@ -1009,23 +1009,23 @@
else if (((stat & BROKEN) || hacker) \
&& opened == COVER_CLOSED \
- && W.force >= 5 \
- && W.w_class >= ITEMSIZE_NORMAL \
+ && attacking_item.force >= 5 \
+ && attacking_item.w_class >= ITEMSIZE_NORMAL \
&& prob(20) )
opened = COVER_REMOVED
- user.visible_message(SPAN_DANGER("The APC cover was knocked down with the [W.name] by [user.name]!"), \
- SPAN_DANGER("You knock down the APC cover with your [W.name]!"), \
+ user.visible_message(SPAN_DANGER("The APC cover was knocked down with the [attacking_item.name] by [user.name]!"), \
+ SPAN_DANGER("You knock down the APC cover with your [attacking_item.name]!"), \
"You hear bang")
update_icon()
else
if (issilicon(user))
return attack_hand(user)
if (opened == COVER_CLOSED && wiresexposed && \
- W.ismultitool() || \
- W.iswirecutter() || istype(W, /obj/item/device/assembly/signaler))
+ attacking_item.ismultitool() || \
+ attacking_item.iswirecutter() || istype(attacking_item, /obj/item/device/assembly/signaler))
return attack_hand(user)
- user.visible_message(SPAN_DANGER("The [name] has been hit with the [W.name] by [user.name]!"), \
- SPAN_DANGER("You hit the [name] with your [W.name]!"), \
+ user.visible_message(SPAN_DANGER("The [name] has been hit with the [attacking_item.name] by [user.name]!"), \
+ SPAN_DANGER("You hit the [name] with your [attacking_item.name]!"), \
"You hear bang")
// attack with hand - remove cell (if cover open) or interact with the APC
diff --git a/code/modules/power/batteryrack.dm b/code/modules/power/batteryrack.dm
index 68a783eb3c4..e7eb17e6227 100644
--- a/code/modules/power/batteryrack.dm
+++ b/code/modules/power/batteryrack.dm
@@ -38,13 +38,13 @@
return round(4 * charge/(capacity ? capacity : 5e6))
-/obj/machinery/power/smes/batteryrack/attackby(var/obj/item/W as obj, var/mob/user as mob) //these can only be moved by being reconstructed, solves having to remake the powernet.
+/obj/machinery/power/smes/batteryrack/attackby(obj/item/attacking_item, mob/user) //these can only be moved by being reconstructed, solves having to remake the powernet.
..() //SMES attackby for now handles screwdriver, cable coils and wirecutters, no need to repeat that here
if(open_hatch)
- if(W.iscrowbar())
+ if(attacking_item.iscrowbar())
if (charge < (capacity / 100))
if (!output_attempt && !input_attempt)
- playsound(get_turf(src), W.usesound, 50, 1)
+ playsound(get_turf(src), attacking_item.usesound, 50, 1)
var/obj/machinery/constructable_frame/machine_frame/M = new /obj/machinery/constructable_frame/machine_frame(src.loc)
M.state = 2
M.icon_state = "box_1"
@@ -56,13 +56,13 @@
to_chat(user, "Turn off the [src] before dismantling it.")
else
to_chat(user, "Better let [src] discharge before dismantling it.")
- else if ((istype(W, /obj/item/stock_parts/capacitor) && (capacitors_amount < 5)) || (istype(W, /obj/item/cell) && (cells_amount < 5)))
+ else if ((istype(attacking_item, /obj/item/stock_parts/capacitor) && (capacitors_amount < 5)) || (istype(attacking_item, /obj/item/cell) && (cells_amount < 5)))
if (charge < (capacity / 100))
if (!output_attempt && !input_attempt)
- user.drop_from_inventory(W,src)
- component_parts += W
+ user.drop_from_inventory(attacking_item,src)
+ component_parts += attacking_item
RefreshParts()
- to_chat(user, "You upgrade the [src] with [W.name].")
+ to_chat(user, "You upgrade the [src] with [attacking_item.name].")
else
to_chat(user, "Turn off the [src] before dismantling it.")
else
diff --git a/code/modules/power/breaker_box.dm b/code/modules/power/breaker_box.dm
index 02700629b7f..34b983c177e 100644
--- a/code/modules/power/breaker_box.dm
+++ b/code/modules/power/breaker_box.dm
@@ -92,8 +92,8 @@
addtimer(CALLBACK(src, PROC_REF(reset_locked)), 600)
busy = 0
-/obj/machinery/power/breakerbox/attackby(var/obj/item/W as obj, var/mob/user as mob)
- if(W.ismultitool())
+/obj/machinery/power/breakerbox/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.ismultitool())
var/newtag = input(user, "Enter new RCON tag. Use \"NO_TAG\" to disable RCON or leave empty to cancel.", "SMES RCON system") as text
if(newtag)
RCon_tag = newtag
diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm
index d78f3ec7057..77dd4ef6dff 100644
--- a/code/modules/power/cable.dm
+++ b/code/modules/power/cable.dm
@@ -123,19 +123,19 @@ By design, d1 is the smallest direction and d2 is the highest
// - Cable coil : merge cables
// - Multitool : get the power currently passing through the cable
//
-/obj/structure/cable/attackby(obj/item/W, mob/user)
+/obj/structure/cable/attackby(obj/item/attacking_item, mob/user)
var/turf/T = src.loc
if(!T.can_have_cabling())
return
- if(W.iswirecutter() || (W.sharp || W.edge))
+ if(attacking_item.iswirecutter() || (attacking_item.sharp || attacking_item.edge))
- if(!W.iswirecutter())
+ if(!attacking_item.iswirecutter())
if(user.a_intent != I_HELP)
return
- if(W.obj_flags & OBJ_FLAG_CONDUCTABLE)
+ if(attacking_item.obj_flags & OBJ_FLAG_CONDUCTABLE)
shock(user, 50, 0.7)
if(d1 == 12 || d2 == 12)
@@ -171,14 +171,14 @@ By design, d1 is the smallest direction and d2 is the highest
return
- else if(W.iscoil())
- var/obj/item/stack/cable_coil/coil = W
+ else if(attacking_item.iscoil())
+ var/obj/item/stack/cable_coil/coil = attacking_item
if (coil.get_amount() < 1)
to_chat(user, "You don't have enough cable.")
return
coil.cable_join(src, user)
- else if(W.ismultitool())
+ else if(attacking_item.ismultitool())
if(powernet && (powernet.avail > 0)) // is it powered?
to_chat(user, SPAN_WARNING("[powernet.avail]W in power network."))
@@ -629,8 +629,8 @@ By design, d1 is the smallest direction and d2 is the highest
add_overlay(overlay_image(icon, "[icon_state]_end", flags=RESET_COLOR))
check_maptext(SMALL_FONTS(7, get_amount()))
-/obj/item/stack/cable_coil/attackby(var/obj/item/W, var/mob/user)
- if(W.ismultitool())
+/obj/item/stack/cable_coil/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.ismultitool())
choose_cable_color(user)
return ..()
@@ -1041,14 +1041,14 @@ By design, d1 is the smallest direction and d2 is the highest
STOP_PROCESSING(SSprocessing, src)
return ..()
-/obj/structure/noose/attackby(obj/item/I, mob/user, params)
- if(I.iswirecutter())
+/obj/structure/noose/attackby(obj/item/attacking_item, mob/user, params)
+ if(attacking_item.iswirecutter())
user.visible_message("[user] cuts \the [src].", SPAN_NOTICE("You cut \the [src]."))
playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1)
if(istype(buckled, /mob/living))
var/mob/living/M = buckled
- M.visible_message(SPAN_DANGER("[M] falls over and hits the ground!"),\
- SPAN_DANGER("You fall over and hit the ground!"))
+ M.visible_message(SPAN_DANGER("[M] falls over and hits the ground!"),
+ SPAN_DANGER("You fall over and hit the ground!"))
M.adjustBruteLoss(10)
new /obj/item/stack/cable_coil(get_turf(src), 25, color)
qdel(src)
diff --git a/code/modules/power/cell.dm b/code/modules/power/cell.dm
index a92ad7d55f7..06498fbd6b0 100644
--- a/code/modules/power/cell.dm
+++ b/code/modules/power/cell.dm
@@ -94,9 +94,9 @@
. += "This power cell has an exciting chrome finish, as it is an uber-capacity cell type! It has a power rating of [maxcharge]J!"
. += "The charge meter reads [round(src.percent() )]%."
-/obj/item/cell/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/reagent_containers/syringe))
- var/obj/item/reagent_containers/syringe/S = W
+/obj/item/cell/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/reagent_containers/syringe))
+ var/obj/item/reagent_containers/syringe/S = attacking_item
to_chat(user, "You inject the solution into the power cell.")
@@ -109,8 +109,8 @@
S.reagents.clear_reagents()
return
- else if(istype(W, /obj/item/device/assembly_holder))
- var/obj/item/device/assembly_holder/assembly = W
+ else if(istype(attacking_item, /obj/item/device/assembly_holder))
+ var/obj/item/device/assembly_holder/assembly = attacking_item
if (istype(assembly.a_left, /obj/item/device/assembly/signaler) && istype(assembly.a_right, /obj/item/device/assembly/signaler))
//TODO: Look into this bad code
user.drop_item()
@@ -120,7 +120,7 @@
else
to_chat(user, "You'd need both devices to be signallers for this to work.")
return
- else if(W.ismultitool() && ishuman(user) && user.get_inactive_hand() == src)
+ else if(attacking_item.ismultitool() && ishuman(user) && user.get_inactive_hand() == src)
if(charge < 10)
to_chat(user, SPAN_WARNING("\The [src] doesn't have enough charge to produce sufficient current!"))
return
@@ -129,10 +129,10 @@
if(H.gloves)
siemens_coeff = H.gloves.siemens_coefficient
if(siemens_coeff >= 0.75 && prob(10 * siemens_coeff))
- to_chat(H, SPAN_WARNING("You probe \the [src] with \the [W] and feel a jolt of electricity shoot through you! It reads out that [100 * siemens_coeff]% of the current was let through."))
+ to_chat(H, SPAN_WARNING("You probe \the [src] with \the [attacking_item] and feel a jolt of electricity shoot through you! It reads out that [100 * siemens_coeff]% of the current was let through."))
H.electrocute_act(5, src, siemens_coeff, H.hand ? BP_R_HAND : BP_L_HAND) // hand holding the battery gets shocked
else
- to_chat(H, SPAN_NOTICE("You probe \the [src] with \the [W]. It reads out that [100 * siemens_coeff]% of the current was let through."))
+ to_chat(H, SPAN_NOTICE("You probe \the [src] with \the [attacking_item]. It reads out that [100 * siemens_coeff]% of the current was let through."))
return
return ..()
diff --git a/code/modules/power/crystal_agitator.dm b/code/modules/power/crystal_agitator.dm
index 12ad7081355..1bbb13add2a 100644
--- a/code/modules/power/crystal_agitator.dm
+++ b/code/modules/power/crystal_agitator.dm
@@ -93,12 +93,12 @@
if(iscapacitor(SP))
change_power_consumption((initial(active_power_usage) - (SP.rating * 500)), POWER_USE_ACTIVE)
-/obj/machinery/power/crystal_agitator/attackby(obj/item/I, mob/user, params)
- if(default_part_replacement(user, I))
+/obj/machinery/power/crystal_agitator/attackby(obj/item/attacking_item, mob/user, params)
+ if(default_part_replacement(user, attacking_item))
return
- else if(default_deconstruction_screwdriver(user, I))
+ else if(default_deconstruction_screwdriver(user, attacking_item))
return
- else if(default_deconstruction_crowbar(user, I))
+ else if(default_deconstruction_crowbar(user, attacking_item))
return
return ..()
diff --git a/code/modules/power/fusion/consoles/_consoles.dm b/code/modules/power/fusion/consoles/_consoles.dm
index 7a86cdbf34f..264e2f5b94b 100644
--- a/code/modules/power/fusion/consoles/_consoles.dm
+++ b/code/modules/power/fusion/consoles/_consoles.dm
@@ -16,8 +16,8 @@
var/datum/component/local_network_member/fusion = GetComponent(/datum/component/local_network_member)
return fusion.get_local_network()
-/obj/machinery/computer/fusion/attackby(obj/item/thing, mob/user)
- if(thing.ismultitool())
+/obj/machinery/computer/fusion/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.ismultitool())
var/datum/component/local_network_member/fusion = GetComponent(/datum/component/local_network_member)
fusion.get_new_tag(user)
return
diff --git a/code/modules/power/fusion/core/_core.dm b/code/modules/power/fusion/core/_core.dm
index 33b42b0e095..a4d374b8da1 100644
--- a/code/modules/power/fusion/core/_core.dm
+++ b/code/modules/power/fusion/core/_core.dm
@@ -74,18 +74,18 @@
Shutdown()
return TRUE
-/obj/machinery/power/fusion_core/attackby(obj/item/W, mob/user)
+/obj/machinery/power/fusion_core/attackby(obj/item/attacking_item, mob/user)
if(owned_field)
to_chat(user,SPAN_WARNING("Shut \the [src] off first!"))
return
- if(W.ismultitool())
+ if(attacking_item.ismultitool())
var/datum/component/local_network_member/fusion = GetComponent(/datum/component/local_network_member)
fusion.get_new_tag(user)
return
- else if(W.iswrench())
+ else if(attacking_item.iswrench())
anchored = !anchored
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
if(anchored)
diff --git a/code/modules/power/fusion/fuel_assembly/fuel_compressor.dm b/code/modules/power/fusion/fuel_assembly/fuel_compressor.dm
index 4f9fd45dfac..3f6224d7474 100644
--- a/code/modules/power/fusion/fuel_assembly/fuel_compressor.dm
+++ b/code/modules/power/fusion/fuel_assembly/fuel_compressor.dm
@@ -16,8 +16,8 @@
return
return do_fuel_compression(target, user)
-/obj/machinery/fusion_fuel_compressor/attackby(obj/item/thing, mob/user)
- return do_fuel_compression(thing, user) || ..()
+/obj/machinery/fusion_fuel_compressor/attackby(obj/item/attacking_item, mob/user)
+ return do_fuel_compression(attacking_item, user) || ..()
/obj/machinery/fusion_fuel_compressor/proc/do_fuel_compression(obj/item/thing, mob/user)
if(istype(thing) && thing.reagents && thing.reagents.total_volume && thing.is_open_container())
diff --git a/code/modules/power/fusion/fuel_assembly/fuel_injector.dm b/code/modules/power/fusion/fuel_assembly/fuel_injector.dm
index fd0e2c9f8c6..1ba2bdb6bd8 100644
--- a/code/modules/power/fusion/fuel_assembly/fuel_injector.dm
+++ b/code/modules/power/fusion/fuel_assembly/fuel_injector.dm
@@ -34,30 +34,30 @@
else
Inject()
-/obj/machinery/fusion_fuel_injector/attackby(obj/item/W, mob/user)
+/obj/machinery/fusion_fuel_injector/attackby(obj/item/attacking_item, mob/user)
- if(W.ismultitool())
+ if(attacking_item.ismultitool())
var/datum/component/local_network_member/fusion = GetComponent(/datum/component/local_network_member)
fusion.get_new_tag(user)
return
- if(istype(W, /obj/item/fuel_assembly))
+ if(istype(attacking_item, /obj/item/fuel_assembly))
if(injecting)
to_chat(user, SPAN_WARNING("Shut \the [src] off before playing with the fuel rod!"))
return
- if(!user.unEquip(W, 0, src))
+ if(!user.unEquip(attacking_item, 0, src))
return
if(cur_assembly)
- visible_message(SPAN_NOTICE("\The [user] swaps \the [src]'s [cur_assembly] for \a [W]."))
+ visible_message(SPAN_NOTICE("\The [user] swaps \the [src]'s [cur_assembly] for \a [attacking_item]."))
else
- visible_message(SPAN_NOTICE("\The [user] inserts \a [W] into \the [src]."))
+ visible_message(SPAN_NOTICE("\The [user] inserts \a [attacking_item] into \the [src]."))
if(cur_assembly)
cur_assembly.dropInto(loc)
user.put_in_hands(cur_assembly)
- cur_assembly = W
+ cur_assembly = attacking_item
return
- if(W.iswelder())
+ if(attacking_item.iswelder())
if(injecting)
to_chat(user, SPAN_WARNING("Shut \the [src] off first!"))
return
diff --git a/code/modules/power/fusion/gyrotron/gyrotron.dm b/code/modules/power/fusion/gyrotron/gyrotron.dm
index 05466c7d4c7..b5b8dec5224 100644
--- a/code/modules/power/fusion/gyrotron/gyrotron.dm
+++ b/code/modules/power/fusion/gyrotron/gyrotron.dm
@@ -39,8 +39,8 @@
else
icon_state = "emitter-off"
-/obj/machinery/power/emitter/gyrotron/attackby(obj/item/W, mob/user)
- if(W.ismultitool())
+/obj/machinery/power/emitter/gyrotron/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.ismultitool())
var/datum/component/local_network_member/fusion = GetComponent(/datum/component/local_network_member)
fusion.get_new_tag(user)
return
diff --git a/code/modules/power/fusion/kinetic_harvester.dm b/code/modules/power/fusion/kinetic_harvester.dm
index 0b458fab3b2..9c1f8a7557f 100644
--- a/code/modules/power/fusion/kinetic_harvester.dm
+++ b/code/modules/power/fusion/kinetic_harvester.dm
@@ -26,8 +26,8 @@
ui_interact(user)
return TRUE
-/obj/machinery/kinetic_harvester/attackby(obj/item/thing, mob/user)
- if(thing.ismultitool())
+/obj/machinery/kinetic_harvester/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.ismultitool())
var/datum/component/local_network_member/lanm = GetComponent(/datum/component/local_network_member)
if(lanm.get_new_tag(user))
find_core()
diff --git a/code/modules/power/generator.dm b/code/modules/power/generator.dm
index 1917fa78090..55a4e9feccc 100644
--- a/code/modules/power/generator.dm
+++ b/code/modules/power/generator.dm
@@ -170,9 +170,9 @@
return
attack_hand(user)
-/obj/machinery/power/generator/attackby(obj/item/W as obj, mob/user as mob)
- if(W.iswrench())
- playsound(src.loc, W.usesound, 75, 1)
+/obj/machinery/power/generator/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.iswrench())
+ playsound(src.loc, attacking_item.usesound, 75, 1)
anchored = !anchored
user.visible_message("[user.name] [anchored ? "secures" : "unsecures"] the bolts holding [src.name] to the floor.", \
"You [anchored ? "secure" : "unsecure"] the bolts holding [src] to the floor.", \
diff --git a/code/modules/power/gravitygenerator.dm b/code/modules/power/gravitygenerator.dm
index 997012cb23a..eac1ca6f4ac 100644
--- a/code/modules/power/gravitygenerator.dm
+++ b/code/modules/power/gravitygenerator.dm
@@ -64,8 +64,8 @@
/obj/machinery/gravity_generator/part
var/obj/machinery/gravity_generator/main/main_part = null
-/obj/machinery/gravity_generator/part/attackby(obj/item/I as obj, mob/user as mob)
- return main_part.attackby(I, user)
+/obj/machinery/gravity_generator/part/attackby(obj/item/attacking_item, mob/user)
+ return main_part.attackby(attacking_item, user)
/obj/machinery/gravity_generator/part/get_status()
return main_part.get_status()
@@ -199,24 +199,24 @@
// Interaction
// Fixing the gravity generator.
-/obj/machinery/gravity_generator/main/attackby(obj/item/I as obj, mob/user as mob)
+/obj/machinery/gravity_generator/main/attackby(obj/item/attacking_item, mob/user)
var/old_broken_state = broken_state
switch(broken_state)
if(GRAV_NEEDS_SCREWDRIVER)
- if(I.isscrewdriver())
+ if(attacking_item.isscrewdriver())
to_chat(user, "You secure the screws of the framework.")
- playsound(src.loc, I.usesound, 50, 1)
+ playsound(src.loc, attacking_item.usesound, 50, 1)
broken_state++
if(GRAV_NEEDS_WELDING)
- if(I.iswelder())
- var/obj/item/weldingtool/WT = I
+ if(attacking_item.iswelder())
+ var/obj/item/weldingtool/WT = attacking_item
if(WT.use(1, user))
to_chat(user, "You mend the damaged framework.")
playsound(src.loc, 'sound/items/welder_pry.ogg', 50, 1)
broken_state++
if(GRAV_NEEDS_PLASTEEL)
- if(istype(I, /obj/item/stack/material/plasteel))
- var/obj/item/stack/material/plasteel/PS = I
+ if(istype(attacking_item, /obj/item/stack/material/plasteel))
+ var/obj/item/stack/material/plasteel/PS = attacking_item
if(PS.amount >= 10)
PS.use(10)
to_chat(user, "You add the plating to the framework.")
@@ -225,19 +225,19 @@
else
to_chat(user, "You need 10 sheets of plasteel.")
if(GRAV_NEEDS_WRENCH)
- if(I.iswrench())
+ if(attacking_item.iswrench())
to_chat(user, "You secure the plating to the framework.")
- playsound(src.loc, I.usesound, 75, 1)
+ playsound(src.loc, attacking_item.usesound, 75, 1)
set_fix()
else
..()
- if(I.iscrowbar())
+ if(attacking_item.iscrowbar())
if(backpanelopen)
- playsound(src.loc, I.usesound, 50, 1)
+ playsound(src.loc, attacking_item.usesound, 50, 1)
to_chat(user, "You replace the back panel.")
backpanelopen = 0
else
- playsound(src.loc, I.usesound, 50, 1)
+ playsound(src.loc, attacking_item.usesound, 50, 1)
to_chat(user, "You open the back panel.")
backpanelopen = 1
diff --git a/code/modules/power/lights/bulbs.dm b/code/modules/power/lights/bulbs.dm
index 898634e3fc9..f5b9223ca27 100644
--- a/code/modules/power/lights/bulbs.dm
+++ b/code/modules/power/lights/bulbs.dm
@@ -59,10 +59,10 @@
// attack bulb/tube with object
// if a syringe, can inject phoron to make it explode
-/obj/item/light/attackby(var/obj/item/I, var/mob/user)
+/obj/item/light/attackby(obj/item/attacking_item, mob/user)
. = ..()
- if(istype(I, /obj/item/reagent_containers/syringe))
- var/obj/item/reagent_containers/syringe/S = I
+ if(istype(attacking_item, /obj/item/reagent_containers/syringe))
+ var/obj/item/reagent_containers/syringe/S = attacking_item
to_chat(user, SPAN_NOTICE("You inject the solution into \the [src]."))
diff --git a/code/modules/power/lights/construction.dm b/code/modules/power/lights/construction.dm
index b488fc3616f..b5c6491a0f8 100644
--- a/code/modules/power/lights/construction.dm
+++ b/code/modules/power/lights/construction.dm
@@ -47,16 +47,17 @@
else
. += SPAN_WARNING("This casing doesn't support a backup power cell.")
-/obj/machinery/light_construct/attackby(obj/item/W, mob/living/user)
+/obj/machinery/light_construct/attackby(obj/item/attacking_item, mob/user)
add_fingerprint(user)
- if(W.iswrench())
+ if(attacking_item.iswrench())
switch(stage)
if(1)
to_chat(user, SPAN_NOTICE("You begin taking \the [src] apart..."))
- if(!W.use_tool(src, usr, 30, volume = 50))
+ if(!attacking_item.use_tool(src, usr, 30, volume = 50))
return
new /obj/item/stack/material/steel(get_turf(src), sheets_refunded)
- user.visible_message(SPAN_NOTICE("\The [user] takes \the [src] apart."), SPAN_WARNING("You take \the [src] apart."))
+ user.visible_message(SPAN_NOTICE("\The [user] takes \the [src] apart."),
+ SPAN_WARNING("You take \the [src] apart."))
if(cell)
cell.forceMove(get_turf(src))
cell = null
@@ -68,7 +69,7 @@
to_chat(user, SPAN_WARNING("You have to unscrew the case first."))
return
- if(W.iswirecutter())
+ if(attacking_item.iswirecutter())
if(stage != 2)
return
stage = 1
@@ -84,14 +85,16 @@
if ("floorlight")
icon_state = "floortube-construct-stage1"
new /obj/item/stack/cable_coil(get_turf(src), 1, "red")
- user.visible_message(SPAN_NOTICE("\The [user] removes the wiring from \the [src]."), SPAN_NOTICE("You remove the wiring from [src]."), SPAN_WARNING("You hear something being cut."))
+ user.visible_message(SPAN_NOTICE("\The [user] removes the wiring from \the [src]."),
+ SPAN_NOTICE("You remove the wiring from [src]."),
+ SPAN_WARNING("You hear something being cut."))
playsound(get_turf(src), 'sound/items/Wirecutter.ogg', 100, TRUE)
return
- if(W.iscoil())
+ if(attacking_item.iscoil())
if(stage != 1)
return
- var/obj/item/stack/cable_coil/coil = W
+ var/obj/item/stack/cable_coil/coil = attacking_item
if(coil.use(1))
switch(fixture_type)
if("tube")
@@ -105,10 +108,11 @@
if ("floorlight")
icon_state = "floortube-construct-stage2"
stage = 2
- user.visible_message(SPAN_NOTICE("\The [user] adds wires to \the [src]."), SPAN_NOTICE("You add wires to \the [src]."))
+ user.visible_message(SPAN_NOTICE("\The [user] adds wires to \the [src]."),
+ SPAN_NOTICE("You add wires to \the [src]."))
return
- if(W.isscrewdriver())
+ if(attacking_item.isscrewdriver())
if(stage == 2)
switch(fixture_type)
if("tube")
@@ -122,8 +126,10 @@
if ("floorlight")
icon_state = "floortube_empty"
stage = 3
- user.visible_message(SPAN_NOTICE("\The [user] closes \the [src]'s casing."), SPAN_NOTICE("You close \the [src]'s casing."), SPAN_WARNING("You hear something being screwed in."))
- playsound(get_turf(src), W.usesound, 75, TRUE)
+ user.visible_message(SPAN_NOTICE("\The [user] closes \the [src]'s casing."),
+ SPAN_NOTICE("You close \the [src]'s casing."),
+ SPAN_WARNING("You hear something being screwed in."))
+ playsound(get_turf(src), attacking_item.usesound, 75, TRUE)
switch(fixture_type)
if("tube")
@@ -147,25 +153,27 @@
qdel(src)
return
- if(istype(W, /obj/item/cell))
+ if(istype(attacking_item, /obj/item/cell))
if(!cell_connectors)
to_chat(user, SPAN_WARNING("\The [src] does not have power cell connectors."))
return
- if(!user.unEquip(W))
+ if(!user.unEquip(attacking_item))
return
if(cell)
- user.visible_message(SPAN_NOTICE("\The [user] swaps \the [W] out for \the [src]'s cell."), SPAN_NOTICE("You swap out \the [src]'s cell out for \the [W]."))
- user.drop_from_inventory(W, src)
+ user.visible_message(SPAN_NOTICE("\The [user] swaps \the [attacking_item] out for \the [src]'s cell."),
+ SPAN_NOTICE("You swap out \the [src]'s cell out for \the [attacking_item]."))
+ user.drop_from_inventory(attacking_item, src)
cell.forceMove(get_turf(src))
user.put_in_hands(cell)
else
- user.visible_message(SPAN_NOTICE("\The [user] installs \the [W] into \the [src]."), SPAN_NOTICE("You hook up \the [W] to \the [src]'s cell terminals."))
- user.drop_from_inventory(W, src)
- cell = W
+ user.visible_message(SPAN_NOTICE("\The [user] installs \the [attacking_item] into \the [src]."),
+ SPAN_NOTICE("You hook up \the [attacking_item] to \the [src]'s cell terminals."))
+ user.drop_from_inventory(attacking_item, src)
+ cell = attacking_item
playsound(get_turf(src), 'sound/machines/click.ogg', 50, TRUE)
return
- if(W.iscrowbar())
+ if(attacking_item.iscrowbar())
if(!cell_connectors)
to_chat(user, SPAN_WARNING("\The [src] does not have a power cell connector."))
return
@@ -173,8 +181,9 @@
to_chat(user, SPAN_WARNING("\The [src] does not have a power cell installed."))
return
- playsound(get_turf(src), W.usesound, 50, TRUE)
- visible_message(SPAN_NOTICE("\The [user] removes \the [cell] from the [src]."), SPAN_NOTICE("You remove \the [cell] from \the [src]."))
+ playsound(get_turf(src), attacking_item.usesound, 50, TRUE)
+ visible_message(SPAN_NOTICE("\The [user] removes \the [cell] from the [src]."),
+ SPAN_NOTICE("You remove \the [cell] from \the [src]."))
cell.forceMove(get_turf(src))
user.put_in_hands(cell)
cell = null
diff --git a/code/modules/power/lights/fixtures.dm b/code/modules/power/lights/fixtures.dm
index 50d56249d70..ab3a7264f0a 100644
--- a/code/modules/power/lights/fixtures.dm
+++ b/code/modules/power/lights/fixtures.dm
@@ -399,23 +399,23 @@
// attack with item - insert light (if right type), otherwise try to break the light
-/obj/machinery/light/attackby(obj/item/W, mob/user)
+/obj/machinery/light/attackby(obj/item/attacking_item, mob/user)
//Light replacer code
- if(istype(W, /obj/item/device/lightreplacer))
- var/obj/item/device/lightreplacer/LR = W
+ if(istype(attacking_item, /obj/item/device/lightreplacer))
+ var/obj/item/device/lightreplacer/LR = attacking_item
if(isliving(user))
var/mob/living/U = user
LR.ReplaceLight(src, U)
return
// attempt to insert light
- if(istype(W, /obj/item/light))
+ if(istype(attacking_item, /obj/item/light))
if(status != LIGHT_EMPTY)
to_chat(user, SPAN_WARNING("There's already a [fitting] inserted."))
return
else
src.add_fingerprint(user)
- var/obj/item/light/L = W
+ var/obj/item/light/L = attacking_item
if(istype(L, light_type))
status = L.status
to_chat(user, SPAN_NOTICE("You insert \the [L]."))
@@ -448,14 +448,14 @@
//If xenos decide they want to smash a light bulb with a toolbox, who am I to stop them? /N
else if(status != LIGHT_BROKEN && status != LIGHT_EMPTY)
- smash_check(W, user, "smashes", "smashes", TRUE)
+ smash_check(attacking_item, user, "smashes", "smashes", TRUE)
else if(status == LIGHT_BROKEN)
- smash_check(W, user, "completely shatters", "shatters completely", FALSE)
+ smash_check(attacking_item, user, "completely shatters", "shatters completely", FALSE)
// attempt to stick weapon into light socket
else if(status == LIGHT_EMPTY)
- if(W.isscrewdriver()) //If it's a screwdriver open it.
- playsound(get_turf(src), W.usesound, 75, 1)
+ if(attacking_item.isscrewdriver()) //If it's a screwdriver open it.
+ playsound(get_turf(src), attacking_item.usesound, 75, 1)
user.visible_message(SPAN_NOTICE("\The [user] opens \the [src]'s casing."), SPAN_NOTICE("You open \the [src]'s casing."), SPAN_NOTICE("You hear a noise."))
var/obj/machinery/light_construct/newlight = null
switch(fitting)
@@ -482,8 +482,8 @@
qdel(src)
return
- to_chat(user, SPAN_WARNING("You stick \the [W] into the light socket!"))
- if(has_power() && (W.obj_flags & OBJ_FLAG_CONDUCTABLE))
+ to_chat(user, SPAN_WARNING("You stick \the [attacking_item] into the light socket!"))
+ if(has_power() && (attacking_item.obj_flags & OBJ_FLAG_CONDUCTABLE))
spark(src, 3)
if(prob(75))
electrocute_mob(user, get_area(src), src, rand(0.7,1.0))
diff --git a/code/modules/power/portgen.dm b/code/modules/power/portgen.dm
index 91c27252fda..2066e5b835f 100644
--- a/code/modules/power/portgen.dm
+++ b/code/modules/power/portgen.dm
@@ -265,9 +265,9 @@
emagged = TRUE
return TRUE
-/obj/machinery/power/portgen/basic/attackby(var/obj/item/O, var/mob/user)
- if(istype(O, sheet_path))
- var/obj/item/stack/addstack = O
+/obj/machinery/power/portgen/basic/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, sheet_path))
+ var/obj/item/stack/addstack = attacking_item
var/amount = min((max_sheets - sheets), addstack.amount)
if(amount < 1)
to_chat(user, SPAN_NOTICE("The [name] is full!"))
@@ -277,7 +277,7 @@
addstack.use(amount)
return
else if(!active)
- if(O.iswrench())
+ if(attacking_item.iswrench())
if(!anchored)
connect_to_network()
@@ -289,14 +289,14 @@
playsound(loc, 'sound/items/Deconstruct.ogg', 50, 1)
anchored = !anchored
- else if(O.isscrewdriver())
+ else if(attacking_item.isscrewdriver())
open = !open
- playsound(loc, O.usesound, 50, 1)
+ playsound(loc, attacking_item.usesound, 50, 1)
if(open)
to_chat(user, SPAN_NOTICE("You open the access panel."))
else
to_chat(user, SPAN_NOTICE("You close the access panel."))
- else if(open && O.iscrowbar())
+ else if(open && attacking_item.iscrowbar())
var/obj/machinery/constructable_frame/machine_frame/new_frame = new /obj/machinery/constructable_frame/machine_frame(loc)
for(var/obj/item/I in component_parts)
I.forceMove(loc)
@@ -514,9 +514,9 @@
if(power_output > max_safe_output)
icon_state = "reactordanger"
-/obj/machinery/power/portgen/basic/fusion/attackby(var/obj/item/O, var/mob/user)
- if(istype(O, /obj/item/reagent_containers))
- var/obj/item/reagent_containers/R = O
+/obj/machinery/power/portgen/basic/fusion/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/reagent_containers))
+ var/obj/item/reagent_containers/R = attacking_item
if(R.standard_pour_into(user, src))
if(reagents.has_reagent(/singleton/reagent/coolant))
audible_message("[src] blips happily!")
diff --git a/code/modules/power/power.dm b/code/modules/power/power.dm
index df35cfa01c3..caec863b595 100644
--- a/code/modules/power/power.dm
+++ b/code/modules/power/power.dm
@@ -82,11 +82,11 @@
// attach a wire to a power machine - leads from the turf you are standing on
//almost never called, overwritten by all power machines but terminal and generator
-/obj/machinery/power/attackby(obj/item/W, mob/user)
+/obj/machinery/power/attackby(obj/item/attacking_item, mob/user)
- if(W.iscoil())
+ if(attacking_item.iscoil())
- var/obj/item/stack/cable_coil/coil = W
+ var/obj/item/stack/cable_coil/coil = attacking_item
var/turf/T = user.loc
diff --git a/code/modules/power/radial_floodlight.dm b/code/modules/power/radial_floodlight.dm
index b42ff5ec687..6e335098723 100644
--- a/code/modules/power/radial_floodlight.dm
+++ b/code/modules/power/radial_floodlight.dm
@@ -32,15 +32,17 @@
toggle_active(FALSE)
return
-/obj/machinery/power/radial_floodlight/attackby(obj/item/W, mob/user)
- if(W.iswrench())
+/obj/machinery/power/radial_floodlight/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.iswrench())
anchored = !anchored
- user.visible_message(SPAN_NOTICE("\The [user] [anchored ? "" : "un"]secures \the [src] [anchored ? "to" : "from"] the floor."), SPAN_NOTICE("You [anchored ? "" : "un"]secure \the [src] [anchored ? "to" : "from"] the floor."), SPAN_WARNING("You hear a ratcheting noise."))
+ user.visible_message(SPAN_NOTICE("\The [user] [anchored ? "" : "un"]secures \the [src] [anchored ? "to" : "from"] the floor."),
+ SPAN_NOTICE("You [anchored ? "" : "un"]secure \the [src] [anchored ? "to" : "from"] the floor."),
+ SPAN_WARNING("You hear a ratcheting noise."))
if(!anchored)
toggle_active(FALSE)
else
connect_to_network()
- playsound(get_turf(src), W.usesound, 75, TRUE)
+ playsound(get_turf(src), attacking_item.usesound, 75, TRUE)
return
return ..()
diff --git a/code/modules/power/rtg.dm b/code/modules/power/rtg.dm
index e316c6cb7dc..be334cd036f 100644
--- a/code/modules/power/rtg.dm
+++ b/code/modules/power/rtg.dm
@@ -47,12 +47,12 @@
power_gen = initial(power_gen) * part_level
-/obj/machinery/power/rtg/attackby(obj/item/I, mob/user, params)
- if(default_part_replacement(user, I))
+/obj/machinery/power/rtg/attackby(obj/item/attacking_item, mob/user, params)
+ if(default_part_replacement(user, attacking_item))
return
- else if(default_deconstruction_screwdriver(user, I))
+ else if(default_deconstruction_screwdriver(user, attacking_item))
return
- else if(default_deconstruction_crowbar(user, I))
+ else if(default_deconstruction_crowbar(user, attacking_item))
return
return ..()
diff --git a/code/modules/power/singularity/emitter.dm b/code/modules/power/singularity/emitter.dm
index f94cd86ce76..03ad6d9d63a 100644
--- a/code/modules/power/singularity/emitter.dm
+++ b/code/modules/power/singularity/emitter.dm
@@ -161,22 +161,22 @@
A.launch_projectile(get_step(src, dir))
shot_counter++
-/obj/machinery/power/emitter/attackby(obj/item/W, mob/user)
- if(W.iswrench())
+/obj/machinery/power/emitter/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.iswrench())
if(active)
to_chat(user, SPAN_WARNING("You cannot unbolt \the [src] while it's active."))
return
switch(state)
if(EMITTER_LOOSE)
state = EMITTER_BOLTED
- playsound(get_turf(src), W.usesound, 75, TRUE)
+ playsound(get_turf(src), attacking_item.usesound, 75, TRUE)
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(EMITTER_BOLTED)
state = EMITTER_LOOSE
- playsound(get_turf(src), W.usesound, 75, TRUE)
+ playsound(get_turf(src), attacking_item.usesound, 75, TRUE)
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."))
@@ -185,8 +185,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
if(active)
to_chat(user, SPAN_NOTICE("You cannot unweld \the [src] while it's active."))
return
@@ -199,7 +199,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 = EMITTER_WELDED
@@ -213,7 +213,7 @@
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 = EMITTER_BOLTED
@@ -223,7 +223,7 @@
to_chat(user, SPAN_WARNING("You need more welding fuel to complete this task."))
return
- if(W.GetID())
+ if(attacking_item.GetID())
if(emagged)
to_chat(user, SPAN_WARNING("The lock seems to be broken."))
return
diff --git a/code/modules/power/singularity/field_generator.dm b/code/modules/power/singularity/field_generator.dm
index f2b2ef920aa..e6f12df418d 100644
--- a/code/modules/power/singularity/field_generator.dm
+++ b/code/modules/power/singularity/field_generator.dm
@@ -93,33 +93,33 @@ field_generator power level display
return
-/obj/machinery/field_generator/attackby(obj/item/W, mob/user)
+/obj/machinery/field_generator/attackby(obj/item/attacking_item, mob/user)
if(active)
to_chat(user, "The [src] needs to be off.")
return
- else if(W.iswrench())
+ else if(attacking_item.iswrench())
switch(state)
if(0)
state = 1
- playsound(src.loc, W.usesound, 75, 1)
- user.visible_message("[user.name] secures [src.name] to the floor.", \
- "You secure the external reinforcing bolts to the floor.", \
- "You hear ratchet")
+ playsound(src.loc, attacking_item.usesound, 75, 1)
+ user.visible_message("[user.name] secures [src.name] to the floor.",
+ "You secure the external reinforcing bolts to the floor.",
+ "You hear ratchet")
src.anchored = 1
update_icon()
if(1)
state = 0
- playsound(src.loc, W.usesound, 75, 1)
- user.visible_message("[user.name] unsecures [src.name] reinforcing bolts from the floor.", \
- "You undo the external reinforcing bolts.", \
- "You hear ratchet")
+ playsound(src.loc, attacking_item.usesound, 75, 1)
+ user.visible_message("[user.name] unsecures [src.name] reinforcing bolts from the floor.",
+ "You undo the external reinforcing bolts.",
+ "You hear ratchet")
src.anchored = 0
update_icon()
if(2)
to_chat(user, "The [src.name] needs to be unwelded from the floor.")
return
- else if(W.iswelder())
- var/obj/item/weldingtool/WT = W
+ else if(attacking_item.iswelder())
+ var/obj/item/weldingtool/WT = attacking_item
switch(state)
if(0)
to_chat(user, "The [src.name] needs to be wrenched to the floor.")
@@ -127,10 +127,10 @@ field_generator power level display
if(1)
if (WT.use(0,user))
playsound(src.loc, 'sound/items/welder_pry.ogg', 50, 1)
- user.visible_message("[user.name] starts to weld the [src.name] to the floor.", \
- "You start to weld the [src] to the floor.", \
- "You hear welding")
- if(W.use_tool(src, user, 20, volume = 50))
+ user.visible_message("[user.name] starts to weld the [src.name] to the floor.",
+ "You start to weld the [src] to the floor.",
+ "You hear welding")
+ if(attacking_item.use_tool(src, user, 20, volume = 50))
if(!src || !WT.isOn()) return
state = 2
to_chat(user, "You weld the field generator to the floor.")
@@ -140,10 +140,10 @@ field_generator power level display
if(2)
if (WT.use(0,user))
playsound(src.loc, 'sound/items/welder_pry.ogg', 50, 1)
- user.visible_message("[user.name] starts to cut the [src.name] free from the floor.", \
- "You start to cut the [src] free from the floor.", \
- "You hear welding")
- if(W.use_tool(src, user, 20, volume = 50))
+ user.visible_message("[user.name] starts to cut the [src.name] free from the floor.",
+ "You start to cut the [src] free from the floor.",
+ "You hear welding")
+ if(attacking_item.use_tool(src, user, 20, volume = 50))
if(!src || !WT.isOn()) return
state = 1
to_chat(user, "You cut the [src] free from the floor.")
diff --git a/code/modules/power/singularity/generator.dm b/code/modules/power/singularity/generator.dm
index d3e088d573d..22c7c30be08 100644
--- a/code/modules/power/singularity/generator.dm
+++ b/code/modules/power/singularity/generator.dm
@@ -24,18 +24,18 @@
new creation_type(T, 50)
if(src) qdel(src)
-/obj/machinery/the_singularitygen/attackby(obj/item/W, mob/user)
- if(W.iswrench())
+/obj/machinery/the_singularitygen/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.iswrench())
anchored = !anchored
- playsound(src.loc, W.usesound, 75, 1)
+ playsound(src.loc, attacking_item.usesound, 75, 1)
if(anchored)
- user.visible_message("[user.name] secures [src.name] to the floor.", \
- "You secure the [src.name] to the floor.", \
- "You hear a ratchet")
+ user.visible_message("[user.name] secures [src.name] to the floor.",
+ "You secure the [src.name] to the floor.",
+ "You hear a ratchet")
else
- user.visible_message("[user.name] unsecures [src.name] from the floor.", \
- "You unsecure the [src.name] from the floor.", \
- "You hear a ratchet")
+ user.visible_message("[user.name] unsecures [src.name] from the floor.",
+ "You unsecure the [src.name] from the floor.",
+ "You hear a ratchet")
update_icon()
return
return ..()
diff --git a/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm b/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm
index 5c50cab0ca3..bc1cd8cb290 100644
--- a/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm
+++ b/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm
@@ -95,9 +95,9 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
if(3)
. += "It seems completely assembled."
-/obj/structure/particle_accelerator/attackby(obj/item/W, mob/user)
- if(istool(W))
- if(process_tool_hit(W, user))
+/obj/structure/particle_accelerator/attackby(obj/item/attacking_item, mob/user)
+ if(istool(attacking_item))
+ if(process_tool_hit(attacking_item, user))
return
..()
return
@@ -246,9 +246,9 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
if(3)
. += "It seems completely assembled."
-/obj/machinery/particle_accelerator/attackby(obj/item/W, mob/user)
- if(istool(W))
- if(process_tool_hit(W,user))
+/obj/machinery/particle_accelerator/attackby(obj/item/attacking_item, mob/user)
+ if(istool(attacking_item))
+ if(process_tool_hit(attacking_item, user))
return
..()
return
diff --git a/code/modules/power/smes.dm b/code/modules/power/smes.dm
index 25549421162..20955e9c93c 100644
--- a/code/modules/power/smes.dm
+++ b/code/modules/power/smes.dm
@@ -327,8 +327,8 @@
add_fingerprint(user)
ui_interact(user)
-/obj/machinery/power/smes/attackby(var/obj/item/W, var/mob/user)
- if(W.isscrewdriver())
+/obj/machinery/power/smes/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.isscrewdriver())
if(!open_hatch)
if(is_badly_damaged())
to_chat(user, SPAN_WARNING("\The [src]'s maintenance panel is broken open!"))
@@ -351,9 +351,9 @@
to_chat(user, "You need to open access hatch on [src] first!")
return 0
- if(W.iscoil() && !terminal && !building_terminal)
+ if(attacking_item.iscoil() && !terminal && !building_terminal)
building_terminal = 1
- var/obj/item/stack/cable_coil/CC = W
+ var/obj/item/stack/cable_coil/CC = attacking_item
if (CC.get_amount() <= 10)
to_chat(user, "You need more cables.")
building_terminal = 0
@@ -370,7 +370,7 @@
stat = 0
return 0
- else if(W.iswirecutter() && terminal && !building_terminal)
+ else if(attacking_item.iswirecutter() && terminal && !building_terminal)
building_terminal = 1
var/turf/tempTDir = terminal.loc
if (istype(tempTDir))
@@ -378,7 +378,7 @@
to_chat(user, "You must remove the floor plating first.")
else
to_chat(user, "You begin to cut the cables...")
- if(W.use_tool(src, user, 50, volume = 50))
+ if(attacking_item.use_tool(src, user, 50, volume = 50))
if (prob(50) && electrocute_mob(usr, terminal.powernet, terminal))
big_spark.queue()
building_terminal = 0
diff --git a/code/modules/power/smes_construction.dm b/code/modules/power/smes_construction.dm
index 65177393f69..183bee1f6db 100644
--- a/code/modules/power/smes_construction.dm
+++ b/code/modules/power/smes_construction.dm
@@ -375,9 +375,8 @@
..()
// Proc: attackby()
-// Parameters: 2 (W - object that was used on this machine, user - person which used the object)
// Description: Handles tool interaction. Allows deconstruction/upgrading/fixing.
-/obj/machinery/power/smes/buildable/attackby(var/obj/item/W as obj, var/mob/user as mob)
+/obj/machinery/power/smes/buildable/attackby(obj/item/attacking_item, mob/user)
// No more disassembling of overloaded SMESs. You broke it, now enjoy the consequences.
if (failing)
to_chat(user, "The [src]'s screen is flashing with alerts. It seems to be overloaded! Touching it now is probably not a good idea.")
@@ -386,11 +385,11 @@
// - Hatch is open, so we can modify the SMES
// - No action was taken in parent function (terminal de/construction atm).
if (..())
- if(W.iswelder())
+ if(attacking_item.iswelder())
if(health == initial(health))
to_chat(user, SPAN_WARNING("\The [src] is already repaired."))
return
- var/obj/item/weldingtool/WT = W
+ var/obj/item/weldingtool/WT = attacking_item
if(!WT.welding)
to_chat(user, SPAN_WARNING("\The [src] isn't lit."))
return
@@ -404,7 +403,7 @@
busted = FALSE
return
// Multitool - change RCON tag
- if(W.ismultitool())
+ if(attacking_item.ismultitool())
var/newtag = input(user, "Enter new RCON tag. Use \"NO_TAG\" to disable RCON or leave empty to cancel.", "SMES RCON system") as text
if(newtag)
RCon_tag = newtag
@@ -429,12 +428,12 @@
failure_probability = 0
// Crowbar - Disassemble the SMES.
- if(W.iscrowbar())
+ if(attacking_item.iscrowbar())
if (terminal)
to_chat(user, "You have to disassemble the terminal first!")
return
- playsound(get_turf(src), W.usesound, 50, 1)
+ playsound(get_turf(src), attacking_item.usesound, 50, 1)
to_chat(user, "You begin to disassemble the [src]!")
if (do_after(usr, 100 * cur_coils, src, DO_REPAIR_CONSTRUCT)) // More coils = takes longer to disassemble. It's complex so largest one with 5 coils will take 50s
@@ -453,7 +452,7 @@
return
// Superconducting Magnetic Coil - Upgrade the SMES
- else if(istype(W, /obj/item/smes_coil))
+ else if(istype(attacking_item, /obj/item/smes_coil))
if (cur_coils < max_coils)
if (failure_probability && prob(failure_probability))
@@ -461,9 +460,9 @@
return
to_chat(usr, "You install the coil into the SMES unit!")
- user.drop_from_inventory(W,src)
+ user.drop_from_inventory(attacking_item,src)
cur_coils ++
- component_parts += W
+ component_parts += attacking_item
recalc_coils()
else
to_chat(usr, "You can't insert more coils to this SMES unit!")
diff --git a/code/modules/power/solar.dm b/code/modules/power/solar.dm
index 38a7faf25f3..3010b6a266c 100644
--- a/code/modules/power/solar.dm
+++ b/code/modules/power/solar.dm
@@ -56,12 +56,12 @@
-/obj/machinery/power/solar/attackby(obj/item/W, mob/user)
+/obj/machinery/power/solar/attackby(obj/item/attacking_item, mob/user)
- if(W.iscrowbar())
+ if(attacking_item.iscrowbar())
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
user.visible_message("[user] begins to take the glass off the solar panel.")
- if(W.use_tool(src, user, 50, volume = 50))
+ if(attacking_item.use_tool(src, user, 50, volume = 50))
var/obj/item/solar_assembly/S = locate() in src
if(S)
S.forceMove(src.loc)
@@ -70,9 +70,9 @@
user.visible_message("[user] takes the glass off the solar panel.")
qdel(src)
return
- else if (W)
+ else if (attacking_item)
src.add_fingerprint(user)
- src.health -= W.force
+ src.health -= attacking_item.force
src.healthcheck()
..()
@@ -217,25 +217,25 @@
glass_type = null
-/obj/item/solar_assembly/attackby(var/obj/item/W, var/mob/user)
+/obj/item/solar_assembly/attackby(obj/item/attacking_item, mob/user)
if(!anchored && isturf(loc))
- if(W.iswrench())
+ if(attacking_item.iswrench())
anchored = 1
user.visible_message("[user] wrenches the solar assembly into place.")
- playsound(src.loc, W.usesound, 75, 1)
+ playsound(src.loc, attacking_item.usesound, 75, 1)
return 1
else
- if(W.iswrench())
+ if(attacking_item.iswrench())
anchored = 0
user.visible_message("[user] unwrenches the solar assembly from it's place.")
- playsound(src.loc, W.usesound, 75, 1)
+ playsound(src.loc, attacking_item.usesound, 75, 1)
return 1
- if(istype(W, /obj/item/stack/material) && (W.get_material_name() == "glass" || W.get_material_name() == MATERIAL_GLASS_REINFORCED))
- var/obj/item/stack/material/S = W
+ if(istype(attacking_item, /obj/item/stack/material) && (attacking_item.get_material_name() == "glass" || attacking_item.get_material_name() == MATERIAL_GLASS_REINFORCED))
+ var/obj/item/stack/material/S = attacking_item
if(S.use(2))
- glass_type = W.type
+ glass_type = attacking_item.type
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
user.visible_message("[user] places the glass on the solar assembly.")
if(tracker)
@@ -248,14 +248,14 @@
return 1
if(!tracker)
- if(istype(W, /obj/item/tracker_electronics))
+ if(istype(attacking_item, /obj/item/tracker_electronics))
tracker = 1
- user.drop_from_inventory(W,get_turf(src))
- qdel(W)
+ user.drop_from_inventory(attacking_item, get_turf(src))
+ qdel(attacking_item)
user.visible_message("[user] inserts the electronics into the solar assembly.")
return 1
else
- if(W.iscrowbar())
+ if(attacking_item.iscrowbar())
new /obj/item/tracker_electronics(src.loc)
tracker = 0
user.visible_message("[user] takes out the electronics from the solar assembly.")
@@ -379,8 +379,8 @@
return
-/obj/machinery/power/solar_control/attackby(var/obj/I, user as mob)
- if(I.isscrewdriver())
+/obj/machinery/power/solar_control/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.isscrewdriver())
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
if(do_after(user, 2 SECONDS, src, DO_REPAIR_CONSTRUCT))
if (src.stat & BROKEN)
diff --git a/code/modules/power/tesla/coil.dm b/code/modules/power/tesla/coil.dm
index 6dda3247f5c..ffd07a111da 100644
--- a/code/modules/power/tesla/coil.dm
+++ b/code/modules/power/tesla/coil.dm
@@ -28,16 +28,16 @@
power_multiplier += C.rating
input_power_multiplier = power_multiplier
-/obj/machinery/power/tesla_coil/attackby(obj/item/W, mob/user)
- if(default_deconstruction_screwdriver(user, W))
+/obj/machinery/power/tesla_coil/attackby(obj/item/attacking_item, mob/user)
+ if(default_deconstruction_screwdriver(user, attacking_item))
return
- if(default_deconstruction_crowbar(user, W))
+ if(default_deconstruction_crowbar(user, attacking_item))
return
- if(default_part_replacement(user, W))
+ if(default_part_replacement(user, attacking_item))
return
- if(W.iswrench())
- playsound(src.loc, W.usesound, 50, 1)
+ if(attacking_item.iswrench())
+ playsound(src.loc, attacking_item.usesound, 50, 1)
to_chat(user, "You [anchored ? "unfasten" : "fasten"] [src] to the flooring.")
anchored = !anchored
update_icon()
@@ -82,16 +82,16 @@
lights_image.layer = EFFECTS_ABOVE_LIGHTING_LAYER
add_overlay(lights_image)
-/obj/machinery/power/grounding_rod/attackby(obj/item/W, mob/user)
- if(default_deconstruction_screwdriver(user, W))
+/obj/machinery/power/grounding_rod/attackby(obj/item/attacking_item, mob/user)
+ if(default_deconstruction_screwdriver(user, attacking_item))
return
- if(default_deconstruction_crowbar(user, W))
+ if(default_deconstruction_crowbar(user, attacking_item))
return
- if(default_part_replacement(user, W))
+ if(default_part_replacement(user, attacking_item))
return
- if(W.iswrench())
- playsound(src.loc, W.usesound, 50, 1)
+ if(attacking_item.iswrench())
+ playsound(src.loc, attacking_item.usesound, 50, 1)
to_chat(user, "You [anchored ? "unfasten" : "fasten"] [src] to the flooring.")
anchored = !anchored
update_icon()
diff --git a/code/modules/power/tracker.dm b/code/modules/power/tracker.dm
index f3bd5e7f61b..0c96cab60c5 100644
--- a/code/modules/power/tracker.dm
+++ b/code/modules/power/tracker.dm
@@ -57,12 +57,12 @@
if(powernet && (powernet == control?.powernet)) //update if we're still in the same powernet
control.cdir = angle
-/obj/machinery/power/tracker/attackby(var/obj/item/W, var/mob/user)
+/obj/machinery/power/tracker/attackby(obj/item/attacking_item, mob/user)
- if(W.iscrowbar())
+ if(attacking_item.iscrowbar())
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
user.visible_message("[user] begins to take the glass off the solar tracker.")
- if(W.use_tool(src, user, 50, volume = 50))
+ if(attacking_item.use_tool(src, user, 50, volume = 50))
var/obj/item/solar_assembly/S = locate() in src
if(S)
S.forceMove(src.loc)
diff --git a/code/modules/projectiles/ammunition.dm b/code/modules/projectiles/ammunition.dm
index 69177bc1a33..691957871c6 100644
--- a/code/modules/projectiles/ammunition.dm
+++ b/code/modules/projectiles/ammunition.dm
@@ -40,14 +40,14 @@
set_dir(pick(GLOB.alldirs)) //spin spent casings
update_icon()
-/obj/item/ammo_casing/attackby(obj/item/W as obj, mob/user as mob)
- if(W.isscrewdriver())
+/obj/item/ammo_casing/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.isscrewdriver())
if(!BB)
to_chat(user, "There is no bullet in the casing to inscribe anything into.")
return
var/tmp_label = ""
- var/label_text = sanitizeSafe(input(user, "Inscribe some text into \the [initial(BB.name)]","Inscription",tmp_label), MAX_NAME_LEN)
+ var/label_text = sanitizeSafe( tgui_input_text(user, "Inscribe some text into \the [initial(BB.name)]", "Inscription", tmp_label, MAX_NAME_LEN), MAX_NAME_LEN )
if(length(label_text) > 20)
to_chat(user, "The inscription can be at most 20 characters long.")
else if(!label_text)
@@ -56,8 +56,8 @@
else
to_chat(user, "You inscribe \"[label_text]\" into \the [initial(BB.name)].")
BB.name = "[initial(BB.name)] (\"[label_text]\")"
- else if(istype(W, /obj/item/ammo_casing))
- if(W.type != src.type)
+ else if(istype(attacking_item, /obj/item/ammo_casing))
+ if(attacking_item.type != src.type)
to_chat(user, SPAN_WARNING("Ammo of different types cannot stack!"))
return
if(max_stack == 1)
@@ -66,11 +66,11 @@
if(!src.BB)
to_chat(user, SPAN_WARNING("That round is spent!"))
return
- var/obj/item/ammo_casing/B = W
+ var/obj/item/ammo_casing/B = attacking_item
if(!B.BB)
to_chat(user, SPAN_WARNING("Your round is spent!"))
return
- var/obj/item/ammo_pile/pile = new /obj/item/ammo_pile(get_turf(user), list(src, W))
+ var/obj/item/ammo_pile/pile = new /obj/item/ammo_pile(get_turf(user), list(src, attacking_item))
user.put_in_hands(pile)
..()
@@ -136,9 +136,9 @@
QDEL_LIST(stored_ammo)
. = ..()
-/obj/item/ammo_magazine/attackby(obj/item/W as obj, mob/user as mob)
- if(istype(W, /obj/item/ammo_casing))
- var/obj/item/ammo_casing/C = W
+/obj/item/ammo_magazine/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/ammo_casing))
+ var/obj/item/ammo_casing/C = attacking_item
if(C.caliber != caliber)
to_chat(user, "[C] does not fit into [src].")
return
@@ -149,10 +149,10 @@
C.forceMove(src)
stored_ammo.Insert(1, C) //add to the head of the list
update_icon()
- else if(istype(W, /obj/item/gun) && ishuman(user))
+ else if(istype(attacking_item, /obj/item/gun) && ishuman(user))
var/mob/living/carbon/human/H = user
- if(H.check_weapon_affinity(W)) // if we have gun-kata, we can reload by attacking a magazine
- W.attackby(src, user)
+ if(H.check_weapon_affinity(attacking_item)) // if we have gun-kata, we can reload by attacking a magazine
+ attacking_item.attackby(src, user)
/obj/item/ammo_magazine/attack_self(mob/user)
if(!stored_ammo.len)
diff --git a/code/modules/projectiles/ammunition/ammo_pile.dm b/code/modules/projectiles/ammunition/ammo_pile.dm
index 8c09c4a4c50..4cf89bdd849 100644
--- a/code/modules/projectiles/ammunition/ammo_pile.dm
+++ b/code/modules/projectiles/ammunition/ammo_pile.dm
@@ -73,20 +73,20 @@
if(!(bullet in src)) // if the gun / mag accepted the bullet, it will no longer be in our pile
remove_ammo()
-/obj/item/ammo_pile/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/ammo_casing))
- if(W.type != ammo_type)
- to_chat(user, SPAN_WARNING("\The [W] has a different type of ammunition!"))
+/obj/item/ammo_pile/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/ammo_casing))
+ if(attacking_item.type != ammo_type)
+ to_chat(user, SPAN_WARNING("\The [attacking_item] has a different type of ammunition!"))
return TRUE
if(length(ammo) >= max_ammo)
to_chat(user, SPAN_WARNING("\The [src] is already fully stacked."))
return TRUE
- var/obj/item/ammo_casing/B = W
+ var/obj/item/ammo_casing/B = attacking_item
if(!B.BB)
to_chat(user, SPAN_WARNING("\The [B] is spent!"))
return TRUE
- to_chat(user, SPAN_NOTICE("You add \the [W] to \the [src]."))
- add_ammo(W)
+ to_chat(user, SPAN_NOTICE("You add \the [attacking_item] to \the [src]."))
+ add_ammo(attacking_item)
return TRUE
return ..()
diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm
index af9d8a23d5d..2169e82ea22 100644
--- a/code/modules/projectiles/gun.dm
+++ b/code/modules/projectiles/gun.dm
@@ -929,40 +929,40 @@
/obj/item/gun/proc/critical_fail(var/mob/user)
return
-/obj/item/gun/attackby(var/obj/item/I, var/mob/user)
- if(istype(I, /obj/item/material/knife/bayonet))
+/obj/item/gun/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/material/knife/bayonet))
if(!can_bayonet)
- balloon_alert(user, "\the [I.name] doesn't fit")
+ balloon_alert(user, "\the [attacking_item.name] doesn't fit")
return ..()
if(bayonet)
balloon_alert(user, "\the [src] already has a bayonet")
return TRUE
- if(user.l_hand != I && user.r_hand != I)
+ if(user.l_hand != attacking_item && user.r_hand != attacking_item)
balloon_alert(user, "not in hand")
return
- user.drop_from_inventory(I,src)
- bayonet = I
- balloon_alert(user, "[I.name] attached")
- w_class += I.w_class
+ user.drop_from_inventory(attacking_item,src)
+ bayonet = attacking_item
+ balloon_alert(user, "[attacking_item.name] attached")
+ w_class += attacking_item.w_class
update_icon()
return TRUE
- if(istype(pin) && pin.attackby(I, user)) //Allows users to use their ID on a gun with a wireless-control firing pin to register their identity.
+ if(istype(pin) && pin.attackby(attacking_item, user)) //Allows users to use their ID on a gun with a wireless-control firing pin to register their identity.
return TRUE
- if(istype(I, /obj/item/ammo_display))
+ if(istype(attacking_item, /obj/item/ammo_display))
if(!can_ammo_display)
- balloon_alert(user, "\the [I.name] doesn't fit")
+ balloon_alert(user, "\the [attacking_item.name] doesn't fit")
return TRUE
if(ammo_display)
balloon_alert(user, "\the [src] already has an ammo display")
return TRUE
- if(user.l_hand != I && user.r_hand != I)
+ if(user.l_hand != attacking_item && user.r_hand != attacking_item)
balloon_alert(user, "not in hand")
return
@@ -970,14 +970,14 @@
balloon_alert(user, "\the [src] is already displaying its ammo count")
return TRUE
- user.drop_from_inventory(I, src)
- ammo_display = I
+ user.drop_from_inventory(attacking_item, src)
+ ammo_display = attacking_item
displays_maptext = TRUE
- balloon_alert(user, "[I.name] attached")
- w_class += I.w_class
+ balloon_alert(user, "[attacking_item.name] attached")
+ w_class += attacking_item.w_class
return TRUE
- if(I.iscrowbar() && bayonet)
+ if(attacking_item.iscrowbar() && bayonet)
to_chat(user, SPAN_NOTICE("You detach \the [bayonet] from \the [src]."))
bayonet.forceMove(get_turf(src))
user.put_in_hands(bayonet)
@@ -986,7 +986,7 @@
update_icon()
return TRUE
- if(I.iswrench() && ammo_display)
+ if(attacking_item.iswrench() && ammo_display)
to_chat(user, SPAN_NOTICE("You wrench the ammo display loose from \the [src]."))
ammo_display.forceMove(get_turf(src))
user.put_in_hands(ammo_display)
@@ -996,9 +996,9 @@
maptext = ""
return TRUE
- if(pin && I.isscrewdriver())
+ if(pin && attacking_item.isscrewdriver())
visible_message(SPAN_WARNING("\The [user] begins to try and pry out \the [src]'s firing pin!"))
- if(I.use_tool(src, user, 45, volume = 50))
+ if(attacking_item.use_tool(src, user, 45, volume = 50))
if(pin.durable || prob(50))
visible_message(SPAN_NOTICE("\The [user] pops \the [pin] out of \the [src]!"))
pin.forceMove(get_turf(src))
@@ -1013,7 +1013,7 @@
pin = null
return TRUE
- if(is_sharp(I))
+ if(is_sharp(attacking_item))
user.visible_message("[user] carves a notched mark into \the [src].", SPAN_NOTICE("You carve a notched mark into \the [src]."))
markings++
return TRUE
diff --git a/code/modules/projectiles/guns/energy/laser.dm b/code/modules/projectiles/guns/energy/laser.dm
index d5b5c4e93e6..155a650df97 100644
--- a/code/modules/projectiles/guns/energy/laser.dm
+++ b/code/modules/projectiles/guns/energy/laser.dm
@@ -228,9 +228,9 @@
turret_is_lethal = FALSE
turret_sprite_set = "red"
-/obj/item/gun/energy/lasertag/attackby(obj/item/I, mob/user)
- if(I.ismultitool())
- var/chosen_color = input(user, "Which color do you wish your gun to be?", "Color Selection") as null|anything in list("blue", "red")
+/obj/item/gun/energy/lasertag/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.ismultitool())
+ var/chosen_color = tgui_input_list(user, "Which color do you wish your gun to be?", "Color Selection", list("blue", "red"))
if(!chosen_color)
return
get_tag_color(chosen_color)
diff --git a/code/modules/projectiles/guns/energy/lawgiver.dm b/code/modules/projectiles/guns/energy/lawgiver.dm
index 9d47cce4973..4197564af98 100644
--- a/code/modules/projectiles/guns/energy/lawgiver.dm
+++ b/code/modules/projectiles/guns/energy/lawgiver.dm
@@ -141,8 +141,8 @@
emagged = 1
return 1
-/obj/item/gun/energy/lawgiver/attackby(obj/item/W as obj, mob/user as mob)
- if (istype(W, /obj/item/card/emag) && !emagged)
+/obj/item/gun/energy/lawgiver/attackby(obj/item/attacking_item, mob/user)
+ if (istype(attacking_item, /obj/item/card/emag) && !emagged)
Emag(user)
else
..()
diff --git a/code/modules/projectiles/guns/energy/mining.dm b/code/modules/projectiles/guns/energy/mining.dm
index e71da06513b..daaa3d325a7 100644
--- a/code/modules/projectiles/guns/energy/mining.dm
+++ b/code/modules/projectiles/guns/energy/mining.dm
@@ -29,8 +29,8 @@
else
. += FONT_SMALL(SPAN_WARNING("It has no power supply installed."))
-/obj/item/gun/energy/plasmacutter/attackby(obj/item/I, mob/user)
- if(I.isscrewdriver())
+/obj/item/gun/energy/plasmacutter/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.isscrewdriver())
if(power_supply)
to_chat(user, SPAN_NOTICE("You uninstall \the [power_supply]."))
power_supply.forceMove(get_turf(src))
@@ -40,13 +40,13 @@
power_supply = null
else
to_chat(user, SPAN_WARNING("\The [src] doesn't have a power supply!"))
- else if(istype(I, /obj/item/cell))
+ else if(istype(attacking_item, /obj/item/cell))
if(power_supply)
to_chat(user, SPAN_WARNING("\The [src] already has a power supply installed!"))
else
- to_chat(user, SPAN_NOTICE("You install \the [I] into \the [src]."))
- user.drop_from_inventory(I, src)
- power_supply = I
+ to_chat(user, SPAN_NOTICE("You install \the [attacking_item] into \the [src]."))
+ user.drop_from_inventory(attacking_item, src)
+ power_supply = attacking_item
else
..()
diff --git a/code/modules/projectiles/guns/energy/modular.dm b/code/modules/projectiles/guns/energy/modular.dm
index c9526d2896d..9e6509ab776 100644
--- a/code/modules/projectiles/guns/energy/modular.dm
+++ b/code/modules/projectiles/guns/energy/modular.dm
@@ -44,8 +44,8 @@
if(modulator)
. += "You can see \a [modulator] attached."
-/obj/item/gun/energy/laser/prototype/attackby(var/obj/item/D, var/mob/user)
- if(!D.isscrewdriver())
+/obj/item/gun/energy/laser/prototype/attackby(obj/item/attacking_item, mob/user)
+ if(!attacking_item.isscrewdriver())
return ..()
to_chat(user, "You disassemble \the [src].")
disassemble(user)
diff --git a/code/modules/projectiles/guns/launcher/crossbow.dm b/code/modules/projectiles/guns/launcher/crossbow.dm
index 46f651e9747..5a7272f418e 100644
--- a/code/modules/projectiles/guns/launcher/crossbow.dm
+++ b/code/modules/projectiles/guns/launcher/crossbow.dm
@@ -138,19 +138,19 @@
user.visible_message("[user] draws back the string of \the [src]!", SPAN_NOTICE("You continue drawing back the string of \the [src]!"))
playsound(loc, 'sound/weapons/reload_clip.ogg', 50, FALSE)
-/obj/item/gun/launcher/crossbow/attackby(obj/item/W as obj, mob/user as mob)
+/obj/item/gun/launcher/crossbow/attackby(obj/item/attacking_item, mob/user)
if(!bolt)
- if (istype(W, /obj/item/arrow))
- user.drop_from_inventory(W, src)
- bolt = W
+ if (istype(attacking_item, /obj/item/arrow))
+ user.drop_from_inventory(attacking_item, src)
+ bolt = attacking_item
user.visible_message("[user] slides \the [bolt] into \the [src].", SPAN_NOTICE("You slide \the [bolt] into \the [src]."))
update_icon()
- if(istype(W, /obj/item/arrow/rod) && W.throwforce < 15)
+ if(istype(attacking_item, /obj/item/arrow/rod) && attacking_item.throwforce < 15)
// un-heated converted arrow rod
superheat_rod(user)
return
- else if(istype(W, /obj/item/stack/rods))
- var/obj/item/stack/rods/R = W
+ else if(istype(attacking_item, /obj/item/stack/rods))
+ var/obj/item/stack/rods/R = attacking_item
if (R.use(1))
bolt = new /obj/item/arrow/rod(src)
bolt.fingerprintslast = src.fingerprintslast
@@ -160,26 +160,26 @@
superheat_rod(user)
return
- if(istype(W, /obj/item/cell))
+ if(istype(attacking_item, /obj/item/cell))
if(!cell)
- user.drop_from_inventory(W, src)
- cell = W
+ user.drop_from_inventory(attacking_item, src)
+ cell = attacking_item
to_chat(user, SPAN_NOTICE("You jam \the [cell] into \the [src] and wire it to the firing coil."))
superheat_rod(user)
else
to_chat(user, SPAN_NOTICE("\The [src] already has a cell installed."))
- else if(W.isscrewdriver())
+ else if(attacking_item.isscrewdriver())
if(cell)
var/obj/item/C = cell
C.forceMove(get_turf(user))
- to_chat(user, SPAN_NOTICE("You jimmy \the [cell] out of \the [src] with \the [W]."))
+ to_chat(user, SPAN_NOTICE("You jimmy \the [cell] out of \the [src] with \the [attacking_item]."))
cell = null
else
to_chat(user, SPAN_NOTICE("\The [src] doesn't have a cell installed."))
- else if(istype(W, /obj/item/rfd))
- W.attackby(src, user)
+ else if(istype(attacking_item, /obj/item/rfd))
+ attacking_item.attackby(src, user)
else
..()
@@ -233,10 +233,10 @@
if(5)
. += "It has a steel cable loosely strung across the limbs."
-/obj/item/crossbowframe/attackby(obj/item/W as obj, mob/user as mob)
- if(istype(W,/obj/item/stack/rods))
+/obj/item/crossbowframe/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/stack/rods))
if(buildstate == 0)
- var/obj/item/stack/rods/R = W
+ var/obj/item/stack/rods/R = attacking_item
if(R.use(3))
to_chat(user, SPAN_NOTICE("You assemble a backbone of rods around the wooden stock."))
buildstate++
@@ -244,9 +244,9 @@
else
to_chat(user, SPAN_NOTICE("You need at least three rods to complete this task."))
return
- else if(W.iswelder())
+ else if(attacking_item.iswelder())
if(buildstate == 1)
- var/obj/item/weldingtool/T = W
+ var/obj/item/weldingtool/T = attacking_item
if(T.use(0,user))
if(!src || !T.isOn()) return
playsound(src.loc, 'sound/items/welder_pry.ogg', 100, 1)
@@ -254,8 +254,8 @@
buildstate++
update_icon()
return
- else if(W.iscoil())
- var/obj/item/stack/cable_coil/C = W
+ else if(attacking_item.iscoil())
+ var/obj/item/stack/cable_coil/C = attacking_item
if(buildstate == 2)
if(C.use(5))
to_chat(user, SPAN_NOTICE("You wire a crude cell mount into the top of the crossbow."))
@@ -272,9 +272,9 @@
else
to_chat(user, SPAN_NOTICE("You need at least five segments of cable coil to complete this task."))
return
- else if(istype(W,/obj/item/stack/material) && W.get_material_name() == MATERIAL_PLASTIC)
+ else if(istype(attacking_item,/obj/item/stack/material) && attacking_item.get_material_name() == MATERIAL_PLASTIC)
if(buildstate == 3)
- var/obj/item/stack/material/P = W
+ var/obj/item/stack/material/P = attacking_item
if(P.use(3))
to_chat(user, SPAN_NOTICE("You assemble and install heavy plastic limbs onto the crossbow."))
buildstate++
@@ -282,7 +282,7 @@
else
to_chat(user, SPAN_NOTICE("You need at least three plastic sheets to complete this task."))
return
- else if(W.isscrewdriver())
+ else if(attacking_item.isscrewdriver())
if(buildstate == 5)
to_chat(user, SPAN_NOTICE("You secure the crossbow's various parts."))
new /obj/item/gun/launcher/crossbow(get_turf(src))
@@ -334,19 +334,19 @@
genBolt(user)
draw(user)
-/obj/item/gun/launcher/crossbow/RFD/attackby(obj/item/W as obj, mob/user as mob)
- if(istype(W, /obj/item/rfd_ammo))
+/obj/item/gun/launcher/crossbow/RFD/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/rfd_ammo))
if((stored_matter + 10) > max_stored_matter)
to_chat(user, SPAN_NOTICE("The RFD can't hold that many additional matter-units."))
return
stored_matter += 10
- qdel(W)
+ qdel(attacking_item)
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
to_chat(user, SPAN_NOTICE("The RFD now holds [stored_matter]/[max_stored_matter] matter-units."))
update_icon()
return
- if(istype(W, /obj/item/arrow/RFD))
- var/obj/item/arrow/RFD/A = W
+ if(istype(attacking_item, /obj/item/arrow/RFD))
+ var/obj/item/arrow/RFD/A = attacking_item
if((stored_matter + 5) > max_stored_matter)
to_chat(user, SPAN_NOTICE("Unable to reclaim flashforged bolt. The RFD can't hold that many additional matter-units."))
return
diff --git a/code/modules/projectiles/guns/launcher/grenade_launcher.dm b/code/modules/projectiles/guns/launcher/grenade_launcher.dm
index b64dd1b60ab..3191deaa7cc 100644
--- a/code/modules/projectiles/guns/launcher/grenade_launcher.dm
+++ b/code/modules/projectiles/guns/launcher/grenade_launcher.dm
@@ -81,9 +81,9 @@
/obj/item/gun/launcher/grenade/unique_action(mob/user)
pump(user)
-/obj/item/gun/launcher/grenade/attackby(obj/item/I, mob/user)
- if((istype(I, /obj/item/grenade)))
- load(I, user)
+/obj/item/gun/launcher/grenade/attackby(obj/item/attacking_item, mob/user)
+ if((istype(attacking_item, /obj/item/grenade)))
+ load(attacking_item, user)
else
..()
diff --git a/code/modules/projectiles/guns/launcher/harpoon.dm b/code/modules/projectiles/guns/launcher/harpoon.dm
index cfab77d4b0e..caef01eeed0 100644
--- a/code/modules/projectiles/guns/launcher/harpoon.dm
+++ b/code/modules/projectiles/guns/launcher/harpoon.dm
@@ -41,12 +41,12 @@
return FALSE
return ..()
-/obj/item/gun/launcher/harpoon/attackby(obj/item/I, mob/user)
- if(istype(I, /obj/item/material/harpoon))
+/obj/item/gun/launcher/harpoon/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/material/harpoon))
if(harpoons.len < max_harpoons)
- user.drop_from_inventory(I,src)
- harpoons += I
- to_chat(user, "You load \the [I] in \the [src].")
+ user.drop_from_inventory(attacking_item, src)
+ harpoons += attacking_item
+ to_chat(user, "You load \the [attacking_item] in \the [src].")
update_icon()
else
to_chat(user, "\The [src] is already loaded.")
diff --git a/code/modules/projectiles/guns/launcher/pneumatic.dm b/code/modules/projectiles/guns/launcher/pneumatic.dm
index 0595b0635e8..603748c954e 100644
--- a/code/modules/projectiles/guns/launcher/pneumatic.dm
+++ b/code/modules/projectiles/guns/launcher/pneumatic.dm
@@ -65,14 +65,15 @@
else
return ..()
-/obj/item/gun/launcher/pneumatic/attackby(obj/item/W as obj, mob/user as mob)
- if(!tank && istype(W,/obj/item/tank))
- user.drop_from_inventory(W, src)
- tank = W
- user.visible_message("[user] jams [W] into [src]'s valve and twists it closed.","You jam [W] into [src]'s valve and twist it closed.")
+/obj/item/gun/launcher/pneumatic/attackby(obj/item/attacking_item, mob/user)
+ if(!tank && istype(attacking_item,/obj/item/tank))
+ user.drop_from_inventory(attacking_item, src)
+ tank = attacking_item
+ user.visible_message("[user] jams [attacking_item] into [src]'s valve and twists it closed.",
+ "You jam [attacking_item] into [src]'s valve and twist it closed.")
update_icon()
- else if(istype(W) && item_storage.can_be_inserted(W))
- item_storage.handle_item_insertion(W)
+ else if(istype(attacking_item) && item_storage.can_be_inserted(attacking_item))
+ item_storage.handle_item_insertion(attacking_item)
/obj/item/gun/launcher/pneumatic/unique_action(mob/user)
eject_tank(user)
@@ -166,17 +167,17 @@
if(5)
. += "It has a transfer valve installed."
-/obj/item/cannonframe/attackby(obj/item/W as obj, mob/user as mob)
- if(istype(W,/obj/item/pipe))
+/obj/item/cannonframe/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/pipe))
if(buildstate == 0)
- qdel(W)
+ qdel(attacking_item)
to_chat(user, "You secure the piping inside the frame.")
buildstate++
update_icon()
return
- else if(istype(W,/obj/item/stack/material) && W.get_material_name() == DEFAULT_WALL_MATERIAL)
+ else if(istype(attacking_item, /obj/item/stack/material) && attacking_item.get_material_name() == DEFAULT_WALL_MATERIAL)
if(buildstate == 2)
- var/obj/item/stack/material/M = W
+ var/obj/item/stack/material/M = attacking_item
if(M.use(5))
to_chat(user, "You assemble a chassis around the cannon frame.")
buildstate++
@@ -184,16 +185,16 @@
else
to_chat(user, "You need at least five metal sheets to complete this task.")
return
- else if(istype(W,/obj/item/device/transfer_valve))
+ else if(istype(attacking_item,/obj/item/device/transfer_valve))
if(buildstate == 4)
- qdel(W)
+ qdel(attacking_item)
to_chat(user, "You install the transfer valve and connect it to the piping.")
buildstate++
update_icon()
return
- else if(W.iswelder())
+ else if(attacking_item.iswelder())
if(buildstate == 1)
- var/obj/item/weldingtool/T = W
+ var/obj/item/weldingtool/T = attacking_item
if(T.use(0,user))
if(!src || !T.isOn()) return
playsound(src.loc, 'sound/items/welder_pry.ogg', 100, 1)
@@ -201,7 +202,7 @@
buildstate++
update_icon()
if(buildstate == 3)
- var/obj/item/weldingtool/T = W
+ var/obj/item/weldingtool/T = attacking_item
if(T.use(0,user))
if(!src || !T.isOn()) return
playsound(src.loc, 'sound/items/welder_pry.ogg', 100, 1)
@@ -209,7 +210,7 @@
buildstate++
update_icon()
if(buildstate == 5)
- var/obj/item/weldingtool/T = W
+ var/obj/item/weldingtool/T = attacking_item
if(T.use(0,user))
if(!src || !T.isOn()) return
playsound(src.loc, 'sound/items/welder_pry.ogg', 100, 1)
diff --git a/code/modules/projectiles/guns/launcher/rocket.dm b/code/modules/projectiles/guns/launcher/rocket.dm
index ee1337a185f..18695967f83 100644
--- a/code/modules/projectiles/guns/launcher/rocket.dm
+++ b/code/modules/projectiles/guns/launcher/rocket.dm
@@ -24,11 +24,11 @@
if(is_adjacent)
. += "[rockets.len] / [max_rockets] rockets."
-/obj/item/gun/launcher/rocket/attackby(obj/item/I as obj, mob/user as mob)
- if(istype(I, /obj/item/ammo_casing/rocket))
+/obj/item/gun/launcher/rocket/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/ammo_casing/rocket))
if(rockets.len < max_rockets)
- user.drop_from_inventory(I,src)
- rockets += I
+ user.drop_from_inventory(attacking_item, src)
+ rockets += attacking_item
to_chat(user, "You put the rocket in [src].")
to_chat(user, "[rockets.len] / [max_rockets] rockets.")
else
diff --git a/code/modules/projectiles/guns/launcher/syringe_gun.dm b/code/modules/projectiles/guns/launcher/syringe_gun.dm
index 6ed0560b872..d49c1643199 100644
--- a/code/modules/projectiles/guns/launcher/syringe_gun.dm
+++ b/code/modules/projectiles/guns/launcher/syringe_gun.dm
@@ -18,9 +18,9 @@
else
icon_state = "syringe-cartridge"
-/obj/item/syringe_cartridge/attackby(obj/item/I, mob/user)
- if(istype(I, /obj/item/reagent_containers/syringe))
- syringe = I
+/obj/item/syringe_cartridge/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/reagent_containers/syringe))
+ syringe = attacking_item
to_chat(user, "You carefully insert [syringe] into [src].")
user.remove_from_mob(syringe)
syringe.forceMove(src)
@@ -121,9 +121,9 @@
else
..()
-/obj/item/gun/launcher/syringe/attackby(var/obj/item/A as obj, mob/user as mob)
- if(istype(A, /obj/item/syringe_cartridge))
- var/obj/item/syringe_cartridge/C = A
+/obj/item/gun/launcher/syringe/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/syringe_cartridge))
+ var/obj/item/syringe_cartridge/C = attacking_item
if(darts.len >= max_darts)
to_chat(user, "[src] is full!")
return
diff --git a/code/modules/projectiles/guns/projectile.dm b/code/modules/projectiles/guns/projectile.dm
index b9b03f009b5..d04fa94f3bc 100644
--- a/code/modules/projectiles/guns/projectile.dm
+++ b/code/modules/projectiles/guns/projectile.dm
@@ -227,13 +227,13 @@
update_maptext()
update_icon()
-/obj/item/gun/projectile/attackby(obj/item/I, mob/user)
+/obj/item/gun/projectile/attackby(obj/item/attacking_item, mob/user)
. = ..()
if(.)
return
- load_ammo(I, user)
- if(istype(I, /obj/item/suppressor))
- var/obj/item/suppressor/S = I
+ load_ammo(attacking_item, user)
+ if(istype(attacking_item, /obj/item/suppressor))
+ var/obj/item/suppressor/S = attacking_item
if(!can_suppress)
balloon_alert(user, "\the [S.name] doesn't fit")
return
diff --git a/code/modules/projectiles/guns/projectile/automatic.dm b/code/modules/projectiles/guns/projectile/automatic.dm
index 84571edf7a1..1887d11a1ae 100644
--- a/code/modules/projectiles/guns/projectile/automatic.dm
+++ b/code/modules/projectiles/guns/projectile/automatic.dm
@@ -377,9 +377,9 @@
. = ..()
-/obj/item/gun/projectile/automatic/rifle/z8/attackby(obj/item/I, mob/user)
- if((istype(I, /obj/item/grenade)))
- launcher.load(I, user)
+/obj/item/gun/projectile/automatic/rifle/z8/attackby(obj/item/attacking_item, mob/user)
+ if((istype(attacking_item, /obj/item/grenade)))
+ launcher.load(attacking_item, user)
else
..()
diff --git a/code/modules/projectiles/guns/projectile/dartgun.dm b/code/modules/projectiles/guns/projectile/dartgun.dm
index 16714d2d1fd..e395177e5c0 100644
--- a/code/modules/projectiles/guns/projectile/dartgun.dm
+++ b/code/modules/projectiles/guns/projectile/dartgun.dm
@@ -106,15 +106,15 @@
var/singleton/reagent/R = GET_SINGLETON(_R)
. += "[B.reagents.reagent_volumes[_R]] units of [R.name]"
-/obj/item/gun/projectile/dartgun/attackby(obj/item/I as obj, mob/user as mob)
- if(istype(I, /obj/item/reagent_containers/glass))
- if(!istype(I, container_type))
- to_chat(user, "[I] doesn't seem to fit into [src].")
+/obj/item/gun/projectile/dartgun/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/reagent_containers/glass))
+ if(!istype(attacking_item, container_type))
+ to_chat(user, "[attacking_item] doesn't seem to fit into [src].")
return
if(beakers.len >= max_beakers)
to_chat(user, "[src] already has [max_beakers] beakers in it - another one isn't going to fit!")
return
- var/obj/item/reagent_containers/glass/beaker/B = I
+ var/obj/item/reagent_containers/glass/beaker/B = attacking_item
user.drop_from_inventory(B,src)
beakers += B
to_chat(user, "You slot [B] into [src].")
diff --git a/code/modules/projectiles/guns/projectile/improvised.dm b/code/modules/projectiles/guns/projectile/improvised.dm
index 9e296bcda5b..896e2c664ff 100644
--- a/code/modules/projectiles/guns/projectile/improvised.dm
+++ b/code/modules/projectiles/guns/projectile/improvised.dm
@@ -32,15 +32,15 @@
return ..()
-/obj/item/gun/projectile/shotgun/improvised/attackby(var/obj/item/A as obj, mob/user as mob)
- if(istype(A, /obj/item/surgery/circular_saw) || istype(A, /obj/item/melee/energy) || istype(A, /obj/item/gun/energy/plasmacutter) && w_class != 3)
+/obj/item/gun/projectile/shotgun/improvised/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/surgery/circular_saw) || istype(attacking_item, /obj/item/melee/energy) || istype(attacking_item, /obj/item/gun/energy/plasmacutter) && w_class != 3)
to_chat(user, "You begin to shorten the barrel of \the [src].")
if(loaded.len)
for(var/i in 1 to max_shells)
Fire(user, user) //will this work? //it will. we call it twice, for twice the FUN
user.visible_message("The shotgun goes off!", "The shotgun goes off in your face!")
return
- if(A.use_tool(src, user, 30, volume = 50))
+ if(attacking_item.use_tool(src, user, 30, volume = 50))
icon_state = "ishotgunsawn"
item_state = "ishotgunsawn"
w_class = ITEMSIZE_NORMAL
@@ -104,30 +104,30 @@
if(3)
. += "Its pieces are held together by tape roll."
-/obj/item/receivergun/attackby(obj/item/W as obj, mob/user as mob)
- if(istype(W,/obj/item/pipe))
+/obj/item/receivergun/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/pipe))
if(buildstate == 0)
- qdel(W)
+ qdel(attacking_item)
to_chat(user, "You place the pipe and the receiver together.")
buildstate++
update_icon()
return
- else if(istype(W,/obj/item/stock))
+ else if(istype(attacking_item, /obj/item/stock))
if(buildstate == 1)
- qdel(W)
+ qdel(attacking_item)
to_chat(user, "You add the stock to the assembly.")
buildstate++
update_icon()
return
- else if(istype(W,/obj/item/tape_roll))
+ else if(istype(attacking_item, /obj/item/tape_roll))
if(buildstate == 2)
- qdel(W)
+ qdel(attacking_item)
to_chat(user, "You strap the pieces together with tape.")
buildstate++
update_icon()
return
- else if(W.iscoil())
- var/obj/item/stack/cable_coil/C = W
+ else if(attacking_item.iscoil())
+ var/obj/item/stack/cable_coil/C = attacking_item
if(buildstate == 3)
if(C.use(10))
to_chat(user, "You tie the lengths of cable to the pipegun, making a sling.")
@@ -190,30 +190,30 @@
if(3)
. += "It has a pipe installed."
-/obj/item/stock/attackby(obj/item/W as obj, mob/user as mob)
- if(istype(W,/obj/item/material/hatchet))
+/obj/item/stock/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/material/hatchet))
if(buildstate == 0)
to_chat(user, "You carve the rifle stock.")
buildstate++
update_icon()
return
- else if(istype(W,/obj/item/receivergun))
+ else if(istype(attacking_item, /obj/item/receivergun))
if(buildstate == 1)
- qdel(W)
+ qdel(attacking_item)
to_chat(user, "You add the receiver to the assembly.")
buildstate++
update_icon()
return
- else if(istype(W,/obj/item/pipe))
+ else if(istype(attacking_item, /obj/item/pipe))
if(buildstate == 2)
- qdel(W)
+ qdel(attacking_item)
to_chat(user, "You strap the pipe to the assembly.")
buildstate++
update_icon()
return
- else if(W.iswelder())
+ else if(attacking_item.iswelder())
if(buildstate == 3)
- var/obj/item/weldingtool/T = W
+ var/obj/item/weldingtool/T = attacking_item
if(T.use(0,user))
if(!src || !T.isOn()) return
playsound(src.loc, 'sound/items/welder_pry.ogg', 100, 1)
diff --git a/code/modules/projectiles/guns/projectile/minigun.dm b/code/modules/projectiles/guns/projectile/minigun.dm
index 71a78641c6a..6915c2dbe3a 100644
--- a/code/modules/projectiles/guns/projectile/minigun.dm
+++ b/code/modules/projectiles/guns/projectile/minigun.dm
@@ -104,8 +104,8 @@
ammo_magazine = null
return ..()
-/obj/item/minigunpack/attackby(obj/item/W, mob/user, params)
- if(W == gun)
+/obj/item/minigunpack/attackby(obj/item/attacking_item, mob/user, params)
+ if(attacking_item == gun)
remove_gun()
return 1
else
diff --git a/code/modules/projectiles/guns/projectile/musket.dm b/code/modules/projectiles/guns/projectile/musket.dm
index 7f0ff23a4c0..772024792ff 100644
--- a/code/modules/projectiles/guns/projectile/musket.dm
+++ b/code/modules/projectiles/guns/projectile/musket.dm
@@ -44,13 +44,13 @@
has_powder = FALSE
return ..()
-/obj/item/gun/projectile/musket/attackby(obj/item/W, mob/user)
+/obj/item/gun/projectile/musket/attackby(obj/item/attacking_item, mob/user)
..()
- if (istype(W, /obj/item/reagent_containers))
+ if (istype(attacking_item, /obj/item/reagent_containers))
if(has_powder)
to_chat(user, SPAN_WARNING("\The [src] is already full of gunpowder."))
return
- var/obj/item/reagent_containers/C = W
+ var/obj/item/reagent_containers/C = attacking_item
if(C.reagents.has_reagent(/singleton/reagent/gunpowder, 5))
if(do_after(user, 15))
if(has_powder)
diff --git a/code/modules/projectiles/guns/projectile/revolver.dm b/code/modules/projectiles/guns/projectile/revolver.dm
index 2ef8a080751..f5c56488ea0 100644
--- a/code/modules/projectiles/guns/projectile/revolver.dm
+++ b/code/modules/projectiles/guns/projectile/revolver.dm
@@ -150,8 +150,8 @@
ammo_type = /obj/item/ammo_casing/cap
needspin = FALSE
-/obj/item/gun/projectile/revolver/capgun/attackby(obj/item/W, mob/user)
- if(!W.iswirecutter() || icon_state == "revolver")
+/obj/item/gun/projectile/revolver/capgun/attackby(obj/item/attacking_item, mob/user)
+ if(!attacking_item.iswirecutter() || icon_state == "revolver")
return ..()
to_chat(user, "You snip off the toy markings off the [src].")
icon = 'icons/obj/guns/revolver.dmi'
diff --git a/code/modules/projectiles/guns/projectile/rifle.dm b/code/modules/projectiles/guns/projectile/rifle.dm
index 4375fa39cdf..311b1a6699c 100644
--- a/code/modules/projectiles/guns/projectile/rifle.dm
+++ b/code/modules/projectiles/guns/projectile/rifle.dm
@@ -111,12 +111,12 @@
if(80 to INFINITY)
. += SPAN_DANGER("\The [src] is completely fouled. You're going to be extremely lucky to get a shot off. Clean it with a rag.")
-/obj/item/gun/projectile/shotgun/pump/rifle/pipegun/attackby(obj/item/A, mob/user)
- if(istype(A, /obj/item/reagent_containers/glass/rag))
+/obj/item/gun/projectile/shotgun/pump/rifle/pipegun/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/reagent_containers/glass/rag))
if(!jam_chance || jam_chance == initial(jam_chance))
to_chat(user, SPAN_WARNING("There's no fouling present on \the [src]."))
return
- user.visible_message("[user] starts cleaning \the [src] with \the [A].", SPAN_NOTICE("You start cleaning \the [src] with \the [A]."))
+ user.visible_message("[user] starts cleaning \the [src] with \the [attacking_item].", SPAN_NOTICE("You start cleaning \the [src] with \the [attacking_item]."))
if(do_after(user, jam_chance * 5))
to_chat(user, SPAN_WARNING("You completely clean \the [src]."))
jam_chance = initial(jam_chance)
@@ -288,14 +288,14 @@
update_icon()
-/obj/item/gun/projectile/shotgun/pump/rifle/vintage/attackby(var/obj/item/A as obj, mob/user as mob)
- if(istype(A, /obj/item/ammo_magazine/boltaction/vintage))
+/obj/item/gun/projectile/shotgun/pump/rifle/vintage/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/ammo_magazine/boltaction/vintage))
if(!open_bolt)
to_chat(user, "You need to open the bolt of \the [src] first.")
return
if(!has_clip)
- user.drop_from_inventory(A,src)
- has_clip = A
+ user.drop_from_inventory(attacking_item, src)
+ has_clip = attacking_item
to_chat(user, "You load the clip into \the [src].")
if(!has_clip.stored_ammo.len)
add_overlay("springfield-clip-empty")
diff --git a/code/modules/projectiles/guns/projectile/shotgun.dm b/code/modules/projectiles/guns/projectile/shotgun.dm
index ce7308996f7..10f0c8490fe 100644
--- a/code/modules/projectiles/guns/projectile/shotgun.dm
+++ b/code/modules/projectiles/guns/projectile/shotgun.dm
@@ -9,7 +9,7 @@
var/sawnoff_workmsg
var/sawing_in_progress = FALSE
-/obj/item/gun/projectile/shotgun/attackby(obj/item/A, mob/user)
+/obj/item/gun/projectile/shotgun/attackby(obj/item/attacking_item, mob/user)
if (!can_sawoff || sawing_in_progress)
return ..()
@@ -18,7 +18,7 @@
/obj/item/melee/energy,
/obj/item/gun/energy/plasmacutter // does this even work?
))
- if(is_type_in_typecache(A, barrel_cutting_tools) && w_class != 3)
+ if(is_type_in_typecache(attacking_item, barrel_cutting_tools) && w_class != 3)
to_chat(user, "You begin to [sawnoff_workmsg] of \the [src].")
if(loaded.len)
for(var/i in 1 to max_shells)
@@ -27,9 +27,9 @@
return
sawing_in_progress = TRUE
- if(A.use_tool(src, user, 30, volume = 50)) //SHIT IS STEALTHY EYYYYY
+ if(attacking_item.use_tool(src, user, 30, volume = 50)) //SHIT IS STEALTHY EYYYYY
sawing_in_progress = FALSE
- saw_off(user, A)
+ saw_off(user, attacking_item)
else
sawing_in_progress = FALSE
else
diff --git a/code/modules/projectiles/modular/laser_base.dm b/code/modules/projectiles/modular/laser_base.dm
index f7d144c5498..787d24aa3c9 100644
--- a/code/modules/projectiles/modular/laser_base.dm
+++ b/code/modules/projectiles/modular/laser_base.dm
@@ -18,11 +18,11 @@
if(condition > reliability)
condition = reliability
-/obj/item/laser_components/attackby(var/obj/item/D as obj, var/mob/user as mob)
- if(!istype(D,repair_item))
+/obj/item/laser_components/attackby(obj/item/attacking_item, mob/user)
+ if(!istype(attacking_item, repair_item))
return ..()
to_chat(user, "You begin repairing \the [src].")
- if(do_after(user,20) && repair_module(D))
+ if(do_after(user, 20) && repair_module(attacking_item))
to_chat(user, "You repair \the [src].")
else
to_chat(user, "You fail to repair \the [src].")
@@ -157,8 +157,8 @@
. = ..()
update_icon()
-/obj/item/device/laser_assembly/attackby(var/obj/item/D as obj, var/mob/user as mob)
- var/obj/item/laser_components/A = D
+/obj/item/device/laser_assembly/attackby(obj/item/attacking_item, mob/user)
+ var/obj/item/laser_components/A = attacking_item
var/success = FALSE
if(!istype(A))
return ..()
diff --git a/code/modules/projectiles/pins.dm b/code/modules/projectiles/pins.dm
index 9bfb52f5a56..4615082896f 100644
--- a/code/modules/projectiles/pins.dm
+++ b/code/modules/projectiles/pins.dm
@@ -346,9 +346,9 @@ var/list/wireless_firing_pins = list() //A list of all initialized wireless firi
return
-/obj/item/device/firing_pin/wireless/attackby(obj/item/C, mob/user) //Lets people register their IDs to the pin. Using it once registers you, using it again clears you.
- if(istype(C, /obj/item/card/id))
- var/obj/item/card/id/idcard = C
+/obj/item/device/firing_pin/wireless/attackby(obj/item/attacking_item, mob/user) //Lets people register their IDs to the pin. Using it once registers you, using it again clears you.
+ if(istype(attacking_item, /obj/item/card/id))
+ var/obj/item/card/id/idcard = attacking_item
if(idcard.registered_name == registered_user)
to_chat(user, SPAN_NOTICE("You press your ID against the RFID reader and it deregisters your identity."))
registered_user = null
diff --git a/code/modules/psionics/abilities/throw.dm b/code/modules/psionics/abilities/throw.dm
index 651b82a2b20..2ebfcaa6e52 100644
--- a/code/modules/psionics/abilities/throw.dm
+++ b/code/modules/psionics/abilities/throw.dm
@@ -18,14 +18,14 @@
psi_cost = 20
var/obj/item_to_throw
-/obj/item/spell/projectile/throw_item/attackby(obj/item/W, mob/user)
+/obj/item/spell/projectile/throw_item/attackby(obj/item/attacking_item, mob/user)
. = ..()
if(!item_to_throw)
- owner.drop_item(W)
- W.forceMove(src)
- to_chat(user, SPAN_NOTICE("You imbue [W] with psionic energy!"))
+ owner.drop_item(attacking_item)
+ attacking_item.forceMove(src)
+ to_chat(user, SPAN_NOTICE("You imbue [attacking_item] with psionic energy!"))
add_overlay("controlled")
- item_to_throw = W
+ item_to_throw = attacking_item
/obj/item/spell/projectile/throw_item/Destroy()
if(item_to_throw)
diff --git a/code/modules/random_map/automata/diona.dm b/code/modules/random_map/automata/diona.dm
index 0fbd8673bca..4a8c43248b8 100644
--- a/code/modules/random_map/automata/diona.dm
+++ b/code/modules/random_map/automata/diona.dm
@@ -21,28 +21,31 @@
. = ..()
health = max_health
-/obj/structure/diona/attackby(obj/item/W, mob/user)
+/obj/structure/diona/attackby(obj/item/attacking_item, mob/user)
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
- if(W.iswelder())
- var/obj/item/weldingtool/WT = W
+ if(attacking_item.iswelder())
+ var/obj/item/weldingtool/WT = attacking_item
if (!WT.welding)
to_chat(user, SPAN_WARNING("\The [WT] must be turned on!"))
return
else if (WT.use(0,user))
- user.visible_message("[user] begins slicing through the skin of \the [src].", SPAN_NOTICE("You begin slicing through the skin of \the [src]."))
- if(!W.use_tool(src, user, 20, volume = 50))
+ user.visible_message("[user] begins slicing through the skin of \the [src].",
+ SPAN_NOTICE("You begin slicing through the skin of \the [src]."))
+ if(!attacking_item.use_tool(src, user, 20, volume = 50))
return
if(QDELETED(src) || !WT.isOn())
return
- user.visible_message("[user] slices through the skin of \the [src].", SPAN_NOTICE("You slice through \the [src]."))
+ user.visible_message("[user] slices through the skin of \the [src].",
+ SPAN_NOTICE("You slice through \the [src]."))
qdel(src)
else
user.do_attack_animation(src)
- if(W.force)
- user.visible_message(SPAN_DANGER("\The [user] [pick(W.attack_verb)] \the [src] with \the [W]!"), SPAN_NOTICE("You [pick(W.attack_verb)] \the [src] with \the [W]!"))
- playsound(loc, W.hitsound, W.get_clamped_volume(), TRUE)
+ if(attacking_item.force)
+ user.visible_message(SPAN_DANGER("\The [user] [pick(attacking_item.attack_verb)] \the [src] with \the [attacking_item]!"),
+ SPAN_NOTICE("You [pick(attacking_item.attack_verb)] \the [src] with \the [attacking_item]!"))
+ playsound(loc, attacking_item.hitsound, attacking_item.get_clamped_volume(), TRUE)
playsound(loc, /singleton/sound_category/wood_break_sound, 50, TRUE)
- health -= W.force
+ health -= attacking_item.force
if(health <= 0)
qdel(src)
@@ -100,12 +103,12 @@
light_power = 0
light_range = 0
-/obj/structure/diona/bulb/unpowered/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/cell))
+/obj/structure/diona/bulb/unpowered/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/cell))
to_chat(user, SPAN_NOTICE("You jack the power cell into the glow bulb."))
new /obj/structure/diona/bulb(get_turf(src))
destroy_spawntype = null
- qdel(W)
+ qdel(attacking_item)
qdel(src)
..()
diff --git a/code/modules/random_map/drop/droppod_doors.dm b/code/modules/random_map/drop/droppod_doors.dm
index f1c2adf173d..22ed74d1596 100644
--- a/code/modules/random_map/drop/droppod_doors.dm
+++ b/code/modules/random_map/drop/droppod_doors.dm
@@ -29,10 +29,10 @@
sleep(30)
deploy()
-/obj/structure/droppod_door/attackby(obj/item/W, mob/user)
+/obj/structure/droppod_door/attackby(obj/item/attacking_item, mob/user)
. = ..()
- if(W.iswelder())
- var/obj/item/weldingtool/WT = W
+ if(attacking_item.iswelder())
+ var/obj/item/weldingtool/WT = attacking_item
if(WT.isOn())
user.visible_message(
SPAN_NOTICE("[user] begins cutting \the [src]'s safety bolts."),
diff --git a/code/modules/reagents/Chemistry-Machinery.dm b/code/modules/reagents/Chemistry-Machinery.dm
index 17bf660eee3..0f93e934a7c 100644
--- a/code/modules/reagents/Chemistry-Machinery.dm
+++ b/code/modules/reagents/Chemistry-Machinery.dm
@@ -64,38 +64,38 @@
if(!use_check_and_message(usr))
eject()
-/obj/machinery/chem_master/attackby(var/obj/item/B, mob/user)
+/obj/machinery/chem_master/attackby(obj/item/attacking_item, mob/user)
- if(istype(B, /obj/item/reagent_containers/glass))
+ if(istype(attacking_item, /obj/item/reagent_containers/glass))
if(src.beaker)
to_chat(user, SPAN_WARNING("A beaker is already loaded into the machine."))
return
- if(is_type_in_list(B, forbidden_containers))
- to_chat(user, SPAN_WARNING("There's no way to fit [B] into \the [src]!"))
+ if(is_type_in_list(attacking_item, forbidden_containers))
+ to_chat(user, SPAN_WARNING("There's no way to fit [attacking_item] into \the [src]!"))
return
- src.beaker = B
- user.drop_from_inventory(B,src)
+ src.beaker = attacking_item
+ user.drop_from_inventory(attacking_item, src)
to_chat(user, "You add the beaker to the machine!")
src.updateUsrDialog()
icon_state = "mixer1"
CHEMMASTER_BOTTLE_SOUND
- else if(istype(B, /obj/item/storage/pill_bottle))
+ else if(istype(attacking_item, /obj/item/storage/pill_bottle))
if(condi)
return
if(src.loaded_pill_bottle)
to_chat(user, "A pill bottle is already loaded into the machine.")
return
- src.loaded_pill_bottle = B
- user.drop_from_inventory(B,src)
+ src.loaded_pill_bottle = attacking_item
+ user.drop_from_inventory(attacking_item, src)
to_chat(user, "You add the pill bottle into the dispenser slot!")
src.updateUsrDialog()
- else if(B.iswrench())
+ else if(attacking_item.iswrench())
anchored = !anchored
to_chat(user, "You [anchored ? "attach" : "detach"] the [src] [anchored ? "to" : "from"] the ground")
- playsound(src.loc, B.usesound, 75, 1)
+ playsound(src.loc, attacking_item.usesound, 75, 1)
ui = SStgui.try_update_ui(user, src, ui)
@@ -366,13 +366,13 @@
icon_state = "juicer"+num2text(!isnull(beaker))
return
-/obj/machinery/reagentgrinder/attackby(var/obj/item/O as obj, var/mob/user as mob)
- if (is_type_in_list(O, beaker_types))
+/obj/machinery/reagentgrinder/attackby(obj/item/attacking_item, mob/user)
+ if (is_type_in_list(attacking_item, beaker_types))
if (beaker)
return 1
else
- src.beaker = O
- user.drop_from_inventory(O,src)
+ src.beaker = attacking_item
+ user.drop_from_inventory(attacking_item,src)
update_icon()
src.updateUsrDialog()
return 0
@@ -381,12 +381,12 @@
to_chat(usr, "The machine cannot hold anymore items.")
return 1
- if(!istype(O))
+ if(!istype(attacking_item))
return
- if(istype(O,/obj/item/storage/bag/plants) || istype(O,/obj/item/storage/pill_bottle))
+ if(istype(attacking_item,/obj/item/storage/bag/plants) || istype(attacking_item,/obj/item/storage/pill_bottle))
var/failed = 1
- var/obj/item/storage/P = O
+ var/obj/item/storage/P = attacking_item
for(var/obj/item/G in P.contents)
if(!G.reagents || !G.reagents.total_volume)
continue
@@ -400,21 +400,21 @@
to_chat(user, "Nothing in the plant bag is usable.")
return 1
- if(!O.contents.len)
- to_chat(user, "You empty \the [O] into \the [src].")
+ if(!attacking_item.contents.len)
+ to_chat(user, "You empty \the [attacking_item] into \the [src].")
else
- to_chat(user, "You fill \the [src] from \the [O].")
+ to_chat(user, "You fill \the [src] from \the [attacking_item].")
src.updateUsrDialog()
return 0
- if(!sheet_reagents[O.type] && (!O.reagents || !O.reagents.total_volume))
- to_chat(user, "\The [O] is not suitable for blending.")
+ if(!sheet_reagents[attacking_item.type] && (!attacking_item.reagents || !attacking_item.reagents.total_volume))
+ to_chat(user, "\The [attacking_item] is not suitable for blending.")
return 0
- user.remove_from_mob(O)
- O.forceMove(src)
- holdingitems += O
+ user.remove_from_mob(attacking_item)
+ attacking_item.forceMove(src)
+ holdingitems += attacking_item
src.updateUsrDialog()
return 0
diff --git a/code/modules/reagents/dispenser/cartridge.dm b/code/modules/reagents/dispenser/cartridge.dm
index 2fc646a356f..a32047a0a35 100644
--- a/code/modules/reagents/dispenser/cartridge.dm
+++ b/code/modules/reagents/dispenser/cartridge.dm
@@ -92,7 +92,7 @@
atom_flags |= ATOM_FLAG_OPEN_CONTAINER
update_icon()
-/obj/item/reagent_containers/chem_disp_cartridge/attackby(obj/item/W as obj, mob/user as mob)
+/obj/item/reagent_containers/chem_disp_cartridge/attackby(obj/item/attacking_item, mob/user)
..()
update_icon()
diff --git a/code/modules/reagents/dispenser/dispenser2.dm b/code/modules/reagents/dispenser/dispenser2.dm
index 594891566eb..e7a3767c2d5 100644
--- a/code/modules/reagents/dispenser/dispenser2.dm
+++ b/code/modules/reagents/dispenser/dispenser2.dm
@@ -95,10 +95,10 @@
if(use_check_and_message(usr))
eject()
-/obj/machinery/chemical_dispenser/attackby(obj/item/W, mob/user)
- if(W.iswrench())
+/obj/machinery/chemical_dispenser/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.iswrench())
to_chat(user, SPAN_NOTICE("You begin to [anchored ? "un" : ""]fasten [src]."))
- if(W.use_tool(src, user, 20, volume = 50))
+ if(attacking_item.use_tool(src, user, 20, volume = 50))
user.visible_message(
SPAN_NOTICE("[user] [anchored ? "un" : ""]fastens [src]."),
SPAN_NOTICE("You have [anchored ? "un" : ""]fastened [src]."),
@@ -107,10 +107,10 @@
else
to_chat(user, SPAN_NOTICE("You decide not to [anchored ? "un" : ""]fasten [src]."))
- else if(istype(W, /obj/item/reagent_containers/chem_disp_cartridge))
- add_cartridge(W, user)
+ else if(istype(attacking_item, /obj/item/reagent_containers/chem_disp_cartridge))
+ add_cartridge(attacking_item, user)
- else if(W.isscrewdriver())
+ else if(attacking_item.isscrewdriver())
var/label = tgui_input_list(user, "Which cartridge would you like to remove?", "Chemical Dispenser", cartridges)
if(!label)
return
@@ -119,12 +119,12 @@
to_chat(user, SPAN_NOTICE("You remove [C] from [src]."))
C.forceMove(loc)
- else if(istype(W, /obj/item/reagent_containers/glass) || is_type_in_list(W, drink_accepted))
+ else if(istype(attacking_item, /obj/item/reagent_containers/glass) || is_type_in_list(attacking_item, drink_accepted))
if(container)
to_chat(user, SPAN_WARNING("There is already \a [container] on [src]!"))
return
- var/obj/item/reagent_containers/RC = W
+ var/obj/item/reagent_containers/RC = attacking_item
if(is_type_in_list(RC, forbidden_containers))
to_chat(user, SPAN_WARNING("There's no way to fit [RC] into \the [src]!"))
diff --git a/code/modules/reagents/dispenser/dispenser_presets.dm b/code/modules/reagents/dispenser/dispenser_presets.dm
index b0b176c6dd1..de6b1c47a95 100644
--- a/code/modules/reagents/dispenser/dispenser_presets.dm
+++ b/code/modules/reagents/dispenser/dispenser_presets.dm
@@ -57,8 +57,8 @@
/obj/item/reagent_containers/chem_disp_cartridge/clonexadone
)
-/obj/machinery/chemical_dispenser/ert/attackby(obj/item/W, mob/user)
- if(W.iswrench())
+/obj/machinery/chemical_dispenser/ert/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.iswrench())
to_chat(user, SPAN_NOTICE("This dispenser is riveted to the floor and cannot be unanchored."))
return
else
diff --git a/code/modules/reagents/reagent_containers.dm b/code/modules/reagents/reagent_containers.dm
index c280e7acba7..7974271607a 100644
--- a/code/modules/reagents/reagent_containers.dm
+++ b/code/modules/reagents/reagent_containers.dm
@@ -94,17 +94,17 @@
shatter_material.place_shard(loc)
qdel(src)
-/obj/item/reagent_containers/attackby(var/obj/item/W, var/mob/user)
- if(istype(W, /obj/item/reagent_containers/food/snacks))
- var/obj/item/reagent_containers/food/snacks/dipped = W
+/obj/item/reagent_containers/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/reagent_containers/food/snacks))
+ var/obj/item/reagent_containers/food/snacks/dipped = attacking_item
dipped.attempt_apply_coating(src, user)
return
- if(!(W.item_flags & ITEM_FLAG_NO_BLUDGEON) && (user.a_intent == I_HURT) && fragile && (W.force > fragile))
+ if(!(attacking_item.item_flags & ITEM_FLAG_NO_BLUDGEON) && (user.a_intent == I_HURT) && fragile && (attacking_item.force > fragile))
if(do_after(user, 1 SECOND, src))
if(!QDELETED(src))
- visible_message(SPAN_WARNING("[user] smashes [src] with \a [W]!"))
+ visible_message(SPAN_WARNING("[user] smashes [src] with \a [attacking_item]!"))
user.do_attack_animation(src)
- shatter(W, user)
+ shatter(attacking_item, user)
return TRUE
return ..()
diff --git a/code/modules/reagents/reagent_containers/blood_pack.dm b/code/modules/reagents/reagent_containers/blood_pack.dm
index bff4fbbea2b..00e04ae43f7 100644
--- a/code/modules/reagents/reagent_containers/blood_pack.dm
+++ b/code/modules/reagents/reagent_containers/blood_pack.dm
@@ -160,9 +160,9 @@
if (distance <= 2 && vampire_marks)
. += SPAN_WARNING("There are sharp, canine-like teeth marks on it.")
-/obj/item/reagent_containers/blood/attackby(obj/item/P as obj, mob/user as mob)
+/obj/item/reagent_containers/blood/attackby(obj/item/attacking_item, mob/user)
..()
- if (P.ispen())
+ if (attacking_item.ispen())
if (REAGENT_VOLUME(reagents, /singleton/reagent/blood) && name != "empty blood pack") //Stops people mucking with bloodpacks that are filled
to_chat(user, SPAN_NOTICE("You can't relabel [name] until it is empty!"))
return
@@ -186,10 +186,10 @@
update_icon()
return
- if (istype(P, /obj/item/) && P.sharp == 1)
+ if (istype(attacking_item, /obj/item/) && attacking_item.sharp == 1)
var/mob/living/carbon/human/H = usr
- if(LAZYLEN(P.attack_verb))
- user.visible_message(SPAN_DANGER("[src] has been [pick(P.attack_verb)] with \the [P] by [user]!"))
+ if(LAZYLEN(attacking_item.attack_verb))
+ user.visible_message(SPAN_DANGER("[src] has been [pick(attacking_item.attack_verb)] with \the [attacking_item] by [user]!"))
var/atkmsg_filled = null
if (REAGENT_VOLUME(reagents, /singleton/reagent/blood))
atkmsg_filled = " and the contents spray everywhere"
@@ -280,6 +280,6 @@
icon_state = "ripped"
volume = 0
-/obj/item/reagent_containers/blood/ripped/attackby(obj/item/P as obj, mob/user as mob)
+/obj/item/reagent_containers/blood/ripped/attackby(obj/item/attacking_item, mob/user)
to_chat(user, SPAN_WARNING("You can't do anything further with this."))
return
diff --git a/code/modules/reagents/reagent_containers/food/cans.dm b/code/modules/reagents/reagent_containers/food/cans.dm
index 3e00ace639e..8e8f2e19107 100644
--- a/code/modules/reagents/reagent_containers/food/cans.dm
+++ b/code/modules/reagents/reagent_containers/food/cans.dm
@@ -55,67 +55,73 @@
var/image/casingoverlay = image('icons/obj/fuses.dmi', icon_state = "pipe_bomb")
add_overlay(casingoverlay)
-/obj/item/reagent_containers/food/drinks/cans/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/grenade/chem_grenade/large))
- var/obj/item/grenade/chem_grenade/grenade_casing = W
+/obj/item/reagent_containers/food/drinks/cans/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/grenade/chem_grenade/large))
+ var/obj/item/grenade/chem_grenade/grenade_casing = attacking_item
if(!grenade_casing.detonator && !length(grenade_casing.beakers) && bombcasing < BOMBCASING_LOOSE)
bombcasing = BOMBCASING_LOOSE
desc = "A grenade casing with \a [name] slotted into it."
if(fuselength)
desc += " It has some steel wool stuffed into the opening."
- user.visible_message(SPAN_NOTICE("[user] slots \the [grenade_casing] over \the [name]."), SPAN_NOTICE("You slot \the [grenade_casing] over \the [name]."))
+ user.visible_message(SPAN_NOTICE("[user] slots \the [grenade_casing] over \the [name]."),
+ SPAN_NOTICE("You slot \the [grenade_casing] over \the [name]."))
desc = "A grenade casing with \a [name] slotted into it."
qdel(grenade_casing)
update_icon()
- if(W.isscrewdriver() && bombcasing > BOMBCASING_EMPTY)
+ if(attacking_item.isscrewdriver() && bombcasing > BOMBCASING_EMPTY)
if(bombcasing == BOMBCASING_LOOSE)
bombcasing = BOMBCASING_SECURE
shrapnelcount = 14
- user.visible_message(SPAN_NOTICE("[user] tightens the grenade casing around \the [name]."), SPAN_NOTICE("You tighten the grenade casing around \the [name]."))
+ user.visible_message(SPAN_NOTICE("[user] tightens the grenade casing around \the [name]."),
+ SPAN_NOTICE("You tighten the grenade casing around \the [name]."))
else if(bombcasing == BOMBCASING_SECURE)
bombcasing = BOMBCASING_EMPTY
shrapnelcount = initial(shrapnelcount)
desc = initial(desc)
if(fuselength)
desc += " It has some steel wool stuffed into the opening."
- user.visible_message(SPAN_NOTICE("[user] removes \the [name] from the grenade casing."), SPAN_NOTICE("You remove \the [name] from the grenade casing."))
+ user.visible_message(SPAN_NOTICE("[user] removes \the [name] from the grenade casing."),
+ SPAN_NOTICE("You remove \the [name] from the grenade casing."))
new /obj/item/grenade/chem_grenade/large(get_turf(src))
- playsound(loc, W.usesound, 50, 1)
+ playsound(loc, attacking_item.usesound, 50, 1)
update_icon()
- if(istype(W, /obj/item/steelwool))
+ if(istype(attacking_item, /obj/item/steelwool))
if(is_open_container())
switch(fuselength)
if(-INFINITY to FUSELENGTH_MAX)
- user.visible_message("[user] stuffs some steel wool into \the [name].", SPAN_NOTICE("You feed steel wool into \the [name], ruining it in the process. It will last approximately 10 seconds."))
+ user.visible_message("[user] stuffs some steel wool into \the [name].",
+ SPAN_NOTICE("You feed steel wool into \the [name], ruining it in the process. It will last approximately 10 seconds."))
fuselength = FUSELENGTH_MAX
update_icon()
desc += " It has some steel wool stuffed into the opening."
- if(W.isFlameSource())
- light_fuse(W, user, TRUE)
- qdel(W)
+ if(attacking_item.isFlameSource())
+ light_fuse(attacking_item, user, TRUE)
+ qdel(attacking_item)
if(FUSELENGTH_MAX)
to_chat(user, SPAN_WARNING("You cannot make the fuse longer than 10 seconds!"))
else
to_chat(user, SPAN_WARNING("There is no opening on \the [name] for the steel wool!"))
- else if(W.iswirecutter() && fuselength)
+ else if(attacking_item.iswirecutter() && fuselength)
switch(fuselength)
if(1 to FUSELENGTH_MIN) // you can't increase the fuse with wirecutters and you can't trim it down below 3, so just remove it outright.
- user.visible_message("[user] removes the steel wool from \the [name].", SPAN_NOTICE("You remove the steel wool fuse from \the [name]."))
+ user.visible_message("[user] removes the steel wool from \the [name].",
+ SPAN_NOTICE("You remove the steel wool fuse from \the [name]."))
FuseRemove()
if(4 to FUSELENGTH_MAX)
- var/fchoice = alert("Do you want to shorten or remove the fuse on \the [name]?", "Shorten or Remove", "Shorten", "Remove", "Cancel")
+ var/fchoice = tgui_input_list(user, "Do you want to shorten or remove the fuse on \the [name]?", "Shorten or Remove", list("Shorten", "Remove", "Cancel"), "Cancel")
switch(fchoice)
if("Shorten")
- var/short = input("How many seconds do you want the fuse to be?", "[name] fuse") as null|num
+ var/short = tgui_input_number(user, "How many seconds do you want the fuse to be?", "[name] fuse", min_value = FUSELENGTH_MIN)
if(!use_check_and_message(user))
if(short < fuselength && short >= FUSELENGTH_MIN)
to_chat(user, SPAN_NOTICE("You shorten the fuse to [short] seconds."))
FuseRemove(fuselength - short)
else if(!short && !isnull(short))
- user.visible_message("[user] removes the steel wool from \the [name]", SPAN_NOTICE("You remove the steel wool fuse from \the [name]."))
+ user.visible_message("[user] removes the steel wool from \the [name]",
+ SPAN_NOTICE("You remove the steel wool fuse from \the [name]."))
FuseRemove()
else if(short == fuselength || isnull(short))
to_chat(user, SPAN_NOTICE("You decide against modifying the fuse."))
@@ -133,8 +139,8 @@
return
return
- else if(W.isFlameSource() && fuselength)
- light_fuse(W, user)
+ else if(attacking_item.isFlameSource() && fuselength)
+ light_fuse(attacking_item, user)
. = ..()
/obj/item/reagent_containers/food/drinks/cans/proc/light_fuse(obj/item/W, mob/user, var/premature=FALSE)
diff --git a/code/modules/reagents/reagent_containers/food/drinks.dm b/code/modules/reagents/reagent_containers/food/drinks.dm
index c140d63d90b..70207254f95 100644
--- a/code/modules/reagents/reagent_containers/food/drinks.dm
+++ b/code/modules/reagents/reagent_containers/food/drinks.dm
@@ -366,33 +366,33 @@ If you add a drink with an empty icon sprite, ensure it is in the same folder, e
src.add_fingerprint(user)
return
-/obj/item/reagent_containers/food/drinks/shaker/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/reagent_containers/food/drinks/shaker_cup))
+/obj/item/reagent_containers/food/drinks/shaker/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/reagent_containers/food/drinks/shaker_cup))
if(cap)
to_chat(user, SPAN_WARNING("\The [src] already has \a [cap]."))
return TRUE
- if(W.reagents.total_volume > 0)
- var/obj/item/reagent_containers/food/drinks/shaker_cup/C = W
+ if(attacking_item.reagents.total_volume > 0)
+ var/obj/item/reagent_containers/food/drinks/shaker_cup/C = attacking_item
C.standard_pour_into(user, src)
return TRUE
if(!top)
- to_chat(user, SPAN_WARNING("\The [src] lacks a top to fit \the [W] on."))
+ to_chat(user, SPAN_WARNING("\The [src] lacks a top to fit \the [attacking_item] on."))
return TRUE
- to_chat(user, SPAN_NOTICE("You put \the [W] onto \the [src]."))
- user.drop_from_inventory(W, src)
+ to_chat(user, SPAN_NOTICE("You put \the [attacking_item] onto \the [src]."))
+ user.drop_from_inventory(attacking_item, src)
atom_flags ^= ATOM_FLAG_OPEN_CONTAINER
- cap = W
+ cap = attacking_item
playsound(src.loc, /singleton/sound_category/shaker_lid_off, 50, 1)
update_icon()
return TRUE
- if(istype(W, /obj/item/shaker_top))
+ if(istype(attacking_item, /obj/item/shaker_top))
if(top)
to_chat(user, SPAN_WARNING("\The [src] already has \a [top]."))
return TRUE
- to_chat(user, SPAN_NOTICE("You fit \the [W] onto \the [src]."))
+ to_chat(user, SPAN_NOTICE("You fit \the [attacking_item] onto \the [src]."))
amount_per_transfer_from_this = 10
- user.drop_from_inventory(W, src)
- top = W
+ user.drop_from_inventory(attacking_item, src)
+ top = attacking_item
playsound(src.loc, /singleton/sound_category/shaker_lid_off, 50, 1)
update_icon()
return TRUE
diff --git a/code/modules/reagents/reagent_containers/food/drinks/bottle.dm b/code/modules/reagents/reagent_containers/food/drinks/bottle.dm
index c3a863ff5e8..6795cace044 100644
--- a/code/modules/reagents/reagent_containers/food/drinks/bottle.dm
+++ b/code/modules/reagents/reagent_containers/food/drinks/bottle.dm
@@ -86,12 +86,12 @@
qdel(src)
return B
-/obj/item/reagent_containers/food/drinks/bottle/attackby(obj/item/W, mob/user)
- if(!rag && istype(W, /obj/item/reagent_containers/glass/rag))
- insert_rag(W, user)
+/obj/item/reagent_containers/food/drinks/bottle/attackby(obj/item/attacking_item, mob/user)
+ if(!rag && istype(attacking_item, /obj/item/reagent_containers/glass/rag))
+ insert_rag(attacking_item, user)
return
- if(rag && W.isFlameSource())
- rag.attackby(W, user)
+ if(rag && attacking_item.isFlameSource())
+ rag.attackby(attacking_item, user)
return
..()
@@ -355,16 +355,16 @@
if(do_after(user, 1 SECONDS, src))
return open(user, sabrage = FALSE, froth_severity = pick(0, 1))
-/obj/item/reagent_containers/food/drinks/bottle/champagne/attackby(obj/item/W, mob/user)
+/obj/item/reagent_containers/food/drinks/bottle/champagne/attackby(obj/item/attacking_item, mob/user)
. = ..()
if(is_open_container())
return ..()
- if(!has_edge(W))
+ if(!has_edge(attacking_item))
return
- if(W.force < 5)
+ if(attacking_item.force < 5)
balloon_alert(user, "not strong enough!")
return
@@ -378,7 +378,7 @@
var/job_bonus = user.mind?.assigned_role == "Bartender" ? 25 : 0
- var/sabrage_chance = (W.force * sabrage_success_percentile) + command_bonus + job_bonus
+ var/sabrage_chance = (attacking_item.force * sabrage_success_percentile) + command_bonus + job_bonus
if(prob(sabrage_chance))
///Severity of the resulting froth to pass to make_froth()
diff --git a/code/modules/reagents/reagent_containers/food/drinks/flask.dm b/code/modules/reagents/reagent_containers/food/drinks/flask.dm
index 1fbc6ab68e2..00fbb4c9a07 100644
--- a/code/modules/reagents/reagent_containers/food/drinks/flask.dm
+++ b/code/modules/reagents/reagent_containers/food/drinks/flask.dm
@@ -42,18 +42,18 @@
cup = null
update_icon()
-/obj/item/reagent_containers/food/drinks/flask/vacuumflask/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/reagent_containers/food/drinks/flask/flask_cup))
+/obj/item/reagent_containers/food/drinks/flask/vacuumflask/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/reagent_containers/food/drinks/flask/flask_cup))
if(cup)
to_chat(user, SPAN_WARNING("\The [src] already has a cap."))
return TRUE
- if(W.reagents.total_volume + reagents.total_volume > volume)
+ if(attacking_item.reagents.total_volume + reagents.total_volume > volume)
to_chat(user, SPAN_WARNING("There's too much fluid in both the cap and \the [src]!"))
return TRUE
to_chat(user, SPAN_NOTICE("You put the cap onto \the [src]."))
- user.drop_from_inventory(W, src)
+ user.drop_from_inventory(attacking_item, src)
atom_flags ^= ATOM_FLAG_OPEN_CONTAINER
- cup = W
+ cup = attacking_item
cup.reagents.trans_to_holder(reagents, cup.reagents.total_volume)
update_icon()
return TRUE
diff --git a/code/modules/reagents/reagent_containers/food/drinks/yoke.dm b/code/modules/reagents/reagent_containers/food/drinks/yoke.dm
index 466450a6ee0..1ccf5d9e98a 100644
--- a/code/modules/reagents/reagent_containers/food/drinks/yoke.dm
+++ b/code/modules/reagents/reagent_containers/food/drinks/yoke.dm
@@ -55,7 +55,7 @@
user.put_in_hands(C)
update_icon()
-/obj/item/storage/box/fancy/yoke/attackby(obj/item/W, mob/user)
+/obj/item/storage/box/fancy/yoke/attackby(obj/item/attacking_item, mob/user)
to_chat(user, SPAN_WARNING("\The [src] cannot be refilled with items!"))
/obj/item/storage/box/fancy/yoke/random
diff --git a/code/modules/reagents/reagent_containers/food/sandwich.dm b/code/modules/reagents/reagent_containers/food/sandwich.dm
index 32546006cc9..5799e6c8ff6 100644
--- a/code/modules/reagents/reagent_containers/food/sandwich.dm
+++ b/code/modules/reagents/reagent_containers/food/sandwich.dm
@@ -18,7 +18,7 @@
var/base_name = "sandwich"
var/topper = "sandwich_top"
-/obj/item/reagent_containers/food/snacks/csandwich/attackby(obj/item/W as obj, mob/user)
+/obj/item/reagent_containers/food/snacks/csandwich/attackby(obj/item/attacking_item, mob/user)
var/sandwich_limit = 4
for(var/obj/item/O in ingredients)
@@ -28,12 +28,12 @@
if(src.contents.len > sandwich_limit)
to_chat(user, SPAN_WARNING("If you put anything else on \the [src] it's going to collapse."))
return
- else if(istype(W,/obj/item/reagent_containers/food/snacks))
- to_chat(user, SPAN_NOTICE("You layer [W] over \the [src]."))
- var/obj/item/reagent_containers/F = W
+ else if(istype(attacking_item, /obj/item/reagent_containers/food/snacks))
+ to_chat(user, SPAN_NOTICE("You layer [attacking_item] over \the [src]."))
+ var/obj/item/reagent_containers/F = attacking_item
F.reagents.trans_to_obj(src, F.reagents.total_volume)
- user.drop_from_inventory(W,src)
- ingredients += W
+ user.drop_from_inventory(attacking_item, src)
+ ingredients += attacking_item
update()
return
..()
diff --git a/code/modules/reagents/reagent_containers/food/snacks.dm b/code/modules/reagents/reagent_containers/food/snacks.dm
index f0834c33c5d..2defbe8152e 100644
--- a/code/modules/reagents/reagent_containers/food/snacks.dm
+++ b/code/modules/reagents/reagent_containers/food/snacks.dm
@@ -157,33 +157,33 @@
else
. += SPAN_NOTICE("\The [src] was bitten multiple times!")
-/obj/item/reagent_containers/food/snacks/attackby(obj/item/W, mob/living/user)
+/obj/item/reagent_containers/food/snacks/attackby(obj/item/attacking_item, mob/user)
- if(istype(W,/obj/item/pen))
+ if(istype(attacking_item, /obj/item/pen))
- var/selection = alert(user,"Which attribute do you wish to edit?","Food Editor","Name","Description","Cancel")
+ var/selection = tgui_input_list(user, "Which attribute do you wish to edit?", "Food Editor", list("Name","Description","Cancel"), "Cancel")
if(selection == "Name")
- var/input_clean_name = sanitize(input(user,"What is the name of this food?", "Set Food Name") as text|null, MAX_LNAME_LEN)
+ var/input_clean_name = sanitize( tgui_input_text(user, "What is the name of this food?", "Set Food Name", max_length = MAX_LNAME_LEN), MAX_LNAME_LEN )
if(input_clean_name)
name = input_clean_name
else
name = initial(name)
else if(selection == "Description")
- var/input_clean_desc = sanitize(input(user,"What is the description of this food?", "Set Food Description") as text|null, MAX_MESSAGE_LEN)
+ var/input_clean_desc = sanitize( tgui_input_text(user, "What is the description of this food?", "Set Food Description", max_length = MAX_MESSAGE_LEN), MAX_MESSAGE_LEN )
if(input_clean_desc)
desc = input_clean_desc
else
desc = initial(desc)
return
- if(istype(W,/obj/item/storage))
+ if(istype(attacking_item, /obj/item/storage))
..() // -> item/attackby()
return
// Eating with forks
- if(istype(W,/obj/item/material/kitchen/utensil))
- var/obj/item/material/kitchen/utensil/U = W
- if(istype(W,/obj/item/material/kitchen/utensil/fork)&&(is_liquid))
+ if(istype(attacking_item, /obj/item/material/kitchen/utensil))
+ var/obj/item/material/kitchen/utensil/U = attacking_item
+ if(istype(attacking_item, /obj/item/material/kitchen/utensil/fork) && (is_liquid))
to_chat(user, SPAN_NOTICE("You uselessly pass \the [U] through \the [src]."))
playsound(user.loc, /singleton/sound_category/generic_pour_sound, 10, 1)
return
@@ -214,27 +214,27 @@
if(is_sliceable())
//these are used to allow hiding edge items in food that is not on a table/tray
var/can_slice_here = isturf(src.loc) && ((locate(/obj/structure/table) in src.loc) || (locate(/obj/machinery/optable) in src.loc) || (locate(/obj/item/tray) in src.loc))
- var/hide_item = !has_edge(W) || !can_slice_here
+ var/hide_item = !has_edge(attacking_item) || !can_slice_here
if(hide_item && user.a_intent == I_HURT)
- if (W.w_class >= src.w_class || is_robot_module(W))
+ if (attacking_item.w_class >= src.w_class || is_robot_module(attacking_item))
return
- to_chat(user, SPAN_WARNING("You slip \the [W] inside \the [src]."))
- user.remove_from_mob(W)
- W.dropped(user)
+ to_chat(user, SPAN_WARNING("You slip \the [attacking_item] inside \the [src]."))
+ user.remove_from_mob(attacking_item)
+ attacking_item.dropped(user)
add_fingerprint(user)
- contents += W
+ contents += attacking_item
return
- if(has_edge(W))
+ if(has_edge(attacking_item))
if (!can_slice_here)
to_chat(user, SPAN_WARNING("You cannot slice \the [src] here! You need a table or at least a tray to do it."))
return
var/slices_lost = 0
- if(W.w_class > 3)
- user.visible_message(SPAN_NOTICE("\The [user] crudely slices \the [src] with [W]!"), SPAN_NOTICE("You crudely slice \the [src] with your [W]!"))
+ if(attacking_item.w_class > 3)
+ user.visible_message(SPAN_NOTICE("\The [user] crudely slices \the [src] with [attacking_item]!"), SPAN_NOTICE("You crudely slice \the [src] with your [attacking_item]!"))
slices_lost = rand(1,min(1,round(slices_num/2)))
else
user.visible_message(SPAN_NOTICE("\The [user] slices \the [src]!"), SPAN_NOTICE("You slice \the [src]!"))
diff --git a/code/modules/reagents/reagent_containers/food/snacks/breads.dm b/code/modules/reagents/reagent_containers/food/snacks/breads.dm
index 7d5c1d092da..265a1337c5e 100644
--- a/code/modules/reagents/reagent_containers/food/snacks/breads.dm
+++ b/code/modules/reagents/reagent_containers/food/snacks/breads.dm
@@ -9,47 +9,47 @@
reagents_to_add = list(/singleton/reagent/nutriment = 4)
reagent_data = list(/singleton/reagent/nutriment = list("bun" = 3))
-/obj/item/reagent_containers/food/snacks/bun/attackby(obj/item/W as obj, mob/user as mob)
+/obj/item/reagent_containers/food/snacks/bun/attackby(obj/item/attacking_item, mob/user)
var/obj/item/reagent_containers/food/snacks/result = null
// Bun + meatball = burger
- if(istype(W,/obj/item/reagent_containers/food/snacks/meatball))
+ if(istype(attacking_item, /obj/item/reagent_containers/food/snacks/meatball))
result = new /obj/item/reagent_containers/food/snacks/burger(src)
to_chat(user, "You make a burger.")
// Bun + cutlet = hamburger
- else if(istype(W,/obj/item/reagent_containers/food/snacks/cutlet))
+ else if(istype(attacking_item, /obj/item/reagent_containers/food/snacks/cutlet))
result = new /obj/item/reagent_containers/food/snacks/burger(src)
to_chat(user, "You make a burger.")
//Bun + katsu = chickenfillet
- else if(istype(W,/obj/item/reagent_containers/food/snacks/chickenkatsu))
+ else if(istype(attacking_item, /obj/item/reagent_containers/food/snacks/chickenkatsu))
result = new /obj/item/reagent_containers/food/snacks/chickenfillet(src)
to_chat(user, "You make a chicken fillet sandwich.")
// Bun + sausage = hotdog
- else if(istype(W,/obj/item/reagent_containers/food/snacks/sausage))
+ else if(istype(attacking_item, /obj/item/reagent_containers/food/snacks/sausage))
result = new /obj/item/reagent_containers/food/snacks/hotdog(src)
to_chat(user, "You make a hotdog.")
- else if(istype(W,/obj/item/reagent_containers/food/snacks/variable/mob))
- var/obj/item/reagent_containers/food/snacks/variable/mob/MF = W
+ else if(istype(attacking_item, /obj/item/reagent_containers/food/snacks/variable/mob))
+ var/obj/item/reagent_containers/food/snacks/variable/mob/MF = attacking_item
switch (MF.kitchen_tag)
if ("rodent")
result = new /obj/item/reagent_containers/food/snacks/burger/mouse(src)
to_chat(user, "You make a ratburger!")
- else if(istype(W,/obj/item/reagent_containers/food/snacks))
+ else if(istype(attacking_item, /obj/item/reagent_containers/food/snacks))
var/obj/item/reagent_containers/food/snacks/csandwich/roll/R = new(get_turf(src))
- R.attackby(W,user)
+ R.attackby(attacking_item, user)
qdel(src)
if (result)
- if (W.reagents)
+ if (attacking_item.reagents)
//Reagents of reuslt objects will be the sum total of both. Except in special cases where nonfood items are used
//Eg robot head
result.reagents.clear_reagents()
- W.reagents.trans_to(result, W.reagents.total_volume)
+ attacking_item.reagents.trans_to(result, attacking_item.reagents.total_volume)
reagents.trans_to(result, reagents.total_volume)
//If the bun was in your hands, the result will be too
@@ -57,7 +57,7 @@
user.drop_from_inventory(src) //This has to be here in order to put the pun in the proper place
user.put_in_hands(result)
- qdel(W)
+ qdel(attacking_item)
qdel(src)
/obj/item/reagent_containers/food/snacks/bunbun
diff --git a/code/modules/reagents/reagent_containers/food/snacks/burger.dm b/code/modules/reagents/reagent_containers/food/snacks/burger.dm
index 78b27080e6d..1d34a0c5880 100644
--- a/code/modules/reagents/reagent_containers/food/snacks/burger.dm
+++ b/code/modules/reagents/reagent_containers/food/snacks/burger.dm
@@ -11,16 +11,16 @@
bitesize = 2
// Burger + cheese wedge = cheeseburger
-/obj/item/reagent_containers/food/snacks/burger/attackby(obj/item/reagent_containers/food/snacks/W as obj, mob/user as mob)
- if(istype(W,/obj/item/reagent_containers/food/snacks/cheesewedge))// && !istype(src,/obj/item/reagent_containers/food/snacks/cheesewedge))
+/obj/item/reagent_containers/food/snacks/burger/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/reagent_containers/food/snacks/cheesewedge))// && !istype(src,/obj/item/reagent_containers/food/snacks/cheesewedge))
new /obj/item/reagent_containers/food/snacks/burger/cheese(src)
to_chat(user, "You make a cheeseburger.")
- qdel(W)
+ qdel(attacking_item)
qdel(src)
return
- else if(istype(W,/obj/item/reagent_containers/food/snacks))
+ else if(istype(attacking_item, /obj/item/reagent_containers/food/snacks))
var/obj/item/reagent_containers/food/snacks/csandwich/burger/B = new(get_turf(src))
- B.attackby(W,user)
+ B.attackby(attacking_item, user)
qdel(src)
else
..()
diff --git a/code/modules/reagents/reagent_containers/food/snacks/cannibalism.dm b/code/modules/reagents/reagent_containers/food/snacks/cannibalism.dm
index 286298a6bf3..bcff7feae3e 100644
--- a/code/modules/reagents/reagent_containers/food/snacks/cannibalism.dm
+++ b/code/modules/reagents/reagent_containers/food/snacks/cannibalism.dm
@@ -15,11 +15,11 @@
reagent_data = list(/singleton/reagent/nutriment = list("buns" = 3))
// Human Burger + cheese wedge = cheeseburger
-/obj/item/reagent_containers/food/snacks/human/burger/attackby(obj/item/reagent_containers/food/snacks/cheesewedge/W as obj, mob/user as mob)
- if(istype(W))
+/obj/item/reagent_containers/food/snacks/human/burger/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/reagent_containers/food/snacks/cheesewedge))
new /obj/item/reagent_containers/food/snacks/burger/cheese(src)
to_chat(user, "You make a cheeseburger.")
- qdel(W)
+ qdel(attacking_item)
qdel(src)
return
else
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 3e28d2a4388..2eadfa3818c 100644
--- a/code/modules/reagents/reagent_containers/food/snacks/cultural/vaurca.dm
+++ b/code/modules/reagents/reagent_containers/food/snacks/cultural/vaurca.dm
@@ -8,13 +8,13 @@
bitesize = 5
reagents_to_add = list(/singleton/reagent/kois = 6, /singleton/reagent/toxin/phoron = 9)
-/obj/item/reagent_containers/food/snacks/friedkois/attackby(obj/item/W as obj, mob/user as mob)
- if(istype(W,/obj/item/stack/rods))
+/obj/item/reagent_containers/food/snacks/friedkois/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/stack/rods))
new /obj/item/reagent_containers/food/snacks/koiskebab1(src)
to_chat(user, "You skewer the fried k'ois.")
qdel(src)
- qdel(W)
- if(istype(W,/obj/item/material/kitchen/rollingpin))
+ qdel(attacking_item)
+ if(istype(attacking_item, /obj/item/material/kitchen/rollingpin))
new /obj/item/reagent_containers/food/snacks/soup/kois(src)
to_chat(user, "You crush the fried K'ois into a paste, and pour it into a bowl.")
qdel(src)
@@ -29,12 +29,12 @@
bitesize = 3
reagents_to_add = list(/singleton/reagent/kois = 8, /singleton/reagent/toxin/phoron = 12)
-/obj/item/reagent_containers/food/snacks/koiskebab1/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/koiskebab1/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/reagent_containers/food/snacks/friedkois))
new /obj/item/reagent_containers/food/snacks/koiskebab2(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/koiskebab2
name = "k'ois on a stick"
diff --git a/code/modules/reagents/reagent_containers/food/snacks/eggs.dm b/code/modules/reagents/reagent_containers/food/snacks/eggs.dm
index fc79e35e5ed..bdcdd8bf628 100644
--- a/code/modules/reagents/reagent_containers/food/snacks/eggs.dm
+++ b/code/modules/reagents/reagent_containers/food/snacks/eggs.dm
@@ -25,9 +25,9 @@
src.visible_message(SPAN_WARNING("\The [src] has been squashed!"), SPAN_WARNING("You hear a smack."))
qdel(src)
-/obj/item/reagent_containers/food/snacks/egg/attackby(obj/item/W as obj, mob/user as mob)
- if(istype( W, /obj/item/pen/crayon ))
- var/obj/item/pen/crayon/C = W
+/obj/item/reagent_containers/food/snacks/egg/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/pen/crayon ))
+ var/obj/item/pen/crayon/C = attacking_item
var/clr = C.colourName
if(!(clr in list("blue","green","mime","orange","purple","rainbow","red","yellow")))
diff --git a/code/modules/reagents/reagent_containers/food/snacks/fish.dm b/code/modules/reagents/reagent_containers/food/snacks/fish.dm
index 41366acc16e..f3e2bd650c0 100644
--- a/code/modules/reagents/reagent_containers/food/snacks/fish.dm
+++ b/code/modules/reagents/reagent_containers/food/snacks/fish.dm
@@ -6,8 +6,8 @@
bitesize = 6
var/fish_type = "fish"
-/obj/item/reagent_containers/food/snacks/fish/attackby(var/obj/item/W, var/mob/user)
- if(is_sharp(W) && (locate(/obj/structure/table) in loc))
+/obj/item/reagent_containers/food/snacks/fish/attackby(obj/item/attacking_item, mob/user)
+ if(is_sharp(attacking_item) && (locate(/obj/structure/table) in loc))
var/transfer_amt = FLOOR(reagents.total_volume/3)
for(var/i = 1 to 3)
var/obj/item/reagent_containers/food/snacks/sashimi/sashimi = new(get_turf(src), fish_type)
@@ -110,9 +110,9 @@
return
return ..()
-/obj/item/mollusc/attackby(var/obj/item/thing, var/mob/user)
- if(thing.sharp || thing.edge)
- user.visible_message("[user] cracks open \the [src] with \the [thing].", SPAN_NOTICE("You crack open \the [src] with \the [thing]."))
+/obj/item/mollusc/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.sharp || attacking_item.edge)
+ user.visible_message("[user] cracks open \the [src] with \the [attacking_item].", SPAN_NOTICE("You crack open \the [src] with \the [attacking_item]."))
crack_shell(user)
return
return ..()
diff --git a/code/modules/reagents/reagent_containers/food/snacks/ingredients.dm b/code/modules/reagents/reagent_containers/food/snacks/ingredients.dm
index 3269183f0a0..c04cd7f053a 100644
--- a/code/modules/reagents/reagent_containers/food/snacks/ingredients.dm
+++ b/code/modules/reagents/reagent_containers/food/snacks/ingredients.dm
@@ -96,8 +96,8 @@
filling_color = "#EDE0AF"
// Dough + rolling pin = flat dough
-/obj/item/reagent_containers/food/snacks/dough/attackby(obj/item/W as obj, mob/user as mob)
- if(istype(W,/obj/item/material/kitchen/rollingpin))
+/obj/item/reagent_containers/food/snacks/dough/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/material/kitchen/rollingpin))
new /obj/item/reagent_containers/food/snacks/sliceable/flatdough(src)
to_chat(user, "You flatten the dough.")
qdel(src)
@@ -129,8 +129,8 @@
filling_color = "#EDE0AF"
// potato + knife = raw sticks
-/obj/item/reagent_containers/food/snacks/grown/potato/attackby(obj/item/W as obj, mob/user as mob)
- if(istype(W,/obj/item/material/kitchen/utensil/knife))
+/obj/item/reagent_containers/food/snacks/grown/potato/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/material/kitchen/utensil/knife))
new /obj/item/reagent_containers/food/snacks/rawsticks(src)
to_chat(user, "You cut the potato.")
qdel(src)
diff --git a/code/modules/reagents/reagent_containers/food/snacks/meat.dm b/code/modules/reagents/reagent_containers/food/snacks/meat.dm
index 0451f16e3cd..32805676d63 100644
--- a/code/modules/reagents/reagent_containers/food/snacks/meat.dm
+++ b/code/modules/reagents/reagent_containers/food/snacks/meat.dm
@@ -359,8 +359,8 @@
icon_state = "squidmeat"
reagents_to_add = list(/singleton/reagent/nutriment/protein/seafood = 3)
-/obj/item/reagent_containers/food/snacks/squidmeat/attackby(var/obj/item/W, var/mob/user)
- if(is_sharp(W) && (locate(/obj/structure/table) in loc))
+/obj/item/reagent_containers/food/snacks/squidmeat/attackby(obj/item/attacking_item, mob/user)
+ if(is_sharp(attacking_item) && (locate(/obj/structure/table) in loc))
var/transfer_amt = FLOOR(reagents.total_volume/3)
for(var/i = 1 to 3)
var/obj/item/reagent_containers/food/snacks/sashimi/sashimi = new(get_turf(src), "squid")
diff --git a/code/modules/reagents/reagent_containers/food/snacks/mexican.dm b/code/modules/reagents/reagent_containers/food/snacks/mexican.dm
index 1f5ccd236aa..b1d2e83c70d 100644
--- a/code/modules/reagents/reagent_containers/food/snacks/mexican.dm
+++ b/code/modules/reagents/reagent_containers/food/snacks/mexican.dm
@@ -233,20 +233,20 @@
reagents_to_add = list(/singleton/reagent/nutriment = 20)
filling_color = "#FFF454"
-/obj/item/reagent_containers/food/snacks/dip/attackby(obj/item/reagent_containers/food/snacks/item as obj, mob/user as mob)
+/obj/item/reagent_containers/food/snacks/dip/attackby(obj/item/attacking_item, mob/user)
. = ..()
var/obj/item/reagent_containers/food/snacks/returningitem
- if(istype(item,/obj/item/reagent_containers/food/snacks/chip/nacho) && item.icon_state == "chip_nacho")
+ if(istype(attacking_item, /obj/item/reagent_containers/food/snacks/chip/nacho) && attacking_item.icon_state == "chip_nacho")
returningitem = new nachotrans(src)
- else if (istype(item,/obj/item/reagent_containers/food/snacks/chip/miniavah) && item.icon_state == "avah_full" || item.icon_state == "avah_half")
+ else if (istype(attacking_item, /obj/item/reagent_containers/food/snacks/chip/miniavah) && attacking_item.icon_state == "avah_full" || attacking_item.icon_state == "avah_half")
returningitem = new avahtrans(src)
- else if (istype(item,/obj/item/reagent_containers/food/snacks/chip) && (item.icon_state == "chip" || item.icon_state == "chip_half"))
+ else if (istype(attacking_item, /obj/item/reagent_containers/food/snacks/chip) && (attacking_item.icon_state == "chip" || attacking_item.icon_state == "chip_half"))
returningitem = new chiptrans(src)
if(returningitem)
returningitem.reagents.clear_reagents() //Clear the new chip
var/memed = 0
- item.reagents.trans_to(returningitem, item.reagents.total_volume) //Old chip to new chip
- if(item.icon_state == "chip_half")
+ attacking_item.reagents.trans_to(returningitem, attacking_item.reagents.total_volume) //Old chip to new chip
+ if(attacking_item.icon_state == "chip_half")
returningitem.icon_state = "[returningitem.icon_state]_half"
returningitem.bitesize = Clamp(returningitem.reagents.total_volume,1,10)
else if(prob(1))
@@ -256,7 +256,7 @@
returningitem.bitesize = Clamp(returningitem.reagents.total_volume,1,10)
else
returningitem.bitesize = Clamp(returningitem.reagents.total_volume*0.5,1,10)
- qdel(item)
+ qdel(attacking_item)
reagents.trans_to(returningitem, bitesize) //Dip to new chip
user.put_in_hands(returningitem)
diff --git a/code/modules/reagents/reagent_containers/food/snacks/sushi.dm b/code/modules/reagents/reagent_containers/food/snacks/sushi.dm
index ed60d873ad1..b181df7923f 100644
--- a/code/modules/reagents/reagent_containers/food/snacks/sushi.dm
+++ b/code/modules/reagents/reagent_containers/food/snacks/sushi.dm
@@ -78,39 +78,39 @@
I.pixel_y = I.pixel_x
add_overlay(I)
-/obj/item/reagent_containers/food/snacks/sashimi/attackby(var/obj/item/I, var/mob/user)
+/obj/item/reagent_containers/food/snacks/sashimi/attackby(obj/item/attacking_item, mob/user)
if(!(locate(/obj/structure/table) in loc))
return ..()
// Add more slices.
- if(istype(I, /obj/item/reagent_containers/food/snacks/sashimi))
- var/obj/item/reagent_containers/food/snacks/sashimi/other_sashimi = I
+ if(istype(attacking_item, /obj/item/reagent_containers/food/snacks/sashimi))
+ var/obj/item/reagent_containers/food/snacks/sashimi/other_sashimi = attacking_item
if(slices + other_sashimi.slices > 5)
to_chat(user, SPAN_WARNING("You can't stack the sashimi that high!"))
return
- if(!user.unEquip(I))
+ if(!user.unEquip(attacking_item))
return
slices += other_sashimi.slices
bitesize = slices
update_icon()
- if(I.reagents)
- I.reagents.trans_to(src, I.reagents.total_volume)
- qdel(I)
+ if(attacking_item.reagents)
+ attacking_item.reagents.trans_to(src, attacking_item.reagents.total_volume)
+ qdel(attacking_item)
return
// Make sushi.
- if(istype(I, /obj/item/reagent_containers/food/snacks/boiledrice))
+ if(istype(attacking_item, /obj/item/reagent_containers/food/snacks/boiledrice))
if(slices > 1)
to_chat(user, SPAN_WARNING("Putting more than one slice of fish on your sushi is just greedy."))
else
- if(!user.unEquip(I))
+ if(!user.unEquip(attacking_item))
return
- new /obj/item/reagent_containers/food/snacks/sushi(get_turf(src), I, src)
+ new /obj/item/reagent_containers/food/snacks/sushi(get_turf(src), attacking_item, src)
return
. = ..()
// Used for turning rice into sushi.
-/obj/item/reagent_containers/food/snacks/boiledrice/attackby(var/obj/item/I, var/mob/user)
+/obj/item/reagent_containers/food/snacks/boiledrice/attackby(obj/item/attacking_item, mob/user)
var/static/list/acceptable_types = list(
/obj/item/reagent_containers/food/snacks/sashimi = TRUE,
/obj/item/reagent_containers/food/snacks/friedegg = TRUE,
@@ -121,34 +121,34 @@
)
if(!(locate(/obj/structure/table) in loc))
return ..()
- if(istype(I, /obj/item/reagent_containers/food/snacks/sashimi))
- var/obj/item/reagent_containers/food/snacks/sashimi/sashimi = I
+ if(istype(attacking_item, /obj/item/reagent_containers/food/snacks/sashimi))
+ var/obj/item/reagent_containers/food/snacks/sashimi/sashimi = attacking_item
if(sashimi.slices > 1)
to_chat(user, SPAN_WARNING("Putting more than one slice of fish on your sushi is just greedy."))
return
- if(is_type_in_typecache(I, acceptable_types))
- new /obj/item/reagent_containers/food/snacks/sushi(get_turf(src), src, I)
+ if(is_type_in_typecache(attacking_item, acceptable_types))
+ new /obj/item/reagent_containers/food/snacks/sushi(get_turf(src), src, attacking_item)
return
. = ..()
// Used for turning other food into sushi.
-/obj/item/reagent_containers/food/snacks/friedegg/attackby(var/obj/item/I, var/mob/user)
- if((locate(/obj/structure/table) in loc) && istype(I, /obj/item/reagent_containers/food/snacks/boiledrice))
- new /obj/item/reagent_containers/food/snacks/sushi(get_turf(src), I, src)
+/obj/item/reagent_containers/food/snacks/friedegg/attackby(obj/item/attacking_item, var/mob/user)
+ 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(var/obj/item/I, var/mob/user)
- if((locate(/obj/structure/table) in loc) && istype(I, /obj/item/reagent_containers/food/snacks/boiledrice))
- new /obj/item/reagent_containers/food/snacks/sushi(get_turf(src), I, src)
+/obj/item/reagent_containers/food/snacks/tofu/attackby(obj/item/attacking_item, var/mob/user)
+ 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(var/obj/item/I, var/mob/user)
- if((locate(/obj/structure/table) in loc) && istype(I, /obj/item/reagent_containers/food/snacks/boiledrice))
- new /obj/item/reagent_containers/food/snacks/sushi(get_turf(src), I, src)
+/obj/item/reagent_containers/food/snacks/rawcutlet/attackby(obj/item/attacking_item, var/mob/user)
+ 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(var/obj/item/I, var/mob/user)
- if((locate(/obj/structure/table) in loc) && istype(I, /obj/item/reagent_containers/food/snacks/boiledrice))
- new /obj/item/reagent_containers/food/snacks/sushi(get_turf(src), I, src)
+/obj/item/reagent_containers/food/snacks/cutlet/attackby(obj/item/attacking_item, var/mob/user)
+ 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
. = ..()
// End non-fish sushi.
diff --git a/code/modules/reagents/reagent_containers/glass.dm b/code/modules/reagents/reagent_containers/glass.dm
index 47c07441f68..a1e6b7030cf 100644
--- a/code/modules/reagents/reagent_containers/glass.dm
+++ b/code/modules/reagents/reagent_containers/glass.dm
@@ -73,12 +73,12 @@
/obj/item/reagent_containers/glass/AltClick(var/mob/user)
set_APTFT()
-/obj/item/reagent_containers/glass/attackby(obj/item/W as obj, mob/user as mob)
- if(istype(W,/obj/item/storage/part_replacer))
+/obj/item/reagent_containers/glass/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item,/obj/item/storage/part_replacer))
if(!reagents || !reagents.total_volume)
return ..()
- if(W.ispen() || istype(W, /obj/item/device/flashlight/pen))
- var/tmp_label = sanitizeSafe(input(user, "Enter a label for [name]", "Label", label_text), MAX_NAME_LEN)
+ if(attacking_item.ispen() || istype(attacking_item, /obj/item/device/flashlight/pen))
+ var/tmp_label = sanitizeSafe( tgui_input_text(user, "Enter a label for [name]", "Label", label_text, MAX_NAME_LEN), MAX_NAME_LEN )
if(length(tmp_label) > 15)
to_chat(user, "The label can be at most 15 characters long.")
else
@@ -252,24 +252,24 @@
var/helmet_type = /obj/item/clothing/head/helmet/bucket
fragile = 0
-/obj/item/reagent_containers/glass/bucket/attackby(var/obj/D, mob/user as mob)
- if(isprox(D))
- to_chat(user, "You add [D] to [src].")
- qdel(D)
+/obj/item/reagent_containers/glass/bucket/attackby(obj/item/attacking_item, mob/user)
+ if(isprox(attacking_item))
+ to_chat(user, "You add [attacking_item] to [src].")
+ qdel(attacking_item)
user.put_in_hands(new /obj/item/bucket_sensor)
qdel(src)
return
- else if(D.iswirecutter())
- to_chat(user, "You cut a big hole in \the [src] with \the [D].")
+ else if(attacking_item.iswirecutter())
+ to_chat(user, "You cut a big hole in \the [src] with \the [attacking_item].")
user.put_in_hands(new helmet_type)
qdel(src)
return
- else if(istype(D, /obj/item/mop))
+ else if(istype(attacking_item, /obj/item/mop))
if(reagents.total_volume < 1)
to_chat(user, "\The [src] is empty!")
else
- reagents.trans_to_obj(D, 5)
- to_chat(user, "You wet \the [D] in \the [src].")
+ reagents.trans_to_obj(attacking_item, 5)
+ to_chat(user, "You wet \the [attacking_item] in \the [src].")
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
return
else
@@ -300,8 +300,8 @@
pickup_sound = 'sound/items/pickup/wooden.ogg'
helmet_type = /obj/item/clothing/head/helmet/bucket/wood
-/obj/item/reagent_containers/glass/bucket/wood/attackby(var/obj/D, mob/user as mob)
- if(isprox(D))
+/obj/item/reagent_containers/glass/bucket/wood/attackby(obj/item/attacking_item, mob/user)
+ if(isprox(attacking_item))
to_chat(user, "This wooden bucket doesn't play well with electronics.")
return
..()
diff --git a/code/modules/reagents/reagent_containers/hypospray.dm b/code/modules/reagents/reagent_containers/hypospray.dm
index 002bcd08ab3..d321ad0f17a 100644
--- a/code/modules/reagents/reagent_containers/hypospray.dm
+++ b/code/modules/reagents/reagent_containers/hypospray.dm
@@ -164,9 +164,9 @@
return
return ..()
-/obj/item/reagent_containers/hypospray/autoinjector/attackby(obj/item/W, mob/user)
- if(W.isscrewdriver() && !is_open_container())
- to_chat(user, SPAN_NOTICE("Using \the [W], you unsecure the autoinjector's lid.")) // it locks shut after being secured
+/obj/item/reagent_containers/hypospray/autoinjector/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.isscrewdriver() && !is_open_container())
+ to_chat(user, SPAN_NOTICE("Using \the [attacking_item], you unsecure the autoinjector's lid.")) // it locks shut after being secured
atom_flags |= ATOM_FLAG_OPEN_CONTAINER
update_icon()
return TRUE
diff --git a/code/modules/reagents/reagent_containers/inhaler.dm b/code/modules/reagents/reagent_containers/inhaler.dm
index b5276ab8e3e..d329b879645 100644
--- a/code/modules/reagents/reagent_containers/inhaler.dm
+++ b/code/modules/reagents/reagent_containers/inhaler.dm
@@ -123,9 +123,9 @@
to_chat(user,"The reagents inside \the [src] are already secured.")
return
-/obj/item/reagent_containers/inhaler/attackby(obj/item/W, mob/user)
- if(W.isscrewdriver() && !is_open_container())
- to_chat(user,"Using \the [W], you unsecure the inhaler's lid.") // it locks shut after being secured
+/obj/item/reagent_containers/inhaler/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.isscrewdriver() && !is_open_container())
+ to_chat(user,"Using \the [attacking_item], you unsecure the inhaler's lid.") // it locks shut after being secured
atom_flags |= ATOM_FLAG_OPEN_CONTAINER
update_icon()
return TRUE
diff --git a/code/modules/reagents/reagent_containers/inhaler_advanced.dm b/code/modules/reagents/reagent_containers/inhaler_advanced.dm
index eb287c62a74..8a4938bad40 100644
--- a/code/modules/reagents/reagent_containers/inhaler_advanced.dm
+++ b/code/modules/reagents/reagent_containers/inhaler_advanced.dm
@@ -60,9 +60,9 @@
to_chat(user,"The reagents inside \the [src] are already secured.")
return
-/obj/item/reagent_containers/personal_inhaler_cartridge/attackby(obj/item/W, mob/user)
- if(W.isscrewdriver() && !is_open_container())
- to_chat(user,"Using \the [W], you unsecure the inhaler cartridge's lid.") // it locks shut after being secured
+/obj/item/reagent_containers/personal_inhaler_cartridge/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.isscrewdriver() && !is_open_container())
+ to_chat(user,"Using \the [attacking_item], you unsecure the inhaler cartridge's lid.") // it locks shut after being secured
atom_flags |= ATOM_FLAG_OPEN_CONTAINER
return
. = ..()
@@ -189,7 +189,8 @@
update_icon()
return
-/obj/item/personal_inhaler/attackby(var/obj/item/reagent_containers/personal_inhaler_cartridge/cartridge as obj, var/mob/user as mob)
+/obj/item/personal_inhaler/attackby(obj/item/attacking_item, mob/user)
+ var/obj/item/reagent_containers/personal_inhaler_cartridge/cartridge = attacking_item
if(istype(cartridge))
if(src.stored_cartridge)
to_chat(user,"\The [src] already has a cartridge.")
diff --git a/code/modules/reagents/reagent_containers/pill.dm b/code/modules/reagents/reagent_containers/pill.dm
index a01703b7627..3fe9403e073 100644
--- a/code/modules/reagents/reagent_containers/pill.dm
+++ b/code/modules/reagents/reagent_containers/pill.dm
@@ -80,12 +80,12 @@
. = ..()
-/obj/item/reagent_containers/pill/attackby(obj/item/W, mob/user)
- if(is_sharp(W) || istype(W, /obj/item/card/id))
+/obj/item/reagent_containers/pill/attackby(obj/item/attacking_item, mob/user)
+ if(is_sharp(attacking_item) || istype(attacking_item, /obj/item/card/id))
var/obj/item/reagent_containers/powder/J = new /obj/item/reagent_containers/powder(loc)
user.visible_message(
- SPAN_WARNING("\The [user] gently cuts up \the [src] with \a [W]!"),
- SPAN_NOTICE("You gently cut up \the [src] with \the [W]."),
+ SPAN_WARNING("\The [user] gently cuts up \the [src] with \a [attacking_item]!"),
+ SPAN_NOTICE("You gently cut up \the [src] with \the [attacking_item]."),
SPAN_WARNING("You hear quiet grinding.")
)
playsound(loc, 'sound/effects/chop.ogg', 50, 1)
diff --git a/code/modules/reagents/reagent_containers/syringes.dm b/code/modules/reagents/reagent_containers/syringes.dm
index 53ccf15ddd3..87d3896e486 100644
--- a/code/modules/reagents/reagent_containers/syringes.dm
+++ b/code/modules/reagents/reagent_containers/syringes.dm
@@ -105,7 +105,7 @@
..()
update_icon()
-/obj/item/reagent_containers/syringe/attackby(obj/item/I as obj, mob/user as mob)
+/obj/item/reagent_containers/syringe/attackby(obj/item/attacking_item, mob/user)
return
/obj/item/reagent_containers/syringe/afterattack(obj/target, mob/user, proximity)
diff --git a/code/modules/reagents/reagent_containers/teapot.dm b/code/modules/reagents/reagent_containers/teapot.dm
index 1be52b83e97..891051a6dcb 100644
--- a/code/modules/reagents/reagent_containers/teapot.dm
+++ b/code/modules/reagents/reagent_containers/teapot.dm
@@ -36,11 +36,11 @@
..()
icon_state = initial(icon_state)
-/obj/item/reagent_containers/glass/beaker/teapot/lidded/attackby(obj/item/W, mob/user)
+/obj/item/reagent_containers/glass/beaker/teapot/lidded/attackby(obj/item/attacking_item, mob/user)
. = ..()
- if(istype(W, lid_type) && !lid)
- user.drop_from_inventory(W, src)
- lid = W
+ if(istype(attacking_item, lid_type) && !lid)
+ user.drop_from_inventory(attacking_item, src)
+ lid = attacking_item
to_chat(user, SPAN_NOTICE("You slide the lid onto \the [src]."))
update_icon()
return TRUE
diff --git a/code/modules/reagents/reagent_containers/welding_backpack.dm b/code/modules/reagents/reagent_containers/welding_backpack.dm
index 7e702d328cc..b4d19ccacb2 100644
--- a/code/modules/reagents/reagent_containers/welding_backpack.dm
+++ b/code/modules/reagents/reagent_containers/welding_backpack.dm
@@ -27,17 +27,17 @@
else
. += SPAN_WARNING("\The [src] is empty!")
-/obj/item/reagent_containers/weldpack/attackby(obj/item/W, mob/user)
- if(W.iswrench())
+/obj/item/reagent_containers/weldpack/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.iswrench())
if(atom_flags & ATOM_FLAG_OPEN_CONTAINER)
atom_flags &= ~ATOM_FLAG_OPEN_CONTAINER
else
atom_flags = ATOM_FLAG_OPEN_CONTAINER
- playsound(src, W.usesound, 70)
+ playsound(src, attacking_item.usesound, 70)
to_chat(user, SPAN_NOTICE("You wrench \the [src]'s fuel cap [(atom_flags & ATOM_FLAG_OPEN_CONTAINER) ? "open" : "closed"]."))
return
- else if(W.iswelder())
- var/obj/item/weldingtool/T = W
+ else if(attacking_item.iswelder())
+ var/obj/item/weldingtool/T = attacking_item
var/fuel_volume = REAGENT_VOLUME(reagents, /singleton/reagent/fuel)
if(!fuel_volume)
to_chat(user, SPAN_WARNING("\The [src] doesn't have any fuel in it!"))
@@ -57,7 +57,7 @@
else
if(T.welding)
to_chat(user, SPAN_DANGER("That was close!"))
- reagents.trans_type_to(W, /singleton/reagent/fuel, min(fuel_volume, T.reagents.maximum_volume - tool_fuel_volume))
+ reagents.trans_type_to(attacking_item, /singleton/reagent/fuel, min(fuel_volume, T.reagents.maximum_volume - tool_fuel_volume))
to_chat(user, SPAN_NOTICE("Welder refilled!"))
playsound(loc, 'sound/effects/refill.ogg', 50, 1, -6)
return
diff --git a/code/modules/reagents/reagent_dispenser.dm b/code/modules/reagents/reagent_dispenser.dm
index 96d8dc55341..10e4f289633 100644
--- a/code/modules/reagents/reagent_dispenser.dm
+++ b/code/modules/reagents/reagent_dispenser.dm
@@ -39,9 +39,9 @@
reagents.splash_turf(get_turf(src), reagents.total_volume)
qdel(src)
-/obj/structure/reagent_dispensers/attackby(obj/item/O as obj, mob/user as mob)
+/obj/structure/reagent_dispensers/attackby(obj/item/attacking_item, mob/user)
- var/obj/item/reagent_containers/RG = O
+ var/obj/item/reagent_containers/RG = attacking_item
if (istype(RG) && RG.is_open_container())
var/atype
@@ -64,12 +64,13 @@
to_chat(user,"The inlet cap on \the [src] is wrenched on tight!")
return
- if (O.iswrench())
+ if (attacking_item.iswrench())
if(use_check(user, USE_DISALLOW_SPECIALS))
to_chat(user, SPAN_WARNING("A strange force prevents you from doing this.")) //there is no way to justify this icly
return
if(can_tamper && user.a_intent == I_HURT)
- user.visible_message("\The [user] wrenches \the [src]'s faucet [is_leaking ? "closed" : "open"].","You wrench \the [src]'s faucet [is_leaking ? "closed" : "open"]")
+ user.visible_message("\The [user] wrenches \the [src]'s faucet [is_leaking ? "closed" : "open"].",
+ "You wrench \the [src]'s faucet [is_leaking ? "closed" : "open"]")
is_leaking = !is_leaking
if (is_leaking)
message_admins("[key_name_admin(user)] wrench opened \the [src] at [loc.loc.name] ([loc.x],[loc.y],[loc.z]), leaking reagents. (JMP)")
@@ -78,9 +79,11 @@
else if(accept_any_reagent)
if(atom_flags & ATOM_FLAG_OPEN_CONTAINER)
- user.visible_message(SPAN_NOTICE("[user] wrenches the inlet cap on \the [src] shut."), SPAN_NOTICE("You wrench the inlet cap back on \the [src]."))
+ user.visible_message(SPAN_NOTICE("[user] wrenches the inlet cap on \the [src] shut."),
+ SPAN_NOTICE("You wrench the inlet cap back on \the [src]."))
else
- user.visible_message(SPAN_NOTICE("[user] unwrenches the inlet cap from \the [src]."), SPAN_NOTICE("You unwrench the inlet cap from \the [src]."))
+ user.visible_message(SPAN_NOTICE("[user] unwrenches the inlet cap from \the [src]."),
+ SPAN_NOTICE("You unwrench the inlet cap from \the [src]."))
atom_flags ^= ATOM_FLAG_OPEN_CONTAINER
return
@@ -146,9 +149,9 @@
rig = null
overlays = new/list()
-/obj/structure/reagent_dispensers/fueltank/attackby(obj/item/W, mob/user)
+/obj/structure/reagent_dispensers/fueltank/attackby(obj/item/attacking_item, mob/user)
src.add_fingerprint(user)
- if(istype(W, /obj/item/wirecutters/bomb) && rig)
+ if(istype(attacking_item, /obj/item/wirecutters/bomb) && rig)
user.visible_message(SPAN_WARNING("\The [user] carefully removes \the [rig] from \the [src]."), \
SPAN_NOTICE("You carefully remove \the [rig] from \the [src]."))
rig.forceMove(get_turf(user))
@@ -156,22 +159,22 @@
user.put_in_hands(rig)
rig = null
overlays = new/list()
- if (istype(W,/obj/item/device/assembly_holder))
+ if (istype(attacking_item,/obj/item/device/assembly_holder))
if (rig)
to_chat(user, "There is another device in the way.")
return ..()
- user.visible_message("[user] begins rigging [W] to \the [src].", "You begin rigging [W] to \the [src]")
+ user.visible_message("[user] begins rigging [attacking_item] to \the [src].", "You begin rigging [attacking_item] to \the [src]")
if(do_after(user, 20))
- user.visible_message("[user] rigs [W] to \the [src].", "You rig [W] to \the [src]")
+ user.visible_message("[user] rigs [attacking_item] to \the [src].", "You rig [attacking_item] to \the [src]")
- var/obj/item/device/assembly_holder/H = W
+ var/obj/item/device/assembly_holder/H = attacking_item
if (istype(H.a_left,/obj/item/device/assembly/igniter) || istype(H.a_right,/obj/item/device/assembly/igniter))
message_admins("[key_name_admin(user)] rigged fueltank at [loc.loc.name] ([loc.x],[loc.y],[loc.z]) for explosion. (JMP)")
log_game("[key_name(user)] rigged fueltank at [loc.loc.name] ([loc.x],[loc.y],[loc.z]) for explosion.",ckey=key_name(user))
- rig = W
- user.drop_from_inventory(W,src)
- var/mutable_appearance/MA = new(W)
+ rig = attacking_item
+ user.drop_from_inventory(attacking_item,src)
+ var/mutable_appearance/MA = new(attacking_item)
MA.pixel_x += 1
MA.pixel_y += 6
add_overlay(MA)
@@ -303,18 +306,20 @@
/obj/structure/reagent_dispensers/water_cooler/proc/RejectionMessage(var/mob/user)
return "[src]'s cup dispenser is empty."
-/obj/structure/reagent_dispensers/water_cooler/attackby(obj/item/W as obj, mob/user as mob)
- if (W.isscrewdriver())
+/obj/structure/reagent_dispensers/water_cooler/attackby(obj/item/attacking_item, mob/user)
+ if (attacking_item.isscrewdriver())
src.add_fingerprint(user)
- playsound(src.loc, W.usesound, 100, 1)
+ playsound(src.loc, attacking_item.usesound, 100, 1)
if(do_after(user, 20))
if(!src) return
switch (anchored)
if (0)
anchored = 1
- user.visible_message("\The [user] tightens the screws securing \the [src] to the floor.", "You tighten the screws securing \the [src] to the floor.")
+ user.visible_message("\The [user] tightens the screws securing \the [src] to the floor.",
+ "You tighten the screws securing \the [src] to the floor.")
if (1)
- user.visible_message("\The [user] unfastens the screws securing \the [src] to the floor.", "You unfasten the screws securing \the [src] to the floor.")
+ user.visible_message("\The [user] unfastens the screws securing \the [src] to the floor.",
+ "You unfasten the screws securing \the [src] to the floor.")
anchored = 0
return
else
@@ -328,9 +333,9 @@
icon_state = "beertankTEMP"
amount_per_transfer_from_this = 10
-/obj/structure/reagent_dispensers/keg/attackby(obj/item/W as obj, mob/user as mob)
- if (istype(W, /obj/item/stack/rods))
- var/obj/item/stack/rods/R = W
+/obj/structure/reagent_dispensers/keg/attackby(obj/item/attacking_item, mob/user)
+ if (istype(attacking_item, /obj/item/stack/rods))
+ var/obj/item/stack/rods/R = attacking_item
if(!R.can_use(3)) // like a tripod
to_chat(user, SPAN_NOTICE("You need three rods to make a still!"))
return
diff --git a/code/modules/recycling/conveyor2.dm b/code/modules/recycling/conveyor2.dm
index a6e9a4a3eda..5918ff3ac3d 100644
--- a/code/modules/recycling/conveyor2.dm
+++ b/code/modules/recycling/conveyor2.dm
@@ -122,8 +122,8 @@
return
// attack with item, place item on conveyor
-/obj/machinery/conveyor/attackby(var/obj/item/I, mob/user)
- if(I.iscrowbar())
+/obj/machinery/conveyor/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.iscrowbar())
if(!(stat & BROKEN))
var/obj/item/conveyor_construct/C = new/obj/item/conveyor_construct(src.loc)
C.id = id
@@ -131,11 +131,12 @@
to_chat(user, "You remove the conveyor belt.")
qdel(src)
return
- if(isrobot(user)) return //Carn: fix for borgs dropping their modules on conveyor belts
- if(I.loc != user) return // This should stop mounted modules ending up outside the module.
+ if(isrobot(user))
+ return //Carn: fix for borgs dropping their modules on conveyor belts
+ if(attacking_item.loc != user)
+ return // This should stop mounted modules ending up outside the module.
user.drop_item(get_turf(src))
- return
// attack with hand, move pulled object onto conveyor
/obj/machinery/conveyor/attack_hand(mob/user as mob)
@@ -260,8 +261,8 @@
S.position = position
S.update()
-/obj/machinery/conveyor_switch/attackby(obj/item/I, mob/user, params)
- if(I.iscrowbar())
+/obj/machinery/conveyor_switch/attackby(obj/item/attacking_item, mob/user, params)
+ if(attacking_item.iscrowbar())
var/obj/item/conveyor_switch_construct/C = new/obj/item/conveyor_switch_construct(src.loc)
C.id = id
transfer_fingerprints_to(C)
@@ -306,11 +307,11 @@
w_class = ITEMSIZE_LARGE
var/id = "" //inherited by the belt
-/obj/item/conveyor_construct/attackby(obj/item/I, mob/user, params)
+/obj/item/conveyor_construct/attackby(obj/item/attacking_item, mob/user, params)
. = ..()
- if(istype(I, /obj/item/conveyor_switch_construct))
+ if(istype(attacking_item, /obj/item/conveyor_switch_construct))
to_chat(user, "You link the switch to the conveyor belt assembly.")
- var/obj/item/conveyor_switch_construct/C = I
+ var/obj/item/conveyor_switch_construct/C = attacking_item
id = C.id
return TRUE
diff --git a/code/modules/recycling/disposal-construction.dm b/code/modules/recycling/disposal-construction.dm
index 78a372d00a2..ea08aa3bad5 100644
--- a/code/modules/recycling/disposal-construction.dm
+++ b/code/modules/recycling/disposal-construction.dm
@@ -181,7 +181,7 @@
// wrench: (un)anchor
// weldingtool: convert to real pipe
-/obj/structure/disposalconstruct/attackby(var/obj/item/I, var/mob/user)
+/obj/structure/disposalconstruct/attackby(obj/item/attacking_item, mob/user)
var/nicetype = "pipe"
var/ispipe = 0 // Indicates if we should change the level of this pipe
src.add_fingerprint(user)
@@ -220,7 +220,7 @@
var/obj/structure/disposalpipe/CP = locate() in T
- if(I.iswrench())
+ if(attacking_item.iswrench())
if(anchored)
anchored = 0
if(ispipe)
@@ -255,12 +255,12 @@
else if(ptype != 15)
density = 1 // We don't want disposal bins or outlets to go density 0
to_chat(user, "You attach the [nicetype] to the underfloor.")
- playsound(src.loc, I.usesound, 100, 1)
+ playsound(src.loc, attacking_item.usesound, 100, 1)
update()
- else if(I.iswelder())
+ else if(attacking_item.iswelder())
if(anchored)
- var/obj/item/weldingtool/W = I
+ var/obj/item/weldingtool/W = attacking_item
if(W.use(0,user))
to_chat(user, "Welding the [nicetype] in place.")
if(W.use_tool(src, user, 20, volume = 50))
diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm
index 2c432f344f2..aa9de33ddc8 100644
--- a/code/modules/recycling/disposal.dm
+++ b/code/modules/recycling/disposal.dm
@@ -118,17 +118,17 @@
return things
// attack by item places it in to disposal
-/obj/machinery/disposal/attackby(var/obj/item/I, var/mob/user)
- if(stat & BROKEN || !I || !user)
+/obj/machinery/disposal/attackby(obj/item/attacking_item, mob/user)
+ if(stat & BROKEN || !attacking_item || !user)
return
src.add_fingerprint(user)
if(mode <= MODE_OFF) // It's off
- if(I.isscrewdriver())
+ if(attacking_item.isscrewdriver())
if(contents_count())
to_chat(user, SPAN_WARNING("Eject the items first!"))
return TRUE
- playsound(src.loc, I.usesound, 50, 1)
+ playsound(src.loc, attacking_item.usesound, 50, 1)
switch(mode)
if(MODE_OFF)
mode = MODE_UNSCREWED
@@ -138,11 +138,11 @@
mode = MODE_OFF
to_chat(user, SPAN_NOTICE("You attach the screws around the power connection."))
return TRUE
- else if(I.iswelder() && mode == MODE_UNSCREWED)
+ else if(attacking_item.iswelder() && mode == MODE_UNSCREWED)
if(contents_count())
to_chat(user, SPAN_WARNING("Eject the items first!"))
return TRUE
- var/obj/item/weldingtool/W = I
+ var/obj/item/weldingtool/W = attacking_item
if(W.use(0,user))
to_chat(user, SPAN_NOTICE("You start slicing the floorweld off the disposal unit."))
if(W.use_tool(src, user, 20, volume = 50))
@@ -167,16 +167,16 @@
else
to_chat(user, SPAN_WARNING("You need more welding fuel to complete this task."))
return TRUE
- else if(I.ismultitool() || I.iswirecutter() || issignaler(I))
+ else if(attacking_item.ismultitool() || attacking_item.iswirecutter() || issignaler(attacking_item))
wires.interact(user)
return TRUE
- if(istype(I, /obj/item/melee/energy/blade))
+ if(istype(attacking_item, /obj/item/melee/energy/blade))
to_chat(user, SPAN_WARNING("You can't place that item inside the disposal unit."))
return TRUE
- if(istype(I, /obj/item/storage) && length(I.contents) && user.a_intent != I_HURT)
- var/obj/item/storage/S = I
+ if(istype(attacking_item, /obj/item/storage) && length(attacking_item.contents) && user.a_intent != I_HURT)
+ var/obj/item/storage/S = attacking_item
if(istype(S, /obj/item/storage/secure))
var/obj/item/storage/secure/secured_storage = S
@@ -191,15 +191,15 @@
update()
return TRUE
- else if (istype (I, /obj/item/material/ashtray) && user.a_intent != I_HURT)
- var/obj/item/material/ashtray/A = I
+ else if (istype (attacking_item, /obj/item/material/ashtray) && user.a_intent != I_HURT)
+ var/obj/item/material/ashtray/A = attacking_item
if(A.emptyout(src))
- user.visible_message("[user] pours [I] out into [src].", SPAN_NOTICE("You pour [I] out into [src]."))
+ user.visible_message("[user] pours [attacking_item] out into [src].", SPAN_NOTICE("You pour [attacking_item] out into [src]."))
return TRUE
- else if (istype (I, /obj/item/device/lightreplacer))
+ else if (istype (attacking_item, /obj/item/device/lightreplacer))
var/count = 0
- var/obj/item/device/lightreplacer/R = I
+ var/obj/item/device/lightreplacer/R = attacking_item
if (R.store_broken)
for(var/obj/item/light/L in R.contents)
count++
@@ -212,7 +212,7 @@
update()
return TRUE
- var/obj/item/grab/G = I
+ var/obj/item/grab/G = attacking_item
if(istype(G)) // handle grabbed mob
if(ismob(G.affecting))
var/mob/GM = G.affecting
@@ -233,15 +233,15 @@
GM.attack_log += text("\[[time_stamp()]\] Has been placed in disposals by [usr.name] ([usr.ckey])")
msg_admin_attack("[key_name_admin(usr)] placed [key_name_admin(GM)] in a disposals unit. (JMP)",ckey=key_name(usr),ckey_target=key_name(GM))
return TRUE
- if(!I.dropsafety())
+ if(!attacking_item.dropsafety())
return TRUE
- if(!I)
+ if(!attacking_item)
return TRUE
- user.drop_from_inventory(I,src)
+ user.drop_from_inventory(attacking_item, src)
- user.visible_message("[user] places \the [I] into \the [src].", SPAN_NOTICE("You place \the [I] into the [src]."), range = 3)
+ user.visible_message("[user] places \the [attacking_item] into \the [src].", SPAN_NOTICE("You place \the [attacking_item] into the [src]."), range = 3)
update()
// mouse drop another mob or self
@@ -972,13 +972,13 @@
//attack by item
//weldingtool: unfasten and convert to obj/disposalconstruct
-/obj/structure/disposalpipe/attackby(var/obj/item/I, var/mob/user)
+/obj/structure/disposalpipe/attackby(obj/item/attacking_item, mob/user)
var/turf/T = src.loc
if(!T.is_plating())
return // prevent interaction with T-scanner revealed pipes
src.add_fingerprint(user)
- if(I.iswelder())
- var/obj/item/weldingtool/W = I
+ if(attacking_item.iswelder())
+ var/obj/item/weldingtool/W = attacking_item
if(W.use(0,user))
playsound(src.loc, 'sound/items/welder_pry.ogg', 100, 1)
@@ -1250,12 +1250,12 @@
updatedesc()
update()
-/obj/structure/disposalpipe/tagger/attackby(var/obj/item/I, var/mob/user)
+/obj/structure/disposalpipe/tagger/attackby(obj/item/attacking_item, mob/user)
if(..())
return
- if(istype(I, /obj/item/device/destTagger))
- var/obj/item/device/destTagger/O = I
+ if(istype(attacking_item, /obj/item/device/destTagger))
+ var/obj/item/device/destTagger/O = attacking_item
if(O.currTag)// Tag set
sort_tag = O.currTag
@@ -1321,12 +1321,12 @@
updatedesc()
update()
-/obj/structure/disposalpipe/sortjunction/attackby(var/obj/item/I, var/mob/user)
+/obj/structure/disposalpipe/sortjunction/attackby(obj/item/attacking_item, mob/user)
if(..())
return
- if(istype(I, /obj/item/device/destTagger))
- var/obj/item/device/destTagger/O = I
+ if(istype(attacking_item, /obj/item/device/destTagger))
+ var/obj/item/device/destTagger/O = attacking_item
if(O.currTag)// Tag set
sortType = O.currTag
@@ -1427,7 +1427,7 @@
update()
// Override attackby so we disallow trunkremoval when somethings ontop
-/obj/structure/disposalpipe/trunk/attackby(var/obj/item/I, var/mob/user)
+/obj/structure/disposalpipe/trunk/attackby(obj/item/attacking_item, mob/user)
//Disposal bins or chutes
/*
@@ -1451,8 +1451,8 @@
if(!T.is_plating())
return // prevent interaction with T-scanner revealed pipes
src.add_fingerprint(user)
- if(I.iswelder())
- var/obj/item/weldingtool/W = I
+ if(attacking_item.iswelder())
+ var/obj/item/weldingtool/W = attacking_item
if(W.use(0,user))
playsound(src.loc, 'sound/items/welder_pry.ogg', 100, 1)
@@ -1605,23 +1605,23 @@
qdel(H)
*/
-/obj/structure/disposaloutlet/attackby(var/obj/item/I, var/mob/user)
- if(!I || !user)
+/obj/structure/disposaloutlet/attackby(obj/item/attacking_item, mob/user)
+ if(!attacking_item || !user)
return
src.add_fingerprint(user)
- if(I.isscrewdriver())
+ if(attacking_item.isscrewdriver())
if(mode==0)
mode=1
- playsound(src.loc, I.usesound, 50, 1)
+ playsound(src.loc, attacking_item.usesound, 50, 1)
to_chat(user, "You remove the screws around the power connection.")
return
else if(mode==1)
mode=0
- playsound(src.loc, I.usesound, 50, 1)
+ playsound(src.loc, attacking_item.usesound, 50, 1)
to_chat(user, "You attach the screws around the power connection.")
return
- else if(I.iswelder() && mode==1)
- var/obj/item/weldingtool/W = I
+ else if(attacking_item.iswelder() && mode==1)
+ var/obj/item/weldingtool/W = attacking_item
if(W.use(0,user))
to_chat(user, "You start slicing the floorweld off the disposal outlet.")
if(W.use_tool(src, user, 20, volume = 50))
diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm
index 3baa48a62f5..8960a70324f 100755
--- a/code/modules/recycling/sortingmachinery.dm
+++ b/code/modules/recycling/sortingmachinery.dm
@@ -29,9 +29,9 @@
O.welded = 0
qdel(src)
-/obj/structure/bigDelivery/attackby(obj/item/W as obj, mob/user as mob)
- if(istype(W, /obj/item/device/destTagger))
- var/obj/item/device/destTagger/O = W
+/obj/structure/bigDelivery/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/device/destTagger))
+ var/obj/item/device/destTagger/O = attacking_item
if(O.currTag)
if(src.sortTag != O.currTag)
to_chat(user, "You have labeled the destination as [O.currTag].")
@@ -46,14 +46,14 @@
else
to_chat(user, "You need to set a destination first!")
- else if(W.ispen())
+ else if(attacking_item.ispen())
switch(alert("What would you like to alter?",,"Title","Description", "Cancel"))
if("Title")
var/str = sanitizeSafe(input(usr,"Label text?","Set label",""), MAX_NAME_LEN)
if(!str || !length(str))
to_chat(usr, "Invalid text.")
return
- user.visible_message("\The [user] titles \the [src] with \a [W], marking down: \"[str]\"",\
+ user.visible_message("\The [user] titles \the [src] with \a [attacking_item], marking down: \"[str]\"",\
"You title \the [src]: \"[str]\"",\
"You hear someone scribbling a note.")
playsound(src, pick('sound/bureaucracy/pen1.ogg','sound/bureaucracy/pen2.ogg'), 20)
@@ -73,7 +73,7 @@
update_icon()
else
examtext = str
- user.visible_message("\The [user] labels \the [src] with \a [W], scribbling down: \"[examtext]\"",\
+ user.visible_message("\The [user] labels \the [src] with \a [attacking_item], scribbling down: \"[examtext]\"",\
"You label \the [src]: \"[examtext]\"",\
"You hear someone scribbling a note.")
playsound(src, pick('sound/bureaucracy/pen1.ogg','sound/bureaucracy/pen2.ogg'), 20)
@@ -152,9 +152,9 @@
qdel(src)
return
-/obj/item/smallDelivery/attackby(obj/item/W as obj, mob/user as mob)
- if(istype(W, /obj/item/device/destTagger))
- var/obj/item/device/destTagger/O = W
+/obj/item/smallDelivery/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/device/destTagger))
+ var/obj/item/device/destTagger/O = attacking_item
if(O.currTag)
if(src.sortTag != O.currTag)
to_chat(user, "You have labeled the destination as [O.currTag].")
@@ -169,14 +169,14 @@
else
to_chat(user, "You need to set a destination first!")
- else if(W.ispen())
- switch(alert("What would you like to alter?",,"Title","Description", "Cancel"))
+ else if(attacking_item.ispen())
+ switch(tgui_input_list(user, "What would you like to alter?", null, list("Title", "Description"), "Cancel"))
if("Title")
- var/str = sanitizeSafe(input(usr,"Label text?","Set label",""), MAX_NAME_LEN)
+ var/str = sanitizeSafe( tgui_input_text(usr, "Label text?", "Set label", "", MAX_NAME_LEN), MAX_NAME_LEN )
if(!str || !length(str))
to_chat(usr, "Invalid text.")
return
- user.visible_message("\The [user] titles \the [src] with \a [W], marking down: \"[str]\"",\
+ user.visible_message("\The [user] titles \the [src] with \a [attacking_item], marking down: \"[str]\"",\
"You title \the [src]: \"[str]\"",\
"You hear someone scribbling a note.")
playsound(src, pick('sound/bureaucracy/pen1.ogg','sound/bureaucracy/pen2.ogg'), 20)
@@ -188,7 +188,7 @@
nameset = 1
if("Description")
- var/str = sanitize(input(usr,"Label text?","Set label",""))
+ var/str = sanitize(tgui_input_text(usr, "Label text?", "Set label", ""))
if(!str || !length(str))
to_chat(usr, "Invalid text.")
return
@@ -197,7 +197,7 @@
update_icon()
else
examtext = str
- user.visible_message("\The [user] labels \the [src] with \a [W], scribbling down: \"[examtext]\"",\
+ user.visible_message("\The [user] labels \the [src] with \a [attacking_item], scribbling down: \"[examtext]\"",\
"You label \the [src]: \"[examtext]\"",\
"You hear someone scribbling a note.")
playsound(src, pick('sound/bureaucracy/pen1.ogg','sound/bureaucracy/pen2.ogg'), 20)
@@ -351,27 +351,27 @@
update()
return
-/obj/machinery/disposal/deliveryChute/attackby(var/obj/item/I, var/mob/user)
- if(!I || !user)
+/obj/machinery/disposal/deliveryChute/attackby(obj/item/attacking_item, mob/user)
+ if(!attacking_item || !user)
return
- if(istype(I, /obj/item/holder))
- user.drop_item(I)
- CollidedWith(I)
+ if(istype(attacking_item, /obj/item/holder))
+ user.drop_item(attacking_item)
+ CollidedWith(attacking_item)
- if(I.isscrewdriver())
+ if(attacking_item.isscrewdriver())
if(c_mode==0)
c_mode=1
- playsound(src.loc, I.usesound, 50, 1)
+ playsound(src.loc, attacking_item.usesound, 50, 1)
to_chat(user, "You remove the screws around the power connection.")
return
else if(c_mode==1)
c_mode=0
- playsound(src.loc, I.usesound, 50, 1)
+ playsound(src.loc, attacking_item.usesound, 50, 1)
to_chat(user, "You attach the screws around the power connection.")
return
- else if(I.iswelder() && c_mode==1)
- var/obj/item/weldingtool/W = I
+ else if(attacking_item.iswelder() && c_mode==1)
+ var/obj/item/weldingtool/W = attacking_item
if(W.use(1,user))
to_chat(user, "You start slicing the floorweld off the delivery chute.")
if(W.use_tool(src, user, 20, volume = 50))
diff --git a/code/modules/research/circuitprinter.dm b/code/modules/research/circuitprinter.dm
index 698e214c027..6be97cd3ccd 100644
--- a/code/modules/research/circuitprinter.dm
+++ b/code/modules/research/circuitprinter.dm
@@ -104,18 +104,18 @@ using metal and glass, it uses glass and reagents (usually sulphuric acid).
S.amount = round(materials[f] / SHEET_MATERIAL_AMOUNT)
..()
-/obj/machinery/r_n_d/circuit_imprinter/attackby(var/obj/item/O as obj, var/mob/user as mob)
+/obj/machinery/r_n_d/circuit_imprinter/attackby(obj/item/attacking_item, mob/user)
if(busy)
to_chat(user, "\The [src] is busy. Please wait for completion of previous operation.")
return 1
- if(default_deconstruction_screwdriver(user, O))
+ if(default_deconstruction_screwdriver(user, attacking_item))
if(linked_console)
linked_console.linked_imprinter = null
linked_console = null
return
- if(default_deconstruction_crowbar(user, O))
+ if(default_deconstruction_crowbar(user, attacking_item))
return
- if(default_part_replacement(user, O))
+ if(default_part_replacement(user, attacking_item))
return
if(panel_open)
to_chat(user, "You can't load \the [src] while it's opened.")
@@ -123,9 +123,9 @@ using metal and glass, it uses glass and reagents (usually sulphuric acid).
if(!linked_console)
to_chat(user, "\The [src] must be linked to an R&D console first.")
return 1
- if(O.is_open_container())
+ if(attacking_item.is_open_container())
return 0
- if(!istype(O, /obj/item/stack/material))
+ if(!istype(attacking_item, /obj/item/stack/material))
to_chat(user, "You cannot insert this item into \the [src]!")
return 1
if(stat)
@@ -135,12 +135,12 @@ using metal and glass, it uses glass and reagents (usually sulphuric acid).
to_chat(user, "\The [src]'s material bin is full. Please remove material before adding more.")
return 1
- var/obj/item/stack/material/stack = O
+ var/obj/item/stack/material/stack = attacking_item
if(!stack.default_type)
to_chat(user, SPAN_WARNING("This stack cannot be used!"))
return
var/amount = round(input("How many sheets do you want to add?") as num)
- if(!O)
+ if(!attacking_item)
return
if(!Adjacent(user))
to_chat(user, "\The [src] is too far away for you to insert this.")
diff --git a/code/modules/research/destructive_analyzer.dm b/code/modules/research/destructive_analyzer.dm
index 67ce943ea64..60094e7c5e4 100644
--- a/code/modules/research/destructive_analyzer.dm
+++ b/code/modules/research/destructive_analyzer.dm
@@ -38,21 +38,21 @@ Note: Must be placed within 3 tiles of the R&D Console
else
icon_state = "d_analyzer"
-/obj/machinery/r_n_d/destructive_analyzer/attackby(var/obj/O as obj, var/mob/user as mob)
+/obj/machinery/r_n_d/destructive_analyzer/attackby(obj/item/attacking_item, mob/user)
if(busy)
to_chat(user, "\The [src] is busy right now.")
return
if(loaded_item)
to_chat(user, "There is something already loaded into \the [src].")
return 1
- if(default_deconstruction_screwdriver(user, O))
+ if(default_deconstruction_screwdriver(user, attacking_item))
if(linked_console)
linked_console.linked_destroy = null
linked_console = null
return
- if(default_deconstruction_crowbar(user, O))
+ if(default_deconstruction_crowbar(user, attacking_item))
return
- if(default_part_replacement(user, O))
+ if(default_part_replacement(user, attacking_item))
return
if(panel_open)
to_chat(user, "You can't load \the [src] while it's opened.")
@@ -60,19 +60,19 @@ Note: Must be placed within 3 tiles of the R&D Console
if(!linked_console)
to_chat(user, "\The [src] must be linked to an R&D console first.")
return
- if(istype(O, /obj/item) && !loaded_item)
- if(!O.dropsafety()) //Don't put your module items in there!
+ if(istype(attacking_item, /obj/item) && !loaded_item)
+ if(!attacking_item.dropsafety()) //Don't put your module items in there!
return
- if(!O.origin_tech)
+ if(!attacking_item.origin_tech)
to_chat(user, "This doesn't seem to have a tech origin.")
return
- if(O.origin_tech.len == 0)
+ if(attacking_item.origin_tech.len == 0)
to_chat(user, "You cannot deconstruct this item.")
return
busy = 1
- loaded_item = O
- user.drop_from_inventory(O,src)
- to_chat(user, "You add \the [O] to \the [src].")
+ loaded_item = attacking_item
+ user.drop_from_inventory(attacking_item, src)
+ to_chat(user, "You add \the [attacking_item] to \the [src].")
flick("d_analyzer_la", src)
spawn(10)
update_icon()
diff --git a/code/modules/research/protolathe.dm b/code/modules/research/protolathe.dm
index da2c5c51c25..302780ce03c 100644
--- a/code/modules/research/protolathe.dm
+++ b/code/modules/research/protolathe.dm
@@ -97,20 +97,20 @@
else
icon_state = "protolathe"
-/obj/machinery/r_n_d/protolathe/attackby(var/obj/item/O as obj, var/mob/user as mob)
+/obj/machinery/r_n_d/protolathe/attackby(obj/item/attacking_item, mob/user)
if(busy)
to_chat(user, "\The [src] is busy. Please wait for completion of previous operation.")
return 1
- if(default_deconstruction_screwdriver(user, O))
+ if(default_deconstruction_screwdriver(user, attacking_item))
if(linked_console)
linked_console.linked_lathe = null
linked_console = null
return
- if(default_deconstruction_crowbar(user, O))
+ if(default_deconstruction_crowbar(user, attacking_item))
return
- if(default_part_replacement(user, O))
+ if(default_part_replacement(user, attacking_item))
return
- if(O.is_open_container())
+ if(attacking_item.is_open_container())
return 1
if(panel_open)
to_chat(user, "You can't load \the [src] while it's opened.")
@@ -118,7 +118,7 @@
if(!linked_console)
to_chat(user, "\The [src] must be linked to an R&D console first!")
return 1
- if(!istype(O, /obj/item/stack/material))
+ if(!istype(attacking_item, /obj/item/stack/material))
to_chat(user, "You cannot insert this item into \the [src]!")
return 1
if(stat)
@@ -128,12 +128,12 @@
to_chat(user, "\The [src]'s material bin is full. Please remove material before adding more.")
return 1
- var/obj/item/stack/material/stack = O
+ var/obj/item/stack/material/stack = attacking_item
if(!stack.default_type)
to_chat(user, SPAN_WARNING("This stack cannot be used!"))
return
var/amount = round(input("How many sheets do you want to add?") as num)//No decimals
- if(!O)
+ if(!attacking_item)
return
if(!Adjacent(user))
to_chat(user, "\The [src] is too far away for you to insert this.")
diff --git a/code/modules/research/rdconsole.dm b/code/modules/research/rdconsole.dm
index 6dceaebecb4..b3ba91222c4 100644
--- a/code/modules/research/rdconsole.dm
+++ b/code/modules/research/rdconsole.dm
@@ -144,22 +144,22 @@ won't update every console in existence) but it's more of a hassle to do. Also,
linked_imprinter.linked_console = null
return ..()
-/obj/machinery/computer/rdconsole/attackby(var/obj/item/D as obj, var/mob/user as mob)
+/obj/machinery/computer/rdconsole/attackby(obj/item/attacking_item, mob/user)
//Loading a disk into it.
- if(istype(D, /obj/item/disk))
+ if(istype(attacking_item, /obj/item/disk))
if(t_disk || d_disk)
to_chat(user, "A disk is already loaded into the machine.")
return
- if(istype(D, /obj/item/disk/tech_disk))
- t_disk = D
- else if (istype(D, /obj/item/disk/design_disk))
- d_disk = D
+ if(istype(attacking_item, /obj/item/disk/tech_disk))
+ t_disk = attacking_item
+ else if (istype(attacking_item, /obj/item/disk/design_disk))
+ d_disk = attacking_item
else
to_chat(user, "Machine cannot accept disks in that format.")
return
- user.drop_from_inventory(D,src)
- to_chat(user, "You add \the [D] to the machine.")
+ user.drop_from_inventory(attacking_item, src)
+ to_chat(user, "You add \the [attacking_item] to the machine.")
else
//The construction/deconstruction of the console code.
..()
diff --git a/code/modules/research/server.dm b/code/modules/research/server.dm
index cf446f085d9..73333a223f3 100644
--- a/code/modules/research/server.dm
+++ b/code/modules/research/server.dm
@@ -135,20 +135,20 @@
env.merge(removed)
-/obj/machinery/r_n_d/server/attackby(obj/item/O, mob/user)
- if(O.ismultitool())
- var/obj/item/device/multitool/MT = O
+/obj/machinery/r_n_d/server/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.ismultitool())
+ var/obj/item/device/multitool/MT = attacking_item
var/obj/machinery/r_n_d/tech_processor/TP = MT.get_buffer(/obj/machinery/r_n_d/tech_processor)
if(TP)
TP.set_server(src)
MT.unregister_buffer(TP)
to_chat(user, SPAN_NOTICE("You link \the [TP] to \the [src]."))
return
- if(default_deconstruction_screwdriver(user, O))
+ if(default_deconstruction_screwdriver(user, attacking_item))
return
- if(default_deconstruction_crowbar(user, O))
+ if(default_deconstruction_crowbar(user, attacking_item))
return
- if(default_part_replacement(user, O))
+ if(default_part_replacement(user, attacking_item))
return
/obj/machinery/r_n_d/server/centcom
diff --git a/code/modules/research/tech_processor.dm b/code/modules/research/tech_processor.dm
index ed23e4d3720..44ee646ff57 100644
--- a/code/modules/research/tech_processor.dm
+++ b/code/modules/research/tech_processor.dm
@@ -35,17 +35,17 @@
produce_heat()
heat_delay = initial(heat_delay)
-/obj/machinery/r_n_d/tech_processor/attackby(obj/item/W, mob/user)
- if(W.ismultitool())
- var/obj/item/device/multitool/MT = W
+/obj/machinery/r_n_d/tech_processor/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.ismultitool())
+ var/obj/item/device/multitool/MT = attacking_item
MT.set_buffer(src)
to_chat(user, SPAN_NOTICE("You attach \the [src]'s linking node to \the [MT]'s machinery buffer."))
return
- if(default_deconstruction_screwdriver(user, W))
+ if(default_deconstruction_screwdriver(user, attacking_item))
return
- if(default_deconstruction_crowbar(user, W))
+ if(default_deconstruction_crowbar(user, attacking_item))
return
- if(default_part_replacement(user, W))
+ if(default_part_replacement(user, attacking_item))
return
return ..()
diff --git a/code/modules/research/weaponsanalyzer.dm b/code/modules/research/weaponsanalyzer.dm
index d2a922307e8..15de07e1cdc 100644
--- a/code/modules/research/weaponsanalyzer.dm
+++ b/code/modules/research/weaponsanalyzer.dm
@@ -21,33 +21,33 @@
. = ..()
. += SPAN_NOTICE("It has [item ? "[item.name]" : "nothing"] attached.")
-/obj/machinery/weapons_analyzer/attackby(var/obj/item/I, var/mob/user as mob)
- if(!I || !user || !ishuman(user))
+/obj/machinery/weapons_analyzer/attackby(obj/item/attacking_item, mob/user)
+ if(!attacking_item || !user || !ishuman(user))
return
var/mob/living/carbon/human/H = user
- if(istype(I, /obj/item/gun))
- check_swap(user, I)
- item = I
- H.drop_from_inventory(I)
- I.forceMove(src)
+ if(istype(attacking_item, /obj/item/gun))
+ check_swap(user, attacking_item)
+ item = attacking_item
+ H.drop_from_inventory(attacking_item)
+ attacking_item.forceMove(src)
update_icon()
- else if(istype(I, /obj/item/device/laser_assembly))
- check_swap(user, I)
- var/obj/item/device/laser_assembly/A = I
+ else if(istype(attacking_item, /obj/item/device/laser_assembly))
+ check_swap(user, attacking_item)
+ var/obj/item/device/laser_assembly/A = attacking_item
A.ready_to_craft = TRUE
item = A
- H.drop_from_inventory(I)
- I.forceMove(src)
+ H.drop_from_inventory(attacking_item)
+ attacking_item.forceMove(src)
A.analyzer = WEAKREF(src)
update_icon()
- else if(istype(I, /obj/item/laser_components) && istype(item, /obj/item/device/laser_assembly))
+ else if(istype(attacking_item, /obj/item/laser_components) && istype(item, /obj/item/device/laser_assembly))
if(process)
to_chat(user, SPAN_WARNING("\The [src] is busy installing a component already."))
return
var/obj/item/device/laser_assembly/A = item
- var/success = A.attackby(I, user)
+ var/success = A.attackby(attacking_item, user)
if(!success)
return
@@ -59,11 +59,11 @@
addtimer(CALLBACK(src, PROC_REF(reset)), 15)
process = TRUE
update_icon()
- else if(I)
- check_swap(user, I)
- item = I
- H.drop_from_inventory(I)
- I.forceMove(src)
+ else if(attacking_item)
+ check_swap(user, attacking_item)
+ item = attacking_item
+ H.drop_from_inventory(attacking_item)
+ attacking_item.forceMove(src)
update_icon()
/obj/machinery/weapons_analyzer/attack_hand(mob/user)
diff --git a/code/modules/research/xenoarchaeology/artifact/artifact.dm b/code/modules/research/xenoarchaeology/artifact/artifact.dm
index bce65e6e5de..64469771eab 100644
--- a/code/modules/research/xenoarchaeology/artifact/artifact.dm
+++ b/code/modules/research/xenoarchaeology/artifact/artifact.dm
@@ -49,29 +49,29 @@
color = coloration
excavation_level = rand(5,50)
-/obj/structure/boulder/attackby(obj/item/W as obj, mob/user as mob)
- if (istype(W, /obj/item/device/core_sampler))
+/obj/structure/boulder/attackby(obj/item/attacking_item, mob/user)
+ if (istype(attacking_item, /obj/item/device/core_sampler))
src.geologic_data.artifact_distance = rand(-100,100) / 100
src.geologic_data.artifact_id = artifact_find.artifact_id
- var/obj/item/device/core_sampler/C = W
+ var/obj/item/device/core_sampler/C = attacking_item
C.sample_item(src, user)
return
- if (istype(W, /obj/item/device/depth_scanner))
- var/obj/item/device/depth_scanner/C = W
+ if (istype(attacking_item, /obj/item/device/depth_scanner))
+ var/obj/item/device/depth_scanner/C = attacking_item
C.scan_atom(user, src)
return
- if (istype(W, /obj/item/device/measuring_tape))
- var/obj/item/device/measuring_tape/P = W
+ if (istype(attacking_item, /obj/item/device/measuring_tape))
+ var/obj/item/device/measuring_tape/P = attacking_item
user.visible_message("[user] extends [P] towards [src].","You extend [P] towards [src].")
if(do_after(user,40))
to_chat(user, "[icon2html(P, user)] [src] has been excavated to a depth of [2*src.excavation_level]cm.")
return
- if (istype(W, /obj/item/pickaxe))
- var/obj/item/pickaxe/P = W
+ if (istype(attacking_item, /obj/item/pickaxe))
+ var/obj/item/pickaxe/P = attacking_item
if(last_act + P.digspeed > world.time)//prevents message spam
return
diff --git a/code/modules/research/xenoarchaeology/artifact/artifact_crystal_madness.dm b/code/modules/research/xenoarchaeology/artifact/artifact_crystal_madness.dm
index a42b7bdda3d..b1c8363c872 100644
--- a/code/modules/research/xenoarchaeology/artifact/artifact_crystal_madness.dm
+++ b/code/modules/research/xenoarchaeology/artifact/artifact_crystal_madness.dm
@@ -192,16 +192,16 @@
SPAN_DANGER("You reach out and touch \the [src]. It is scorching hot, and you feel it twitch and vibrate slightly."),
)
-/obj/structure/crystal_madness/attackby(obj/item/W, mob/living/user)
+/obj/structure/crystal_madness/attackby(obj/item/attacking_item, mob/user)
if(stage < 6)
user.visible_message(
SPAN_WARNING("\The [user] reaches out and touches \the [src]."),
- SPAN_DANGER("You touch \the [W] to \the [src]."),
+ SPAN_DANGER("You touch \the [attacking_item] to \the [src]."),
)
else
user.visible_message(
SPAN_WARNING("\The [user] reaches out and touches \the [src]."),
- SPAN_DANGER("You touch \the [W] to \the [src]. You can feel it vibrating slightly even through \the [src]."),
+ SPAN_DANGER("You touch \the [attacking_item] to \the [src]. You can feel it vibrating slightly even through \the [src]."),
)
diff --git a/code/modules/research/xenoarchaeology/artifact/artifact_replicator.dm b/code/modules/research/xenoarchaeology/artifact/artifact_replicator.dm
index 4f4b219cb6b..e59d81d7873 100644
--- a/code/modules/research/xenoarchaeology/artifact/artifact_replicator.dm
+++ b/code/modules/research/xenoarchaeology/artifact/artifact_replicator.dm
@@ -126,10 +126,10 @@
user << browse(dat, "window=alien_replicator")
-/obj/machinery/replicator/attackby(obj/item/W as obj, mob/living/user as mob)
- user.drop_from_inventory(W,src)
- stored_materials.Add(W)
- src.visible_message("[user] inserts [W] into [src].")
+/obj/machinery/replicator/attackby(obj/item/attacking_item, mob/user)
+ user.drop_from_inventory(attacking_item, src)
+ stored_materials.Add(attacking_item)
+ src.visible_message("[user] inserts [attacking_item] into [src].")
/obj/machinery/replicator/Topic(href, href_list)
diff --git a/code/modules/research/xenoarchaeology/artifact/artifact_unknown.dm b/code/modules/research/xenoarchaeology/artifact/artifact_unknown.dm
index c66468cc8be..6f6f8b10c36 100644
--- a/code/modules/research/xenoarchaeology/artifact/artifact_unknown.dm
+++ b/code/modules/research/xenoarchaeology/artifact/artifact_unknown.dm
@@ -195,48 +195,51 @@
if(secondary_effect?.effect == EFFECT_TOUCH && secondary_effect.activated)
secondary_effect.DoEffectTouch(user)
-/obj/machinery/artifact/attackby(var/obj/item/W, mob/living/user)
+/obj/machinery/artifact/attackby(obj/item/attacking_item, mob/user)
- if (istype(W, /obj/item/reagent_containers/))
- if(W.reagents.has_reagent(/singleton/reagent/hydrazine, 1) || W.reagents.has_reagent(/singleton/reagent/water, 1))
+ if (istype(attacking_item, /obj/item/reagent_containers/))
+ if(attacking_item.reagents.has_reagent(/singleton/reagent/hydrazine, 1) || attacking_item.reagents.has_reagent(/singleton/reagent/water, 1))
if(my_effect.trigger == TRIGGER_WATER)
my_effect.ToggleActivate()
if(secondary_effect?.trigger == TRIGGER_WATER)
secondary_effect.ToggleActivate()
- else if(W.reagents.has_reagent(/singleton/reagent/acid, 1) || W.reagents.has_reagent(/singleton/reagent/acid/polyacid, 1) || W.reagents.has_reagent(/singleton/reagent/diethylamine, 1))
+ else if(attacking_item.reagents.has_reagent(/singleton/reagent/acid, 1) || attacking_item.reagents.has_reagent(/singleton/reagent/acid/polyacid, 1) ||\
+ attacking_item.reagents.has_reagent(/singleton/reagent/diethylamine, 1))
if(my_effect.trigger == TRIGGER_ACID)
my_effect.ToggleActivate()
if(secondary_effect?.trigger == TRIGGER_ACID)
secondary_effect.ToggleActivate()
- else if(W.reagents.has_reagent(/singleton/reagent/toxin/phoron, 1) || W.reagents.has_reagent(/singleton/reagent/thermite, 1))
+ else if(attacking_item.reagents.has_reagent(/singleton/reagent/toxin/phoron, 1) || attacking_item.reagents.has_reagent(/singleton/reagent/thermite, 1))
if(my_effect.trigger == TRIGGER_VOLATILE)
my_effect.ToggleActivate()
if(secondary_effect?.trigger == TRIGGER_VOLATILE)
secondary_effect.ToggleActivate()
- else if(W.reagents.has_reagent(/singleton/reagent/toxin, 1) || W.reagents.has_reagent(/singleton/reagent/toxin/cyanide, 1) || W.reagents.has_reagent(/singleton/reagent/drugs/cryptobiolin, 1) || W.reagents.has_reagent(/singleton/reagent/drugs/impedrezene, 1) || W.reagents.has_reagent(/singleton/reagent/toxin/amatoxin, 1) || W.reagents.has_reagent(/singleton/reagent/alcohol/neurotoxin, 1))
+ else if(attacking_item.reagents.has_reagent(/singleton/reagent/toxin, 1) || attacking_item.reagents.has_reagent(/singleton/reagent/toxin/cyanide, 1) ||\
+ attacking_item.reagents.has_reagent(/singleton/reagent/drugs/cryptobiolin, 1) || attacking_item.reagents.has_reagent(/singleton/reagent/drugs/impedrezene, 1) ||\
+ attacking_item.reagents.has_reagent(/singleton/reagent/toxin/amatoxin, 1) || attacking_item.reagents.has_reagent(/singleton/reagent/alcohol/neurotoxin, 1))
if(my_effect.trigger == TRIGGER_TOXIN)
my_effect.ToggleActivate()
if(secondary_effect?.trigger == TRIGGER_TOXIN)
secondary_effect.ToggleActivate()
- else if(istype(W,/obj/item/melee/baton) && W:status ||\
- istype(W,/obj/item/melee/energy) ||\
- istype(W,/obj/item/melee/cultblade) ||\
- istype(W,/obj/item/card/emag) ||\
- W.ismultitool())
+ else if(istype(attacking_item,/obj/item/melee/baton) && attacking_item:status ||\
+ istype(attacking_item,/obj/item/melee/energy) ||\
+ istype(attacking_item,/obj/item/melee/cultblade) ||\
+ istype(attacking_item,/obj/item/card/emag) ||\
+ attacking_item.ismultitool())
if (my_effect.trigger == TRIGGER_ENERGY)
my_effect.ToggleActivate()
if(secondary_effect?.trigger == TRIGGER_ENERGY)
secondary_effect.ToggleActivate()
- else if (istype(W,/obj/item/flame) && W:lit ||\
- W.iswelder() && W:welding)
+ else if (istype(attacking_item,/obj/item/flame) && attacking_item:lit ||\
+ attacking_item.iswelder() && attacking_item:welding)
if(my_effect.trigger == TRIGGER_HEAT)
my_effect.ToggleActivate()
if(secondary_effect?.trigger == TRIGGER_HEAT)
secondary_effect.ToggleActivate()
else
..()
- if (my_effect.trigger == TRIGGER_FORCE && W.force >= 10)
+ if (my_effect.trigger == TRIGGER_FORCE && attacking_item.force >= 10)
my_effect.ToggleActivate()
if(secondary_effect?.trigger == TRIGGER_FORCE)
secondary_effect.ToggleActivate()
diff --git a/code/modules/research/xenoarchaeology/chemistry.dm b/code/modules/research/xenoarchaeology/chemistry.dm
index b077321b5c4..14cac31b30d 100644
--- a/code/modules/research/xenoarchaeology/chemistry.dm
+++ b/code/modules/research/xenoarchaeology/chemistry.dm
@@ -13,14 +13,14 @@
volume = 2
atom_flags = ATOM_FLAG_OPEN_CONTAINER
-/obj/item/reagent_containers/glass/solution_tray/attackby(obj/item/W as obj, mob/living/user as mob)
- if(W.ispen())
- var/new_label = sanitizeSafe(input("What should the new label be?","Label solution tray"), MAX_NAME_LEN)
+/obj/item/reagent_containers/glass/solution_tray/attackby(obj/item/attacking_item, mob/living/user)
+ 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)
name = "solution tray ([new_label])"
to_chat(user, "You write on the label of the solution tray.")
else
- ..(W, user)
+ return ..()
/obj/item/storage/box/solution_trays
name = "solution tray box"
diff --git a/code/modules/research/xenoarchaeology/finds/finds.dm b/code/modules/research/xenoarchaeology/finds/finds.dm
index 886da395609..b3a9eda70c1 100644
--- a/code/modules/research/xenoarchaeology/finds/finds.dm
+++ b/code/modules/research/xenoarchaeology/finds/finds.dm
@@ -45,9 +45,9 @@
if(severity && prob(30))
src.visible_message("The [src] crumbles away, leaving some dust and gravel behind.")*/
-/obj/item/ore/strangerock/attackby(obj/item/W as obj, mob/user as mob)
- if(istype(W,/obj/item/weldingtool/))
- var/obj/item/weldingtool/w = W
+/obj/item/ore/strangerock/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/weldingtool/))
+ var/obj/item/weldingtool/w = attacking_item
if(w.isOn())
if(w.get_fuel() >= 4 && !src.method)
if(inside)
@@ -65,8 +65,8 @@
w.use(1)
return
- else if(istype(W,/obj/item/device/core_sampler/))
- var/obj/item/device/core_sampler/S = W
+ else if(istype(attacking_item, /obj/item/device/core_sampler/))
+ var/obj/item/device/core_sampler/S = attacking_item
S.sample_item(src, user)
return
diff --git a/code/modules/research/xenoarchaeology/finds/finds_fossils.dm b/code/modules/research/xenoarchaeology/finds/finds_fossils.dm
index c966a1ea9a8..9b2d49b2a92 100644
--- a/code/modules/research/xenoarchaeology/finds/finds_fossils.dm
+++ b/code/modules/research/xenoarchaeology/finds/finds_fossils.dm
@@ -41,14 +41,14 @@
/obj/item/fossil/skull/horned/New()
icon_state = "horned_skull[rand(1, 2)]"
-/obj/item/fossil/skull/attackby(obj/item/W as obj, mob/user as mob)
- if(istype(W,/obj/item/fossil/bone))
+/obj/item/fossil/skull/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/fossil/bone))
var/obj/o = new /obj/skeleton(get_turf(src))
var/a = new /obj/item/fossil/bone
var/b = new src.type
o.contents.Add(a)
o.contents.Add(b)
- qdel(W)
+ qdel(attacking_item)
qdel(src)
/obj/skeleton
@@ -65,12 +65,12 @@
src.breq = rand(3)+3
src.desc = "An incomplete skeleton, looks like it could use [src.breq-src.bnum] more bones."
-/obj/skeleton/attackby(obj/item/W as obj, mob/user as mob)
- if(istype(W,/obj/item/fossil/bone))
+/obj/skeleton/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/fossil/bone))
if(!bstate)
bnum++
src.contents.Add(new/obj/item/fossil/bone)
- qdel(W)
+ qdel(attacking_item)
if(bnum==breq)
usr = user
icon_state = "skel"
@@ -86,7 +86,7 @@
to_chat(user, "Looks like it could use [src.breq-src.bnum] more bones.")
else
..()
- else if(istype(W,/obj/item/pen))
+ else if(istype(attacking_item, /obj/item/pen))
plaque_contents = sanitize(input("What would you like to write on the plaque:","Skeleton plaque",""))
user.visible_message("[user] writes something on the base of [src].","You relabel the plaque on the base of [icon2html(src, user)] [src].")
if(src.contents.Find(/obj/item/fossil/skull/horned))
diff --git a/code/modules/research/xenoarchaeology/machinery/artifact_harvester.dm b/code/modules/research/xenoarchaeology/machinery/artifact_harvester.dm
index facdbbabd3b..78f8a8be944 100644
--- a/code/modules/research/xenoarchaeology/machinery/artifact_harvester.dm
+++ b/code/modules/research/xenoarchaeology/machinery/artifact_harvester.dm
@@ -20,12 +20,12 @@
if(!owned_scanner)
owned_scanner = locate(/obj/machinery/artifact_scanpad) in orange(1, src)
-/obj/machinery/artifact_harvester/attackby(var/obj/I as obj, var/mob/user as mob)
- if(istype(I,/obj/item/anobattery))
+/obj/machinery/artifact_harvester/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/anobattery))
if(!inserted_battery)
- to_chat(user, "You insert [I] into [src].")
- user.drop_from_inventory(I,src)
- src.inserted_battery = I
+ to_chat(user, "You insert [attacking_item] into [src].")
+ user.drop_from_inventory(attacking_item, src)
+ src.inserted_battery = attacking_item
updateDialog()
else
to_chat(user, "There is already a battery in [src].")
diff --git a/code/modules/research/xenoarchaeology/machinery/geosample_scanner.dm b/code/modules/research/xenoarchaeology/machinery/geosample_scanner.dm
index 2ee97ec2d39..7aefa934fd6 100644
--- a/code/modules/research/xenoarchaeology/machinery/geosample_scanner.dm
+++ b/code/modules/research/xenoarchaeology/machinery/geosample_scanner.dm
@@ -63,29 +63,29 @@
/obj/machinery/radiocarbon_spectrometer/attack_hand(var/mob/user as mob)
ui_interact(user)
-/obj/machinery/radiocarbon_spectrometer/attackby(var/obj/I as obj, var/mob/user as mob)
+/obj/machinery/radiocarbon_spectrometer/attackby(obj/item/attacking_item, mob/user)
if(scanning)
to_chat(user, "You can't do that while [src] is scanning!")
else
- if(istype(I, /obj/item/stack/nanopaste))
+ if(istype(attacking_item, /obj/item/stack/nanopaste))
var/choice = alert("What do you want to do with the nanopaste?","Radiometric Scanner","Scan nanopaste","Fix seal integrity")
if(choice == "Fix seal integrity")
- var/obj/item/stack/nanopaste/N = I
+ var/obj/item/stack/nanopaste/N = attacking_item
var/amount_used = min(N.get_amount(), 10 - scanner_seal_integrity / 10)
N.use(amount_used)
scanner_seal_integrity = round(scanner_seal_integrity + amount_used * 10)
return
- if(istype(I, /obj/item/reagent_containers/glass))
+ if(istype(attacking_item, /obj/item/reagent_containers/glass))
var/choice = alert("What do you want to do with the container?","Radiometric Scanner","Add coolant","Empty coolant","Scan container")
if(choice == "Add coolant")
- var/obj/item/reagent_containers/glass/G = I
+ var/obj/item/reagent_containers/glass/G = attacking_item
var/amount_transferred = min(src.reagents.maximum_volume - src.reagents.total_volume, G.reagents.total_volume)
G.reagents.trans_to(src, amount_transferred)
to_chat(user, "You empty [amount_transferred]u of coolant into [src].")
update_coolant()
return
else if(choice == "Empty coolant")
- var/obj/item/reagent_containers/glass/G = I
+ var/obj/item/reagent_containers/glass/G = attacking_item
var/amount_transferred = min(G.reagents.maximum_volume - G.reagents.total_volume, src.reagents.total_volume)
src.reagents.trans_to(G, amount_transferred)
to_chat(user, "You remove [amount_transferred]u of coolant from [src].")
@@ -94,9 +94,9 @@
if(scanned_item)
to_chat(user, "\The [src] already has \a [scanned_item] inside!")
return
- user.drop_from_inventory(I,src)
- scanned_item = I
- to_chat(user, "You put \the [I] into \the [src].")
+ user.drop_from_inventory(attacking_item, src)
+ scanned_item = attacking_item
+ to_chat(user, "You put \the [attacking_item] into \the [src].")
/obj/machinery/radiocarbon_spectrometer/proc/update_coolant()
var/total_purity = 0
diff --git a/code/modules/research/xenoarchaeology/tools/ano_device_battery.dm b/code/modules/research/xenoarchaeology/tools/ano_device_battery.dm
index 7c681ab57a2..f1b675499d6 100644
--- a/code/modules/research/xenoarchaeology/tools/ano_device_battery.dm
+++ b/code/modules/research/xenoarchaeology/tools/ano_device_battery.dm
@@ -37,12 +37,12 @@
..()
START_PROCESSING(SSprocessing, src)
-/obj/item/anodevice/attackby(var/obj/I as obj, var/mob/user as mob)
- if(istype(I, /obj/item/anobattery))
+/obj/item/anodevice/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/anobattery))
if(!inserted_battery)
to_chat(user, "You insert the battery.")
- user.drop_from_inventory(I,src)
- inserted_battery = I
+ user.drop_from_inventory(attacking_item, src)
+ inserted_battery = attacking_item
UpdateSprite()
else
return ..()
diff --git a/code/modules/research/xenoarchaeology/tools/suspension_generator.dm b/code/modules/research/xenoarchaeology/tools/suspension_generator.dm
index 104865be4ab..33587765be2 100644
--- a/code/modules/research/xenoarchaeology/tools/suspension_generator.dm
+++ b/code/modules/research/xenoarchaeology/tools/suspension_generator.dm
@@ -38,8 +38,8 @@
ui_interact(user)
-/obj/machinery/suspension_gen/attackby(obj/item/I, mob/user)
- if(I.isscrewdriver())
+/obj/machinery/suspension_gen/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.isscrewdriver())
if(!open)
screwed = !screwed
to_chat(user, SPAN_NOTICE("You [screwed ? "screw" : "unscrew"] the battery panel."))
@@ -47,7 +47,7 @@
else
to_chat(user, SPAN_WARNING("\The [src]'s battery panel is open!"))
return
- else if (I.iscrowbar())
+ else if (attacking_item.iscrowbar())
if(!screwed)
if(!suspension_field)
open = !open
@@ -57,7 +57,7 @@
to_chat(user, SPAN_WARNING("[src]'s safety locks are engaged, shut it down first."))
else
to_chat(user, SPAN_WARNING("Unscrew [src]'s battery panel first."))
- else if (I.iswrench())
+ else if (attacking_item.iswrench())
if(!suspension_field)
anchored = !anchored
to_chat(user, SPAN_NOTICE("You wrench the stabilising bolts [anchored ? "into place" : "loose"]."))
@@ -69,13 +69,13 @@
update_icon()
else
to_chat(user, SPAN_WARNING("You are unable to secure [src] while it is active!"))
- else if (istype(I, /obj/item/cell))
+ else if (istype(attacking_item, /obj/item/cell))
if(open)
if(cell)
to_chat(user, SPAN_WARNING("There is a power cell already installed."))
else
- user.drop_from_inventory(I, src)
- cell = I
+ user.drop_from_inventory(attacking_item, src)
+ cell = attacking_item
to_chat(user, SPAN_NOTICE("You insert the power cell."))
update_icon()
diff --git a/code/modules/security levels/keycard authentication.dm b/code/modules/security levels/keycard authentication.dm
index 2062fba04c9..cd732771da4 100644
--- a/code/modules/security levels/keycard authentication.dm
+++ b/code/modules/security levels/keycard authentication.dm
@@ -35,12 +35,12 @@
to_chat(user, SPAN_NOTICE("The station AI is not to interact with these devices."))
return
-/obj/machinery/keycard_auth/attackby(obj/item/W, mob/user)
+/obj/machinery/keycard_auth/attackby(obj/item/attacking_item, mob/user)
if(stat & (NOPOWER|BROKEN))
to_chat(user, "This device is not powered.")
return
- if(istype(W,/obj/item/card/id))
- var/obj/item/card/id/ID = W
+ if(istype(attacking_item, /obj/item/card/id))
+ var/obj/item/card/id/ID = attacking_item
if(ACCESS_KEYCARD_AUTH in ID.access)
if(active == 1)
//This is not the device that made the initial request. It is the device confirming the request.
diff --git a/code/modules/shieldgen/emergency_shield.dm b/code/modules/shieldgen/emergency_shield.dm
index 7d8675f390f..ab9d9725c26 100644
--- a/code/modules/shieldgen/emergency_shield.dm
+++ b/code/modules/shieldgen/emergency_shield.dm
@@ -59,12 +59,12 @@
if(!height || air_group) return FALSE
else return ..()
-/obj/machinery/shield/attackby(obj/item/W, mob/user)
+/obj/machinery/shield/attackby(obj/item/attacking_item, mob/user)
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
- user.do_attack_animation(src, W)
+ user.do_attack_animation(src, attacking_item)
//Calculate damage
- var/aforce = W.force
- if(W.damtype == DAMAGE_BRUTE || W.damtype == DAMAGE_BURN)
+ var/aforce = attacking_item.force
+ if(attacking_item.damtype == DAMAGE_BRUTE || attacking_item.damtype == DAMAGE_BURN)
health -= aforce
//Play a fitting sound
@@ -301,9 +301,9 @@
update_icon()
return 1
-/obj/machinery/shieldgen/attackby(obj/item/W as obj, mob/user as mob)
- if(W.isscrewdriver())
- playsound(src.loc, W.usesound, 50, 1)
+/obj/machinery/shieldgen/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.isscrewdriver())
+ playsound(src.loc, attacking_item.usesound, 50, 1)
if(is_open)
to_chat(user, "You close the panel.")
is_open = FALSE
@@ -311,23 +311,23 @@
to_chat(user, "You open the panel and expose the wiring.")
is_open = TRUE
- else if(W.iscoil() && malfunction && is_open)
- var/obj/item/stack/cable_coil/coil = W
+ else if(attacking_item.iscoil() && malfunction && is_open)
+ var/obj/item/stack/cable_coil/coil = attacking_item
to_chat(user, "You begin to replace the wires.")
//if(do_after(user, min(60, round( ((maxhealth/health)*10)+(malfunction*10) ))) //Take longer to repair heavier damage
- if(W.use_tool(src, user, 30, volume = 50))
+ if(attacking_item.use_tool(src, user, 30, volume = 50))
if (coil.use(1))
health = initial(health)
malfunction = FALSE
to_chat(user, "You repair the [src]!")
update_icon()
- else if(W.iswrench())
+ else if(attacking_item.iswrench())
if(locked)
to_chat(user, "The bolts are covered, unlocking this would retract the covers.")
return
if(anchored)
- playsound(src.loc, W.usesound, 100, 1)
+ playsound(src.loc, attacking_item.usesound, 100, 1)
to_chat(user, "You unsecure the [src] from the floor!")
if(active)
to_chat(user, "The [src] shuts off!")
@@ -335,12 +335,12 @@
anchored = FALSE
else
if(istype(get_turf(src), /turf/space)) return //No wrenching these in space!
- playsound(src.loc, W.usesound, 100, 1)
+ playsound(src.loc, attacking_item.usesound, 100, 1)
to_chat(user, "You secure the [src] to the floor!")
anchored = TRUE
- else if(W.GetID())
+ else if(attacking_item.GetID())
if(src.allowed(user))
src.locked = !src.locked
to_chat(user, "The controls are now [src.locked ? "locked." : "unlocked."]")
diff --git a/code/modules/shieldgen/energy_field.dm b/code/modules/shieldgen/energy_field.dm
index b029dbaa783..6459c3966ff 100644
--- a/code/modules/shieldgen/energy_field.dm
+++ b/code/modules/shieldgen/energy_field.dm
@@ -31,13 +31,15 @@
/obj/effect/energy_field/proc/diffuse(var/duration)
diffused_for = max(duration, 0)
-/obj/effect/energy_field/attackby(obj/item/I, mob/user)
- user.do_attack_animation(src, I)
- if(I.force < 10)
- user.visible_message(SPAN_WARNING("[user] harmlessly attacks \the [src] with \the [I]."), SPAN_WARNING("You attack \the [src] with \the [I], but it bounces off without doing any damage."))
+/obj/effect/energy_field/attackby(obj/item/attacking_item, mob/user)
+ user.do_attack_animation(src, attacking_item)
+ if(attacking_item.force < 10)
+ user.visible_message(SPAN_WARNING("[user] harmlessly attacks \the [src] with \the [attacking_item]."),
+ SPAN_WARNING("You attack \the [src] with \the [attacking_item], but it bounces off without doing any damage."))
else
- user.visible_message(SPAN_WARNING("[user] attacks \the [src] with \the [I]."), SPAN_WARNING("You attack \the [src] with \the [I]."))
- Stress(I.force / 10)
+ user.visible_message(SPAN_WARNING("[user] attacks \the [src] with \the [attacking_item]."),
+ SPAN_WARNING("You attack \the [src] with \the [attacking_item]."))
+ Stress(attacking_item.force / 10)
/obj/effect/energy_field/attack_hand(mob/living/carbon/human/H)
if(istype(H))
diff --git a/code/modules/shieldgen/shield_capacitor.dm b/code/modules/shieldgen/shield_capacitor.dm
index 66ecd8186b2..24d4fc7de6a 100644
--- a/code/modules/shieldgen/shield_capacitor.dm
+++ b/code/modules/shieldgen/shield_capacitor.dm
@@ -39,16 +39,16 @@
updateDialog()
spark(src, 5, GLOB.alldirs)
-/obj/machinery/shield_capacitor/attackby(obj/item/W, mob/user)
+/obj/machinery/shield_capacitor/attackby(obj/item/attacking_item, mob/user)
- if(istype(W, /obj/item/card/id))
+ if(istype(attacking_item, /obj/item/card/id))
if(allowed(user))
locked = !locked
to_chat(user, "Controls are now [locked ? "locked." : "unlocked."]")
updateDialog()
else
to_chat(user, SPAN_ALERT("Access denied."))
- else if(W.iswrench())
+ else if(attacking_item.iswrench())
anchored = !anchored
visible_message(SPAN_NOTICE("\The [src] has been [anchored ? "bolted to the floor" : "unbolted from the floor"] by \the [user]."))
diff --git a/code/modules/shieldgen/shield_gen.dm b/code/modules/shieldgen/shield_gen.dm
index c4c4de520d1..82c75ec64ce 100644
--- a/code/modules/shieldgen/shield_gen.dm
+++ b/code/modules/shieldgen/shield_gen.dm
@@ -56,15 +56,15 @@
spark(src, 5, GLOB.alldirs)
-/obj/machinery/shield_gen/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/card/id))
+/obj/machinery/shield_gen/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/card/id))
if(allowed(user))
locked = !locked
to_chat(user, "Controls are now [locked ? "locked." : "unlocked."]")
updateDialog()
else
to_chat(user, SPAN_ALERT("Access denied."))
- else if(W.iswrench())
+ else if(attacking_item.iswrench())
anchored = !anchored
visible_message(SPAN_NOTICE("\The [src] has been [anchored ? "bolted to the floor":"unbolted from the floor"] by \the [user]."))
diff --git a/code/modules/shieldgen/shieldwallgen.dm b/code/modules/shieldgen/shieldwallgen.dm
index 90b1707946a..c3d99211e2d 100644
--- a/code/modules/shieldgen/shieldwallgen.dm
+++ b/code/modules/shieldgen/shieldwallgen.dm
@@ -143,22 +143,22 @@
var/obj/shieldwall/CF = new /obj/shieldwall/(T, src, G) //(ref to this gen, ref to connected gen)
CF.set_dir(field_dir)
-/obj/machinery/shieldwallgen/attackby(obj/item/W, mob/user)
- if(W.iswrench())
+/obj/machinery/shieldwallgen/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.iswrench())
if(power_state)
to_chat(user, SPAN_WARNING("You cannot unsecure \the [src] while it's active."))
return
wrenched = !wrenched
anchored = wrenched
- playsound(loc, W.usesound, 75, TRUE)
+ playsound(loc, attacking_item.usesound, 75, TRUE)
add_fingerprint(user)
var/others_msg = wrenched ? "[user] secures the external reinforcing bolts to the floor." : "[user] unsecures the external reinforcing bolts."
var/self_msg = wrenched ? "You secure the external reinforcing bolts to the floor." : "You unsecure the external reinforcing bolts."
user.visible_message(others_msg, SPAN_NOTICE(self_msg), SPAN_NOTICE("You hear a ratcheting noise."))
return
- if(W.GetID())
+ if(attacking_item.GetID())
add_fingerprint(user)
if(allowed(user))
locked = !locked
diff --git a/code/modules/shuttles/shuttle_console.dm b/code/modules/shuttles/shuttle_console.dm
index bb09fe7adb8..dce25335dda 100644
--- a/code/modules/shuttles/shuttle_console.dm
+++ b/code/modules/shuttles/shuttle_console.dm
@@ -27,14 +27,14 @@
PH.linked_console = null
return ..()
-/obj/machinery/computer/shuttle_control/attackby(obj/item/I, user)
- if(istype(I, /obj/item/clothing/head/helmet/pilot))
- var/obj/item/clothing/head/helmet/pilot/PH = I
- if(I in linked_helmets)
- to_chat(user, SPAN_NOTICE("You unlink \the [I] from \the [src]."))
+/obj/machinery/computer/shuttle_control/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/clothing/head/helmet/pilot))
+ var/obj/item/clothing/head/helmet/pilot/PH = attacking_item
+ if(attacking_item in linked_helmets)
+ to_chat(user, SPAN_NOTICE("You unlink \the [attacking_item] from \the [src]."))
PH.set_console(null)
else
- to_chat(user, SPAN_NOTICE("You link \the [I] to \the [src]."))
+ to_chat(user, SPAN_NOTICE("You link \the [attacking_item] to \the [src]."))
PH.set_console(src)
PH.set_hud_maptext("Shuttle Status: [get_shuttle_status(SSshuttle.shuttles[shuttle_tag])]")
return
diff --git a/code/modules/shuttles/shuttle_emergency.dm b/code/modules/shuttles/shuttle_emergency.dm
index bd1273ffb52..3aba40c43c3 100644
--- a/code/modules/shuttles/shuttle_emergency.dm
+++ b/code/modules/shuttles/shuttle_emergency.dm
@@ -172,8 +172,8 @@
emagged = 1
return 1
-/obj/machinery/computer/shuttle_control/emergency/attackby(obj/item/W as obj, mob/user as mob)
- read_authorization(W)
+/obj/machinery/computer/shuttle_control/emergency/attackby(obj/item/attacking_item, mob/user)
+ read_authorization(attacking_item)
..()
/obj/machinery/computer/shuttle_control/emergency/ui_interact(mob/user, datum/tgui/ui)
diff --git a/code/modules/spell_system/artifacts/items/lich_phylactery.dm b/code/modules/spell_system/artifacts/items/lich_phylactery.dm
index 62370bd1940..b8b6bea8362 100644
--- a/code/modules/spell_system/artifacts/items/lich_phylactery.dm
+++ b/code/modules/spell_system/artifacts/items/lich_phylactery.dm
@@ -29,9 +29,9 @@
else
. += "The heart is pulsing slowly."
-/obj/item/phylactery/attackby(var/obj/item/I, var/mob/user)
+/obj/item/phylactery/attackby(obj/item/attacking_item, mob/user)
..()
- if(istype(I, /obj/item/nullrod))
+ if(istype(attacking_item, /obj/item/nullrod))
src.visible_message("\The [src] twists violently and explodes!")
gibs(src.loc)
qdel(src)
diff --git a/code/modules/spell_system/artifacts/items/poppet.dm b/code/modules/spell_system/artifacts/items/poppet.dm
index fb6aceb3fa0..5c64104b20b 100644
--- a/code/modules/spell_system/artifacts/items/poppet.dm
+++ b/code/modules/spell_system/artifacts/items/poppet.dm
@@ -73,29 +73,29 @@
cooldown = world.time + cooldown_time
-/obj/item/poppet/attackby(obj/item/W as obj, mob/user as mob)
+/obj/item/poppet/attackby(obj/item/attacking_item, mob/user)
var/mob/living/carbon/human/H = target.resolve()
if(H && cooldown < world.time)
cooldown = world.time + cooldown_time
var/target_zone = user.zone_sel.selecting
- if(W.isFlameSource())
+ if(attacking_item.isFlameSource())
fire_act()
return TRUE
- if(istype(W, /obj/item/melee/baton))
- H.electrocute_act(W.force * 2, W, def_zone = target_zone)
+ if(istype(attacking_item, /obj/item/melee/baton))
+ H.electrocute_act(attacking_item.force * 2, attacking_item, def_zone = target_zone)
playsound(get_turf(H), 'sound/weapons/Egloves.ogg', 50, 1, -1)
return TRUE
- if(istype(W, /obj/item/device/flashlight))
- to_chat(H, "You direct \the [W] towards \the [src]'s eyes!")
+ if(istype(attacking_item, /obj/item/device/flashlight))
+ to_chat(H, "You direct \the [attacking_item] towards \the [src]'s eyes!")
playsound(get_turf(H), 'sound/items/flashlight.ogg', 50, 1, -1)
H.flash_act()
return TRUE
- if(W.iscoil())
- to_chat(H, "You strangle \the [src] with \the [W]!")
+ if(attacking_item.iscoil())
+ to_chat(H, "You strangle \the [src] with \the [attacking_item]!")
H.silent += 10
playsound(get_turf(H), 'sound/effects/noosed.ogg', 50, 1, -1)
if(!(H.species.flags & NO_BREATHE))
@@ -103,12 +103,12 @@
H.losebreath += 5
return TRUE
- if(istype(W, /obj/item/bikehorn))
+ if(istype(attacking_item, /obj/item/bikehorn))
playsound(get_turf(H), 'sound/items/bikehorn.ogg', 50, 1, -1)
return TRUE
- if(W.edge)
- to_chat(H, "You stab \the [src] with \the [W]!")
+ if(attacking_item.edge)
+ to_chat(H, "You stab \the [src] with \the [attacking_item]!")
H.apply_damage(2, DAMAGE_BRUTE, target_zone, damage_flags = DAMAGE_FLAG_EDGE)
playsound(get_turf(H), 'sound/weapons/bladeslice.ogg', 50, 1, -1)
if(H.can_feel_pain())
diff --git a/code/modules/spell_system/spells/spell_list/self/conjure/forcewall.dm b/code/modules/spell_system/spells/spell_list/self/conjure/forcewall.dm
index 6b971694760..531a93c7886 100644
--- a/code/modules/spell_system/spells/spell_list/self/conjure/forcewall.dm
+++ b/code/modules/spell_system/spells/spell_list/self/conjure/forcewall.dm
@@ -28,10 +28,10 @@
Proj.on_hit(M,M.bullet_act(Proj, def_zone))
return
-/obj/effect/forcefield/attackby(var/obj/item/I, var/mob/user)
+/obj/effect/forcefield/attackby(obj/item/attacking_item, mob/user)
..()
- if(istype(I, /obj/item/nullrod))
- to_chat(user, "\the [src] dissipates at the touch of the \the [I].")
+ if(istype(attacking_item, /obj/item/nullrod))
+ to_chat(user, "\the [src] dissipates at the touch of the \the [attacking_item].")
qdel(src)
/obj/effect/forcefield/cultify()
diff --git a/code/modules/supermatter/supermatter.dm b/code/modules/supermatter/supermatter.dm
index 1a1caad1241..20148a0d97a 100644
--- a/code/modules/supermatter/supermatter.dm
+++ b/code/modules/supermatter/supermatter.dm
@@ -383,15 +383,19 @@
ui = new(user, src, "Supermatter", "Supermatter Crystal", 500, 300)
ui.open()
-/obj/machinery/power/supermatter/attackby(obj/item/W, mob/living/user)
- user.visible_message("\The [user] touches \a [W] to \the [src] as a silence fills the room...",\
- "You touch \the [W] to \the [src] when everything suddenly goes silent.\"\n\The [W] flashes into dust as you flinch away from \the [src].",\
+/obj/machinery/power/supermatter/attackby(obj/item/attacking_item, mob/user)
+ var/mob/living/living_user = user
+ if(!istype(living_user))
+ return
+
+ living_user.visible_message("\The [living_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.")
- user.drop_from_inventory(W)
- Consume(W)
+ living_user.drop_from_inventory(attacking_item)
+ Consume(attacking_item)
- user.apply_damage(150, DAMAGE_RADIATION, damage_flags = DAMAGE_FLAG_DISPERSED)
+ living_user.apply_damage(150, DAMAGE_RADIATION, damage_flags = DAMAGE_FLAG_DISPERSED)
/obj/machinery/power/supermatter/CollidedWith(atom/AM as mob|obj)
if(!AM.simulated)
diff --git a/code/modules/synthesized_instruments/real_instruments/Synthesizer/synthesizer.dm b/code/modules/synthesized_instruments/real_instruments/Synthesizer/synthesizer.dm
index f9b06fece88..1999eb8f9f3 100644
--- a/code/modules/synthesized_instruments/real_instruments/Synthesizer/synthesizer.dm
+++ b/code/modules/synthesized_instruments/real_instruments/Synthesizer/synthesizer.dm
@@ -12,8 +12,8 @@
path = /datum/instrument
sound_player = /datum/sound_player/synthesizer
-/obj/structure/synthesized_instrument/synthesizer/attackby(obj/item/O, mob/user, params)
- if (istype(O, /obj/item/wrench))
+/obj/structure/synthesized_instrument/synthesizer/attackby(obj/item/attacking_item, mob/user, params)
+ if (istype(attacking_item, /obj/item/wrench))
if (!anchored && !isinspace())
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
to_chat(usr, SPAN_NOTICE(" You begin to tighten \the [src] to the floor..."))
diff --git a/code/modules/tables/interactions.dm b/code/modules/tables/interactions.dm
index f0e02eba7cf..8738a4d2e94 100644
--- a/code/modules/tables/interactions.dm
+++ b/code/modules/tables/interactions.dm
@@ -181,13 +181,13 @@
/obj/item/proc/reset_table_position()
animate(src, pixel_y = 0, time = 2, loop = 1, easing = BOUNCE_EASING)
-/obj/structure/table/attackby(obj/item/W, mob/user, var/click_parameters)
- if (!W)
+/obj/structure/table/attackby(obj/item/attacking_item, mob/user, params)
+ if (!attacking_item)
return
// Handle harm intent grabbing/tabling.
- if(istype(W, /obj/item/grab) && get_dist(src,user)<2)
- var/obj/item/grab/G = W
+ if(istype(attacking_item, /obj/item/grab) && get_dist(src,user)<2)
+ var/obj/item/grab/G = attacking_item
if(istype(G.affecting, /mob/living))
var/mob/living/M = G.affecting
var/obj/occupied = turf_is_crowded()
@@ -222,17 +222,17 @@
G.affecting.forceMove(src.loc)
G.affecting.Weaken(rand(2,4))
visible_message("[G.assailant] puts [G.affecting] on \the [src].")
- qdel(W)
+ qdel(attacking_item)
return
else
to_chat(user, "You need a better grip to do that!")
return
- if(!W.dropsafety())
+ if(!attacking_item.dropsafety())
return
- if(istype(W, /obj/item/melee/energy/blade))
- var/obj/item/melee/energy/blade/blade = W
+ if(istype(attacking_item, /obj/item/melee/energy/blade))
+ var/obj/item/melee/energy/blade/blade = attacking_item
blade.spark_system.queue()
playsound(src.loc, 'sound/weapons/blade.ogg', 50, 1)
playsound(src.loc, /singleton/sound_category/spark_sound, 50, 1)
@@ -241,11 +241,11 @@
return
if(can_plate && !material)
- to_chat(user, "There's nothing to put \the [W] on! Try adding plating to \the [src] first.")
+ to_chat(user, "There's nothing to put \the [attacking_item] on! Try adding plating to \the [src] first.")
return
- if(W.ishammer() && user.a_intent != I_HURT)
+ if(attacking_item.ishammer() && user.a_intent != I_HURT)
var/obj/item/I = usr.get_inactive_hand()
if(I && istype(I, /obj/item/stack))
var/obj/item/stack/D = I
@@ -262,9 +262,9 @@
visible_message("[user] repairs \the [src].", SPAN_NOTICE("You repair \the [src]."))
// Placing stuff on tables
- if(user.unEquip(W, 0, loc)) //Loc is intentional here so we don't forceMove() items into oblivion
- user.make_item_drop_sound(W)
- auto_align(W, click_parameters)
+ if(user.unEquip(attacking_item, 0, loc)) //Loc is intentional here so we don't forceMove() items into oblivion
+ user.make_item_drop_sound(attacking_item)
+ auto_align(attacking_item, params)
return
#define CELLS 8 //Amount of cells per row/column in grid
diff --git a/code/modules/tables/tables.dm b/code/modules/tables/tables.dm
index 112e48cf7d3..d823f2a7e77 100644
--- a/code/modules/tables/tables.dm
+++ b/code/modules/tables/tables.dm
@@ -110,16 +110,16 @@
if(0.5 to 1.0)
. += "It has a few scrapes and dents."
-/obj/structure/table/attackby(obj/item/W, mob/user)
- if(reinforced && W.isscrewdriver())
- remove_reinforced(W, user)
+/obj/structure/table/attackby(obj/item/attacking_item, mob/user)
+ if(reinforced && attacking_item.isscrewdriver())
+ remove_reinforced(attacking_item, user)
if(!reinforced)
update_desc()
queue_icon_update()
update_material()
return 1
- if(carpeted && W.iscrowbar())
+ if(carpeted && attacking_item.iscrowbar())
user.visible_message("\The [user] removes the carpet from \the [src].",
"You remove the carpet from \the [src].")
new /obj/item/stack/tile/carpet(loc)
@@ -127,8 +127,8 @@
queue_icon_update()
return 1
- if(!carpeted && material && istype(W, /obj/item/stack/tile/carpet))
- var/obj/item/stack/tile/carpet/C = W
+ if(!carpeted && material && istype(attacking_item, /obj/item/stack/tile/carpet))
+ var/obj/item/stack/tile/carpet/C = attacking_item
if(C.use(1))
user.visible_message("\The [user] adds \the [C] to \the [src].",
"You add \the [C] to \the [src].")
@@ -138,8 +138,8 @@
else
to_chat(user, "You don't have enough carpet!")
- if(!reinforced && !carpeted && material && (W.iswrench() || istype(W, /obj/item/gun/energy/plasmacutter)))
- remove_material(W, user)
+ if(!reinforced && !carpeted && material && (attacking_item.iswrench() || istype(attacking_item, /obj/item/gun/energy/plasmacutter)))
+ remove_material(attacking_item, user)
if(!material)
update_connections(1)
queue_icon_update()
@@ -149,23 +149,23 @@
update_material()
return 1
- if(!carpeted && !reinforced && !material && (W.iswrench() || istype(W, /obj/item/gun/energy/plasmacutter)))
- dismantle(W, user)
+ if(!carpeted && !reinforced && !material && (attacking_item.iswrench() || istype(attacking_item, /obj/item/gun/energy/plasmacutter)))
+ dismantle(attacking_item, user)
return 1
- if(health < maxhealth && W.iswelder())
- var/obj/item/weldingtool/F = W
+ if(health < maxhealth && attacking_item.iswelder())
+ var/obj/item/weldingtool/F = attacking_item
if(F.welding)
to_chat(user, "You begin reparing damage to \the [src].")
- if(!W.use_tool(src, user, 20, volume = 50) || !F.use(1, user))
+ if(!attacking_item.use_tool(src, user, 20, volume = 50) || !F.use(1, user))
return
user.visible_message("\The [user] repairs some damage to \the [src].",
"You repair some damage to \the [src].")
health = max(health+(maxhealth/5), maxhealth) // 20% repair per application
return 1
- if(!material && can_plate && istype(W, /obj/item/stack/material))
- material = common_material_add(W, user, "plat")
+ if(!material && can_plate && istype(attacking_item, /obj/item/stack/material))
+ material = common_material_add(attacking_item, user, "plat")
if(material)
update_connections(1)
queue_icon_update()
@@ -173,9 +173,9 @@
update_material()
return 1
- if(!material && can_plate && istype(W, /obj/item/reagent_containers/cooking_container/board/bowl))
+ if(!material && can_plate && istype(attacking_item, /obj/item/reagent_containers/cooking_container/board/bowl))
new /obj/structure/chemkit(loc)
- qdel(W)
+ qdel(attacking_item)
qdel(src)
return 1
diff --git a/code/modules/telesci/telepad.dm b/code/modules/telesci/telepad.dm
index 0f0a9cb05b1..117c13dc166 100644
--- a/code/modules/telesci/telepad.dm
+++ b/code/modules/telesci/telepad.dm
@@ -24,20 +24,20 @@
E += C.rating
efficiency = E
-/obj/machinery/telepad/attackby(obj/item/I, mob/user, params)
- if(default_deconstruction_screwdriver(user, I))
+/obj/machinery/telepad/attackby(obj/item/attacking_item, mob/user, params)
+ if(default_deconstruction_screwdriver(user, attacking_item))
return
if(panel_open)
- if(I.ismultitool())
- var/obj/item/device/multitool/M = I
+ if(attacking_item.ismultitool())
+ var/obj/item/device/multitool/M = attacking_item
M.buffer = src
- to_chat(user, "You save the data in the [I.name]'s buffer.")
+ to_chat(user, "You save the data in the [attacking_item.name]'s buffer.")
else
- if(I.ismultitool())
+ if(attacking_item.ismultitool())
to_chat(user, "You should open [src]'s maintenance panel first.")
- default_deconstruction_crowbar(user, I)
+ default_deconstruction_crowbar(user, attacking_item)
/obj/machinery/telepad/update_icon()
switch (panel_open)
@@ -58,26 +58,26 @@
active_power_usage = 500
var/stage = 0
-/obj/machinery/telepad_cargo/attackby(obj/item/W, mob/user, params)
- if(W.iswrench())
+/obj/machinery/telepad_cargo/attackby(obj/item/attacking_item, mob/user, params)
+ if(attacking_item.iswrench())
anchored = 0
- playsound(src, W.usesound, 50, 1)
+ playsound(src, attacking_item.usesound, 50, 1)
if(anchored)
anchored = 0
to_chat(user, "\The [src] can now be moved.")
else if(!anchored)
anchored = 1
to_chat(user, "\The [src] is now secured.")
- if(W.isscrewdriver())
+ if(attacking_item.isscrewdriver())
if(stage == 0)
- playsound(src, W.usesound, 50, 1)
+ playsound(src, attacking_item.usesound, 50, 1)
to_chat(user, "You unscrew the telepad's tracking beacon.")
stage = 1
else if(stage == 1)
- playsound(src, W.usesound, 50, 1)
+ playsound(src, attacking_item.usesound, 50, 1)
to_chat(user, "You screw in the telepad's tracking beacon.")
stage = 0
- if(W.iswelder() && stage == 1)
+ if(attacking_item.iswelder() && stage == 1)
playsound(src, 'sound/items/Welder.ogg', 50, 1)
to_chat(user, "You disassemble the telepad.")
new /obj/item/stack/material/steel(get_turf(src))
@@ -145,8 +145,8 @@
playsound(src.loc, 'sound/effects/pop.ogg', 50, 0)
to_chat(user, "You calibrate the telepad locator.")
-/obj/item/rcs/attackby(var/obj/item/O, var/mob/user)
- if (istype(O, /obj/item/card/emag) && !emagged)
+/obj/item/rcs/attackby(obj/item/attacking_item, mob/user)
+ if (istype(attacking_item, /obj/item/card/emag) && !emagged)
emagged = 1
spark(src, 5, GLOB.alldirs)
to_chat(user, "You emag the RCS. Click on it to toggle between modes.")
diff --git a/code/modules/telesci/telesci_computer.dm b/code/modules/telesci/telesci_computer.dm
index 37a4912b720..b9243023e90 100644
--- a/code/modules/telesci/telesci_computer.dm
+++ b/code/modules/telesci/telesci_computer.dm
@@ -48,28 +48,28 @@
for(var/i = 1; i <= starting_crystals; i++)
crystals += new /obj/item/bluespace_crystal/artificial(null) // starting crystals
-/obj/machinery/computer/telescience/attackby(obj/item/W, mob/user, params)
- if(istype(W, /obj/item/bluespace_crystal))
+/obj/machinery/computer/telescience/attackby(obj/item/attacking_item, mob/user, params)
+ if(istype(attacking_item, /obj/item/bluespace_crystal))
if(crystals.len >= max_crystals)
to_chat(user, "There are not enough crystal slots.")
return
user.drop_item(src)
- crystals += W
- W.forceMove(null)
- user.visible_message("[user] inserts [W] into \the [src]'s crystal slot.", "You insert [W] into \the [src]'s crystal slot.")
+ crystals += attacking_item
+ attacking_item.forceMove(null)
+ user.visible_message("[user] inserts [attacking_item] into \the [src]'s crystal slot.", "You insert [attacking_item] into \the [src]'s crystal slot.")
updateDialog()
- else if(istype(W, /obj/item/device/gps))
+ else if(istype(attacking_item, /obj/item/device/gps))
if(!inserted_gps)
- inserted_gps = W
- user.unEquip(W)
- W.forceMove(src)
- user.visible_message("[user] inserts [W] into \the [src]'s GPS device slot.", "You insert [W] into \the [src]'s GPS device slot.")
- else if(W.ismultitool())
- var/obj/item/device/multitool/M = W
+ inserted_gps = attacking_item
+ user.unEquip(attacking_item)
+ attacking_item.forceMove(src)
+ user.visible_message("[user] inserts [attacking_item] into \the [src]'s GPS device slot.", "You insert [attacking_item] into \the [src]'s GPS device slot.")
+ else if(attacking_item.ismultitool())
+ var/obj/item/device/multitool/M = attacking_item
if(M.buffer && istype(M.buffer, /obj/machinery/telepad))
telepad = M.buffer
M.buffer = null
- to_chat(user, "You upload the data from the [W.name]'s buffer.")
+ to_chat(user, "You upload the data from the [attacking_item.name]'s buffer.")
else
..()
diff --git a/code/modules/vehicles/bike.dm b/code/modules/vehicles/bike.dm
index 204ecdc061d..550acd0b485 100644
--- a/code/modules/vehicles/bike.dm
+++ b/code/modules/vehicles/bike.dm
@@ -333,8 +333,8 @@
return
..()
-/obj/vehicle/bike/casino/attackby(obj/item/W as obj, mob/user as mob)
- if(istype(W, /obj/item/coin/casino))
+/obj/vehicle/bike/casino/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/coin/casino))
if(!paid)
paid = TRUE
to_chat(user, SPAN_NOTICE("Payment confirmed, enjoy two minutes of unlimited snowmobile use."))
diff --git a/code/modules/vehicles/cargo_train.dm b/code/modules/vehicles/cargo_train.dm
index a9cfb5c7dfc..ee20b452879 100644
--- a/code/modules/vehicles/cargo_train.dm
+++ b/code/modules/vehicles/cargo_train.dm
@@ -126,19 +126,20 @@
return ..()
-/obj/vehicle/train/cargo/trolley/attackby(obj/item/W as obj, mob/user as mob)
- if(open && W.iswirecutter())
+/obj/vehicle/train/cargo/trolley/attackby(obj/item/attacking_item, mob/user)
+ if(open && attacking_item.iswirecutter())
passenger_allowed = !passenger_allowed
- user.visible_message(SPAN_NOTICE("[user] [passenger_allowed ? "cuts" : "mends"] a cable in [src]."),SPAN_NOTICE("You [passenger_allowed ? "cut" : "mend"] the load limiter cable."))
+ user.visible_message(SPAN_NOTICE("[user] [passenger_allowed ? "cuts" : "mends"] a cable in [src]."),
+ SPAN_NOTICE("You [passenger_allowed ? "cut" : "mend"] the load limiter cable."))
else
..()
-/obj/vehicle/train/cargo/engine/attackby(obj/item/W as obj, mob/user as mob)
- if(istype(W, key_type))
+/obj/vehicle/train/cargo/engine/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, key_type))
if(!key)
- user.drop_from_inventory(W, src)
- key = W // put the key in the ignition
- to_chat(user, SPAN_NOTICE("You slide \the [W] into \the [src]\s ignition."))
+ user.drop_from_inventory(attacking_item, src)
+ key = attacking_item // put the key in the ignition
+ to_chat(user, SPAN_NOTICE("You slide \the [attacking_item] into \the [src]\s ignition."))
playsound(src, 'sound/machines/vehicles/key_in.ogg', 50, FALSE)
else
to_chat(user, SPAN_NOTICE("There is already a key in \the [src]\s ignition."))
diff --git a/code/modules/vehicles/droppod.dm b/code/modules/vehicles/droppod.dm
index 9209e11a01e..832f66ef418 100644
--- a/code/modules/vehicles/droppod.dm
+++ b/code/modules/vehicles/droppod.dm
@@ -45,12 +45,12 @@
/obj/vehicle/droppod/Move()
return
-/obj/vehicle/droppod/attackby(obj/item/I as obj, mob/user as mob)
- if(I.iswelder() && status == USED && !humanload && !passenger)
- var/obj/item/weldingtool/W = I
+/obj/vehicle/droppod/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.iswelder() && status == USED && !humanload && !passenger)
+ var/obj/item/weldingtool/W = attacking_item
if(W.welding)
src.visible_message(SPAN_NOTICE("[user] starts cutting \the [src] apart."))
- if(I.use_tool(src, user, 200, volume = 50))
+ if(attacking_item.use_tool(src, user, 200, volume = 50))
src.visible_message(SPAN_DANGER("\The [src] is cut apart by [user]!"))
new /obj/item/stack/material/titanium(src.loc, 10)
new /obj/item/stack/material/plasteel(src.loc, 10)
diff --git a/code/modules/vehicles/pussywagon.dm b/code/modules/vehicles/pussywagon.dm
index 6946f936f7f..bd9cc214163 100644
--- a/code/modules/vehicles/pussywagon.dm
+++ b/code/modules/vehicles/pussywagon.dm
@@ -163,18 +163,18 @@
var/mopping = 0
var/hoover = 0
-/obj/vehicle/train/cargo/trolley/pussywagon/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/reagent_containers))
+/obj/vehicle/train/cargo/trolley/pussywagon/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/reagent_containers))
if(!open)
to_chat(user, SPAN_WARNING("\The [src]'s maintenance panel isn't open."))
return
if(!bucket)
- user.drop_from_inventory(W,src)
- bucket = W
+ user.drop_from_inventory(attacking_item,src)
+ bucket = attacking_item
to_chat(user, SPAN_NOTICE("You replace \the [src]'s reagent reservoir."))
return
- if(W.iswrench())
+ if(attacking_item.iswrench())
if(!open)
to_chat(user, SPAN_WARNING("\The [src]'s maintenance panel isn't open."))
return
@@ -187,7 +187,7 @@
to_chat(user, SPAN_WARNING("\The [src] doesn't have a reagent reservoir installed."))
return
- if(W.iscrowbar())
+ if(attacking_item.iscrowbar())
if(!open)
to_chat(user, SPAN_WARNING("\The [src]'s panel isn't open."))
return
diff --git a/code/modules/vehicles/train.dm b/code/modules/vehicles/train.dm
index 24f678293e8..c311ff87c2a 100644
--- a/code/modules/vehicles/train.dm
+++ b/code/modules/vehicles/train.dm
@@ -102,9 +102,9 @@
else if(load)
unload(user) //unload if loaded
-/obj/vehicle/train/attackby(obj/item/W, mob/user)
- if(W.iswrench())
- playsound(loc, W.usesound, 70, FALSE)
+/obj/vehicle/train/attackby(obj/item/attacking_item, mob/user)
+ if(attacking_item.iswrench())
+ playsound(loc, attacking_item.usesound, 70, FALSE)
unattach(user)
return
return ..()
diff --git a/code/modules/vehicles/vehicle.dm b/code/modules/vehicles/vehicle.dm
index d5dc4719731..5cb802f97cb 100644
--- a/code/modules/vehicles/vehicle.dm
+++ b/code/modules/vehicles/vehicle.dm
@@ -84,21 +84,21 @@
/obj/vehicle/proc/create_vehicle_overlay()
return
-/obj/vehicle/attackby(obj/item/W as obj, mob/user as mob)
- if(istype(W, /obj/item/device/hand_labeler))
+/obj/vehicle/attackby(obj/item/attacking_item, mob/user)
+ if(istype(attacking_item, /obj/item/device/hand_labeler))
return
- if(W.isscrewdriver() && !organic)
+ if(attacking_item.isscrewdriver() && !organic)
if(!locked)
open = !open
update_icon()
to_chat(user, "Maintenance panel is now [open ? "opened" : "closed"].")
- else if(W.iscrowbar() && cell && open && !organic)
+ else if(attacking_item.iscrowbar() && cell && open && !organic)
remove_cell(user)
- else if(istype(W, /obj/item/cell) && !cell && open && !organic)
- insert_cell(W, user)
- else if(W.iswelder() && !organic)
- var/obj/item/weldingtool/T = W
+ else if(istype(attacking_item, /obj/item/cell) && !cell && open && !organic)
+ insert_cell(attacking_item, user)
+ else if(attacking_item.iswelder() && !organic)
+ var/obj/item/weldingtool/T = attacking_item
if(T.welding)
if(health < maxhealth)
if(open)
@@ -111,13 +111,13 @@
to_chat(user, "[src] does not need a repair.")
else
to_chat(user, "Unable to repair while [src] is off.")
- else if(hasvar(W,"force") && hasvar(W,"damtype"))
+ else if(hasvar(attacking_item,"force") && hasvar(attacking_item,"damtype"))
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
- switch(W.damtype)
+ switch(attacking_item.damtype)
if("fire")
- health -= W.force * fire_dam_coeff
+ health -= attacking_item.force * fire_dam_coeff
if("brute")
- health -= W.force * brute_dam_coeff
+ health -= attacking_item.force * brute_dam_coeff
..()
healthcheck()
else
diff --git a/code/unit_tests/loadout_tests.dm b/code/unit_tests/loadout_tests.dm
new file mode 100644
index 00000000000..330b51720cc
--- /dev/null
+++ b/code/unit_tests/loadout_tests.dm
@@ -0,0 +1,77 @@
+/**
+ * Tests loadouts
+ */
+/datum/unit_test/loadout_test
+ name = "Loadout Test"
+ groups = list("generic")
+
+/datum/unit_test/loadout_test/start_test()
+ return UNIT_TEST_SKIPPED //This is just a generic to inherit from, hence skip it
+
+/**
+ * Tests loadout gears
+ */
+/datum/unit_test/loadout_test/loadout_gear_test
+ name = "Loadout Gears Test"
+
+/datum/unit_test/loadout_test/loadout_gear_test/start_test()
+
+ //We overwrite it if we fail, let's assume it passes for now
+ var/test_result = UNIT_TEST_PASSED
+
+ //The test mob we'll give the items to
+ var/mob/living/test_mob = new /mob/living/carbon/human(locate(1,1,1))
+
+ //List of item names, to ensure they're unique
+ var/list/names = list()
+
+ for(var/typepath in subtypesof(/datum/gear))
+ //We do not care about abstract types
+ var/datum/gear/fake_gear_but_is_a_path = typepath
+ if(initial(fake_gear_but_is_a_path.abstract_type) == initial(fake_gear_but_is_a_path.abstract_type))
+ TEST_DEBUG("Not creating [typepath] because it matches the abstract_type")
+ continue
+
+ TEST_DEBUG("Creating [typepath]")
+
+ var/datum/gear/gear_item = new typepath(null)
+
+
+ //Check that we have an unique name
+ TEST_ASSERT(!(gear_item.display_name in names), "The display name of [typepath] is not unique!")
+ names += gear_item.display_name
+
+ //Check that if we areaugment we don't have a slot set
+ if(gear_item.augment)
+ TEST_ASSERT( (isnull(gear_item.slot)), "A slot is defined for gear item [typepath] that is an augment!")
+
+ //Check that allowed_roles and whitelisted are either null or lists
+ TEST_ASSERT( (istype(gear_item.allowed_roles) || isnull(gear_item.allowed_roles)), "The allowed_roles var of [typepath] is neither null nor a list!")
+ TEST_ASSERT( (istype(gear_item.whitelisted) || isnull(gear_item.whitelisted)), "The whitelisted var of [typepath] is neither null nor a list!")
+
+ //Check culture restrictions
+ if(length(gear_item.culture_restriction) || isnull(gear_item.culture_restriction))
+ for(var/whitelisted_culture in gear_item.culture_restriction)
+ if(!ispath(whitelisted_culture, /singleton/origin_item/culture))
+ test_result = TEST_FAIL("The culture_restriction var of [typepath] contains the following element that is not a valid /singleton/origin_item/culture: [whitelisted_culture]!")
+ else
+ test_result = TEST_FAIL("The culture_restriction var of [typepath] is neither null nor a list!")
+
+ //Check origin restriction
+ if(length(gear_item.origin_restriction) || isnull(gear_item.origin_restriction))
+ for(var/whitelisted_culture in gear_item.origin_restriction)
+ if(!ispath(whitelisted_culture, /singleton/origin_item/origin))
+ test_result = TEST_FAIL("The origin_restriction var of [typepath] contains the following element that is not a valid /singleton/origin_item/origin: [whitelisted_culture]!")
+ else
+ test_result = TEST_FAIL("The origin_restriction var of [typepath] is neither null nor a list!")
+
+ //Check that the object can actually spawn
+ TEST_ASSERT(ispath(gear_item.path), "The path of the object to spawn for [typepath] isn't a path!")
+ var/obj/item/actual_item = gear_item.spawn_item(test_mob, list(), test_mob)
+ TEST_ASSERT(!QDELETED(actual_item), "The actual item of [typepath] did not spawn correctly!")
+
+
+ if(test_result == UNIT_TEST_FAILED)
+ return TEST_FAIL("Errors were encountered in the test, read the logs above!")
+ else
+ return TEST_PASS("All loadout gears items (/datum/gear) successfully tested")
diff --git a/code/unit_tests/unit_test.dm b/code/unit_tests/unit_test.dm
index 6b208471b76..9df9f8f4e91 100644
--- a/code/unit_tests/unit_test.dm
+++ b/code/unit_tests/unit_test.dm
@@ -119,9 +119,18 @@ var/ascii_reset = "[ascii_esc]\[0m"
log_unit_test(LOG_UNIT_TEST_WARNING, message, file, line)
/datum/unit_test/proc/fail(var/message, var/file, var/line)
- all_unit_tests_passed = 0
+ SHOULD_CALL_PARENT(TRUE)
+ SHOULD_NOT_SLEEP(TRUE)
+
+ all_unit_tests_passed = FALSE
unit_tests_failures++
- reported = 1
+ reported = TRUE
+
+ //If we're running in manual mode, raise an exception so we can see it in VSC directly
+ #if defined(MANUAL_UNIT_TEST)
+ stack_trace("Unit test failed: [src.name] - Message: [message] @@@ [file]:[line]")
+ #endif
+
log_unit_test(LOG_UNIT_TEST_ERROR, message, file, line)
return UNIT_TEST_FAILED
diff --git a/html/changelogs/fluffyghost-geartweaks.yml b/html/changelogs/fluffyghost-geartweaks.yml
new file mode 100644
index 00000000000..6d71a629309
--- /dev/null
+++ b/html/changelogs/fluffyghost-geartweaks.yml
@@ -0,0 +1,51 @@
+################################
+# 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
+# wip (For works in progress)
+# tweak
+# soundadd
+# sounddel
+# rscadd (general adding of nice things)
+# rscdel (general deleting of nice things)
+# imageadd
+# imagedel
+# maptweak
+# spellcheck (typo fixes)
+# experiment
+# balance
+# admin
+# backend
+# security
+# refactor
+#################################
+
+# 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, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries.
+# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog.
+changes:
+ - backend: "DMDoced gear vars."
+ - backend: "Reordered gears."
+ - backend: "Implemented handling of abstract types for gears."
+ - backend: "Created unit test to check gears."
+ - refactor: "Refactored object attackby and handling of bags pickups."
+ - backend: "DMDoced attackby proc."
+ - backend: "DMDoced and minor refactor of some mob inventory procs."
+ - refactor: "Refactored attackby proc args name."
+ - refactor: "Refactored some attackby procs to not sleep."
+ - refactor: "Refactored a bunch of procs to use tgui inputs instead of native alert/input."
+ - backend: "Unit tests failures will throw an exception if compiled with MANUAL_UNIT_TEST so it's easier to catch them in VSC."
diff --git a/html/changelogs/fluffyghost-smallpr.yml b/html/changelogs/fluffyghost-smallpr.yml
new file mode 100644
index 00000000000..b463b7105e9
--- /dev/null
+++ b/html/changelogs/fluffyghost-smallpr.yml
@@ -0,0 +1,51 @@
+################################
+# 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
+# wip (For works in progress)
+# tweak
+# soundadd
+# sounddel
+# rscadd (general adding of nice things)
+# rscdel (general deleting of nice things)
+# imageadd
+# imagedel
+# maptweak
+# spellcheck (typo fixes)
+# experiment
+# balance
+# admin
+# backend
+# security
+# refactor
+#################################
+
+# 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, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries.
+# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog.
+changes:
+ - refactor: "Refactored attackby function headers."
+ - refactor: "Minor attackby's internal refactors across the codebase."
+ - refactor: "Refactored some attackby to not sleep."
+ - refactor: "Turned various alerts and inputs to tgui inputs to accomplish the no sleep listed above."
+ - refactor: "Refactored large bags pickup to not lag the server to death as much."
+ - backend: "Added spawn gear DMdoc."
+ - backend: "Added some DMdoc to other procs."
+ - backend: "Added spawn gear unit test."
+ - backend: "Modified some spawn gears that were abstract, marking them as abstract."
+ - backend: "Some reordering in general for the spawn gears."
+ - tweak: "Attack message on atoms is only shown if you have harm intent."
diff --git a/maps/away/away_site/blueriver/blueriver.dm b/maps/away/away_site/blueriver/blueriver.dm
index 038443a8642..782b1ceb35f 100644
--- a/maps/away/away_site/blueriver/blueriver.dm
+++ b/maps/away/away_site/blueriver/blueriver.dm
@@ -98,12 +98,12 @@
density = TRUE
anchored = TRUE
-/obj/structure/deity/attackby(obj/item/W as obj, mob/user as mob)
+/obj/structure/deity/attackby(obj/item/attacking_item, mob/user)
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
user.do_attack_animation(src)
user.visible_message(
- "[user] hits \the [src] with \the [W]!",
- "You hit \the [src] with \the [W]!",
+ "[user] hits \the [src] with \the [attacking_item]!",
+ "You hit \the [src] with \the [attacking_item]!",
"You hear something breaking!"
)
diff --git a/maps/away/away_site/romanovich/grand_romanovich.dm b/maps/away/away_site/romanovich/grand_romanovich.dm
index fd1eb4ed80a..5bb56f22272 100644
--- a/maps/away/away_site/romanovich/grand_romanovich.dm
+++ b/maps/away/away_site/romanovich/grand_romanovich.dm
@@ -78,11 +78,11 @@
density = 1
anchored = 1
-/obj/structure/casino/attackby(obj/item/W as obj, mob/user as mob, var/click_parameters)
- if (!W) return
+/obj/structure/casino/attackby(obj/item/attacking_item, mob/user)
+ if (!attacking_item) return
- if(user.unEquip(W, 0, src.loc))
- user.make_item_drop_sound(W)
+ if(user.unEquip(attacking_item, 0, src.loc))
+ user.make_item_drop_sound(attacking_item)
return 1
/obj/item/coin/casino