mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
[MIRROR] Refactors tool typechecks, refactors transforming tools, makes Altevian wrench into one (#7062)
Co-authored-by: Heroman3003 <31296024+Heroman3003@users.noreply.github.com> Co-authored-by: Nadyr <41974248+Darlantanis@users.noreply.github.com>
This commit is contained in:
@@ -271,7 +271,7 @@
|
||||
return
|
||||
|
||||
/obj/structure/closet/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(W.is_wrench())
|
||||
if(W.has_tool_quality(TOOL_WRENCH))
|
||||
if(opened)
|
||||
if(anchored)
|
||||
user.visible_message("\The [user] begins unsecuring \the [src] from the floor.", "You start unsecuring \the [src] from the floor.")
|
||||
@@ -291,8 +291,8 @@
|
||||
return 0
|
||||
if(istype(W,/obj/item/tk_grab))
|
||||
return 0
|
||||
if(istype(W, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
if(W.has_tool_quality(TOOL_WELDER))
|
||||
var/obj/item/weapon/weldingtool/WT = W.get_welder()
|
||||
if(!WT.remove_fuel(0,user))
|
||||
if(!WT.isOn())
|
||||
return
|
||||
@@ -326,8 +326,8 @@
|
||||
else if(seal_tool)
|
||||
if(istype(W, seal_tool))
|
||||
var/obj/item/weapon/S = W
|
||||
if(istype(S, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/WT = S
|
||||
if(S.has_tool_quality(TOOL_WELDER))
|
||||
var/obj/item/weapon/weldingtool/WT = S.get_welder()
|
||||
if(!WT.remove_fuel(0,user))
|
||||
if(!WT.isOn())
|
||||
return
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
icon_state = icon_closed
|
||||
|
||||
/obj/structure/closet/secure_closet/egg/attackby(obj/item/weapon/W, mob/user as mob) //This also prevents crew from welding the eggs and making them unable to be opened.
|
||||
if(istype(W, /obj/item/weapon/weldingtool))
|
||||
if(W.has_tool_quality(TOOL_WELDER))
|
||||
src.dump_contents()
|
||||
qdel(src)
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
to_chat(user, "<span class='notice'>Access Denied</span>")
|
||||
|
||||
/obj/structure/closet/secure_closet/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(W.is_wrench())
|
||||
if(W.has_tool_quality(TOOL_WRENCH))
|
||||
if(opened)
|
||||
if(anchored)
|
||||
user.visible_message("\The [user] begins unsecuring \the [src] from the floor.", "You start unsecuring \the [src] from the floor.")
|
||||
@@ -91,7 +91,7 @@
|
||||
spark_system.start()
|
||||
playsound(src, 'sound/weapons/blade1.ogg', 50, 1)
|
||||
playsound(src, "sparks", 50, 1)
|
||||
else if(istype(W,/obj/item/weapon/packageWrap) || istype(W,/obj/item/weapon/weldingtool))
|
||||
else if(istype(W,/obj/item/weapon/packageWrap) || W.has_tool_quality(TOOL_WELDER))
|
||||
return ..(W,user)
|
||||
else
|
||||
togglelock(user)
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
src.set_dir(turn(src.dir, 90))
|
||||
|
||||
/obj/structure/closet/crate/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(W.is_wrench() && istype(src,/obj/structure/closet/crate/bin))
|
||||
if(W.has_tool_quality(TOOL_WRENCH) && istype(src,/obj/structure/closet/crate/bin))
|
||||
return ..()
|
||||
else if(opened)
|
||||
if(isrobot(user))
|
||||
@@ -117,7 +117,7 @@
|
||||
user.drop_item()
|
||||
W.forceMove(src)
|
||||
return
|
||||
else if(W.is_wirecutter())
|
||||
else if(W.has_tool_quality(TOOL_WIRECUTTER))
|
||||
if(rigged)
|
||||
to_chat(user , "<span class='notice'>You cut away the wiring.</span>")
|
||||
playsound(src, W.usesound, 100, 1)
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
var/turf/T = get_turf(src)
|
||||
if(!T)
|
||||
to_chat(user, "<span class='notice'>You can't open this here!</span>")
|
||||
if(W.is_crowbar())
|
||||
if(W.has_tool_quality(TOOL_CROWBAR))
|
||||
new /obj/item/stack/material/wood(src)
|
||||
|
||||
for(var/atom/movable/AM in contents)
|
||||
@@ -55,7 +55,7 @@
|
||||
icon_state = "vehiclecrate"
|
||||
|
||||
/obj/structure/largecrate/hoverpod/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(W.is_crowbar())
|
||||
if(W.has_tool_quality(TOOL_CROWBAR))
|
||||
var/obj/item/mecha_parts/mecha_equipment/ME
|
||||
var/obj/mecha/working/hoverpod/H = new (loc)
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
desc = "You hear chirping and cawing inside the crate. It sounds like there are a lot of birds in there..."
|
||||
|
||||
/obj/structure/largecrate/birds/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(W.is_crowbar())
|
||||
if(W.has_tool_quality(TOOL_CROWBAR))
|
||||
new /obj/item/stack/material/wood(src)
|
||||
new /mob/living/simple_mob/animal/passive/bird(src)
|
||||
new /mob/living/simple_mob/animal/passive/bird/parrot/kea(src)
|
||||
|
||||
@@ -31,11 +31,11 @@
|
||||
var/turf/T = get_turf(src)
|
||||
if(!T)
|
||||
to_chat(user, "<span class='notice'>You can't open this here!</span>")
|
||||
if(W.is_wrench() && do_after(user, 60 * W.toolspeed, src))
|
||||
if(W.has_tool_quality(TOOL_WRENCH) && do_after(user, 60 * W.toolspeed, src))
|
||||
playsound(src, W.usesound, 50, 1)
|
||||
disassemble(W, user)
|
||||
user.visible_message("<span class='notice'>[user] begins loosening \the [src]'s bolts.</span>")
|
||||
if(W.is_wirecutter() && do_after(user, 70 * W.toolspeed, src))
|
||||
if(W.has_tool_quality(TOOL_WIRECUTTER) && do_after(user, 70 * W.toolspeed, src))
|
||||
playsound(src, W.usesound, 50, 1)
|
||||
disassemble(W, user)
|
||||
user.visible_message("<span class='notice'>[user] begins cutting \the [src]'s bolts.</span>")
|
||||
|
||||
Reference in New Issue
Block a user