mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-21 04:57:57 +01:00
Makes try_install_component a function of the hardware.
This commit is contained in:
@@ -68,4 +68,12 @@
|
||||
|
||||
/obj/item/weapon/computer_hardware/battery_module/proc/charge_to_full()
|
||||
if(battery)
|
||||
battery.charge = battery.maxcharge
|
||||
battery.charge = battery.maxcharge
|
||||
|
||||
/obj/item/weapon/computer_hardware/battery_module/try_install_component(mob/living/user, obj/item/modular_computer/M, found = 0)
|
||||
if(M.battery_module)
|
||||
user << "This computer's battery slot is already occupied by \the [M.battery_module]."
|
||||
return
|
||||
found = 1
|
||||
M.battery_module = src
|
||||
..(user, M, found)
|
||||
@@ -18,4 +18,12 @@
|
||||
if(stored_card2)
|
||||
stored_card2.forceMove(get_turf(holder2))
|
||||
holder2 = null
|
||||
..()
|
||||
..()
|
||||
|
||||
/obj/item/weapon/computer_hardware/card_slot/try_install_component(mob/living/user, obj/item/modular_computer/M, found = 0)
|
||||
if(M.card_slot)
|
||||
user << "This computer's card slot is already occupied by \the [M.card_slot]."
|
||||
return
|
||||
found = 1
|
||||
M.card_slot = src
|
||||
..(user, M, found)
|
||||
@@ -164,4 +164,12 @@
|
||||
|
||||
/obj/item/weapon/computer_hardware/hard_drive/New()
|
||||
install_default_programs()
|
||||
..()
|
||||
..()
|
||||
|
||||
/obj/item/weapon/computer_hardware/hard_drive/try_install_component(mob/living/user, obj/item/modular_computer/M, found = 0)
|
||||
if(M.hard_drive)
|
||||
user << "This computer's hard drive slot is already occupied by \the [M.hard_drive]."
|
||||
return
|
||||
found = 1
|
||||
M.hard_drive = src
|
||||
..(user, M, found)
|
||||
@@ -89,3 +89,11 @@
|
||||
damage += round(amount) // We want nice rounded numbers here.
|
||||
damage = max(0, min(damage, max_damage)) // Clamp the value.
|
||||
|
||||
// Attempts to install the hardware into apropriate slot.
|
||||
/obj/item/weapon/computer_hardware/proc/try_install_component(mob/living/user, obj/item/modular_computer/M, found = 0)
|
||||
if(found)
|
||||
user << "You install \the [src] into \the [M]"
|
||||
holder2 = M
|
||||
if(!user.drop_item(src))
|
||||
return
|
||||
forceMove(M)
|
||||
@@ -49,4 +49,12 @@
|
||||
if(holder2 && (holder2.nano_printer == src))
|
||||
holder2.nano_printer = null
|
||||
holder2 = null
|
||||
..()
|
||||
..()
|
||||
|
||||
/obj/item/weapon/computer_hardware/nano_printer/try_install_component(mob/living/user, obj/item/modular_computer/M, found = 0)
|
||||
if(M.nano_printer)
|
||||
user << "This computer's nano printer slot is already occupied by \the [M.nano_printer]."
|
||||
return
|
||||
found = 1
|
||||
M.nano_printer = src
|
||||
..(user, M, found)
|
||||
@@ -93,4 +93,12 @@ var/global/ntnet_card_uid = 1
|
||||
/obj/item/weapon/computer_hardware/network_card/Destroy()
|
||||
if(holder2 && (holder2.network_card == src))
|
||||
holder2.network_card = null
|
||||
..()
|
||||
..()
|
||||
|
||||
/obj/item/weapon/computer_hardware/network_card/try_install_component(mob/living/user, obj/item/modular_computer/M, found = 0)
|
||||
if(M.network_card)
|
||||
user << "This computer's network card slot is already occupied by \the [M.network_card]."
|
||||
return
|
||||
found = 1
|
||||
M.network_card = src
|
||||
..(user, M, found)
|
||||
@@ -29,4 +29,13 @@
|
||||
/obj/item/weapon/computer_hardware/hard_drive/portable/New()
|
||||
..()
|
||||
stored_files = list()
|
||||
recalculate_size()
|
||||
recalculate_size()
|
||||
|
||||
|
||||
/obj/item/weapon/computer_hardware/hard_drive/portable/try_install_component(mob/living/user, obj/item/modular_computer/M, found = 0)
|
||||
if(M.portable_drive)
|
||||
user << "This computer's portable drive slot is already occupied by \the [M.portable_drive]."
|
||||
return
|
||||
found = 1
|
||||
M.portable_drive = src
|
||||
..(user, M, found)
|
||||
@@ -38,4 +38,12 @@
|
||||
hardware_size = 1
|
||||
power_usage = 75
|
||||
max_idle_programs = 2
|
||||
origin_tech = list("programming" = 4, "engineering" = 3)
|
||||
origin_tech = list("programming" = 4, "engineering" = 3)
|
||||
|
||||
/obj/item/weapon/computer_hardware/processor_unit/try_install_component(mob/living/user, obj/item/modular_computer/M, found = 0)
|
||||
if(M.processor_unit)
|
||||
user << "This computer's processor slot is already occupied by \the [M.processor_unit]."
|
||||
return
|
||||
found = 1
|
||||
M.processor_unit = src
|
||||
..(user, M, found)
|
||||
@@ -17,4 +17,15 @@
|
||||
/obj/item/weapon/computer_hardware/tesla_link/Destroy()
|
||||
if(holder && (holder.tesla_link == src))
|
||||
holder.tesla_link = null
|
||||
..()
|
||||
..()
|
||||
|
||||
/obj/item/weapon/computer_hardware/tesla_link/try_install_component(mob/living/user, obj/item/modular_computer/M, found = 0)
|
||||
if(istype(M, /obj/item/modular_computer/processor))
|
||||
var/obj/item/modular_computer/processor/P = M
|
||||
if(P.machinery_computer.tesla_link)
|
||||
user << "This computer's tesla link slot is already occupied by \the [P.machinery_computer.tesla_link]."
|
||||
return
|
||||
holder = P.machinery_computer
|
||||
P.machinery_computer.tesla_link = src
|
||||
found = 1
|
||||
..(user, M, found)
|
||||
Reference in New Issue
Block a user