12/21 modernizations from TG live (#103)

* sync (#3)

* shuttle auto call

* Merge /vore into /master (#39)

* progress

* Compile errors fixed

No idea if it's test worthy tho as conflicts with race overhaul and
narky removal.

* Update admins.txt

* efforts continue

Fuck grab code, seriously

* grab code is cancer

* Execute the Narkism

Do not hesitate.

Show no mercy.

* holy shit grab code is awful

* have I bitched about grab code

My bitching, let me show you it

* código de agarre es una mierda

No really it is

* yeah I don't even know anymore.

* Lolnope. Fuck grab code

* I'm not even sure what to fix anymore

* Self eating is not an acceptable fate

* Taste the void, son.

* My code doesn't pass it's own sanity check.

Maybe it's a sign of things to come.

* uncommented and notes

* It Works and I Don't Know Why (#38)

* shuttle auto call

* it works and I don't know why

* Subsystem 12/21

Most Recent TG subsystem folder

* globalvars 12/21

Tossed out the flavor_misc and parallax files

* Onclick 12/21

as well as .dme updates

* _defines 12/21

ommited old _MC.dm

* _HELPERS 12/21

Preserved snowflake placement of furry sprites

* _defeines/genetics

reapplied narkism holdover for snowflake races.

* Oops forgot mutant colors

* modules porting 12/21 + Sounds/icons

Admin, Client and most of mob life files ommitted

* enviroment file

* Admin optimizations

ahelp log system kept

* Mob ports 12/21

Flavor text preserved

* datums ported 12/21

* Game ported 12/21

* batch of duplicate fixes/dogborg work

Dogborgs need to be modernized to refractored borg standards.

* moar fixes

* Maps and futher compile fixes
This commit is contained in:
Poojawa
2016-12-22 03:57:55 -06:00
committed by GitHub
parent f5e143a452
commit cf59ac1c3d
2215 changed files with 707445 additions and 87041 deletions

View File

@@ -0,0 +1,44 @@
// CPU that allows the computer to run programs.
// Better CPUs are obtainable via research and can run more programs on background.
/obj/item/weapon/computer_hardware/processor_unit
name = "processor board"
desc = "A standard CPU board used in most computers. It can run up to three programs simultaneously."
icon_state = "cpuboard"
w_class = WEIGHT_CLASS_SMALL
power_usage = 50
critical = 1
malfunction_probability = 1
origin_tech = "programming=3;engineering=2"
var/max_idle_programs = 2 // 2 idle, + 1 active = 3 as said in description.
device_type = MC_CPU
/obj/item/weapon/computer_hardware/processor_unit/on_remove(obj/item/device/modular_computer/MC, mob/user)
MC.shutdown_computer()
/obj/item/weapon/computer_hardware/processor_unit/small
name = "microprocessor"
desc = "A miniaturised CPU used in portable devices. It can run up to two programs simultaneously."
icon_state = "cpu"
w_class = WEIGHT_CLASS_TINY
power_usage = 25
max_idle_programs = 1
origin_tech = "programming=2;engineering=2"
/obj/item/weapon/computer_hardware/processor_unit/photonic
name = "photonic processor board"
desc = "An advanced experimental CPU board that uses photonic core instead of regular circuitry. It can run up to five programs simultaneously, but uses a lot of power."
icon_state = "cpuboard_super"
w_class = WEIGHT_CLASS_SMALL
power_usage = 250
max_idle_programs = 4
origin_tech = "programming=5;engineering=4"
/obj/item/weapon/computer_hardware/processor_unit/photonic/small
name = "photonic microprocessor"
desc = "An advanced miniaturised CPU for use in portable devices. It uses photonic core instead of regular circuitry. It can run up to three programs simultaneously."
icon_state = "cpu_super"
w_class = WEIGHT_CLASS_TINY
power_usage = 75
max_idle_programs = 2
origin_tech = "programming=4;engineering=3"

View File

@@ -0,0 +1,103 @@
/obj/item/weapon/computer_hardware
name = "hardware"
desc = "Unknown Hardware."
icon = 'icons/obj/module.dmi'
icon_state = "std_mod"
w_class = WEIGHT_CLASS_TINY // w_class limits which devices can contain this component.
// 1: PDAs/Tablets, 2: Laptops, 3-4: Consoles only
var/obj/item/device/modular_computer/holder = null
// Computer that holds this hardware, if any.
var/power_usage = 0 // If the hardware uses extra power, change this.
var/enabled = 1 // If the hardware is turned off set this to 0.
var/critical = 0 // Prevent disabling for important component, like the CPU.
var/can_install = 1 // Prevents direct installation of removable media.
var/damage = 0 // Current damage level
var/max_damage = 100 // Maximal damage level.
var/damage_malfunction = 20 // "Malfunction" threshold. When damage exceeds this value the hardware piece will semi-randomly fail and do !!FUN!! things
var/damage_failure = 50 // "Failure" threshold. When damage exceeds this value the hardware piece will not work at all.
var/malfunction_probability = 10// Chance of malfunction when the component is damaged
var/device_type
/obj/item/weapon/computer_hardware/New(var/obj/L)
..()
pixel_x = rand(-8, 8)
pixel_y = rand(-8, 8)
/obj/item/weapon/computer_hardware/Destroy()
if(holder)
holder.uninstall_component(src)
return ..()
/obj/item/weapon/computer_hardware/attackby(obj/item/I, mob/living/user)
// Multitool. Runs diagnostics
if(istype(I, /obj/item/device/multitool))
user << "***** DIAGNOSTICS REPORT *****"
diagnostics(user)
user << "******************************"
return 1
// Cable coil. Works as repair method, but will probably require multiple applications and more cable.
if(istype(I, /obj/item/stack/cable_coil))
var/obj/item/stack/S = I
if(obj_integrity == max_integrity)
user << "<span class='warning'>\The [src] doesn't seem to require repairs.</span>"
return 1
if(S.use(1))
user << "<span class='notice'>You patch up \the [src] with a bit of \the [I].</span>"
obj_integrity = min(obj_integrity + 10, max_integrity)
return 1
if(try_insert(I, user))
return 1
return ..()
// Called on multitool click, prints diagnostic information to the user.
/obj/item/weapon/computer_hardware/proc/diagnostics(var/mob/user)
user << "Hardware Integrity Test... (Corruption: [damage]/[max_damage]) [damage > damage_failure ? "FAIL" : damage > damage_malfunction ? "WARN" : "PASS"]"
// Handles damage checks
/obj/item/weapon/computer_hardware/proc/check_functionality()
if(!enabled) // Disabled.
return FALSE
if(damage > damage_failure) // Too damaged to work at all.
return FALSE
if(damage > damage_malfunction) // Still working. Well, sometimes...
if(prob(malfunction_probability))
return FALSE
return TRUE // Good to go.
/obj/item/weapon/computer_hardware/examine(var/mob/user)
. = ..()
if(damage > damage_failure)
user << "<span class='danger'>It seems to be severely damaged!</span>"
else if(damage > damage_malfunction)
user << "<span class='warning'>It seems to be damaged!</span>"
else if(damage)
user << "<span class='notice'>It seems to be slightly damaged.</span>"
// Component-side compatibility check.
/obj/item/weapon/computer_hardware/proc/can_install(obj/item/device/modular_computer/M, mob/living/user = null)
return can_install
// Called when component is installed into PC.
/obj/item/weapon/computer_hardware/proc/on_install(obj/item/device/modular_computer/M, mob/living/user = null)
return
// Called when component is removed from PC.
/obj/item/weapon/computer_hardware/proc/on_remove(obj/item/device/modular_computer/M, mob/living/user = null)
try_eject(forced = 1)
// Called when someone tries to insert something in it - paper in printer, card in card reader, etc.
/obj/item/weapon/computer_hardware/proc/try_insert(obj/item/I, mob/living/user = null)
return FALSE
// Called when someone tries to eject something from it - card from card reader, etc.
/obj/item/weapon/computer_hardware/proc/try_eject(slot=0, mob/living/user = null, forced = 0)
return FALSE

View File

@@ -0,0 +1,72 @@
/obj/item/weapon/computer_hardware/ai_slot
name = "intelliCard interface slot"
desc = "A module allowing this computer to interface with most common intelliCard modules. Necessary for some programs to run properly."
power_usage = 100 //W
icon_state = "card_mini"
w_class = WEIGHT_CLASS_SMALL
origin_tech = "programming=2"
device_type = MC_AI
var/obj/item/device/aicard/stored_card = null
var/locked = FALSE
/obj/item/weapon/computer_hardware/ai_slot/examine(mob/user)
..()
if(stored_card)
user << "There appears to be an intelliCard loaded. There appears to be a pinhole protecting a manual eject button. A screwdriver could probably press it"
/obj/item/weapon/computer_hardware/ai_slot/on_install(obj/item/device/modular_computer/M, mob/living/user = null)
M.add_verb(device_type)
/obj/item/weapon/computer_hardware/ai_slot/on_remove(obj/item/device/modular_computer/M, mob/living/user = null)
M.remove_verb(device_type)
/obj/item/weapon/computer_hardware/ai_slot/try_insert(obj/item/I, mob/living/user = null)
if(!holder)
return FALSE
if(!istype(I, /obj/item/device/aicard))
return FALSE
if(stored_card)
user << "<span class='warning'>You try to insert \the [I] into \the [src], but the slot is occupied.</span>"
return FALSE
if(user && !user.unEquip(I))
return FALSE
stored_card = I
I.forceMove(src)
user << "<span class='notice'>You insert \the [I] into \the [src].</span>"
return TRUE
/obj/item/weapon/computer_hardware/ai_slot/try_eject(slot=0,mob/living/user = null,forced = 0)
if(!stored_card)
user << "<span class='warning'>There is no card in \the [src].</span>"
return FALSE
if(locked && !forced)
user << "<span class='warning'>Safeties prevent you from removing the card until reconstruction is complete...</span>"
return FALSE
if(stored_card)
stored_card.forceMove(get_turf(src))
locked = FALSE
stored_card.verb_pickup()
stored_card = null
user << "<span class='notice'>You remove the card from \the [src].</span>"
return TRUE
return FALSE
/obj/item/weapon/computer_hardware/ai_slot/attackby(obj/item/I, mob/living/user)
if(..())
return
if(istype(I, /obj/item/weapon/screwdriver))
user << "<span class='notice'>You press down on the manual eject button with \the [I].</span>"
try_eject(,user,1)
return

View File

@@ -0,0 +1,99 @@
/obj/item/weapon/computer_hardware/battery
name = "power cell controller"
desc = "A charge controller for standard power cells, used in all kinds of modular computers."
icon_state = "cell_con"
critical = 1
malfunction_probability = 1
origin_tech = "powerstorage=1;engineering=1"
var/obj/item/weapon/stock_parts/cell/battery = null
device_type = MC_CELL
/obj/item/weapon/computer_hardware/battery/New(loc, battery_type = null)
if(battery_type)
battery = new battery_type(src)
..()
/obj/item/weapon/computer_hardware/battery/try_insert(obj/item/I, mob/living/user = null)
if(!holder)
return FALSE
if(!istype(I, /obj/item/weapon/stock_parts/cell))
return FALSE
if(battery)
user << "<span class='warning'>You try to connect \the [I] to \the [src], but its connectors are occupied.</span>"
return FALSE
if(I.w_class > holder.max_hardware_size)
user << "<span class='warning'>This power cell is too large for \the [holder]!</span>"
return FALSE
if(user && !user.unEquip(I))
return FALSE
battery = I
I.forceMove(src)
user << "<span class='notice'>You connect \the [I] to \the [src].</span>"
return TRUE
/obj/item/weapon/computer_hardware/battery/try_eject(slot=0, mob/living/user = null, forced = 0)
if(!battery)
user << "<span class='warning'>There is no power cell connected to \the [src].</span>"
return FALSE
else
battery.forceMove(get_turf(src))
user << "<span class='notice'>You detach \the [battery] from \the [src].</span>"
battery = null
if(holder)
if(holder.enabled && !holder.use_power())
holder.shutdown_computer()
return TRUE
return FALSE
/obj/item/weapon/stock_parts/cell/computer
name = "standard battery"
desc = "A standard power cell, commonly seen in high-end portable microcomputers or low-end laptops."
icon = 'icons/obj/module.dmi'
icon_state = "cell_mini"
origin_tech = "powerstorage=2;engineering=1"
w_class = WEIGHT_CLASS_TINY
maxcharge = 750
/obj/item/weapon/stock_parts/cell/computer/advanced
name = "advanced battery"
desc = "An advanced power cell, often used in most laptops. It is too large to be fitted into smaller devices."
icon_state = "cell"
origin_tech = "powerstorage=2;engineering=2"
w_class = WEIGHT_CLASS_SMALL
maxcharge = 1500
/obj/item/weapon/stock_parts/cell/computer/super
name = "super battery"
desc = "An advanced power cell, often used in high-end laptops."
icon_state = "cell"
origin_tech = "powerstorage=3;engineering=3"
w_class = WEIGHT_CLASS_SMALL
maxcharge = 2000
/obj/item/weapon/stock_parts/cell/computer/micro
name = "micro battery"
desc = "A small power cell, commonly seen in most portable microcomputers."
icon_state = "cell_micro"
maxcharge = 500
/obj/item/weapon/stock_parts/cell/computer/nano
name = "nano battery"
desc = "A tiny power cell, commonly seen in low-end portable microcomputers."
icon_state = "cell_micro"
maxcharge = 300

View File

@@ -0,0 +1,104 @@
/obj/item/weapon/computer_hardware/card_slot
name = "identification card authentication module" // \improper breaks the find_hardware_by_name proc
desc = "A module allowing this computer to read or write data on ID cards. Necessary for some programs to run properly."
power_usage = 10 //W
icon_state = "card_mini"
w_class = WEIGHT_CLASS_TINY
origin_tech = "programming=2"
device_type = MC_CARD
var/obj/item/weapon/card/id/stored_card = null
var/obj/item/weapon/card/id/stored_card2 = null
/obj/item/weapon/computer_hardware/card_slot/Destroy()
try_eject()
return ..()
/obj/item/weapon/computer_hardware/card_slot/GetAccess()
if(stored_card && stored_card2) // Best of both worlds
return (stored_card.GetAccess() | stored_card2.GetAccess())
else if(stored_card)
return stored_card.GetAccess()
else if(stored_card2)
return stored_card2.GetAccess()
return ..()
/obj/item/weapon/computer_hardware/card_slot/GetID()
if(stored_card)
return stored_card
else if(stored_card2)
return stored_card2
return ..()
/obj/item/weapon/computer_hardware/card_slot/on_install(obj/item/device/modular_computer/M, mob/living/user = null)
M.add_verb(device_type)
/obj/item/weapon/computer_hardware/card_slot/on_remove(obj/item/device/modular_computer/M, mob/living/user = null)
M.remove_verb(device_type)
/obj/item/weapon/computer_hardware/card_slot/try_insert(obj/item/I, mob/living/user = null)
if(!holder)
return FALSE
if(!istype(I, /obj/item/weapon/card/id))
return FALSE
if(stored_card && stored_card2)
user << "<span class='warning'>You try to insert \the [I] into \the [src], but its slots are occupied.</span>"
return FALSE
if(user && !user.unEquip(I))
return FALSE
if(!stored_card)
stored_card = I
else
stored_card2 = I
I.forceMove(src)
user << "<span class='notice'>You insert \the [I] into \the [src].</span>"
return TRUE
/obj/item/weapon/computer_hardware/card_slot/try_eject(slot=0, mob/living/user = null, forced = 0)
if(!stored_card && !stored_card2)
user << "<span class='warning'>There are no cards in \the [src].</span>"
return FALSE
var/ejected = 0
if(stored_card && (!slot || slot == 1))
stored_card.forceMove(get_turf(src))
stored_card.verb_pickup()
stored_card = null
ejected++
if(stored_card2 && (!slot || slot == 2))
stored_card2.forceMove(get_turf(src))
stored_card2.verb_pickup()
stored_card2 = null
ejected++
if(ejected)
if(holder)
if(holder.active_program)
holder.active_program.event_idremoved(0, slot)
for(var/I in holder.idle_threads)
var/datum/computer_file/program/P = I
P.event_idremoved(1, slot)
user << "<span class='notice'>You remove the card[ejected>1 ? "s" : ""] from \the [src].</span>"
return TRUE
return FALSE
/obj/item/weapon/computer_hardware/card_slot/attackby(obj/item/I, mob/living/user)
if(..())
return
if(istype(I, /obj/item/weapon/screwdriver))
user << "<span class='notice'>You press down on the manual eject button with \the [I].</span>"
try_eject(0,user)
return
/obj/item/weapon/computer_hardware/card_slot/examine(mob/user)
..()
if(stored_card || stored_card2)
user << "There appears to be something loaded in the card slots."

View File

@@ -0,0 +1,173 @@
/obj/item/weapon/computer_hardware/hard_drive
name = "hard disk drive"
desc = "A small HDD, for use in basic computers where power efficiency is desired."
power_usage = 25
icon_state = "harddisk_mini"
critical = 1
w_class = WEIGHT_CLASS_TINY
origin_tech = "programming=1;engineering=1"
device_type = MC_HDD
var/max_capacity = 128
var/used_capacity = 0
var/list/stored_files = list() // List of stored files on this drive. DO NOT MODIFY DIRECTLY!
/obj/item/weapon/computer_hardware/hard_drive/on_remove(obj/item/device/modular_computer/MC, mob/user)
MC.shutdown_computer()
/obj/item/weapon/computer_hardware/hard_drive/proc/install_default_programs()
store_file(new/datum/computer_file/program/computerconfig(src)) // Computer configuration utility, allows hardware control and displays more info than status bar
store_file(new/datum/computer_file/program/ntnetdownload(src)) // NTNet Downloader Utility, allows users to download more software from NTNet repository
store_file(new/datum/computer_file/program/filemanager(src)) // File manager, allows text editor functions and basic file manipulation.
/obj/item/weapon/computer_hardware/hard_drive/examine(user)
..()
user << "<span class='notice'>It has [max_capacity] GQ of storage capacity.</span>"
/obj/item/weapon/computer_hardware/hard_drive/diagnostics(var/mob/user)
..()
// 999 is a byond limit that is in place. It's unlikely someone will reach that many files anyway, since you would sooner run out of space.
user << "NT-NFS File Table Status: [stored_files.len]/999"
user << "Storage capacity: [used_capacity]/[max_capacity]GQ"
// Use this proc to add file to the drive. Returns 1 on success and 0 on failure. Contains necessary sanity checks.
/obj/item/weapon/computer_hardware/hard_drive/proc/store_file(var/datum/computer_file/F)
if(!F || !istype(F))
return 0
if(!can_store_file(F))
return 0
if(!check_functionality())
return 0
if(!stored_files)
return 0
// This file is already stored. Don't store it again.
if(F in stored_files)
return 0
F.holder = src
stored_files.Add(F)
recalculate_size()
return 1
// Use this proc to remove file from the drive. Returns 1 on success and 0 on failure. Contains necessary sanity checks.
/obj/item/weapon/computer_hardware/hard_drive/proc/remove_file(var/datum/computer_file/F)
if(!F || !istype(F))
return 0
if(!stored_files)
return 0
if(!check_functionality())
return 0
if(F in stored_files)
stored_files -= F
recalculate_size()
return 1
else
return 0
// Loops through all stored files and recalculates used_capacity of this drive
/obj/item/weapon/computer_hardware/hard_drive/proc/recalculate_size()
var/total_size = 0
for(var/datum/computer_file/F in stored_files)
total_size += F.size
used_capacity = total_size
// Checks whether file can be stored on the hard drive. We can only store unique files, so this checks whether we wouldn't get a duplicity by adding a file.
/obj/item/weapon/computer_hardware/hard_drive/proc/can_store_file(var/datum/computer_file/F)
if(!F || !istype(F))
return 0
if(F in stored_files)
return 0
var/name = F.filename + "." + F.filetype
for(var/datum/computer_file/file in stored_files)
if((file.filename + "." + file.filetype) == name)
return 0
// In the unlikely event someone manages to create that many files.
// BYOND is acting weird with numbers above 999 in loops (infinite loop prevention)
if(stored_files.len >= 999)
return 0
if((used_capacity + F.size) > max_capacity)
return 0
else
return 1
// Tries to find the file by filename. Returns null on failure
/obj/item/weapon/computer_hardware/hard_drive/proc/find_file_by_name(var/filename)
if(!check_functionality())
return null
if(!filename)
return null
if(!stored_files)
return null
for(var/datum/computer_file/F in stored_files)
if(F.filename == filename)
return F
return null
/obj/item/weapon/computer_hardware/hard_drive/Destroy()
stored_files = null
return ..()
/obj/item/weapon/computer_hardware/hard_drive/New()
install_default_programs()
..()
/obj/item/weapon/computer_hardware/hard_drive/advanced
name = "advanced hard disk drive"
desc = "A hybrid HDD, for use in higher grade computers where balance between power efficiency and capacity is desired."
max_capacity = 256
origin_tech = "programming=2;engineering=2"
power_usage = 50 // Hybrid, medium capacity and medium power storage
icon_state = "harddisk_mini"
w_class = WEIGHT_CLASS_SMALL
/obj/item/weapon/computer_hardware/hard_drive/super
name = "super hard disk drive"
desc = "A high capacity HDD, for use in cluster storage solutions where capacity is more important than power efficiency."
max_capacity = 512
origin_tech = "programming=3;engineering=3"
power_usage = 100 // High-capacity but uses lots of power, shortening battery life. Best used with APC link.
icon_state = "harddisk_mini"
w_class = WEIGHT_CLASS_SMALL
/obj/item/weapon/computer_hardware/hard_drive/cluster
name = "cluster hard disk drive"
desc = "A large storage cluster consisting of multiple HDDs for usage in dedicated storage systems."
power_usage = 500
origin_tech = "programming=4;engineering=4"
max_capacity = 2048
icon_state = "harddisk"
w_class = WEIGHT_CLASS_NORMAL
// For tablets, etc. - highly power efficient.
/obj/item/weapon/computer_hardware/hard_drive/small
name = "solid state drive"
desc = "An efficient SSD for portable devices."
power_usage = 10
origin_tech = "programming=2;engineering=2"
max_capacity = 64
icon_state = "ssd_mini"
w_class = WEIGHT_CLASS_TINY
/obj/item/weapon/computer_hardware/hard_drive/micro
name = "micro solid state drive"
desc = "A highly efficient SSD chip for portable devices."
power_usage = 2
origin_tech = "programming=1;engineering=1"
max_capacity = 32
icon_state = "ssd_micro"
w_class = WEIGHT_CLASS_TINY

View File

@@ -0,0 +1,82 @@
var/global/ntnet_card_uid = 1
/obj/item/weapon/computer_hardware/network_card
name = "network card"
desc = "A basic wireless network card for usage with standard NTNet frequencies."
power_usage = 50
origin_tech = "programming=2;engineering=1"
icon_state = "radio_mini"
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.
malfunction_probability = 1
device_type = MC_NET
/obj/item/weapon/computer_hardware/network_card/diagnostics(var/mob/user)
..()
user << "NIX Unique ID: [identification_id]"
user << "NIX User Tag: [identification_string]"
user << "Supported protocols:"
user << "511.m SFS (Subspace) - Standard Frequency Spread"
if(long_range)
user << "511.n WFS/HB (Subspace) - Wide Frequency Spread/High Bandiwdth"
if(ethernet)
user << "OpenEth (Physical Connection) - Physical network connection port"
/obj/item/weapon/computer_hardware/network_card/New(var/l)
..(l)
identification_id = ntnet_card_uid
ntnet_card_uid++
// 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(!holder) // Hardware is not installed in anything. No signal. How did this even get called?
return 0
if(!check_functionality())
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(holder)
var/turf/T = get_turf(holder)
if((T && istype(T)) && (T.z == ZLEVEL_STATION || T.z == ZLEVEL_MINING))
// Computer is on station. Low/High signal depending on what type of network card you have
if(long_range)
return 2
else
return 1
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/advanced
name = "advanced network card"
desc = "An advanced network card for usage with standard NTNet frequencies. Its transmitter is strong enough to connect even off-station."
long_range = 1
origin_tech = "programming=4;engineering=2"
power_usage = 100 // Better range but higher power usage.
icon_state = "radio"
w_class = WEIGHT_CLASS_TINY
/obj/item/weapon/computer_hardware/network_card/wired
name = "wired network card"
desc = "An advanced network card for usage with standard NTNet frequencies. This one also supports wired connection."
ethernet = 1
origin_tech = "programming=5;engineering=3"
power_usage = 100 // Better range but higher power usage.
icon_state = "net_wired"
w_class = WEIGHT_CLASS_NORMAL

View File

@@ -0,0 +1,35 @@
/obj/item/weapon/computer_hardware/hard_drive/portable
name = "data disk"
desc = "Removable disk used to store data."
power_usage = 10
icon_state = "datadisk6"
w_class = WEIGHT_CLASS_TINY
critical = 0
max_capacity = 16
origin_tech = "programming=1"
device_type = MC_SDD
/obj/item/weapon/computer_hardware/hard_drive/portable/on_install(obj/item/device/modular_computer/M, mob/living/user = null)
M.add_verb(device_type)
/obj/item/weapon/computer_hardware/hard_drive/portable/on_remove(obj/item/device/modular_computer/M, mob/living/user = null)
..()
M.remove_verb(device_type)
/obj/item/weapon/computer_hardware/hard_drive/portable/install_default_programs()
return // Empty by default
/obj/item/weapon/computer_hardware/hard_drive/portable/advanced
name = "advanced data disk"
power_usage = 20
icon_state = "datadisk5"
max_capacity = 64
origin_tech = "programming=2"
/obj/item/weapon/computer_hardware/hard_drive/portable/super
name = "super data disk"
desc = "Removable disk used to store large amounts of data."
power_usage = 40
icon_state = "datadisk3"
max_capacity = 256
origin_tech = "programming=4"

View File

@@ -0,0 +1,63 @@
/obj/item/weapon/computer_hardware/printer
name = "printer"
desc = "Computer-integrated printer with paper recycling module."
power_usage = 100
origin_tech = "programming=2;engineering=2"
icon_state = "printer"
w_class = WEIGHT_CLASS_NORMAL
device_type = MC_PRINT
var/stored_paper = 20
var/max_paper = 30
/obj/item/weapon/computer_hardware/printer/diagnostics(mob/living/user)
..()
user << "Paper level: [stored_paper]/[max_paper]"
/obj/item/weapon/computer_hardware/printer/examine(mob/user)
..()
user << "<span class='notice'>Paper level: [stored_paper]/[max_paper]</span>"
/obj/item/weapon/computer_hardware/printer/proc/print_text(var/text_to_print, var/paper_title = "")
if(!stored_paper)
return FALSE
if(!check_functionality())
return FALSE
var/obj/item/weapon/paper/P = new/obj/item/weapon/paper(get_turf(holder))
// Damaged printer causes the resulting paper to be somewhat harder to read.
if(damage > damage_malfunction)
P.info = stars(text_to_print, 100-malfunction_probability)
else
P.info = text_to_print
if(paper_title)
P.name = paper_title
P.update_icon()
stored_paper--
P = null
return TRUE
/obj/item/weapon/computer_hardware/printer/try_insert(obj/item/I, mob/living/user = null)
if(istype(I, /obj/item/weapon/paper))
if(user && !user.unEquip(I))
return FALSE
if(stored_paper >= max_paper)
user << "<span class='warning'>You try to add \the [I] into [src], but its paper bin is full!</span>"
return FALSE
user << "<span class='notice'>You insert \the [I] into [src]'s paper recycler.</span>"
qdel(I)
stored_paper++
return TRUE
return FALSE
/obj/item/weapon/computer_hardware/printer/mini
name = "miniprinter"
desc = "A small printer with paper recycling module."
power_usage = 50
icon_state = "printer_mini"
w_class = WEIGHT_CLASS_TINY
stored_paper = 5
max_paper = 15

View File

@@ -0,0 +1,93 @@
/obj/item/weapon/computer_hardware/recharger
critical = 1
enabled = 1
var/charge_rate = 100
device_type = MC_CHARGE
/obj/item/weapon/computer_hardware/recharger/proc/use_power(amount, charging=0)
if(charging)
return 1
return 0
/obj/item/weapon/computer_hardware/recharger/process()
..()
var/obj/item/weapon/computer_hardware/battery/battery_module = holder.all_components[MC_CELL]
if(!holder || !battery_module || !battery_module.battery)
return
var/obj/item/weapon/stock_parts/cell/cell = battery_module.battery
if(cell.charge >= cell.maxcharge)
return
if(use_power(charge_rate, charging=1))
holder.give_power(charge_rate * CELLRATE)
/obj/item/weapon/computer_hardware/recharger/APC
name = "area power connector"
desc = "A device that wirelessly recharges connected device from nearby APC."
icon_state = "charger_APC"
w_class = WEIGHT_CLASS_SMALL // Can't be installed into tablets/PDAs
origin_tech = "programming=2;engineering=2;powerstorage=3"
/obj/item/weapon/computer_hardware/recharger/APC/use_power(amount, charging=0)
if(istype(holder.physical, /obj/machinery))
var/obj/machinery/M = holder.physical
if(M.powered())
M.use_power(amount)
return 1
else
var/area/A = get_area(src)
if(!A || !isarea(A) || !A.master)
return 0
if(A.master.powered(EQUIP))
A.master.use_power(amount, EQUIP)
return 1
return 0
/obj/item/weapon/computer_hardware/recharger/wired
name = "wired power connector"
desc = "A power connector that recharges connected device from nearby power wire. Incompatible with portable computers."
icon_state = "charger_wire"
w_class = WEIGHT_CLASS_NORMAL
origin_tech = "engineering=2;powerstorage=1"
/obj/item/weapon/computer_hardware/recharger/wired/can_install(obj/item/device/modular_computer/M, mob/living/user = null)
if(istype(M.physical, /obj/machinery) && M.physical.anchored)
return ..()
user << "<span class='warning'>\The [src] is incompatible with portable computers!</span>"
return 0
/obj/item/weapon/computer_hardware/recharger/wired/use_power(amount, charging=0)
if(istype(holder.physical, /obj/machinery) && holder.physical.anchored)
var/obj/machinery/M = holder.physical
var/turf/T = M.loc
if(!T || !istype(T))
return 0
var/obj/structure/cable/C = T.get_cable_node()
if(!C || !C.powernet)
return 0
var/power_in_net = C.powernet.avail-C.powernet.load
if(power_in_net && power_in_net > amount)
C.powernet.load += amount
return 1
return 0
// This is not intended to be obtainable in-game. Intended for adminbus and debugging purposes.
/obj/item/weapon/computer_hardware/recharger/lambda
name = "lambda coil"
desc = "A very complex device that draws power from its own bluespace dimension."
icon_state = "charger_lambda"
w_class = WEIGHT_CLASS_TINY
charge_rate = 100000
/obj/item/weapon/computer_hardware/recharger/lambda/use_power(amount, charging=0)
return 1