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
+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()