Gripper attackby fixes (#13571)

This cannot go wrong, can it?
This commit is contained in:
mikomyazaki
2022-04-20 22:15:15 +02:00
committed by GitHub
parent d8497aa4cb
commit e59589ec8a
184 changed files with 975 additions and 894 deletions
+14 -11
View File
@@ -410,28 +410,29 @@
user.drop_from_inventory(W, src)
use_internal_tank = 1
START_PROCESSING(SSfast_process, src)
return
else
to_chat(user, "<span class='warning'>[src] already has a tank attached.</span>")
return TRUE
if(opened)
if(istype(W, /obj/item/grab))
var/obj/item/grab/G = W
MouseDrop_T(G.affecting, user)
return 0
return FALSE
if(!W.dropsafety())
return
return FALSE
user.drop_item()
return TRUE
else if(istype(W, /obj/item/handcuffs/cable))
if(zipped)
to_chat(user, "<span class='warning'>[src]'s zipper is already restrained.</span>")
return
return TRUE
user.visible_message(
"<span class='warning'>[user] begins putting cable restrains on zipper of [src].</span>",
"<span class='notice'>You begin putting cable restrains on zipper of [src].</span>"
)
playsound(loc, 'sound/weapons/cablecuff.ogg', 50, 1)
if (!do_after(user, 3 SECONDS, act_target = src, extra_checks = CALLBACK(src, .proc/is_closed)))
return
return TRUE
zipped = !zipped
update_icon()
user.visible_message(
@@ -441,18 +442,19 @@
qdel(W)
update_icon()
return TRUE
else if(W.iswirecutter())
if(!zipped)
to_chat(user, "<span class='warning'>[src] has no cables to cut.</span>")
attack_hand(user)
return
return TRUE
user.visible_message(
"<span class='warning'>[user] begins cutting cable restrains on zipper of [src].</span>",
"<span class='notice'>You begin cutting cable restrains on zipper of [src].</span>"
)
playsound(loc, 'sound/items/wirecutter.ogg', 50, 1)
if (!do_after(user, 3 SECONDS, act_target = src, extra_checks = CALLBACK(src, .proc/is_closed)))
return
return TRUE
zipped = !zipped
update_icon()
user.visible_message(
@@ -461,17 +463,18 @@
)
new/obj/item/handcuffs/cable(src.loc)
update_icon()
return TRUE
else if(istype(W, /obj/item/cell))
if(!isnull(cell))
to_chat(user, "<span class='warning'>[src] already has [cell] attached to it.</span>")
attack_hand(user)
return
return TRUE
user.visible_message(
"<span class='warning'>[user] is attaching [W] to [src].</span>",
"<span class='notice'>You are attaching [W] to [src].</span>"
)
if (!do_after(user, 2 SECONDS, act_target = src))
return
return TRUE
user.visible_message(
"<span class='warning'>[user] has attached [W] to [src].</span>",
"<span class='notice'>You attached [W] to [src].</span>"
@@ -479,9 +482,9 @@
cell = W
cooling = TRUE
user.drop_from_inventory(W, src)
return TRUE
else
attack_hand(user)
return
return attack_hand(user)
/obj/structure/closet/airbubble/store_mobs(var/stored_units)
contains_body = ..()
+2 -1
View File
@@ -8,10 +8,11 @@
flags = CONDUCT
/obj/item/frame/apc/attackby(obj/item/W as obj, mob/user as mob)
..()
if (W.iswrench())
new /obj/item/stack/material/steel( get_turf(src.loc), 2 )
qdel(src)
return TRUE
return ..()
/obj/item/frame/apc/try_build(turf/on_wall)
if (get_dist(on_wall,usr)>1)
+4 -3
View File
@@ -79,9 +79,9 @@
if (W.ispen())
var/t = input(user, "What would you like the label to be?", text("[]", src.name), null) as text
if (user.get_active_hand() != W)
return
return TRUE
if (!in_range(src, user) && src.loc != user)
return
return TRUE
t = sanitizeSafe(t, MAX_NAME_LEN)
if (t)
src.name = "body bag - "
@@ -97,12 +97,13 @@
LAZYADD(overlays, image(icon, "bodybag_label"))
else
src.name = "body bag"
return
return TRUE
else if(W.iswirecutter())
to_chat(user, "You cut the tag off the bodybag.")
playsound(src.loc, 'sound/items/wirecutter.ogg', 50, 1)
src.name = "body bag"
LAZYREMOVE(overlays, image(icon, "bodybag_label"))
return TRUE
/obj/structure/closet/body_bag/store_mobs(var/stored_units)
contains_body = ..()
+10 -8
View File
@@ -17,7 +17,7 @@
I.DrawBox(color, drawX, drawY)
return I
/**
/**
* Interface for easy drawing of one pixel on an atom.
*/
/atom/proc/DrawPixelOn(color, drawX, drawY)
@@ -46,7 +46,7 @@
name = "23px by 23px canvas"
icon_state = "23x23"
/**
/**
* One pixel increments.
*/
/obj/item/canvas/attackby(obj/item/I, mob/user, params)
@@ -56,8 +56,8 @@
if(do_after(user, 40 / I.toolspeed))
user.visible_message("<b>[user]</b> [anchored ? "loosens" : "tightens"] \the [src].", SPAN_NOTICE("You [anchored ? "loosen" : "tighten"] \the [src]."), SPAN_NOTICE("You hear a ratchet."))
anchored = !anchored
return
return TRUE
// Click info.
var/list/click_params = params2list(params)
var/pixX = text2num(click_params["icon-x"])
@@ -65,7 +65,7 @@
// Should always be true, otherwise you didn't click the object, but let's check because SS13~
if(!click_params || !click_params["icon-x"] || !click_params["icon-y"])
return
return TRUE
// Cleaning one pixel with a soap or rag.
if(istype(I, /obj/item/soap) || istype(I, /obj/item/reagent_containers/glass/rag))
@@ -75,21 +75,23 @@
var/icon/Ico = clean_canvas()
if(!Ico)
qdel(masterpiece)
return
return TRUE
var/theOriginalPix = Ico.GetPixel(pixX,pixY)
if(thePix != theOriginalPix) // Clour changed.
DrawPixelOn(theOriginalPix,pixX,pixY)
qdel(masterpiece)
return TRUE
// Drawing one pixel with a crayon.
else if(istype(I, /obj/item/pen/crayon))
var/obj/item/pen/crayon/C = I
DrawPixelOn(C.shadeColour, pixX, pixY)
return TRUE
else
return ..()
/**
/**
* Clean the whole canvas.
*/
/obj/item/canvas/attack_self(mob/user)
@@ -136,4 +138,4 @@
/obj/item/canvas/proc/clean_canvas()
var/icon/I = icon(initial(icon), initial(icon_state))
. = I
. = I
+1
View File
@@ -113,6 +113,7 @@
if(reagents.total_volume <= 0)
user.visible_message("<span class='notice'>[user] finished their crayon!</span>", "<span class='warning'>You ate your crayon!</span>")
qdel(src)
return TRUE
else
..(user, target_zone)
+2 -1
View File
@@ -33,8 +33,9 @@
if(W.isscrewdriver())
in_hack_mode = !in_hack_mode
playsound(src.loc, 'sound/items/screwdriver.ogg', 50, TRUE)
return TRUE
else
..()
return ..()
/obj/item/device/multitool/hacktool/resolve_attackby(atom/A, mob/user)
sanity_check()
@@ -51,15 +51,14 @@
to_chat(user, "<span class='notice'>You install a [diode.name] in [src].</span>")
else
to_chat(user, "<span class='notice'>[src] already has a laser diode.</span>")
return TRUE
else if(W.isscrewdriver())
if(diode)
to_chat(user, "<span class='notice'>You remove the [diode.name] from the [src].</span>")
diode.forceMove(get_turf(user))
diode = null
return
..()
return
return TRUE
/obj/item/device/laser_pointer/afterattack(var/atom/target, var/mob/living/user, flag, params)
if(flag) //we're placing the object on a table or in backpack
@@ -67,7 +67,7 @@
load_interval = 10
max_uses = 30
uses = 0 //Starts empty
/obj/item/device/lightreplacer/New()
failmsg = "The [name]'s refill light blinks red."
..()
@@ -90,7 +90,7 @@
to_chat(user, SPAN_NOTICE("You insert five pieces of glass into the [src]. You have [uses] light\s remaining."))
else
to_chat(user, SPAN_WARNING("You need 5 sheets of glass to replace lights."))
return
return TRUE
if(istype(W, /obj/item/light))
var/obj/item/light/L = W
@@ -102,18 +102,18 @@
qdel(L)
else
to_chat(user, SPAN_WARNING("You need a working light."))
return
return TRUE
if(istype(W, /obj/item/device/lightreplacer))
var/obj/item/device/lightreplacer/LR = W
if(LR.uses == LR.max_uses)
to_chat(user, SPAN_WARNING("\The [LR] is already full!"))
return
return TRUE
var/use_difference = min(LR.max_uses - LR.uses, uses)
AddUses(-use_difference)
LR.AddUses(use_difference)
to_chat(user, SPAN_NOTICE("You transfer the lights from \the [src] to \the [LR]."))
return
return TRUE
/obj/item/device/lightreplacer/afterattack(var/atom/target, var/mob/living/user, proximity, params)
@@ -116,7 +116,7 @@
/obj/item/device/magnetic_lock/attackby(var/obj/item/I, var/mob/user)
if (status == STATUS_BROKEN)
to_chat(user, "<span class='danger'>[src] is broken beyond repair!</span>")
return
return TRUE
if (istype(I, /obj/item/card/id))
if (!constructionstate && !hacked)
@@ -134,7 +134,7 @@
return
else
to_chat(user, "<span class='danger'>You cannot swipe your [I] through [src] with it partially dismantled!</span>")
return
return TRUE
if (istype(I, /obj/item) && user.a_intent == "harm")
if (I.force >= 18)
@@ -142,14 +142,13 @@
takedamage(I.force)
playsound(loc, "sound/weapons/genhit[rand(1,3)].ogg", I.force*3, 1)
addtimer(CALLBACK(GLOBAL_PROC, /proc/playsound, loc, "sound/effects/sparks[rand(1,4)].ogg", 30, 1), 3, TIMER_CLIENT_TIME)
return
else
user.visible_message("<span class='danger'>[user] hits [src] with [I] but fails to damage it.</span>", "<span class='warning'>You hit [src] with [I], [I.force >= 10 ? "and it almost makes a dent!" : "but it appears to have no visible effect."]</span>")
playsound(loc, "sound/weapons/genhit.ogg", I.force*2.5, 1)
return
return TRUE
if(invincible)
return
return TRUE
switch (constructionstate)
if (0)
if (istype(I, /obj/item/card/emag))
@@ -161,7 +160,7 @@
if (target)
detach()
update_icon()
return
return TRUE
if (I.iswelder())
var/obj/item/weldingtool/WT = I
@@ -178,7 +177,7 @@
else
cut_overlay("overlay_welding")
update_icon()
return
return TRUE
if (I.iscrowbar())
if (!locked)
@@ -186,30 +185,30 @@
setconstructionstate(1)
else
to_chat(user, SPAN_NOTICE("You try to pry the cover off [src] but it doesn't budge."))
return
return TRUE
if (1)
if (istype(I, /obj/item/cell))
if (powercell)
to_chat(user, SPAN_NOTICE("There's already a powercell in \the [src]."))
return
return TRUE
if (I.iscrowbar())
to_chat(user, SPAN_NOTICE("You wedge the cover back in place."))
setconstructionstate(0)
return
return TRUE
if (2)
if (I.isscrewdriver())
to_chat(user, SPAN_NOTICE("You unscrew and remove the wiring cover from \the [src]."))
playsound(loc, I.usesound, 50, 1)
setconstructionstate(3)
return
return TRUE
if (I.iscrowbar())
to_chat(user, SPAN_NOTICE("You wedge the cover back in place."))
setconstructionstate(0)
return
return TRUE
if (istype(I, /obj/item/cell))
if (!powercell)
@@ -217,26 +216,26 @@
user.drop_from_inventory(I,src)
powercell = I
setconstructionstate(1)
return
return TRUE
if (3)
if (I.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
return TRUE
if (I.isscrewdriver())
to_chat(user, SPAN_NOTICE("You replace and screw tight the wiring cover from \the [src]."))
playsound(loc, I.usesound, 50, 1)
setconstructionstate(2)
return
return TRUE
if (4)
if (I.iswirecutter())
to_chat(user, SPAN_NOTICE("You repair the wires connecting the [src]'s magnets to their internal powersupply"))
setconstructionstate(3)
return
return TRUE
/obj/item/device/magnetic_lock/process()
if(!processpower)
+5 -5
View File
@@ -48,11 +48,11 @@
/obj/item/device/paicard/attackby(obj/item/C, mob/user)
if(istype(C, /obj/item/card/id))
scan_ID(C, user)
return
return TRUE
else if(istype(C, /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
return TRUE
var/obj/item/device/encryptionkey/EK = C
var/added_channels = FALSE
for(var/thing in (EK.channels | EK.additional_channels))
@@ -68,7 +68,7 @@
to_chat(pai, SPAN_NOTICE("You now have access to these radio channels: [english_list(radio.channels)]."))
else
to_chat(user, SPAN_WARNING("\The [src] would not gain any new channels from \the [EK]."))
return
return TRUE
else if(C.isscrewdriver())
if(!length(installed_encryptionkeys))
to_chat(user, SPAN_WARNING("There are no installed encryption keys to remove!"))
@@ -79,11 +79,11 @@
EK.forceMove(get_turf(src))
installed_encryptionkeys -= EK
recalculateChannels()
return
return TRUE
else if(istype(C, /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
return TRUE
pai.attackby(C, user)
/obj/item/device/paicard/proc/recalculateChannels()
+3 -5
View File
@@ -39,15 +39,13 @@
attached = locate() in T
if(!attached)
to_chat(user, "<span class='warning'>No exposed cable here to attach to.</span>")
return
else
anchored = 1
mode = 1
visible_message("<span class='notice'>\The [user] attaches \the [src] to the cable!</span>")
return
else
to_chat(user, "<span class='warning'>\The [src] must be placed over an exposed cable to attach to it.</span>")
return
return TRUE
else
if (mode == 2)
STOP_PROCESSING(SSprocessing, src)
@@ -59,9 +57,9 @@
icon_state = "powersink0"
item_state = "powersink0"
return
return TRUE
else
..()
return ..()
/obj/item/device/powersink/attack_ai()
return
@@ -134,6 +134,7 @@ var/list/active_radio_jammers = list()
assembly_holder.detached()
user.put_in_hands(cell)
qdel(src)
return TRUE
/obj/item/device/radiojammer/improvised/toggle(mob/user)
if(!active)
@@ -156,4 +157,4 @@ var/list/active_radio_jammers = list()
else
active_radio_jammers -= src
icon_state = initial(icon_state)
STOP_PROCESSING(SSprocessing, src)
STOP_PROCESSING(SSprocessing, src)
+3 -1
View File
@@ -44,8 +44,9 @@
if(istype(W, /obj/item/device/spy_monitor))
var/obj/item/device/spy_monitor/SM = W
SM.pair(src, user)
return TRUE
else
..()
return ..()
/obj/item/device/spy_bug/hear_talk(mob/M, var/msg, verb, datum/language/speaking)
radio.hear_talk(M, msg, speaking)
@@ -90,6 +91,7 @@
/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)
return TRUE
else
return ..()
+3 -3
View File
@@ -31,11 +31,11 @@
C.pixel_y = 0
C.pixel_z = 0
user.visible_message("<b>[user]</b> puts \the [C] on \the [src].", SPAN_NOTICE("You place \the [C] on \the [src]."))
return
return TRUE
if(I.iswrench())
to_chat(user, SPAN_NOTICE("You dismantle \the [src]."))
dismantle()
return
return TRUE
return ..()
/*
@@ -45,4 +45,4 @@
if(painting && Adjacent(painting)) // Only move if it's near us.
painting.forceMove(get_turf(src))
else
painting = null
painting = null
+3 -2
View File
@@ -116,7 +116,7 @@
if(contains == JAR_NOTHING)
contains = JAR_MONEY
if(contains != JAR_MONEY)
return
return TRUE
user.visible_message(SPAN_NOTICE("<b>[user]</b> puts [S.worth] credit\s into \the [src]."))
user.drop_from_inventory(S,src)
update_icon()
@@ -132,7 +132,7 @@
update_icon()
else
to_chat(user, SPAN_WARNING("\The [name] is full!"))
return
return TRUE
if(istype(A, /obj/item/holder))
var/obj/item/holder/H = A
if(H.w_class <= ITEMSIZE_SMALL)
@@ -141,6 +141,7 @@
scoop(H, user)
else
scoop_fail(H, user)
return TRUE
/obj/item/glass_jar/update_icon() // Also updates name and desc
underlays.Cut()
+3 -3
View File
@@ -63,14 +63,14 @@
update_icon()
else
to_chat(user, SPAN_WARNING("Access denied."))
return
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]."))
menu_text = P.info
menu_text = replacetext(menu_text, "color=black>", "color=white>")
update_icon()
return
return TRUE
return ..()
/obj/item/holomenu/examine(mob/user, distance)
@@ -122,4 +122,4 @@
else
to_chat(user, SPAN_WARNING("Access denied."))
return
return ..()
return ..()
+2 -1
View File
@@ -71,6 +71,7 @@
ball = O
to_chat(user, SPAN_NOTICE("You place \the [O] in \the [src]"))
update_icon()
return TRUE
/obj/item/knittingneedles/attack_self(mob/user as mob)
if(!ball) //if there is no yarn ball, nothing happens
@@ -164,4 +165,4 @@
new /obj/item/yarn/blue(src)
new /obj/item/yarn/green(src)
new /obj/item/yarn/purple(src)
new /obj/item/yarn/yellow(src)
new /obj/item/yarn/yellow(src)
+2 -2
View File
@@ -45,7 +45,7 @@
if(istype(H))
species_restricted = list(H.species.get_bodytype())
kit.use(1,user)
return 1
return TRUE
return ..()
/obj/item/clothing/suit/space/void/attackby(var/obj/item/O, var/mob/user)
@@ -64,5 +64,5 @@
if(istype(H))
species_restricted = list(H.species.get_bodytype())
kit.use(1,user)
return 1
return TRUE
return ..()
+3 -3
View File
@@ -21,7 +21,7 @@
if(W.iswelder())
if(hp == initial(hp))
to_chat(user, SPAN_NOTICE("\The [src] is fully repaired."))
return
return TRUE
var/obj/item/weldingtool/WT = W
if(WT.remove_fuel(0, user))
cut_overlays()
@@ -29,7 +29,7 @@
icon = initial(icon)
hp = initial(hp)
to_chat(user, SPAN_NOTICE("You slice off \the [src]'s uneven chunks of steel and scorch marks."))
return
return TRUE
/obj/item/target/attack_hand(var/mob/user)
// taking pinned targets off!
@@ -137,4 +137,4 @@
LAZYADD(Target.bullet_holes, src)
#undef DECAL_SCORCH
#undef DECAL_BULLET
#undef DECAL_BULLET
+1 -6
View File
@@ -65,12 +65,7 @@
/obj/effect/temp_visual/constellation/attackby(obj/item/W as obj, mob/user as mob)
visible_message("<span class='notice'>\The [src] vanishes!</span>")
qdel(src)
return
/obj/effect/temp_visual/constellation/attackby(obj/item/W as obj, mob/user as mob)
visible_message("<span class='notice'>\The [src] vanishes!</span>")
qdel(src)
return
return TRUE
/obj/effect/temp_visual/constellation/attack_hand(mob/user as mob)
if(user.a_intent == I_HURT)
+2 -1
View File
@@ -42,6 +42,7 @@
var/atom/movable/attached_atom = attached.resolve()
if(attached_atom)
attached_atom.attackby(I, user) // don't allow people to make sticker armor
return TRUE
/obj/item/sticker/afterattack(atom/movable/target, mob/user, proximity_flag, click_parameters)
if(!proximity_flag)
@@ -89,4 +90,4 @@
var/obj/item/sticker/S = locate() in src
if(S)
S.remove_sticker(usr)
S.remove_sticker(usr)
+4 -3
View File
@@ -76,8 +76,8 @@
src.desc = "A translucent balloon with some form of liquid sloshing around in it."
to_chat(user, "<span class='notice'>You fill the balloon with the contents of [O].</span>")
O.reagents.trans_to_obj(src, 10)
src.update_icon()
return
src.update_icon()
return TRUE
/obj/item/toy/waterballoon/throw_impact(atom/hit_atom)
if(src.reagents.total_volume >= 1)
@@ -177,6 +177,7 @@
/obj/item/toy/balloon/attackby(obj/item/W as obj, mob/user as mob)
if(W.can_puncture())
burst()
return TRUE
/obj/item/toy/balloon/latex
desc = "Leaves a starchy taste in your mouth after blowing into it."
@@ -1256,4 +1257,4 @@
/obj/item/chess_piece/queen/black
name = "black queen"
icon_state = "black_queen"
icon_state = "black_queen"
+2 -1
View File
@@ -216,6 +216,7 @@
qdel(W)
has_chopsticks = TRUE
update_icon()
return TRUE
/obj/item/trash/ricetub/update_icon()
if(has_chopsticks)
@@ -240,4 +241,4 @@
/obj/item/trash/phoroncandy
name = "\improper phoron rock candy stick"
icon_state = "rock_candy"
icon_state = "rock_candy"
+7 -7
View File
@@ -76,7 +76,7 @@
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
return TRUE
if(W.isscrewdriver()) // Turning it into a crossbow
crafting = !crafting
@@ -85,7 +85,7 @@
else
to_chat(user, SPAN_NOTICE("The RFD can now be modified."))
src.add_fingerprint(user)
return
return TRUE
if(crafting)
var/obj/item/crossbow // the thing we're gonna add, check what it is below
@@ -93,16 +93,16 @@
var/obj/item/crossbowframe/F = W
if(F.buildstate != 5)
to_chat(user, SPAN_WARNING("You need to fully assemble the crossbow frame first!"))
return
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
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
return TRUE
if(C.cell)
to_chat(user, SPAN_WARNING("You need to remove \the [C.cell] from \the [C] before you can attach it to \the [src]."))
return
return TRUE
crossbow = C
if(crossbow)
@@ -113,8 +113,8 @@
user.drop_from_inventory(src)
qdel(src)
user.put_in_hands(CB)
return
..()
return TRUE
return ..()
/obj/item/rfd/proc/useResource(var/amount, var/mob/user)
@@ -320,7 +320,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
var/obj/item/melee/energy/sword/S = W
if(S.active)
light(SPAN_WARNING("[user] swings their [W], barely missing themselves. They light their [name] in the process."))
return
return TRUE
/obj/item/clothing/mask/smokable/cigarette/catch_fire()
if(!lit)
@@ -988,7 +988,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
var/obj/item/clothing/mask/smokable/cigarette/rolled/CR = I
return CR.attackby(src, user)
. = ..()
//tobacco sold seperately if you're too snobby to grow it yourself.
/obj/item/reagent_containers/food/snacks/grown/dried_tobacco
@@ -28,10 +28,12 @@
if(I.isscrewdriver())
open_panel = !open_panel
to_chat(user, "<span class='notice'>You [open_panel ? "open" : "close"] the wire panel.</span>")
return TRUE
else if(I.iswirecutter() || I.ismultitool() || istype(I, /obj/item/device/assembly/signaler ))
wires.Interact(user)
return TRUE
else
..()
return ..()
/obj/item/plastique/attack_self(mob/user as mob)
var/newtime = input(usr, "Please set the timer.", "Timer", 10) as num
@@ -32,7 +32,7 @@
playsound(E.loc, 'sound/items/stimpack.ogg', 50, 1)
else
to_chat(user,"<span class='notice'>\The [E] is full!</span>")
return
return TRUE
. = ..()
@@ -51,7 +51,7 @@
if(W.isscrewdriver() && !is_open_container())
to_chat(user,"<span class='notice'>Using \the [W], you unsecure the extinguisher refill cartridge's lid.</span>") // it locks shut after being secured
flags |= OPENCONTAINER
return
return TRUE
. = ..()
/obj/item/reagent_containers/extinguisher_refill/examine(var/mob/user) //Copied from inhalers.
@@ -157,7 +157,7 @@
playsound(ER.loc, 'sound/items/stimpack.ogg', 50, 1)
else
to_chat(user,"<span class='notice'>\The [src] is full!</span>")
return
return TRUE
. = ..()
+11 -11
View File
@@ -106,7 +106,7 @@
/obj/item/flamethrower/attackby(obj/item/W, mob/user)
if(use_check_and_message(user))
return
return TRUE
if(W.iswrench() && !secured)//Taking this apart
var/turf/T = get_turf(src)
@@ -121,26 +121,26 @@
gas_tank = null
new /obj/item/stack/rods(T)
qdel(src)
return
return TRUE
else if(W.isscrewdriver() && igniter && !lit)
secured = !secured
to_chat(user, SPAN_NOTICE("[igniter] is now [secured ? "secured" : "unsecured"]!"))
update_icon()
return
return TRUE
else if(isigniter(W))
var/obj/item/device/assembly/igniter/I = W
if(I.secured)
to_chat(user, SPAN_WARNING("\The [I] is not ready to attach yet! Use a screwdriver on it first."))
return
return TRUE
if(igniter)
to_chat(user, SPAN_WARNING("\The [src] already has an igniter installed."))
return
return TRUE
user.drop_from_inventory(I, src)
igniter = I
update_icon()
return
return TRUE
else if(istype(W, /obj/item/tank/phoron) || istype(W, /obj/item/tank/hydrogen))
if(gas_tank)
@@ -149,18 +149,18 @@
user.drop_from_inventory(W, src)
gas_tank = W
update_icon()
return
return TRUE
else if(istype(W, /obj/item/device/analyzer))
var/obj/item/device/analyzer/A = W
A.analyze_gases(src, user)
return
return TRUE
else if(W.isFlameSource()) // you can light it with external input, even without an igniter
attempt_lighting(user, TRUE)
update_icon()
return
..()
return TRUE
return ..()
/obj/item/flamethrower/attack_self(mob/user)
@@ -267,4 +267,4 @@
igniter.secured = FALSE
secured = TRUE
gas_tank = new /obj/item/tank/phoron(src)
return ..()
return ..()
+2 -2
View File
@@ -54,8 +54,8 @@
/obj/effect/attackby(obj/item/I, mob/user)
if(istype(I, /obj/item/mop) || istype(I, /obj/item/soap))
return
..()
return FALSE
return ..()
/obj/item/mop/update_icon()
icon_state = "[initial(icon_state)][reagents.total_volume > 1 ? "_wet" : null]"
@@ -209,7 +209,7 @@ var/list/tape_roll_applications = list()
return ..()
/obj/item/tape/attackby(obj/item/W, mob/user)
breaktape(W, user)
return breaktape(W, user)
/obj/item/tape/attack_hand(mob/user)
if(user.a_intent == I_HELP)
@@ -253,3 +253,4 @@ var/list/tape_roll_applications = list()
cur = get_step(cur,dir[i])
qdel(src)
return TRUE
+2 -2
View File
@@ -38,8 +38,8 @@
var/obj/item/key/K = I
key_data = K.key_data
update_icon()
return
..()
return TRUE
return ..()
/obj/item/soap/update_icon()
overlays.Cut()
@@ -40,7 +40,7 @@
/obj/item/storage/bible/attackby(obj/item/W as obj, mob/user as mob)
if(src.use_sound)
playsound(src.loc, src.use_sound, 50, 1, -5)
..()
return ..()
/obj/item/storage/bible/proc/Set_Religion(mob/user)
if(use_check(user))
@@ -84,7 +84,7 @@
/obj/item/watertank/attackby(obj/item/W, mob/user, params)
if(W == noz)
remove_noz()
return 1
return TRUE
else
return ..()
+14 -13
View File
@@ -336,17 +336,17 @@
if(W.isscrewdriver())
if(isrobot(loc))
to_chat(user, SPAN_ALERT("You cannot modify your own welder!"))
return
return TRUE
if(welding)
to_chat(user, SPAN_DANGER("Stop welding first!"))
return
return TRUE
status = !status
if(status)
to_chat(user, SPAN_NOTICE("You secure the welder."))
else
to_chat(user, SPAN_NOTICE("The welder can now be attached and modified."))
add_fingerprint(user)
return
return TRUE
if(!status && (istype(W, /obj/item/stack/rods)))
var/obj/item/stack/rods/R = W
@@ -355,10 +355,9 @@
user.drop_from_inventory(src)
var/obj/item/flamethrower/F = new /obj/item/flamethrower(get_turf(src), src)
user.put_in_hands(F)
return
return TRUE
..()
return
return ..()
/obj/item/weldingtool/process()
if(welding)
@@ -607,26 +606,26 @@
if(istype(I, /obj/item/eyeshield))
if(eyeshield)
to_chat(user, SPAN_WARNING("\The [src] already has an eye shield installed!"))
return
return TRUE
user.drop_from_inventory(I, src)
to_chat(user, SPAN_NOTICE("You install \the [I] into \the [src]."))
eyeshield = I
add_overlay("eyeshield_attached", TRUE)
return
return TRUE
if(istype(I, /obj/item/overcapacitor))
if(overcap)
to_chat(user, SPAN_WARNING("\The [src] already has an overcapacitor installed!"))
return
return TRUE
user.drop_from_inventory(I, src)
to_chat(user, SPAN_NOTICE("You install \the [I] into \the [src]."))
overcap = I
add_overlay("overcap_attached", TRUE)
toolspeed *= 2
return
return TRUE
if(I.isscrewdriver())
if(!eyeshield && !overcap)
to_chat(user, SPAN_WARNING("\The [src] doesn't have any accessories to remove!"))
return
return TRUE
var/list/accessories = list()
if(eyeshield)
var/image/radial_button = image(icon = src.icon, icon_state = "eyeshield")
@@ -644,11 +643,11 @@
overcap = null
toolspeed *= 0.5
if(!remove_accessory)
return
return TRUE
user.put_in_hands(remove_accessory)
to_chat(user, SPAN_NOTICE("You remove \the [remove_accessory] into \the [src]."))
cut_overlay("[remove_accessory.icon_state]_attached", TRUE)
return
return TRUE
return ..()
//Make sure the experimental tool only stops processing when its turned off AND full
@@ -916,12 +915,14 @@
/obj/item/steelwool/attackby(obj/item/W, mob/user)
if(W.isFlameSource())
ignite(W, user)
return TRUE
else if(istype(W, /obj/item/cell))
var/obj/item/cell/S = W
if(S.charge)
ignite(W, user)
else
to_chat(user, SPAN_WARNING("The cell isn't charged!"))
return TRUE
/obj/item/steelwool/fire_act()
ignite()