Gripper attackby fixes (#13571)

This cannot go wrong, can it?
This commit is contained in:
mikomyazaki
2022-04-20 21:15:15 +01:00
committed by GitHub
parent d8497aa4cb
commit e59589ec8a
184 changed files with 975 additions and 894 deletions

View File

@@ -204,21 +204,22 @@
if(istype(W, /obj/item/card/tech_support))
if(!can_reset)
to_chat(user, SPAN_WARNING("You cannot reset this type of device."))
return
return TRUE
if(!enabled)
to_chat(user, SPAN_WARNING("You cannot reset the device if it isn't powered on."))
return
return TRUE
if(!hard_drive)
to_chat(user, SPAN_WARNING("You cannot reset a device that has no hard drive."))
return
return TRUE
enrolled = 0
hard_drive.reset_drive()
audible_message("[icon2html(src, viewers(get_turf(src)))] <b>[src]</b> pings, <span class='notice'>\"Enrollment status reset! Have a NanoTrasen day.\"</span>")
return TRUE
if(istype(W, /obj/item/card/id)) // ID Card, try to insert it.
var/obj/item/card/id/I = W
if(!card_slot)
to_chat(user, SPAN_WARNING("You try to insert \the [I] into \the [src], but it does not have an ID card slot installed."))
return
return TRUE
user.drop_from_inventory(I, src)
if(card_slot.stored_card)
@@ -227,58 +228,61 @@
card_slot.insert_id(I)
update_uis()
to_chat(user, SPAN_NOTICE("You insert \the [I] into \the [src]."))
return
return TRUE
if(is_type_in_list(W, card_slot?.allowed_items))
if(!card_slot)
to_chat(user, SPAN_WARNING("You try to insert \the [W] into \the [src], but it does not have an ID card slot installed."))
return
return TRUE
if(card_slot.stored_item)
to_chat(user, SPAN_WARNING("You try to insert \the [W] into \the [src], but its storage slot is occupied."))
return
return TRUE
user.drop_from_inventory(W, src)
card_slot.stored_item = W
update_uis()
verbs += /obj/item/modular_computer/proc/eject_item
to_chat(user, SPAN_NOTICE("You insert \the [W] into \the [src]."))
return
return TRUE
if(istype(W, /obj/item/paper))
if(!nano_printer)
return
return TRUE
nano_printer.attackby(W, user)
return TRUE
if(istype(W, /obj/item/aicard))
if(!ai_slot)
return
ai_slot.attackby(W, user)
if(ai_slot)
ai_slot.attackby(W, user)
return TRUE
if(istype(W, /obj/item/computer_hardware))
var/obj/item/computer_hardware/C = W
if(C.hardware_size <= max_hardware_size)
try_install_component(user, C)
else
to_chat(user, SPAN_WARNING("This component is too large for \the [src]."))
return TRUE
if(istype(W, /obj/item/device/paicard))
try_install_component(user, W)
return TRUE
if(W.iswrench())
var/list/components = get_all_components()
if(components.len)
to_chat(user, SPAN_WARNING("You have to remove all the components from \the [src] before disassembling it."))
return
return TRUE
to_chat(user, SPAN_NOTICE("You begin to disassemble \the [src]."))
playsound(get_turf(src), W.usesound, 100, TRUE)
if (do_after(user, 20/W.toolspeed))
new /obj/item/stack/material/steel(get_turf(src), steel_sheet_cost)
user.visible_message(SPAN_NOTICE("\The [user] disassembles \the [src]."), SPAN_NOTICE("You disassemble \the [src]."), SPAN_NOTICE("You hear a ratcheting noise."))
qdel(src)
return
return TRUE
if(W.iswelder())
var/obj/item/weldingtool/WT = W
if(!WT.isOn())
to_chat(user, SPAN_WARNING("\The [W] is off."))
return
return TRUE
if(!damage)
to_chat(user, SPAN_WARNING("\The [src] does not require repairs."))
return
return TRUE
to_chat(user, SPAN_NOTICE("You begin repairing the damage to \the [src]..."))
playsound(get_turf(src), 'sound/items/welder.ogg', 100, 1)
@@ -286,26 +290,26 @@
damage = 0
to_chat(user, SPAN_NOTICE("You fully repair \the [src]."))
update_icon()
return
return TRUE
if(W.isscrewdriver())
var/list/all_components = get_all_components()
if(!all_components.len)
to_chat(user, SPAN_WARNING("This device doesn't have any components installed."))
return
return TRUE
var/obj/item/computer_hardware/choice = input(user, "Which component do you want to uninstall?", "Hardware Removal") as null|anything in all_components
if(!choice)
return
return TRUE
if(!Adjacent(usr))
return
return TRUE
var/obj/item/computer_hardware/H = find_hardware_by_name(initial(choice.name))
if(!H)
return
return TRUE
uninstall_component(user, H)
return
..()
return TRUE
return ..()
/obj/item/modular_computer/MouseDrop(atom/over_object)
var/mob/M = usr
@@ -326,4 +330,4 @@
if(!P || (P.program_state == PROGRAM_STATE_KILLED && P.service_state == PROGRAM_STATE_KILLED))
return
if(P.focused_conv)
P.focused_conv.cl_send(P, text, M)
P.focused_conv.cl_send(P, text, M)