a small addition

This commit is contained in:
Geevies
2020-04-15 19:58:18 +02:00
parent 21deec90c3
commit 94579a73bf
65 changed files with 1200 additions and 1223 deletions

View File

@@ -4,12 +4,7 @@
set category = "Object"
set src in view(1)
if(usr.incapacitated() || !istype(usr, /mob/living))
to_chat(usr, "<span class='warning'>You can't do that.</span>")
return
if(!Adjacent(usr))
to_chat(usr, "<span class='warning'>You can't reach it.</span>")
if(use_check_and_message(usr))
return
proc_eject_id(usr)
@@ -20,12 +15,7 @@
set category = "Object"
set src in view(1)
if(usr.incapacitated() || !istype(usr, /mob/living))
to_chat(usr, "<span class='warning'>You can't do that.</span>")
return
if(!Adjacent(usr))
to_chat(usr, "<span class='warning'>You can't reach it.</span>")
if(use_check_and_message(usr))
return
proc_eject_usb(usr)
@@ -35,12 +25,7 @@
set category = "Object"
set src in view(1)
if(usr.incapacitated() || !istype(usr, /mob/living))
to_chat(usr, "<span class='warning'>You can't do that.</span>")
return
if(!Adjacent(usr))
to_chat(usr, "<span class='warning'>You can't reach it.</span>")
if(use_check_and_message(usr))
return
proc_eject_ai(usr)
@@ -50,25 +35,25 @@
user = usr
if(!card_slot)
to_chat(user, "\The [src] does not have an ID card slot")
to_chat(user, SPAN_WARNING("\The [src] does not have an ID card slot."))
return
if(!card_slot.stored_card)
to_chat(user, "There is no card in \the [src]")
to_chat(user, SPAN_WARNING("There is no card in \the [src]."))
return
if(active_program)
active_program.event_idremoved(0)
active_program.event_idremoved(FALSE)
for(var/datum/computer_file/program/P in idle_threads)
P.event_idremoved(1)
P.event_idremoved(TRUE)
if(ishuman(user))
user.put_in_hands(card_slot.stored_card)
else
card_slot.stored_card.forceMove(get_turf(src))
card_slot.stored_card = null
update_uis()
to_chat(user, "You remove the card from \the [src]")
to_chat(user, SPAN_NOTICE("You remove the card from \the [src]."))
/obj/item/modular_computer/proc/proc_eject_usb(mob/user)
@@ -76,7 +61,7 @@
user = usr
if(!portable_drive)
to_chat(user, "There is no portable device connected to \the [src].")
to_chat(user, SPAN_WARNING("There is no portable drive connected to \the [src]."))
return
uninstall_component(user, portable_drive)
@@ -86,8 +71,12 @@
if(!user)
user = usr
if(!ai_slot || !ai_slot.stored_card)
to_chat(user, "There is no intellicard connected to \the [src].")
if(!ai_slot)
to_chat(user, SPAN_WARNING("\The [src] doesn't have an intellicard slot."))
return
if(!ai_slot.stored_card)
to_chat(user, SPAN_WARNING("There is no intellicard connected to \the [src]."))
return
if(ishuman(user))
@@ -123,33 +112,33 @@
else if(!enabled && screen_on)
turn_on(user)
/obj/item/modular_computer/attackby(var/obj/item/W as obj, var/mob/user as mob)
/obj/item/modular_computer/attackby(obj/item/W, mob/user)
if(istype(W, /obj/item/card/tech_support))
if(!can_reset)
to_chat(user, span("notice", "You cannot reset this type of device."))
to_chat(user, SPAN_WARNING("You cannot reset this type of device."))
return
if(!enabled)
to_chat(user, span("notice", "You cannot reset the device if it isn't powered on."))
to_chat(user, SPAN_WARNING("You cannot reset the device if it isn't powered on."))
return
if(!hard_drive)
to_chat(user, span("notice", "You cannot reset a device that has no hard drive."))
to_chat(user, SPAN_WARNING("You cannot reset a device that has no hard drive."))
return
enrolled = 0
enrolled = FALSE
hard_drive.reset_drive()
visible_message("\icon[src.icon] <b>[src]</b> pings, <span class='notice'>\"Enrollment status reset! Have a NanoTrasen day.\"</span>")
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, "You try to insert \the [I] into \the [src], but it does not have an ID card slot installed.")
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
if(card_slot.stored_card)
to_chat(user, SPAN_WARNING("You try to insert \the [I] into \the [src], but its ID card slot is occupied."))
return
if(card_slot.stored_card)
to_chat(user, "You try to insert \the [I] into \the [src], but it's ID card slot is occupied.")
return
user.drop_from_inventory(I,src)
user.drop_from_inventory(I, src)
card_slot.stored_card = I
update_uis()
to_chat(user, "You insert \the [I] into \the [src].")
to_chat(user, SPAN_NOTICE("You insert \the [I] into \the [src]."))
return
if(istype(W, /obj/item/paper))
if(!nano_printer)
@@ -164,63 +153,59 @@
if(C.hardware_size <= max_hardware_size)
try_install_component(user, C)
else
to_chat(user, "This component is too large for \the [src].")
to_chat(user, SPAN_WARNING("This component is too large for \the [src]."))
if(W.iswrench())
var/list/components = get_all_components()
if(components.len)
to_chat(user, "Remove all components from \the [src] before disassembling it.")
to_chat(user, SPAN_WARNING("You have to remove all the components from \the [src] before disassembling it."))
return
to_chat(user, span("notice", "You begin to disassemble \the [src]."))
playsound(user, W.usesound, 100, 1)
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.loc), steel_sheet_cost)
src.visible_message("\The [user] disassembles \the [src].",
"You disassemble \the [src].",
"You hear a ratchet.")
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
if(W.iswelder())
var/obj/item/weldingtool/WT = W
if(!WT.isOn())
to_chat(user, "\The [W] is off.")
to_chat(user, SPAN_WARNING("\The [W] is off."))
return
if(!damage)
to_chat(user, "\The [src] does not require repairs.")
to_chat(user, SPAN_WARNING("\The [src] does not require repairs."))
return
to_chat(user, "You begin repairing damage to \the [src]...")
playsound(src, 'sound/items/Welder.ogg', 100, 1)
if(WT.remove_fuel(round(damage/75)) && do_after(usr, damage/10))
to_chat(user, SPAN_NOTICE("You begin repairing the damage to \the [src]..."))
playsound(get_turf(src), 'sound/items/Welder.ogg', 100, 1)
if(WT.remove_fuel(round(damage / 75)) && do_after(user, damage / 10))
damage = 0
to_chat(user, "You repair \the [src].")
to_chat(user, SPAN_NOTICE("You fully repair \the [src]."))
update_icon()
return
if(W.isscrewdriver())
var/list/all_components = get_all_components()
if(!all_components.len)
to_chat(user, "This device doesn't have any components installed.")
to_chat(user, SPAN_WARNING("This device doesn't have any components installed."))
return
var/list/component_names = list()
for(var/obj/item/computer_hardware/H in all_components)
component_names.Add(H.name)
var/choice = input(usr, "Which component do you want to uninstall?", "Computer maintenance", null) as null|anything in component_names
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
if(!Adjacent(usr))
return
var/obj/item/computer_hardware/H = find_hardware_by_name(choice)
var/obj/item/computer_hardware/H = find_hardware_by_name(initial(choice.name))
if(!H)
return
uninstall_component(user, H)
return
..()
/obj/item/modular_computer/MouseDrop(atom/over_object)
var/mob/M = usr
if(use_check_and_message(M))
return
if(!istype(over_object, /obj/screen) && !(over_object == src))
return attack_self(M)