This commit is contained in:
Guti
2024-09-09 02:36:53 +02:00
parent 7ddba46758
commit 409aaba802
2375 changed files with 61869 additions and 61871 deletions
@@ -55,7 +55,7 @@
/obj/item/modular_computer/Destroy()
kill_program(1)
STOP_PROCESSING(SSobj, src)
for(var/obj/item/weapon/computer_hardware/CH in src.get_all_components())
for(var/obj/item/computer_hardware/CH in src.get_all_components())
uninstall_component(null, CH)
qdel(CH)
return ..()
@@ -9,7 +9,7 @@
visible_message("\The [src] breaks apart!")
var/turf/newloc = get_turf(src)
new /obj/item/stack/material/steel(newloc, round(steel_sheet_cost/2))
for(var/obj/item/weapon/computer_hardware/H in get_all_components())
for(var/obj/item/computer_hardware/H in get_all_components())
uninstall_component(null, H)
H.forceMove(newloc)
if(prob(25))
@@ -26,7 +26,7 @@
damage = between(0, damage, max_damage)
if(component_probability)
for(var/obj/item/weapon/computer_hardware/H in get_all_components())
for(var/obj/item/computer_hardware/H in get_all_components())
if(prob(component_probability))
H.take_damage(round(amount / 2))
@@ -1,49 +1,49 @@
// Attempts to install the hardware into apropriate slot.
/obj/item/modular_computer/proc/try_install_component(var/mob/living/user, var/obj/item/weapon/computer_hardware/H, var/found = 0)
/obj/item/modular_computer/proc/try_install_component(var/mob/living/user, var/obj/item/computer_hardware/H, var/found = 0)
// "USB" flash drive.
if(istype(H, /obj/item/weapon/computer_hardware/hard_drive/portable))
if(istype(H, /obj/item/computer_hardware/hard_drive/portable))
if(portable_drive)
to_chat(user, "This computer's portable drive slot is already occupied by \the [portable_drive].")
return
found = 1
portable_drive = H
else if(istype(H, /obj/item/weapon/computer_hardware/hard_drive))
else if(istype(H, /obj/item/computer_hardware/hard_drive))
if(hard_drive)
to_chat(user, "This computer's hard drive slot is already occupied by \the [hard_drive].")
return
found = 1
hard_drive = H
else if(istype(H, /obj/item/weapon/computer_hardware/network_card))
else if(istype(H, /obj/item/computer_hardware/network_card))
if(network_card)
to_chat(user, "This computer's network card slot is already occupied by \the [network_card].")
return
found = 1
network_card = H
else if(istype(H, /obj/item/weapon/computer_hardware/nano_printer))
else if(istype(H, /obj/item/computer_hardware/nano_printer))
if(nano_printer)
to_chat(user, "This computer's nano printer slot is already occupied by \the [nano_printer].")
return
found = 1
nano_printer = H
else if(istype(H, /obj/item/weapon/computer_hardware/card_slot))
else if(istype(H, /obj/item/computer_hardware/card_slot))
if(card_slot)
to_chat(user, "This computer's card slot is already occupied by \the [card_slot].")
return
found = 1
card_slot = H
else if(istype(H, /obj/item/weapon/computer_hardware/battery_module))
else if(istype(H, /obj/item/computer_hardware/battery_module))
if(battery_module)
to_chat(user, "This computer's battery slot is already occupied by \the [battery_module].")
return
found = 1
battery_module = H
else if(istype(H, /obj/item/weapon/computer_hardware/processor_unit))
else if(istype(H, /obj/item/computer_hardware/processor_unit))
if(processor_unit)
to_chat(user, "This computer's processor slot is already occupied by \the [processor_unit].")
return
found = 1
processor_unit = H
else if(istype(H, /obj/item/weapon/computer_hardware/tesla_link))
else if(istype(H, /obj/item/computer_hardware/tesla_link))
if(tesla_link)
to_chat(user, "This computer's tesla link slot is already occupied by \the [tesla_link].")
return
@@ -57,7 +57,7 @@
update_verbs()
// Uninstalls component. Found and Critical vars may be passed by parent types, if they have additional hardware.
/obj/item/modular_computer/proc/uninstall_component(var/mob/living/user, var/obj/item/weapon/computer_hardware/H, var/found = 0, var/critical = 0)
/obj/item/modular_computer/proc/uninstall_component(var/mob/living/user, var/obj/item/computer_hardware/H, var/found = 0, var/critical = 0)
if(portable_drive == H)
portable_drive = null
found = 1
@@ -120,9 +120,9 @@
else if(!enabled && screen_on)
turn_on(user)
/obj/item/modular_computer/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
if(istype(W, /obj/item/weapon/card/id)) // ID Card, try to insert it.
var/obj/item/weapon/card/id/I = W
/obj/item/modular_computer/attackby(var/obj/item/W as obj, var/mob/user as mob)
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.")
return
@@ -136,12 +136,12 @@
update_uis()
to_chat(user, "You insert \the [I] into \the [src].")
return
if(istype(W, /obj/item/weapon/paper) || istype(W, /obj/item/weapon/paper_bundle))
if(istype(W, /obj/item/paper) || istype(W, /obj/item/paper_bundle))
if(!nano_printer)
return
nano_printer.attackby(W, user)
if(istype(W, /obj/item/weapon/computer_hardware))
var/obj/item/weapon/computer_hardware/C = W
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
@@ -156,7 +156,7 @@
qdel(src)
return
if(W.has_tool_quality(TOOL_WELDER))
var/obj/item/weapon/weldingtool/WT = W.get_welder()
var/obj/item/weldingtool/WT = W.get_welder()
if(!WT.isOn())
to_chat(user, "\The [W] is off.")
return
@@ -177,7 +177,7 @@
to_chat(user, "This device doesn't have any components installed.")
return
var/list/component_names = list()
for(var/obj/item/weapon/computer_hardware/H in all_components)
for(var/obj/item/computer_hardware/H in all_components)
component_names.Add(H.name)
var/choice = tgui_input_list(usr, "Which component do you want to uninstall?", "Computer maintenance", component_names)
@@ -188,7 +188,7 @@
if(!Adjacent(usr))
return
var/obj/item/weapon/computer_hardware/H = find_hardware_by_name(choice)
var/obj/item/computer_hardware/H = find_hardware_by_name(choice)
if(!H)
return
@@ -44,7 +44,7 @@
// Handles power-related things, such as battery interaction, recharging, shutdown when it's discharged
/obj/item/modular_computer/proc/handle_power()
var/power_usage = screen_on ? base_active_power_usage : base_idle_power_usage
for(var/obj/item/weapon/computer_hardware/H in get_all_components())
for(var/obj/item/computer_hardware/H in get_all_components())
if(H.enabled)
power_usage += H.power_usage
last_power_usage = power_usage
@@ -38,9 +38,9 @@
data["device_theme"] = device_theme
data["login"] = list()
var/obj/item/weapon/computer_hardware/card_slot/cardholder = card_slot
var/obj/item/computer_hardware/card_slot/cardholder = card_slot
if(cardholder)
var/obj/item/weapon/card/id/stored_card = cardholder.stored_card
var/obj/item/card/id/stored_card = cardholder.stored_card
if(stored_card)
var/stored_name = stored_card.registered_name
var/stored_title = stored_card.assignment
@@ -43,22 +43,22 @@
var/max_damage = 100 // Damage level at which the computer breaks apart.
// Important hardware (must be installed for computer to work)
var/obj/item/weapon/computer_hardware/processor_unit/processor_unit // CPU. Without it the computer won't run. Better CPUs can run more programs at once.
var/obj/item/weapon/computer_hardware/network_card/network_card // Network Card component of this computer. Allows connection to NTNet
var/obj/item/weapon/computer_hardware/hard_drive/hard_drive // Hard Drive component of this computer. Stores programs and files.
var/obj/item/computer_hardware/processor_unit/processor_unit // CPU. Without it the computer won't run. Better CPUs can run more programs at once.
var/obj/item/computer_hardware/network_card/network_card // Network Card component of this computer. Allows connection to NTNet
var/obj/item/computer_hardware/hard_drive/hard_drive // Hard Drive component of this computer. Stores programs and files.
// Optional hardware (improves functionality, but is not critical for computer to work in most cases)
var/obj/item/weapon/computer_hardware/battery_module/battery_module // An internal power source for this computer. Can be recharged.
var/obj/item/weapon/computer_hardware/card_slot/card_slot // ID Card slot component of this computer. Mostly for HoP modification console that needs ID slot for modification.
var/obj/item/weapon/computer_hardware/nano_printer/nano_printer // Nano Printer component of this computer, for your everyday paperwork needs.
var/obj/item/weapon/computer_hardware/hard_drive/portable/portable_drive // Portable data storage
var/obj/item/weapon/computer_hardware/ai_slot/ai_slot // AI slot, an intellicard housing that allows modifications of AIs.
var/obj/item/weapon/computer_hardware/tesla_link/tesla_link // Tesla Link, Allows remote charging from nearest APC.
var/obj/item/computer_hardware/battery_module/battery_module // An internal power source for this computer. Can be recharged.
var/obj/item/computer_hardware/card_slot/card_slot // ID Card slot component of this computer. Mostly for HoP modification console that needs ID slot for modification.
var/obj/item/computer_hardware/nano_printer/nano_printer // Nano Printer component of this computer, for your everyday paperwork needs.
var/obj/item/computer_hardware/hard_drive/portable/portable_drive // Portable data storage
var/obj/item/computer_hardware/ai_slot/ai_slot // AI slot, an intellicard housing that allows modifications of AIs.
var/obj/item/computer_hardware/tesla_link/tesla_link // Tesla Link, Allows remote charging from nearest APC.
var/modifiable = TRUE // can't be modified or damaged if false
var/stores_pen = FALSE
var/obj/item/weapon/pen/stored_pen
var/obj/item/pen/stored_pen
var/interact_sounds
var/interact_sound_volume = 40