Files
VOREStation/code/game/machinery/computer/computer.dm
T
Cameron Lennox 453080616b SM, Tesla, and general engineering adjustments [MDB IGNORE] [IDB IGNORE] (#19339)
* Update supermatter.dm

* fix

* clamps these

* gwah

* Stops tesla from zapping unwrenched coils

* tesla upgrade

* unglobals this

* fix these

* Update coil.dm

* Update coil.dm

* Descriptions

* Update coil.dm

* Update coil.dm

* Update coil.dm

* Update coil.dm

* Update coil.dm

* ranges

* UGH

* Update vorestation.dme

* meth

* monster math

* Update coil.dm

* Update coil.dm

* Update coil.dm

* THEY DID THE MATH

* the monster math

* egwah

* desc

* Update coil.dm

* Returns

* Update coil.dm

* Lowers amount gained

* this

* im dumb

* tesy

* Update coil.dm

* Update coil.dm

* fixes initial density on blast doors

* dot

* fixes these

* Mapper Tools

* icon

* these

* Fixes the sound following people

* recursive geigers

* Make this a proc

* Update supermatter.dm

* less ear destroying

* these

* makes canisters not get softlocked

* Hotkeys

* proper return

* Makes shield gen useful. Gets rid of a harddel

Adds hydromagnetic trap

* math

* Makes buttons more clear.

* lol

* Fixes ancient runtime

* Adds craftable mass driver buttons

* button

* fixes this

* Makes misclicks not destroy solar panels

* Update solar.dm

* fix this

* make them both numbers

* upports reflectors

* Update reflector.dm

* Update reflectors.dm

* solar panel and climbable

* Gets rid of 'as X'

* Adds account console

* Update vorestation.dme

* Craftable message server

* Update message_server.dm

* These

* con struct

* Update smartfridge.dm

* whoop

* edits
2026-03-26 22:20:06 -04:00

135 lines
3.3 KiB
Plaintext

/obj/machinery/computer
name = "computer"
icon = 'icons/obj/computer.dmi'
icon_state = "computer"
density = TRUE
anchored = TRUE
unacidable = TRUE
use_power = USE_POWER_IDLE
idle_power_usage = 300
active_power_usage = 300
blocks_emissive = EMISSIVE_BLOCK_NONE
var/processing = 0
var/icon_keyboard = "generic_key"
var/icon_screen = "generic"
var/light_range_on = 2
var/light_power_on = 1
clicksound = "keyboard"
/obj/machinery/computer/Initialize(mapload)
. = ..()
power_change()
update_icon()
AddElement(/datum/element/climbable)
/obj/machinery/computer/process()
if(stat & (NOPOWER|BROKEN))
return 0
return 1
/obj/machinery/computer/emp_act(severity, recursive)
if(prob(20/severity)) set_broken()
..()
/obj/machinery/computer/ex_act(severity)
switch(severity)
if(1.0)
fall_apart(severity)
return
if(2.0)
if (prob(25))
fall_apart(severity)
return
if (prob(50))
for(var/x in verbs)
src.verbs -= x
set_broken()
if(3.0)
if (prob(25))
for(var/x in verbs)
src.verbs -= x
set_broken()
return
/obj/machinery/computer/bullet_act(var/obj/item/projectile/Proj)
if(prob(Proj.get_structure_damage()))
set_broken()
..()
/obj/machinery/computer/blob_act()
ex_act(2)
/obj/machinery/computer/update_icon()
cut_overlays()
. = list()
// Connecty
if(initial(icon_state) == "computer")
var/append_string = ""
var/left = turn(dir, 90)
var/right = turn(dir, -90)
var/turf/L = get_step(src, left)
var/turf/R = get_step(src, right)
var/obj/machinery/computer/LC = locate() in L
var/obj/machinery/computer/RC = locate() in R
if(LC && LC.dir == dir && initial(LC.icon_state) == "computer")
append_string += "_L"
if(RC && RC.dir == dir && initial(RC.icon_state) == "computer")
append_string += "_R"
icon_state = "computer[append_string]"
if(icon_keyboard)
if(stat & NOPOWER)
playsound(src, 'sound/machines/terminal_off.ogg', 50, 1)
return add_overlay("[icon_keyboard]_off")
. += icon_keyboard
// This whole block lets screens ignore lighting and be visible even in the darkest room
var/overlay_state = icon_screen
if(stat & BROKEN)
overlay_state = "[icon_state]_broken"
. += mutable_appearance(icon, overlay_state)
. += emissive_appearance(icon, overlay_state)
playsound(src, 'sound/machines/terminal_on.ogg', 50, 1)
add_overlay(.)
/obj/machinery/computer/power_change()
..()
update_icon()
if(stat & NOPOWER)
set_light(0)
else
set_light(light_range_on, light_power_on)
/obj/machinery/computer/proc/set_broken()
stat |= BROKEN
update_icon()
/obj/machinery/computer/proc/decode(text)
// Adds line breaks
text = replacetext(text, "\n", "<BR>")
return text
/obj/machinery/computer/attackby(obj/item/W, mob/user)
if(computer_deconstruction_screwdriver(user, W))
return
else
if(istype(W,/obj/item/gripper)) //Behold, Grippers and their horribleness. If ..() is called by any computers' attackby() now or in the future, this should let grippers work with them appropriately.
var/obj/item/gripper/B = W //B, for Borg.
var/obj/item/wrapped = B.get_wrapped_item()
if(!wrapped)
to_chat(user, "\The [B] is not holding anything.")
return
else
var/B_held = wrapped
to_chat(user, "You use \the [B] to use \the [B_held] with \the [src].")
playsound(src, clicksound, 100, 1, 0)
return
attack_hand(user)
return