mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-13 03:33:21 +00:00
-Cleaned up computers. Fixes Issue 1195
-Made computers use idle_power_usage and active_power_usage that it used from the MC. I'm sure something is likely to break because I removed a lot of snowflake code. I tried to test all the computers with what I can but if you find something odd then please tell me. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5369 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -87,6 +87,8 @@ obj/machinery/computer/general_air_control
|
||||
var/datum/radio_frequency/radio_connection
|
||||
|
||||
attack_hand(mob/user)
|
||||
if(..(user))
|
||||
return
|
||||
user << browse(return_text(),"window=computer")
|
||||
user.set_machine(src)
|
||||
onclose(user, "computer")
|
||||
@@ -95,39 +97,6 @@ obj/machinery/computer/general_air_control
|
||||
..()
|
||||
src.updateDialog()
|
||||
|
||||
attackby(I as obj, user as mob)
|
||||
if(istype(I, /obj/item/weapon/screwdriver))
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
if(do_after(user, 20))
|
||||
if (src.stat & BROKEN)
|
||||
user << "\blue The broken glass falls out."
|
||||
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
|
||||
new /obj/item/weapon/shard( src.loc )
|
||||
var/obj/item/weapon/circuitboard/air_management/M = new /obj/item/weapon/circuitboard/air_management( A )
|
||||
for (var/obj/C in src)
|
||||
C.loc = src.loc
|
||||
M.frequency = src.frequency
|
||||
A.circuit = M
|
||||
A.state = 3
|
||||
A.icon_state = "3"
|
||||
A.anchored = 1
|
||||
del(src)
|
||||
else
|
||||
user << "\blue You disconnect the monitor."
|
||||
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
|
||||
var/obj/item/weapon/circuitboard/air_management/M = new /obj/item/weapon/circuitboard/air_management( A )
|
||||
for (var/obj/C in src)
|
||||
C.loc = src.loc
|
||||
M.frequency = src.frequency
|
||||
A.circuit = M
|
||||
A.state = 4
|
||||
A.icon_state = "4"
|
||||
A.anchored = 1
|
||||
del(src)
|
||||
else
|
||||
src.attack_hand(user)
|
||||
return
|
||||
|
||||
receive_signal(datum/signal/signal)
|
||||
if(!signal || signal.encryption) return
|
||||
|
||||
@@ -294,38 +263,6 @@ Max Output Pressure: [output_pressure] kPa<BR>"}
|
||||
var/cutoff_temperature = 2000
|
||||
var/on_temperature = 1200
|
||||
|
||||
attackby(I as obj, user as mob)
|
||||
if(istype(I, /obj/item/weapon/screwdriver))
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
if(do_after(user, 20))
|
||||
if (src.stat & BROKEN)
|
||||
user << "\blue The broken glass falls out."
|
||||
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
|
||||
new /obj/item/weapon/shard( src.loc )
|
||||
var/obj/item/weapon/circuitboard/injector_control/M = new /obj/item/weapon/circuitboard/injector_control( A )
|
||||
for (var/obj/C in src)
|
||||
C.loc = src.loc
|
||||
M.frequency = src.frequency
|
||||
A.circuit = M
|
||||
A.state = 3
|
||||
A.icon_state = "3"
|
||||
A.anchored = 1
|
||||
del(src)
|
||||
else
|
||||
user << "\blue You disconnect the monitor."
|
||||
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
|
||||
var/obj/item/weapon/circuitboard/injector_control/M = new /obj/item/weapon/circuitboard/injector_control( A )
|
||||
for (var/obj/C in src)
|
||||
C.loc = src.loc
|
||||
M.frequency = src.frequency
|
||||
A.circuit = M
|
||||
A.state = 4
|
||||
A.icon_state = "4"
|
||||
A.anchored = 1
|
||||
del(src)
|
||||
else
|
||||
src.attack_hand(user)
|
||||
return
|
||||
|
||||
process()
|
||||
if(automation)
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
return
|
||||
|
||||
attack_hand(var/mob/user as mob)
|
||||
if(..(user))
|
||||
return
|
||||
src.add_fingerprint(usr)
|
||||
var/dat = {"
|
||||
<html>
|
||||
|
||||
@@ -198,6 +198,8 @@
|
||||
|
||||
/obj/machinery/computer/HolodeckControl/process()
|
||||
|
||||
if(!..())
|
||||
return
|
||||
if(active)
|
||||
|
||||
if(!checkInteg(linkedholodeck))
|
||||
|
||||
@@ -76,7 +76,5 @@
|
||||
|
||||
|
||||
/obj/machinery/computer/operating/process()
|
||||
if(!(stat & (NOPOWER|BROKEN)) )
|
||||
use_power(500)
|
||||
|
||||
if(..())
|
||||
src.updateDialog()
|
||||
|
||||
@@ -108,9 +108,7 @@
|
||||
return
|
||||
|
||||
/obj/machinery/computer/aifixer/process()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
|
||||
if(..())
|
||||
src.updateDialog()
|
||||
return
|
||||
|
||||
@@ -144,3 +142,19 @@
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/computer/aifixer/update_icon()
|
||||
..()
|
||||
// Broken / Unpowered
|
||||
if((stat & BROKEN) || (stat & NOPOWER))
|
||||
overlays = null
|
||||
|
||||
// Working / Powered
|
||||
else
|
||||
if (occupant)
|
||||
switch (occupant.stat)
|
||||
if (0)
|
||||
overlays += image('icons/obj/computer.dmi', "ai-fixer-full")
|
||||
if (2)
|
||||
overlays += image('icons/obj/computer.dmi', "ai-fixer-404")
|
||||
else
|
||||
overlays += image('icons/obj/computer.dmi', "ai-fixer-empty")
|
||||
|
||||
@@ -219,18 +219,6 @@
|
||||
src.blocked = 0
|
||||
return
|
||||
|
||||
/obj/machinery/computer/arcade/power_change()
|
||||
|
||||
if(stat & BROKEN)
|
||||
icon_state = "arcadeb"
|
||||
else
|
||||
if( powered() )
|
||||
icon_state = initial(icon_state)
|
||||
stat &= ~NOPOWER
|
||||
else
|
||||
spawn(rand(0, 15))
|
||||
src.icon_state = "arcade0"
|
||||
stat |= NOPOWER
|
||||
|
||||
/obj/machinery/computer/arcade/attackby(I as obj, user as mob)
|
||||
if(istype(I, /obj/item/weapon/card/emag) && !emagged)
|
||||
|
||||
@@ -12,10 +12,11 @@
|
||||
var/datum/radio_frequency/radio_connection
|
||||
|
||||
|
||||
initialize()
|
||||
/obj/machinery/computer/atmos_alert/initialize()
|
||||
..()
|
||||
set_frequency(receive_frequency)
|
||||
|
||||
receive_signal(datum/signal/signal)
|
||||
/obj/machinery/computer/atmos_alert/receive_signal(datum/signal/signal)
|
||||
if(!signal || signal.encryption) return
|
||||
|
||||
var/zone = signal.data["zone"]
|
||||
@@ -33,22 +34,27 @@
|
||||
return
|
||||
|
||||
|
||||
proc/set_frequency(new_frequency)
|
||||
/obj/machinery/computer/atmos_alert/proc/set_frequency(new_frequency)
|
||||
radio_controller.remove_object(src, receive_frequency)
|
||||
receive_frequency = new_frequency
|
||||
radio_connection = radio_controller.add_object(src, receive_frequency, RADIO_ATMOSIA)
|
||||
|
||||
|
||||
attack_hand(mob/user)
|
||||
/obj/machinery/computer/atmos_alert/attack_hand(mob/user)
|
||||
if(..(user))
|
||||
return
|
||||
user << browse(return_text(),"window=computer")
|
||||
user.set_machine(src)
|
||||
onclose(user, "computer")
|
||||
|
||||
process()
|
||||
..()
|
||||
/obj/machinery/computer/atmos_alert/process()
|
||||
if(..())
|
||||
src.updateDialog()
|
||||
|
||||
update_icon()
|
||||
/obj/machinery/computer/atmos_alert/update_icon()
|
||||
..()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
if(priority_alarms.len)
|
||||
icon_state = "alert:2"
|
||||
|
||||
@@ -60,7 +66,7 @@
|
||||
return
|
||||
|
||||
|
||||
proc/return_text()
|
||||
/obj/machinery/computer/atmos_alert/proc/return_text()
|
||||
var/priority_text
|
||||
var/minor_text
|
||||
|
||||
@@ -88,7 +94,7 @@
|
||||
return output
|
||||
|
||||
|
||||
Topic(href, href_list)
|
||||
/obj/machinery/computer/atmos_alert/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
@@ -105,26 +111,3 @@
|
||||
minor_alarms -= zone
|
||||
update_icon()
|
||||
return
|
||||
|
||||
attackby(I as obj, user as mob)
|
||||
if(istype(I, /obj/item/weapon/screwdriver))
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
if(do_after(user, 20))
|
||||
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
|
||||
var/obj/item/weapon/circuitboard/atmos_alert/M = new /obj/item/weapon/circuitboard/atmos_alert( A )
|
||||
for (var/obj/C in src)
|
||||
C.loc = src.loc
|
||||
A.circuit = M
|
||||
A.anchored = 1
|
||||
|
||||
if (src.stat & BROKEN)
|
||||
user << "\blue The broken glass falls out."
|
||||
new /obj/item/weapon/shard( src.loc )
|
||||
A.state = 3
|
||||
A.icon_state = "3"
|
||||
else
|
||||
user << "\blue You disconnect the monitor."
|
||||
A.state = 4
|
||||
A.icon_state = "4"
|
||||
|
||||
del(src)
|
||||
|
||||
@@ -88,6 +88,12 @@
|
||||
density = 0
|
||||
circuit = null
|
||||
|
||||
/obj/machinery/computer/security/telescreen/update_icon()
|
||||
icon_state = initial(icon_state)
|
||||
if(stat & BROKEN)
|
||||
icon_state += "b"
|
||||
return
|
||||
|
||||
/obj/machinery/computer/security/telescreen/entertainment
|
||||
name = "entertainment monitor"
|
||||
desc = "Damn, they better have /tg/thechannel on these things."
|
||||
|
||||
@@ -454,15 +454,14 @@
|
||||
break
|
||||
return selected_record
|
||||
|
||||
/obj/machinery/computer/cloning/power_change()
|
||||
/obj/machinery/computer/cloning/update_icon()
|
||||
|
||||
if(stat & BROKEN)
|
||||
icon_state = "commb"
|
||||
else
|
||||
if( powered() )
|
||||
icon_state = initial(icon_state)
|
||||
stat &= ~NOPOWER
|
||||
else
|
||||
spawn(rand(0, 15))
|
||||
if(stat & NOPOWER)
|
||||
src.icon_state = "c_unpowered"
|
||||
stat |= NOPOWER
|
||||
else
|
||||
icon_state = initial(icon_state)
|
||||
stat &= ~NOPOWER
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
|
||||
/obj/machinery/computer/communications/process()
|
||||
..()
|
||||
if(..())
|
||||
if(state != STATE_STATUSDISPLAY)
|
||||
src.updateDialog()
|
||||
|
||||
|
||||
@@ -3,16 +3,27 @@
|
||||
icon = 'icons/obj/computer.dmi'
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
var/obj/item/weapon/circuitboard/circuit = null //if circuit==null, computer can't disassemble
|
||||
use_power = 1
|
||||
idle_power_usage = 300
|
||||
active_power_usage = 300
|
||||
var/obj/item/weapon/circuitboard/circuit = null //if circuit==null, computer can't disassembly
|
||||
var/processing = 0
|
||||
|
||||
|
||||
New()
|
||||
/obj/machinery/computer/New()
|
||||
..()
|
||||
spawn(2)
|
||||
if(ticker)
|
||||
initialize()
|
||||
|
||||
|
||||
/obj/machinery/computer/initialize()
|
||||
power_change()
|
||||
|
||||
/obj/machinery/computer/process()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return 0
|
||||
return 1
|
||||
|
||||
meteorhit(var/obj/O as obj)
|
||||
/obj/machinery/computer/meteorhit(var/obj/O as obj)
|
||||
for(var/x in verbs)
|
||||
verbs -= x
|
||||
set_broken()
|
||||
@@ -22,12 +33,12 @@
|
||||
return
|
||||
|
||||
|
||||
emp_act(severity)
|
||||
/obj/machinery/computer/emp_act(severity)
|
||||
if(prob(20/severity)) set_broken()
|
||||
..()
|
||||
|
||||
|
||||
ex_act(severity)
|
||||
/obj/machinery/computer/ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
del(src)
|
||||
@@ -48,64 +59,44 @@
|
||||
else
|
||||
return
|
||||
|
||||
bullet_act(var/obj/item/projectile/Proj)
|
||||
/obj/machinery/computer/bullet_act(var/obj/item/projectile/Proj)
|
||||
if(prob(Proj.damage))
|
||||
set_broken()
|
||||
..()
|
||||
|
||||
|
||||
blob_act()
|
||||
/obj/machinery/computer/blob_act()
|
||||
if (prob(75))
|
||||
for(var/x in verbs)
|
||||
verbs -= x
|
||||
set_broken()
|
||||
density = 0
|
||||
|
||||
|
||||
power_change()
|
||||
if(!istype(src,/obj/machinery/computer/security/telescreen))
|
||||
/obj/machinery/computer/update_icon()
|
||||
..()
|
||||
icon_state = initial(icon_state)
|
||||
// Broken
|
||||
if(stat & BROKEN)
|
||||
icon_state = initial(icon_state)
|
||||
icon_state += "b"
|
||||
if (istype(src,/obj/machinery/computer/aifixer))
|
||||
overlays = null
|
||||
|
||||
else if(powered())
|
||||
icon_state = initial(icon_state)
|
||||
stat &= ~NOPOWER
|
||||
if (istype(src,/obj/machinery/computer/aifixer))
|
||||
var/obj/machinery/computer/aifixer/O = src
|
||||
if (O.occupant)
|
||||
switch (O.occupant.stat)
|
||||
if (0)
|
||||
overlays += image('icons/obj/computer.dmi', "ai-fixer-full")
|
||||
if (2)
|
||||
overlays += image('icons/obj/computer.dmi', "ai-fixer-404")
|
||||
else
|
||||
overlays += image('icons/obj/computer.dmi', "ai-fixer-empty")
|
||||
else
|
||||
spawn(rand(0, 15))
|
||||
//icon_state = "c_unpowered"
|
||||
// Powered
|
||||
else if(stat & NOPOWER)
|
||||
icon_state = initial(icon_state)
|
||||
icon_state += "0"
|
||||
stat |= NOPOWER
|
||||
if (istype(src,/obj/machinery/computer/aifixer))
|
||||
overlays = null
|
||||
|
||||
|
||||
process()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
use_power(250)
|
||||
|
||||
/obj/machinery/computer/power_change()
|
||||
..()
|
||||
update_icon()
|
||||
|
||||
|
||||
proc/set_broken()
|
||||
icon_state = initial(icon_state)
|
||||
icon_state += "b"
|
||||
/obj/machinery/computer/proc/set_broken()
|
||||
stat |= BROKEN
|
||||
update_icon()
|
||||
|
||||
|
||||
attackby(I as obj, user as mob)
|
||||
/obj/machinery/computer/attackby(I as obj, user as mob)
|
||||
if(istype(I, /obj/item/weapon/screwdriver) && circuit)
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
if(do_after(user, 20))
|
||||
|
||||
@@ -9,37 +9,37 @@
|
||||
var/list/tracked = list( )
|
||||
|
||||
|
||||
New()
|
||||
/obj/machinery/computer/crew/New()
|
||||
tracked = list()
|
||||
..()
|
||||
|
||||
|
||||
attack_ai(mob/user)
|
||||
/obj/machinery/computer/crew/attack_ai(mob/user)
|
||||
attack_hand(user)
|
||||
interact(user)
|
||||
|
||||
|
||||
attack_hand(mob/user)
|
||||
/obj/machinery/computer/crew/attack_hand(mob/user)
|
||||
add_fingerprint(user)
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
interact(user)
|
||||
|
||||
|
||||
power_change()
|
||||
/obj/machinery/computer/crew/update_icon()
|
||||
|
||||
if(stat & BROKEN)
|
||||
icon_state = "broken"
|
||||
else
|
||||
if( powered() )
|
||||
icon_state = initial(icon_state)
|
||||
stat &= ~NOPOWER
|
||||
else
|
||||
spawn(rand(0, 15))
|
||||
if(stat & NOPOWER)
|
||||
src.icon_state = "c_unpowered"
|
||||
stat |= NOPOWER
|
||||
else
|
||||
icon_state = initial(icon_state)
|
||||
stat &= ~NOPOWER
|
||||
|
||||
|
||||
Topic(href, href_list)
|
||||
/obj/machinery/computer/crew/Topic(href, href_list)
|
||||
if(..()) return
|
||||
if (src.z > 6)
|
||||
usr << "\red <b>Unable to establish a connection</b>: \black You're too far away from the station!"
|
||||
@@ -53,9 +53,10 @@
|
||||
return
|
||||
|
||||
|
||||
interact(mob/user)
|
||||
if( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) )
|
||||
if(!istype(user, /mob/living/silicon))
|
||||
/obj/machinery/computer/crew/interact(mob/user)
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
if(!istype(user, /mob/living/silicon) && get_dist(src, user) > 1)
|
||||
user.unset_machine()
|
||||
user << browse(null, "window=powcomp")
|
||||
return
|
||||
@@ -105,7 +106,7 @@
|
||||
onclose(user, "crewcomp")
|
||||
|
||||
|
||||
proc/scan()
|
||||
/obj/machinery/computer/crew/proc/scan()
|
||||
for(var/obj/item/clothing/under/C in world)
|
||||
if((C.has_sensor) && (istype(C.loc, /mob/living/carbon/human)))
|
||||
var/check = 0
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/machinery/computer/message_monitor/power_change()
|
||||
/obj/machinery/computer/message_monitor/update_icon()
|
||||
..()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
@@ -74,7 +74,7 @@
|
||||
else
|
||||
icon_state = normal_icon
|
||||
|
||||
/obj/machinery/computer/message_monitor/process()
|
||||
/obj/machinery/computer/message_monitor/initialize()
|
||||
//Is the server isn't linked to a server, and there's a server available, default it to the first one in the list.
|
||||
if(!linkedServer)
|
||||
if(message_servers && message_servers.len > 0)
|
||||
|
||||
@@ -146,7 +146,8 @@
|
||||
|
||||
|
||||
/obj/machinery/computer/pod/process()
|
||||
..()
|
||||
if(!..())
|
||||
return
|
||||
if(timing)
|
||||
if(time > 0)
|
||||
time = round(time) - 1
|
||||
|
||||
@@ -126,10 +126,6 @@
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/power/monitor/process()
|
||||
if(!(stat & (NOPOWER|BROKEN)) )
|
||||
use_power(250)
|
||||
|
||||
/obj/machinery/power/monitor/power_change()
|
||||
|
||||
if(stat & BROKEN)
|
||||
|
||||
@@ -63,9 +63,7 @@
|
||||
|
||||
|
||||
process()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
use_power(500)
|
||||
if(!..())
|
||||
src.updateDialog()
|
||||
return
|
||||
|
||||
|
||||
@@ -116,6 +116,8 @@ proc/move_mining_shuttle()
|
||||
var/location = 0 //0 = station, 1 = mining base
|
||||
|
||||
/obj/machinery/computer/mining_shuttle/attack_hand(user as mob)
|
||||
if(..(user))
|
||||
return
|
||||
src.add_fingerprint(usr)
|
||||
var/dat
|
||||
dat = text("<center>Mining shuttle:<br> <b><A href='?src=\ref[src];move=[1]'>Send</A></b></center>")
|
||||
|
||||
Reference in New Issue
Block a user