Skip to content

Commit

Permalink
Machinery (#12)
Browse files Browse the repository at this point in the history
* Make arcade to machine instead computer

* Power stuff

* Machinery power and building update.
  • Loading branch information
LethalGhost authored Dec 5, 2017
1 parent e104c6d commit 45ff6d2
Show file tree
Hide file tree
Showing 112 changed files with 484 additions and 649 deletions.
6 changes: 3 additions & 3 deletions baystation12.dme
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@
#include "code\game\machinery\adv_med.dm"
#include "code\game\machinery\ai_slipper.dm"
#include "code\game\machinery\alarm.dm"
#include "code\game\machinery\arcade.dm"
#include "code\game\machinery\atmo_control.dm"
#include "code\game\machinery\autolathe.dm"
#include "code\game\machinery\autolathe_datums.dm"
Expand All @@ -375,6 +376,7 @@
#include "code\game\machinery\flasher.dm"
#include "code\game\machinery\floodlight.dm"
#include "code\game\machinery\floorlayer.dm"
#include "code\game\machinery\guestpass.dm"
#include "code\game\machinery\hologram.dm"
#include "code\game\machinery\holosign.dm"
#include "code\game\machinery\igniter.dm"
Expand All @@ -389,7 +391,6 @@
#include "code\game\machinery\newscaster.dm"
#include "code\game\machinery\nuclear_bomb.dm"
#include "code\game\machinery\OpTable.dm"
#include "code\game\machinery\overview.dm"
#include "code\game\machinery\PDApainter.dm"
#include "code\game\machinery\portable_tag_turret.dm"
#include "code\game\machinery\portable_turret.dm"
Expand Down Expand Up @@ -427,7 +428,6 @@
#include "code\game\machinery\camera\tracking.dm"
#include "code\game\machinery\computer\ai_core.dm"
#include "code\game\machinery\computer\aifixer.dm"
#include "code\game\machinery\computer\arcade.dm"
#include "code\game\machinery\computer\atmos_alert.dm"
#include "code\game\machinery\computer\atmos_control.dm"
#include "code\game\machinery\computer\buildandrepair.dm"
Expand All @@ -437,7 +437,6 @@
#include "code\game\machinery\computer\communications.dm"
#include "code\game\machinery\computer\computer.dm"
#include "code\game\machinery\computer\crew.dm"
#include "code\game\machinery\computer\guestpass.dm"
#include "code\game\machinery\computer\law.dm"
#include "code\game\machinery\computer\medical.dm"
#include "code\game\machinery\computer\message.dm"
Expand Down Expand Up @@ -722,6 +721,7 @@
#include "code\game\objects\items\weapons\circuitboards\computer\research.dm"
#include "code\game\objects\items\weapons\circuitboards\computer\supply.dm"
#include "code\game\objects\items\weapons\circuitboards\computer\telecomms.dm"
#include "code\game\objects\items\weapons\circuitboards\machinery\arcade.dm"
#include "code\game\objects\items\weapons\circuitboards\machinery\biogenerator.dm"
#include "code\game\objects\items\weapons\circuitboards\machinery\cloning.dm"
#include "code\game\objects\items\weapons\circuitboards\machinery\commsantenna.dm"
Expand Down
7 changes: 0 additions & 7 deletions code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,6 @@
if(.<=2)
user << "A small gauge in the corner reads [round(last_flow_rate, 0.1)] L/s; [round(last_power_draw)] W"


/obj/machinery/atmospherics/unary/vent_pump/power_change()
var/old_stat = stat
..()
if(old_stat != stat)
update_icon()

/obj/machinery/atmospherics/binary/dp_vent_pump/receive_signal(datum/signal/signal)
if(!signal.data["tag"] || (signal.data["tag"] != id) || (signal.data["sigtype"]!="command"))
return 0
Expand Down
6 changes: 0 additions & 6 deletions code/ATMOSPHERICS/components/binary_devices/pump.dm
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,6 @@ Thus, the two variables affect pump operation are set in New():

src.update_icon()

/obj/machinery/atmospherics/binary/pump/power_change()
var/old_stat = stat
..()
if(old_stat != stat)
update_icon()

/obj/machinery/atmospherics/binary/pump/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
if (!istype(W, /obj/item/weapon/wrench))
return ..()
Expand Down
6 changes: 0 additions & 6 deletions code/ATMOSPHERICS/components/omni_devices/omni_base.dm
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,6 @@
return 0
return 1

/obj/machinery/atmospherics/omni/power_change()
var/old_stat = stat
..()
if(old_stat != stat)
update_icon()

/obj/machinery/atmospherics/omni/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
if(!istype(W, /obj/item/weapon/wrench))
return ..()
Expand Down
6 changes: 0 additions & 6 deletions code/ATMOSPHERICS/components/trinary_devices/filter.dm
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,6 @@
/obj/machinery/atmospherics/trinary/filter/hide(var/i)
update_underlays()

/obj/machinery/atmospherics/trinary/filter/power_change()
var/old_stat = stat
..()
if(old_stat != stat)
update_icon()

/obj/machinery/atmospherics/trinary/filter/process()
..()

Expand Down
6 changes: 0 additions & 6 deletions code/ATMOSPHERICS/components/trinary_devices/mixer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,6 @@
/obj/machinery/atmospherics/trinary/mixer/hide(var/i)
update_underlays()

/obj/machinery/atmospherics/trinary/mixer/power_change()
var/old_stat = stat
..()
if(old_stat != stat)
update_icon()

/obj/machinery/atmospherics/trinary/mixer/New()
..()
air1.volume = ATMOS_DEFAULT_VOLUME_MIXER
Expand Down
18 changes: 4 additions & 14 deletions code/ATMOSPHERICS/components/tvalve.dm
Original file line number Diff line number Diff line change
Expand Up @@ -288,16 +288,11 @@
icon_state = "map_tvalve1"
state = 1

/obj/machinery/atmospherics/tvalve/digital/power_change()
var/old_stat = stat
..()
if(old_stat != stat)
update_icon()

/obj/machinery/atmospherics/tvalve/digital/update_icon()
..()
if(!powered())
icon_state = "tvalvenopower"
else
..()

/obj/machinery/atmospherics/tvalve/digital/attack_ai(mob/user as mob)
return src.attack_hand(user)
Expand Down Expand Up @@ -428,16 +423,11 @@
icon_state = "map_tvalvem1"
state = 1

/obj/machinery/atmospherics/tvalve/mirrored/digital/power_change()
var/old_stat = stat
..()
if(old_stat != stat)
update_icon()

/obj/machinery/atmospherics/tvalve/mirrored/digital/update_icon()
..()
if(!powered())
icon_state = "tvalvemnopower"
else
..()

/obj/machinery/atmospherics/tvalve/mirrored/digital/attack_ai(mob/user as mob)
return src.attack_hand(user)
Expand Down
24 changes: 9 additions & 15 deletions code/ATMOSPHERICS/components/unary/outlet_injector.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//Basically a one way passive valve. If the pressure inside is greater than the environment then gas will flow passively,
//Basically a one way passive valve. If the pressure inside is greater than the environment then gas will flow passively,
//but it does not permit gas to flow back from the environment into the injector. Can be turned off to prevent any gas flow.
//When it receives the "inject" signal, it will try to pump it's entire contents into the environment regardless of pressure, using power.

Expand All @@ -13,7 +13,7 @@
use_power = 0
idle_power_usage = 150 //internal circuitry, friction losses and stuff
power_rating = 15000 //15000 W ~ 20 HP

var/injecting = 0

var/volume_rate = 50 //flow rate limit
Expand All @@ -26,7 +26,7 @@

/obj/machinery/atmospherics/unary/outlet_injector/New()
..()
air_contents.volume = ATMOS_DEFAULT_VOLUME_PUMP + 500 //Give it a small reservoir for injecting. Also allows it to have a higher flow rate limit than vent pumps, to differentiate injectors a bit more.
air_contents.volume = ATMOS_DEFAULT_VOLUME_PUMP + 500 //Give it a small reservoir for injecting. Also allows it to have a higher flow rate limit than vent pumps, to differentiate injectors a bit more.

/obj/machinery/atmospherics/unary/outlet_injector/update_icon()
if(!powered())
Expand All @@ -42,12 +42,6 @@
return
add_underlay(T, node, dir)

/obj/machinery/atmospherics/unary/outlet_injector/power_change()
var/old_stat = stat
..()
if(old_stat != stat)
update_icon()

/obj/machinery/atmospherics/unary/outlet_injector/process()
..()

Expand All @@ -56,21 +50,21 @@

if((stat & (NOPOWER|BROKEN)) || !use_power)
return

var/power_draw = -1
var/datum/gas_mixture/environment = loc.return_air()

if(environment && air_contents.temperature > 0)
var/transfer_moles = (volume_rate/air_contents.volume)*air_contents.total_moles //apply flow rate limit
power_draw = pump_gas(src, air_contents, environment, transfer_moles, power_rating)

if (power_draw >= 0)
last_power_draw = power_draw
use_power(power_draw)

if(network)
network.update = 1

return 1

/obj/machinery/atmospherics/unary/outlet_injector/proc/inject()
Expand All @@ -80,7 +74,7 @@
var/datum/gas_mixture/environment = loc.return_air()
if (!environment)
return 0

injecting = 1

if(air_contents.temperature > 0)
Expand Down
6 changes: 0 additions & 6 deletions code/ATMOSPHERICS/components/unary/vent_pump.dm
Original file line number Diff line number Diff line change
Expand Up @@ -389,12 +389,6 @@
if(welded)
user << "It seems welded shut."

/obj/machinery/atmospherics/unary/vent_pump/power_change()
var/old_stat = stat
..()
if(old_stat != stat)
update_icon()

/obj/machinery/atmospherics/unary/vent_pump/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
if (!istype(W, /obj/item/weapon/wrench))
return ..()
Expand Down
6 changes: 0 additions & 6 deletions code/ATMOSPHERICS/components/unary/vent_scrubber.dm
Original file line number Diff line number Diff line change
Expand Up @@ -247,12 +247,6 @@
update_icon()
return

/obj/machinery/atmospherics/unary/vent_scrubber/power_change()
var/old_stat = stat
..()
if(old_stat != stat)
update_icon()

/obj/machinery/atmospherics/unary/vent_scrubber/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
if (!istype(W, /obj/item/weapon/wrench))
return ..()
Expand Down
9 changes: 2 additions & 7 deletions code/ATMOSPHERICS/components/valve.dm
Original file line number Diff line number Diff line change
Expand Up @@ -247,16 +247,11 @@
open = 1
icon_state = "map_valve1"

/obj/machinery/atmospherics/valve/digital/power_change()
var/old_stat = stat
..()
if(old_stat != stat)
update_icon()

/obj/machinery/atmospherics/valve/digital/update_icon()
..()
if(!powered())
icon_state = "valve[open]nopower"
else
..()

/obj/machinery/atmospherics/valve/digital/proc/set_frequency(new_frequency)
radio_controller.remove_object(src, frequency)
Expand Down
3 changes: 3 additions & 0 deletions code/__defines/machinery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,6 @@
#define TELECOMMS_RECEPTION_SENDER 1
#define TELECOMMS_RECEPTION_RECEIVER 2
#define TELECOMMS_RECEPTION_BOTH 3

#define FRAME_COMPUTER 1
#define FRAME_LAPTOP 2
22 changes: 1 addition & 21 deletions code/game/dna/dna_modifier.dm
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@
name = "DNA Modifier Access Console"
desc = "Scand DNA."
icon = 'icons/obj/computer.dmi'
icon_state = "scanner"
screen_icon = "scanner"
density = 1
circuit = /obj/item/weapon/circuitboard/scan_consolenew
var/selected_ui_block = 1.0
Expand Down Expand Up @@ -277,17 +277,6 @@
if(prob(75))
qdel(src)

/obj/machinery/computer/scan_consolenew/power_change()
..()
if(stat & BROKEN)
icon_state = "broken"
else
if (stat & NOPOWER)
spawn(rand(0, 15))
src.icon_state = "c_unpowered"
else
icon_state = initial(icon_state)

/obj/machinery/computer/scan_consolenew/New()
..()
for(var/i=0;i<3;i++)
Expand Down Expand Up @@ -317,15 +306,6 @@
I.buf = buffer
return 1

/*
/obj/machinery/computer/scan_consolenew/process() //not really used right now
if(stat & (NOPOWER|BROKEN))
return
if (!( src.status )) //remove this
return
return
*/

/obj/machinery/computer/scan_consolenew/attack_ai(user as mob)
src.add_hiddenprint(user)
ui_interact(user)
Expand Down
7 changes: 1 addition & 6 deletions code/game/machinery/PDApainter.dm
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,4 @@
storedpda = null
update_icon()
else
usr << SPAN_NOTE("The [src] is empty.")


/obj/machinery/pdapainter/power_change()
..()
update_icon()
usr << SPAN_NOTE("The [src] is empty.")
3 changes: 1 addition & 2 deletions code/game/machinery/adv_med.dm
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,7 @@
if(prob(50))
qdel(src)

/obj/machinery/body_scanconsole/power_change()
..()
/obj/machinery/body_scanconsole/update_icon()
if(stat & BROKEN)
icon_state = "body_scannerconsole-p"
else
Expand Down
4 changes: 0 additions & 4 deletions code/game/machinery/ai_slipper.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@
..()
update_icon()

/obj/machinery/ai_slipper/power_change()
..()
update_icon()

/obj/machinery/ai_slipper/update_icon()
if (stat & NOPOWER || stat & BROKEN)
icon_state = "motion0"
Expand Down
12 changes: 0 additions & 12 deletions code/game/machinery/alarm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -842,11 +842,6 @@

return ..()

/obj/machinery/alarm/power_change()
..()
spawn(rand(0,15))
update_icon()

/obj/machinery/alarm/examine(mob/user)
. = ..()
if (buildstage < 2)
Expand Down Expand Up @@ -1001,13 +996,6 @@ FIRE ALARM
if(locate(/obj/fire) in loc)
alarm()

return

/obj/machinery/firealarm/power_change()
..()
spawn(rand(0,15))
update_icon()

/obj/machinery/firealarm/attack_hand(mob/user as mob)
if(user.stat || stat & (NOPOWER|BROKEN))
return
Expand Down
Loading

0 comments on commit 45ff6d2

Please sign in to comment.