[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:
CHOMPStation2
2023-10-04 15:37:41 -07:00
committed by GitHub
parent 00a5f09ad4
commit d2e66e6410
310 changed files with 1035 additions and 944 deletions

View File

@@ -36,12 +36,12 @@
. += "The lid is open."
/obj/machinery/beehive/attackby(var/obj/item/I, var/mob/user)
if(I.is_crowbar())
if(I.has_tool_quality(TOOL_CROWBAR))
closed = !closed
user.visible_message(SPAN_NOTICE("[user] [closed ? "closes" : "opens"] \the [src]."), SPAN_NOTICE("You [closed ? "close" : "open"] \the [src]."))
update_icon()
return
else if(I.is_wrench())
else if(I.has_tool_quality(TOOL_WRENCH))
anchored = !anchored
playsound(src, I.usesound, 50, 1)
user.visible_message(SPAN_NOTICE("[user] [anchored ? "wrenches" : "unwrenches"] \the [src]."), SPAN_NOTICE("You [anchored ? "wrench" : "unwrench"] \the [src]."))
@@ -107,7 +107,7 @@
if(smoked)
to_chat(user, "The hive is smoked.")
return 1
else if(I.is_screwdriver())
else if(I.has_tool_quality(TOOL_SCREWDRIVER))
if(bee_count)
to_chat(user, SPAN_NOTICE("You can't dismantle \the [src] with these bees inside."))
return

View File

@@ -96,7 +96,7 @@
if(default_deconstruction_screwdriver(user, W))
return
if(W.is_wrench())
if(W.has_tool_quality(TOOL_WRENCH))
playsound(src, W.usesound, 100, 1)
to_chat(user, "<span class='notice'>You [anchored ? "un" : ""]secure \the [src].</span>")
anchored = !anchored

View File

@@ -245,7 +245,7 @@
/obj/machinery/seed_storage/tgui_data(mob/user, datum/tgui/ui, datum/tgui_state/state)
var/list/data = ..()
if(smart)
scanner = list("stats", "produce", "soil", "temperature", "light", "pressure")
else
@@ -402,18 +402,18 @@
else
to_chat(user, "<span class='notice'>There are no seeds in \the [O.name].</span>")
return
else if(O.is_wrench())
else if(O.has_tool_quality(TOOL_WRENCH))
playsound(src, O.usesound, 50, 1)
anchored = !anchored
to_chat(user, "<span class ='filter_notice'>You [anchored ? "wrench" : "unwrench"] \the [src].</span>")
else if(O.is_screwdriver())
else if(O.has_tool_quality(TOOL_SCREWDRIVER))
panel_open = !panel_open
to_chat(user, "<span class ='filter_notice'>You [panel_open ? "open" : "close"] the maintenance panel.</span>")
playsound(src, O.usesound, 50, 1)
cut_overlays()
if(panel_open)
add_overlay("[initial(icon_state)]-panel")
else if((O.is_wirecutter() || istype(O, /obj/item/device/multitool)) && panel_open)
else if((O.has_tool_quality(TOOL_WIRECUTTER) || istype(O, /obj/item/device/multitool)) && panel_open)
wires.Interact(user)
/obj/machinery/seed_storage/emag_act(var/remaining_charges, var/mob/user)

View File

@@ -252,7 +252,7 @@
user.setClickCooldown(user.get_attack_speed(W))
SSplants.add_plant(src)
if(W.is_wirecutter() || istype(W, /obj/item/weapon/surgical/scalpel))
if(W.has_tool_quality(TOOL_WIRECUTTER) || istype(W, /obj/item/weapon/surgical/scalpel))
if(sampled)
to_chat(user, "<span class='warning'>\The [src] has already been sampled recently.</span>")
return

View File

@@ -507,7 +507,7 @@
if(O.is_open_container())
return 0
if(O.is_wirecutter() || istype(O, /obj/item/weapon/surgical/scalpel))
if(O.has_tool_quality(TOOL_WIRECUTTER) || istype(O, /obj/item/weapon/surgical/scalpel))
if(!seed)
to_chat(user, "<span class='filter_notice'>There is nothing to take a sample from in \the [src].</span>")
@@ -602,7 +602,7 @@
qdel(O)
check_health()
else if(mechanical && O.is_wrench())
else if(mechanical && O.has_tool_quality(TOOL_WRENCH))
//If there's a connector here, the portable_atmospherics setup can handle it.
if(locate(/obj/machinery/atmospherics/portables_connector/) in loc)