Files
Aurora.3/code/modules/modular_computers/hardware/network_card.dm
Atlantis 7e39ef1a38 Hardware rework
- Hardware pieces are now items, rather than datums.
- Adds deconstruction for computers. Empty tablet/laptop/console frames may be wrenched to break them back into metal sheets. You have to empty the frame first, by using screwdriver to take out components one by one.
- Components may be moved between devices. You can for example take your tablet, remove it's hard drive, and slot it into a console. It will have all the files it had on your tablet.
- Not all hardware can be fitted into all devices. Tablet can't hold 2K GQ cluster hard drive, for example.
- Hardware may be fabricated by research for relatively low costs, once you have relevant research levels. Obtaining computer this way is much cheaper than buying it at the vendor.
- Data crystals added (glorified USB flash sticks) that allow file transfer to different devices. File browser program updated accordingly to support importing/exporting of files to these crystals.
- Battery module added.  These are wrappers for actual power cell object and act as limit for cell size, otherwise it would be possible to have 30k cells inside devices, which would allow them to run insanely long.
2015-12-02 10:32:49 +01:00

73 lines
2.7 KiB
Plaintext

var/global/ntnet_card_uid = 1
/obj/item/weapon/computer_hardware/network_card/
name = "basic NTNet network card"
desc = "A basic network card for usage with standard NTNet frequencies."
power_usage = 50
critical = 0
icon_state = "netcard_basic"
hardware_size = 1
var/identification_id = null // Identification ID. Technically MAC address of this device. Can't be changed by user.
var/identification_string = "" // Identification string, technically nickname seen in the network. Can be set by user.
var/long_range = 0
var/ethernet = 0 // Hard-wired, therefore always on, ignores NTNet wireless checks.
/obj/item/weapon/computer_hardware/network_card/New(var/l)
..(l)
identification_id = ntnet_card_uid
ntnet_card_uid++
/obj/item/weapon/computer_hardware/network_card/advanced
name = "advanced NTNet network card"
desc = "An advanced network card for usage with standard NTNet frequencies. It's transmitter is strong enough to connect even off-station."
long_range = 1
power_usage = 100 // Better range but higher power usage.
icon_state = "netcard_advanced"
hardware_size = 1
/obj/item/weapon/computer_hardware/network_card/wired
name = "wired NTNet network card"
desc = "An advanced network card for usage with NTNet. This one uses wired connection."
ethernet = 1
power_usage = 100 // Better range but higher power usage.
icon_state = "netcard_ethernet"
hardware_size = 3
/obj/item/weapon/computer_hardware/network_card/Destroy()
if(holder2 && (holder2.network_card == src))
holder2.network_card = null
holder2 = null
..()
// Returns a string identifier of this network card
/obj/item/weapon/computer_hardware/network_card/proc/get_network_tag()
return "[identification_string] (NID [identification_id])"
// 0 - No signal, 1 - Low signal, 2 - High signal. 3 - Wired Connection
/obj/item/weapon/computer_hardware/network_card/proc/get_signal(var/specific_action = 0)
if(!holder2) // Hardware is not installed in anything. No signal. How did this even get called?
return 0
if(!enabled)
return 0
if(ethernet) // Computer is connected via wired connection.
return 3
if(!ntnet_global || !ntnet_global.check_function(specific_action)) // NTNet is down and we are not connected via wired connection. No signal.
return 0
if(holder2)
var/turf/T = get_turf(holder2)
if((T && istype(T)) && T.z in config.station_levels)
return 2
if(long_range) // Computer is not on station, but it has upgraded network card. Low signal.
return 1
return 0 // Computer is not on station and does not have upgraded network card. No signal.
/obj/item/weapon/computer_hardware/network_card/Destroy()
if(holder2 && (holder2.network_card == src))
holder2.network_card = null
..()