Moves almost all wrench checks in attackby to wrench_act() (#25687)

* wrench a bunch of acts

* atmospherics

* some last few things

* last iswrench changes for anything that isn't construction

* Update code/game/machinery/pipe/pipe_construction.dm

Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
Signed-off-by: Luc <89928798+lewcc@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
Signed-off-by: Luc <89928798+lewcc@users.noreply.github.com>

* thank you dgamer

* oopsie daisy

* tests and addresses some introduced bugs

* proper testing

* proper ci

* Update code/game/objects/structures/fluff.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
Signed-off-by: Luc <89928798+lewcc@users.noreply.github.com>

* Update code/game/objects/structures/fluff.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
Signed-off-by: Luc <89928798+lewcc@users.noreply.github.com>

* thank you burza 🙏

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
Signed-off-by: Luc <89928798+lewcc@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
Signed-off-by: DGamerL <108773801+DGamerL@users.noreply.github.com>

* Update code/modules/recycling/disposal-construction.dm

Signed-off-by: DGamerL <108773801+DGamerL@users.noreply.github.com>

---------

Signed-off-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
This commit is contained in:
Luc
2024-07-30 13:51:00 +00:00
committed by GitHub
co-authored by DGamerL Burzah
parent 2411c62392
commit 495afc5e60
32 changed files with 474 additions and 483 deletions
+10 -11
View File
@@ -29,17 +29,16 @@
. = ..()
. += "<span class='warning'>You can <b>Alt-Click</b> [src] to activate it.</span>"
/obj/structure/chair/e_chair/attackby(obj/item/W as obj, mob/user as mob, params)
if(istype(W, /obj/item/wrench))
var/obj/structure/chair/C = new /obj/structure/chair(loc)
playsound(loc, W.usesound, 50, 1)
C.dir = dir
part.loc = loc
part.master = null
part = null
qdel(src)
return
return ..()
/obj/structure/chair/e_chair/wrench_act(mob/user, obj/item/I)
. = TRUE
var/obj/structure/chair/C = new /obj/structure/chair(loc)
I.play_tool_sound(src, 50)
C.dir = dir
part.loc = loc
part.master = null
part = null
visible_message("<span class='warning'>[user] deconstructs [src].</span>")
qdel(src)
/obj/structure/chair/e_chair/AltClick(mob/user)
if(user.stat || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED) || !Adjacent(user))
+26 -15
View File
@@ -82,24 +82,35 @@
update_icon(UPDATE_OVERLAYS)
else
to_chat(user, fail_msg)
else if(istype(I, /obj/item/wrench))
if(!anchored && !isinspace())
playsound(src.loc, I.usesound, 50, 1)
user.visible_message( \
"[user] tightens \the [src]'s casters.", \
"<span class='notice'> You have tightened \the [src]'s casters.</span>", \
"You hear ratchet.")
anchored = TRUE
else if(anchored)
playsound(src.loc, I.usesound, 50, 1)
user.visible_message( \
"[user] loosens \the [src]'s casters.", \
"<span class='notice'> You have loosened \the [src]'s casters.</span>", \
"You hear ratchet.")
anchored = FALSE
else
to_chat(usr, "<span class='warning'>You cannot interface your modules [src]!</span>")
/obj/structure/engineeringcart/tool_act(mob/living/user, obj/item/I, tool_type)
if(I.is_robot_module())
to_chat(user, "<span class='warning'>You cannot interface your modules [src]!</span>")
return FALSE
return ..()
/obj/structure/engineeringcart/wrench_act(mob/living/user, obj/item/I)
if(!anchored && !isinspace())
I.play_tool_sound(src, I.tool_volume)
user.visible_message(
"[user] tightens [src]'s casters.",
"<span class='notice'>You have tightened [src]'s casters.</span>",
"You hear ratchet."
)
anchored = TRUE
else if(anchored)
I.play_tool_sound(src, I.tool_volume)
user.visible_message(
"[user] loosens [src]'s casters.",
"<span class='notice'> You have loosened [src]'s casters.</span>",
"You hear ratchet."
)
anchored = FALSE
return TRUE
/obj/structure/engineeringcart/attack_hand(mob/user)
var/list/engicart_items = list()
+12 -11
View File
@@ -10,17 +10,18 @@
opacity = FALSE
var/deconstructible = TRUE
/obj/structure/fluff/attackby(obj/item/I, mob/living/user, params)
if(istype(I, /obj/item/wrench) && deconstructible)
user.visible_message("<span class='notice'>[user] starts disassembling [src]...</span>", "<span class='notice'>You start disassembling [src]...</span>")
playsound(loc, I.usesound, 50, 1)
if(do_after(user, 5 SECONDS * I.toolspeed, target = src))
user.visible_message("<span class='notice'>[user] disassembles [src]!</span>", "<span class='notice'>You break down [src] into scrap metal.</span>")
playsound(user, 'sound/items/deconstruct.ogg', 50, 1)
new /obj/item/stack/sheet/metal(drop_location())
qdel(src)
return
return ..()
/obj/structure/fluff/wrench_act(mob/living/user, obj/item/I)
if(!deconstructible)
return FALSE
user.visible_message("<span class='notice'>[user] starts disassembling [src]...</span>", "<span class='notice'>You start disassembling [src]...</span>")
playsound(loc, I.usesound, 50, TRUE)
if(I.use_tool(src, user, 5 SECONDS, 0, 50))
user.visible_message("<span class='notice'>[user] disassembles [src]!</span>", "<span class='notice'>You break down [src] into scrap metal.</span>")
playsound(user, 'sound/items/deconstruct.ogg', 50, TRUE)
new /obj/item/stack/sheet/metal(drop_location())
qdel(src)
return TRUE
/// Empty terrariums are created when a preserved terrarium in a lavaland seed vault is activated.
/obj/structure/fluff/empty_terrarium
+11 -9
View File
@@ -10,17 +10,19 @@
anchored = TRUE
max_integrity = 200
/obj/structure/kitchenspike_frame/wrench_act(mob/living/user, obj/item/I)
if(!I.tool_use_check(user, 0))
return FALSE
TOOL_ATTEMPT_DISMANTLE_MESSAGE
if(!I.use_tool(src, user, 4 SECONDS, volume = I.tool_volume))
return TRUE
TOOL_DISMANTLE_SUCCESS_MESSAGE
deconstruct(TRUE)
return TRUE
/obj/structure/kitchenspike_frame/attackby(obj/item/I, mob/user, params)
add_fingerprint(user)
if(istype(I, /obj/item/wrench))
if(!I.tool_use_check(user, 0))
return
TOOL_ATTEMPT_DISMANTLE_MESSAGE
if(!I.use_tool(src, user, 40, volume = I.tool_volume))
return
TOOL_DISMANTLE_SUCCESS_MESSAGE
deconstruct(TRUE)
else if(istype(I, /obj/item/stack/rods))
if(istype(I, /obj/item/stack/rods))
var/obj/item/stack/rods/R = I
if(R.get_amount() >= 4)
R.use(4)
+11 -9
View File
@@ -103,17 +103,19 @@
if(istype(I, /obj/item/tank/internals/plasma))
try_insert_tank(user, stored_plasma_tanks, I)
return
if(istype(I, /obj/item/wrench))
if(anchored)
to_chat(user, "<span class='notice'>You lean down and unwrench [src].</span>")
anchored = FALSE
else
to_chat(user, "<span class='notice'>You wrench [src] into place.</span>")
anchored = TRUE
return
return ..()
/obj/structure/dispenser/wrench_act(mob/living/user, obj/item/I)
I.play_tool_sound(src, 50)
if(anchored)
to_chat(user, "<span class='notice'>You lean down and unwrench [src].</span>")
anchored = FALSE
else
to_chat(user, "<span class='notice'>You wrench [src] into place.</span>")
anchored = TRUE
return TRUE
/// Called when the user clicks on the oxygen or plasma tank UI buttons, and tries to withdraw a tank.
/obj/structure/dispenser/proc/try_remove_tank(mob/living/user, list/tank_list)
if(!LAZYLEN(tank_list))