diff --git a/code/defines/obj/machinery.dm b/code/defines/obj/machinery.dm
index 0aa09ba8205..ac254a02919 100644
--- a/code/defines/obj/machinery.dm
+++ b/code/defines/obj/machinery.dm
@@ -311,40 +311,6 @@
idle_power_usage = 0
active_power_usage = 1
*/
-/obj/machinery/power
- name = null
- icon = 'power.dmi'
- anchored = 1.0
- var/datum/powernet/powernet = null
- var/netnum = 0
- var/directwired = 1 // by default, power machines are connected by a cable in a neighbouring turf
- // if set to 0, requires a 0-X cable on this turf
- use_power = 0
- idle_power_usage = 0
- active_power_usage = 0
-
-/obj/machinery/power/terminal
- name = "terminal"
- icon_state = "term"
- desc = "It's an underfloor wiring terminal for power equipment."
- level = 1
- layer = TURF_LAYER
- var/obj/machinery/power/master = null
- anchored = 1
- directwired = 0 // must have a cable on same turf connecting to terminal
- layer = 2.6 // a bit above wires
-
-
-/obj/machinery/power/monitor
- name = "power monitoring computer"
- desc = "It monitors power levels across the station."
- icon = 'computer.dmi'
- icon_state = "power"
- density = 1
- anchored = 1
- use_power = 2
- idle_power_usage = 20
- active_power_usage = 80
/obj/machinery/light_switch
name = "light switch"
diff --git a/code/game/machinery/computer/power.dm b/code/game/machinery/computer/power.dm
index d894e486c56..33b0dfb88eb 100644
--- a/code/game/machinery/computer/power.dm
+++ b/code/game/machinery/computer/power.dm
@@ -1,5 +1,16 @@
// the power monitoring computer
// for the moment, just report the status of all APCs in the same powernet
+/obj/machinery/power/monitor
+ name = "power monitoring computer"
+ desc = "It monitors power levels across the station."
+ icon = 'computer.dmi'
+ icon_state = "power"
+ density = 1
+ anchored = 1
+ use_power = 2
+ idle_power_usage = 20
+ active_power_usage = 80
+
/obj/machinery/power/monitor/attack_ai(mob/user)
add_fingerprint(user)
diff --git a/code/modules/mob/living/carbon/human/inventory.dm b/code/modules/mob/living/carbon/human/inventory.dm
index 437ca037f01..96d805ccede 100644
--- a/code/modules/mob/living/carbon/human/inventory.dm
+++ b/code/modules/mob/living/carbon/human/inventory.dm
@@ -451,10 +451,6 @@
message = text("\red [] is trying to inject []!", source, target)
if("pill")
message = text("\red [] is trying to force [] to swallow []!", source, target, item)
-// dear god this is all horrible, godspeed carn ;-;
-// mport: i dunno if you care about this, but it's related to AM. -Pete
-// if("fuel")
-// message = text("\red [source] is trying to force [target] to eat the [item:content]!")
if("drink")
message = text("\red [] is trying to force [] to swallow a gulp of []!", source, target, item)
if("dnainjector")
@@ -944,21 +940,6 @@ It can still be worn/put on as normal.
O.show_message(text("\red [] performs CPR on []!", source, target), 1)
target << "\blue You feel a breath of fresh air enter your lungs. It feels good."
source << "\red Repeat every 7 seconds AT LEAST."
-/* if("fuel")
- var/obj/item/weapon/fuel/S = item
- if (!( istype(S, /obj/item/weapon/fuel) ))
- //SN src = null
- del(src)
- return
- if (S.s_time >= world.time + 30)
- //SN src = null
- del(src)
- return
- S.s_time = world.time
- var/a = S.content
- for(var/mob/O in viewers(source, null))
- O.show_message(text("\red [source] forced [target] to eat the [a]!"), 1)
- S.injest(target) */
if("dnainjector")
var/obj/item/weapon/dnainjector/S = item
if(item)
diff --git a/code/modules/power/antimatter/containment_jar.dm b/code/modules/power/antimatter/containment_jar.dm
new file mode 100644
index 00000000000..ea86c986de6
--- /dev/null
+++ b/code/modules/power/antimatter/containment_jar.dm
@@ -0,0 +1,41 @@
+/obj/item/weapon/am_containment
+ name = "antimatter containment jar"
+ desc = "Holds antimatter."
+ icon = 'antimatter.dmi'
+ icon_state = "jar"
+ density = 0
+ anchored = 0
+ force = 8
+ throwforce = 10
+ throw_speed = 1
+ throw_range = 2
+
+ var/fuel = 1000
+ var/fuel_max = 1000//Lets try this for now
+ var/stability = 100//TODO: add all the stability things to this so its not very safe if you keep hitting in on things
+
+
+ ex_act(severity)
+ switch(severity)
+ if(1.0)
+ explosion(get_turf(src), 1, 2, 3, 5)//Should likely be larger but this works fine for now I guess
+ if(src)
+ del(src)
+ return
+ if(2.0)
+ if(prob((fuel/10)-stability))
+ explosion(get_turf(src), 1, 2, 3, 5)
+ if(src)
+ del(src)
+ return
+ stability -= 40
+ if(3.0)
+ stability -= 20
+ //check_stability()
+ return
+
+ proc/usefuel(var/wanted)
+ if(fuel < wanted)
+ wanted = fuel
+ fuel -= wanted
+ return wanted
\ No newline at end of file
diff --git a/code/modules/power/antimatter/control.dm b/code/modules/power/antimatter/control.dm
new file mode 100644
index 00000000000..ab03ab9010c
--- /dev/null
+++ b/code/modules/power/antimatter/control.dm
@@ -0,0 +1,333 @@
+/obj/machinery/power/am_control_unit
+ name = "antimatter control unit"
+ desc = "This device injects antimatter into connected shielding units, the more shielding the more is antimatter is injected and the more power will be output."
+ icon = 'antimatter.dmi'
+ icon_state = "control"
+ anchored = 1
+ density = 1
+ use_power = 1
+ idle_power_usage = 100
+ active_power_usage = 1000
+
+ var/list/obj/machinery/am_shielding/linked_shielding
+ var/list/obj/machinery/am_shielding/linked_cores
+ var/obj/item/weapon/am_containment/fueljar
+ var/update_shield_icons = 0
+ var/stability = 100
+
+ var/active = 0//On or not
+ var/fuel_injection = 2//How much fuel to inject
+ var/shield_icon_delay = 0//delays resetting for a short time
+ var/reported_core_efficiency = 0
+
+ var/power_cycle = 0
+ var/power_cycle_delay = 4//How many ticks till produce_power is called
+ var/stored_core_stability = 0
+ var/stored_core_stability_delay = 0
+
+ var/stored_power = 0//Power to deploy per tick
+
+ New()
+ ..()
+ linked_shielding = list()
+ linked_cores = list()
+
+
+ Del()//Perhaps damage and run stability checks rather than just del on the others
+ for(var/obj/machinery/am_shielding/AMS in linked_shielding)
+ del(AMS)
+ ..()
+
+
+ process()
+ if(update_shield_icons && !shield_icon_delay)
+ check_shield_icons()
+ update_shield_icons = 0
+
+ if(stat & (NOPOWER|BROKEN) || !active)//can update the icons even without power
+ return
+
+ if(!fueljar)//No fuel but we are on, shutdown
+ toggle_power()
+ //Angry buzz or such here
+ return
+
+ add_avail(stored_power)
+
+ power_cycle++
+ if(power_cycle >= power_cycle_delay)
+ produce_power()
+ power_cycle = 0
+
+ return
+
+
+ proc/produce_power()
+ playsound(src.loc, 'bang.ogg', 25, 1)
+ var/core_power = reported_core_efficiency//Effectively how much fuel we can safely deal with
+ if(core_power <= 0) return 0//Something is wrong
+ var/core_damage = 0
+ var/fuel = fueljar.usefuel(fuel_injection)
+
+ stored_power = (fuel/core_power)*fuel*100000
+ //Now check if the cores could deal with it safely, this is done after so you can overload for more power if needed, still a bad idea
+ if(fuel > (2*core_power))//More fuel has been put in than the current cores can deal with
+ if(prob(50))core_damage = 1//Small chance of damage
+ if((fuel-core_power) > 5) core_damage = 5//Now its really starting to overload the cores
+ if((fuel-core_power) > 10) core_damage = 20//Welp now you did it, they wont stand much of this
+ if(core_damage == 0) return
+ for(var/obj/machinery/am_shielding/AMS in linked_cores)
+ AMS.stability -= core_damage
+ AMS.check_stability(1)
+ playsound(src.loc, 'bang.ogg', 50, 1)
+ return
+
+
+ emp_act(severity)
+ switch(severity)
+ if(1)
+ if(active) toggle_power()
+ stability -= rand(15,30)
+ if(2)
+ if(active) toggle_power()
+ stability -= rand(10,20)
+ ..()
+ return 0
+
+
+ blob_act()
+ stability -= 20
+ if(prob(100-stability))//Might infect the rest of the machine
+ for(var/obj/machinery/am_shielding/AMS in linked_shielding)
+ AMS.blob_act()
+ spawn(0)
+ //Likely explode
+ del(src)
+ return
+ check_stability()
+ return
+
+
+ ex_act(severity)
+ switch(severity)
+ if(1.0)
+ stability -= 60
+ if(2.0)
+ stability -= 40
+ if(3.0)
+ stability -= 20
+ check_stability()
+ return
+
+
+ bullet_act(var/obj/item/projectile/Proj)
+ if(Proj.flag != "bullet")
+ stability -= Proj.force
+ return 0
+
+
+ power_change()
+ ..()
+ if(stat & NOPOWER && active)
+ toggle_power()
+ return
+
+
+ update_icon()
+ if(active) icon_state = "control_on"
+ else icon_state = "control"
+ //No other icons for it atm
+
+
+ attackby(obj/item/W, mob/user)
+ if(!istype(W) || !user) return
+ if(istype(W, /obj/item/weapon/wrench))
+ if(!anchored)
+ playsound(src.loc, 'Ratchet.ogg', 75, 1)
+ user.visible_message("[user.name] secures the [src.name] to the floor.", \
+ "You secure the anchor bolts to the floor.", \
+ "You hear a ratchet")
+ src.anchored = 1
+ connect_to_network()
+ else if(!linked_shielding.len > 0)
+ playsound(src.loc, 'Ratchet.ogg', 75, 1)
+ user.visible_message("[user.name] unsecures the [src.name].", \
+ "You remove the anchor bolts.", \
+ "You hear a ratchet")
+ src.anchored = 0
+ disconnect_from_network()
+ else
+ user << "\red Once bolted and linked to a shielding unit it the [src.name] is unable to be moved!"
+ return
+
+ if(istype(W, /obj/item/weapon/am_containment))
+ if(fueljar)
+ user << "\red There is already a [fueljar] inside!"
+ return
+ fueljar = W
+ W.loc = src
+ if(user.client)
+ user.client.screen -= W
+ user.u_equip(W)
+ user.update_icons()
+ user.visible_message("[user.name] loads an [W.name] into the [src.name].", \
+ "You load an [W.name].", \
+ "You hear a thunk.")
+ return
+
+ if(W.force >= 20)
+ stability -= W.force/2
+ check_stability()
+ ..()
+ return
+
+
+ attack_hand(mob/user as mob)
+ if(anchored)
+ interact(user)
+ return
+
+
+ proc/add_shielding(var/obj/machinery/am_shielding/AMS, var/AMS_linking = 0)
+ if(!istype(AMS)) return 0
+ if(!anchored) return 0
+ if(!AMS_linking && !AMS.link_control(src)) return 0
+ linked_shielding.Add(AMS)
+ update_shield_icons = 1
+ return 1
+
+
+ proc/remove_shielding(var/obj/machinery/am_shielding/AMS)
+ if(!istype(AMS)) return 0
+ linked_shielding.Remove(AMS)
+ update_shield_icons = 2
+ if(active) toggle_power()
+ return 1
+
+
+ proc/check_stability()//TODO: make it break when low also might want to add a way to fix it like a part or such that can be replaced
+ if(stability <= 0)
+ del(src)
+ return
+
+
+ proc/toggle_power()
+ active = !active
+ if(active)
+ use_power = 2
+ visible_message("The [src.name] starts up.")
+ else
+ use_power = 1
+ visible_message("The [src.name] shuts down up.")
+ update_icon()
+ return
+
+
+ proc/check_shield_icons()//Forces icon_update for all shields
+ if(shield_icon_delay) return
+ shield_icon_delay = 1
+ if(update_shield_icons == 2)//2 means to clear everything and rebuild
+ for(var/obj/machinery/am_shielding/AMS in linked_shielding)
+ if(AMS.processing) AMS.shutdown_core()
+ AMS.control_unit = null
+ spawn(10)
+ AMS.controllerscan()
+ linked_shielding = list()
+
+ else
+ for(var/obj/machinery/am_shielding/AMS in linked_shielding)
+ AMS.update_icon()
+ spawn(20)
+ shield_icon_delay = 0
+ return
+
+
+ proc/check_core_stability()
+ if(stored_core_stability_delay || linked_cores.len <= 0) return
+ stored_core_stability_delay = 1
+ stored_core_stability = 0
+ for(var/obj/machinery/am_shielding/AMS in linked_cores)
+ stored_core_stability += AMS.stability
+ stored_core_stability/=linked_cores.len
+ spawn(40)
+ stored_core_stability_delay = 0
+ return
+
+
+ proc/interact(mob/user)
+ if((get_dist(src, user) > 1) || (stat & (BROKEN|NOPOWER)))
+ if(!istype(user, /mob/living/silicon/ai))
+ user.machine = null
+ user << browse(null, "window=AMcontrol")
+ return
+ user.machine = src
+
+ var/dat = ""
+ dat += "AntiMatter Control Panel
"
+ dat += "Close
"
+ dat += "Refresh
"
+ dat += "Force Shielding Update
"
+ dat += "Status: [(active?"Injecting":"Standby")]
"
+ dat += "Toggle Status
"
+
+ dat += "Stability: [stability]%
"
+ dat += "Reactor parts: [linked_shielding.len]
"//TODO: perhaps add some sort of stability check
+ dat += "Cores: [linked_cores.len]
"
+ dat += "-Current Efficiency: [reported_core_efficiency]
"
+ dat += "-Average Stability: [stored_core_stability] (update)
"
+ dat += "Last Produced: [stored_power]
"
+
+ dat += "Fuel: "
+ if(!fueljar)
+ dat += "
No fuel receptacle detected."
+ else
+ dat += "Eject
"
+ dat += "- [fueljar.fuel]/[fueljar.fuel_max] Units
"
+
+ dat += "- Injecting: [fuel_injection] units
"
+ dat += "- --|++
"
+
+
+ user << browse(dat, "window=AMcontrol;size=420x500")
+ onclose(user, "AMcontrol")
+ return
+
+
+ Topic(href, href_list)
+ ..()
+ //Ignore input if we are broken or guy is not touching us, AI can control from a ways away
+ if(stat & (BROKEN|NOPOWER) || (get_dist(src, usr) > 1 && !istype(usr, /mob/living/silicon/ai)))
+ usr.machine = null
+ usr << browse(null, "window=AMcontrol")
+ return
+
+ if(href_list["close"])
+ usr << browse(null, "window=AMcontrol")
+ usr.machine = null
+ return
+
+ if(href_list["togglestatus"])
+ toggle_power()
+
+ if(href_list["refreshicons"])
+ update_shield_icons = 1
+
+ if(href_list["ejectjar"])
+ if(fueljar)
+ fueljar.loc = src.loc
+ fueljar = null
+ //fueljar.control_unit = null currently it does not care where it is
+ //update_icon() when we have the icon for it
+
+ if(href_list["strengthup"])
+ fuel_injection++
+
+ if(href_list["strengthdown"])
+ fuel_injection--
+ if(fuel_injection < 0) fuel_injection = 0
+
+ if(href_list["refreshstability"])
+ check_core_stability()
+
+ updateDialog()
+ return
\ No newline at end of file
diff --git a/code/modules/power/antimatter/shielding.dm b/code/modules/power/antimatter/shielding.dm
new file mode 100644
index 00000000000..da75529cf8a
--- /dev/null
+++ b/code/modules/power/antimatter/shielding.dm
@@ -0,0 +1,221 @@
+//like orange but only checks north/south/east/west for one step
+proc/cardinalrange(var/center)
+ var/list/things = list()
+ for(var/direction in cardinal)
+ var/turf/T = get_step(center, direction)
+ if(!T) continue
+ things += T.contents
+ return things
+
+/obj/machinery/am_shielding
+ name = "antimatter reactor section"
+ desc = "This device was built using a plasma life-form that seems to increase plasma's natural ability to react with neutrinos while reducing the combustibility."
+
+ icon = 'antimatter.dmi'
+ icon_state = "shield"
+ anchored = 1
+ density = 1
+ dir = 1
+ use_power = 0//Living things generally dont use power
+ idle_power_usage = 0
+ active_power_usage = 0
+
+ var/obj/machinery/power/am_control_unit/control_unit = null
+ var/processing = 0//To track if we are in the update list or not, we need to be when we are damaged and if we ever
+ var/stability = 100//If this gets low bad things tend to happen
+ var/efficiency = 1//How many cores this core counts for when doing power processing, plasma in the air and stability could affect this
+
+ New(var/l)
+ ..(l)
+ spawn(10)
+ controllerscan()
+ return
+
+
+ proc/controllerscan(var/priorscan = 0)
+ //Make sure we are the only one here
+ if(!istype(src.loc, /turf))
+ del(src)
+ return
+ for(var/obj/machinery/am_shielding/AMS in loc.contents)
+ if(AMS == src) continue
+ spawn(0)
+ del(src)
+ return
+
+ //Search for shielding first
+ for(var/obj/machinery/am_shielding/AMS in cardinalrange(src))
+ if(AMS && AMS.control_unit && link_control(AMS.control_unit))
+ break
+
+ if(!control_unit)//No other guys nearby look for a control unit
+ for(var/direction in cardinal)
+ for(var/obj/machinery/power/am_control_unit/AMC in cardinalrange(src))
+ if(AMC.add_shielding(src))
+ break
+
+ if(!control_unit)
+ if(!priorscan)
+ spawn(20)
+ controllerscan(1)//Last chance
+ return
+ spawn(0)
+ del(src)
+ return
+
+
+ Del()
+ if(control_unit) control_unit.remove_shielding(src)
+ if(processing) shutdown_core()
+ visible_message("\red The [src.name] melts!")
+ //Might want to have it leave a mess on the floor but no sprites for now
+ ..()
+ return
+
+
+ CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
+ if(air_group || (height==0)) return 1
+ return 0
+
+
+ process()
+ if(!processing) ..()
+ //TODO: core functions and stability
+ //TODO: think about checking the airmix for plasma and increasing power output
+ return
+
+
+ emp_act()//Immune due to not really much in the way of electronics.
+ return 0
+
+
+ blob_act()
+ stability -= 20
+ if(prob(100-stability))
+ var/obj/effect/blob/B = new /obj/effect/blob(src.loc,60)
+ if(prob(10))//Might create a node
+ B.blobdebug = 2
+ spawn(0)
+ del(src)
+ return
+ check_stability()
+ return
+
+
+ ex_act(severity)
+ switch(severity)
+ if(1.0)
+ stability -= 80
+ if(2.0)
+ stability -= 40
+ if(3.0)
+ stability -= 20
+ check_stability()
+ return
+
+
+ bullet_act(var/obj/item/projectile/Proj)
+ if(Proj.flag != "bullet")
+ stability -= Proj.force/2
+ return 0
+
+
+ update_icon()
+ overlays = null
+ for(var/direction in alldirs)
+ var/machine = locate(/obj/machinery, get_step(loc, direction))
+ if((istype(machine, /obj/machinery/am_shielding) && machine:control_unit == control_unit)||(istype(machine, /obj/machinery/power/am_control_unit) && machine == control_unit))
+ overlays += "shield_[direction]"
+
+ if(core_check())
+ overlays += "core"
+ if(!processing) setup_core()
+ else if(processing) shutdown_core()
+
+
+ attackby(obj/item/W, mob/user)
+ if(!istype(W) || !user) return
+ if(W.force > 10)
+ stability -= W.force/2
+ check_stability()
+ ..()
+ return
+
+
+
+ //Call this to link a detected shilding unit to the controller
+ proc/link_control(var/obj/machinery/power/am_control_unit/AMC)
+ if(!istype(AMC)) return 0
+ if(control_unit && control_unit != AMC) return 0//Already have one
+ control_unit = AMC
+ control_unit.add_shielding(src,1)
+ return 1
+
+
+ //Scans cards for shields or the control unit and if all there it
+ proc/core_check()
+ for(var/direction in alldirs)
+ var/machine = locate(/obj/machinery, get_step(loc, direction))
+ if(!machine) return 0//Need all for a core
+ if(!istype(machine, /obj/machinery/am_shielding) && !istype(machine, /obj/machinery/power/am_control_unit)) return 0
+ return 1
+
+
+ proc/setup_core()
+ processing = 1
+ machines.Add(src)
+ if(!control_unit) return
+ control_unit.linked_cores.Add(src)
+ control_unit.reported_core_efficiency += efficiency
+ return
+
+
+ proc/shutdown_core()
+ processing = 0
+ machines.Remove(src)
+ if(!control_unit) return
+ control_unit.linked_cores.Remove(src)
+ control_unit.reported_core_efficiency -= efficiency
+ return
+
+
+ proc/check_stability(var/injecting_fuel = 0)
+ if(stability > 0) return
+ if(injecting_fuel)
+ explosion(get_turf(src),4,6,10,12)
+ if(src)
+ del(src)
+ return
+
+
+ proc/recalc_efficiency(var/new_efficiency)//tbh still not 100% sure how I want to deal with efficiency so this is likely temp
+ if(!control_unit || !processing) return
+ if(stability < 50)
+ new_efficiency /= 2
+ control_unit.reported_core_efficiency += (new_efficiency - efficiency)
+ efficiency = new_efficiency
+ return
+
+
+
+/obj/item/device/am_shielding_container
+ name = "packaged antimatter reactor section"
+ desc = "A small storage unit containing an antimatter reactor section. To use place near an antimatter control unit or deployed antimatter reactor section and use a multitool to activate this package."
+ icon = 'antimatter.dmi'
+ icon_state = "box"
+ item_state = "electronic"
+ w_class = 4.0
+ flags = FPRINT | TABLEPASS | CONDUCT
+ throwforce = 5
+ throw_speed = 1
+ throw_range = 2
+ m_amt = 100
+ w_amt = 2000
+
+ attackby(var/obj/item/I, var/mob/user)
+ if(istype(I, /obj/item/device/multitool) && istype(src.loc,/turf))
+ new/obj/machinery/am_shielding(src.loc)
+ del(src)
+ return
+ ..()
+ return
\ No newline at end of file
diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm
index 49280352ef9..97ec4a0b6d7 100644
--- a/code/modules/power/cable.dm
+++ b/code/modules/power/cable.dm
@@ -141,7 +141,7 @@
for(var/mob/O in viewers(src, null))
O.show_message("\red [user] cuts the cable.", 1)
- if(defer_powernet_rebuild)
+ if(!defer_powernet_rebuild)
if(netnum && powernets && powernets.len >= netnum)
var/datum/powernet/PN = powernets[netnum]
PN.cut_cable(src)
diff --git a/code/modules/power/power.dm b/code/modules/power/power.dm
index 41074362513..31000362c67 100644
--- a/code/modules/power/power.dm
+++ b/code/modules/power/power.dm
@@ -1,3 +1,15 @@
+/obj/machinery/power
+ name = null
+ icon = 'power.dmi'
+ anchored = 1.0
+ var/datum/powernet/powernet = null
+ var/netnum = 0
+ var/directwired = 1 // by default, power machines are connected by a cable in a neighbouring turf
+ // if set to 0, requires a 0-X cable on this turf
+ use_power = 0
+ idle_power_usage = 0
+ active_power_usage = 0
+
// common helper procs for all power machines
/obj/machinery/power/proc/add_avail(var/amount)
if(powernet)
@@ -31,7 +43,7 @@
if(!A || !isarea(A) || !A.master)
return 0 // if not, then not powered
- return A.master.powered(power_channel) // return power status of the area
+ return A.master.powered(chan) // return power status of the area
// increment the power usage stats for an area
@@ -45,7 +57,7 @@
/obj/machinery/proc/power_change() // called whenever the power settings of the containing area change
// by default, check equipment channel & set flag
// can override if needed
- if(powered())
+ if(powered(power_channel))
stat &= ~NOPOWER
else
diff --git a/code/modules/power/singularity/generator.dm b/code/modules/power/singularity/generator.dm
index ff121c29635..2765e6a7409 100644
--- a/code/modules/power/singularity/generator.dm
+++ b/code/modules/power/singularity/generator.dm
@@ -1,6 +1,3 @@
-//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:33
-
-
/////SINGULARITY SPAWNER
/obj/machinery/the_singularitygen/
name = "Gravitational Singularity Generator"
@@ -12,8 +9,6 @@
use_power = 0
var/energy = 0
-//////////////////////Singularity gen START
-
/obj/machinery/the_singularitygen/process()
var/turf/T = get_turf(src)
if(src.energy >= 200)
@@ -21,20 +16,6 @@
spawn(0)
del(src)
return
-/*
- if (singularity_is_surrounded(T))
- new /obj/machinery/singularity/(T, 200)
- spawn(0)
- del(src)
- return
-*/
-
-///obj/machinery/the_singularitygen/Bumped(atom/A)
-// if(istype(A,/obj/effect/accelerated_particle))
-// src.energy += A:energy
-// return
-// ..()
-
/obj/machinery/the_singularitygen/attackby(obj/item/W, mob/user)
if(istype(W, /obj/item/weapon/wrench))
@@ -50,11 +31,3 @@
"You hear a ratchet")
return
return ..()
-
-
-/proc/singularity_is_surrounded(turf/T)//TODO:Add a timer so we dont need this
- var/checkpointC = 0
- for (var/obj/X in orange(4,T)) //TODO: do we need requirement to singularity be actually _surrounded_ by field?
- if(istype(X, /obj/machinery/containment_field) || istype(X, /obj/machinery/shieldwall))
- checkpointC ++
- return checkpointC >= 20
diff --git a/code/modules/power/terminal.dm b/code/modules/power/terminal.dm
index a4e9e12d7be..b87a8d02cbf 100644
--- a/code/modules/power/terminal.dm
+++ b/code/modules/power/terminal.dm
@@ -3,21 +3,30 @@
// all conduit connects go to this object instead of the APC
// using this solves the problem of having the APC in a wall yet also inside an area
-/obj/machinery/power/terminal/New()
-
- ..()
-
- var/turf/T = src.loc
-
- if(level==1) hide(T.intact)
+/obj/machinery/power/terminal
+ name = "terminal"
+ icon_state = "term"
+ desc = "It's an underfloor wiring terminal for power equipment."
+ level = 1
+ layer = TURF_LAYER
+ var/obj/machinery/power/master = null
+ anchored = 1
+ directwired = 0 // must have a cable on same turf connecting to terminal
+ layer = 2.6 // a bit above wires
-/obj/machinery/power/terminal/hide(var/i)
+ New()
+ ..()
+ var/turf/T = src.loc
+ if(level==1) hide(T.intact)
+ return
- if(i)
- invisibility = 101
- icon_state = "term-f"
- else
- invisibility = 0
- icon_state = "term"
+
+ hide(var/i)
+ if(i)
+ invisibility = 101
+ icon_state = "term-f"
+ else
+ invisibility = 0
+ icon_state = "term"
diff --git a/icons/obj/machines/antimatter.dmi b/icons/obj/machines/antimatter.dmi
new file mode 100644
index 00000000000..4e20f20e7b0
Binary files /dev/null and b/icons/obj/machines/antimatter.dmi differ
diff --git a/tgstation.dme b/tgstation.dme
index d224422a6a2..9851d1f0aea 100644
--- a/tgstation.dme
+++ b/tgstation.dme
@@ -125,6 +125,7 @@
#define FILE_DIR "code/modules/mob/simple_animal"
#define FILE_DIR "code/modules/paperwork"
#define FILE_DIR "code/modules/power"
+#define FILE_DIR "code/modules/power/antimatter"
#define FILE_DIR "code/modules/power/singularity"
#define FILE_DIR "code/modules/power/singularity/particle_accelerator"
#define FILE_DIR "code/modules/projectiles"
@@ -1036,6 +1037,9 @@
#include "code\modules\power\terminal.dm"
#include "code\modules\power\tracker.dm"
#include "code\modules\power\turbine.dm"
+#include "code\modules\power\antimatter\containment_jar.dm"
+#include "code\modules\power\antimatter\control.dm"
+#include "code\modules\power\antimatter\shielding.dm"
#include "code\modules\power\singularity\collector.dm"
#include "code\modules\power\singularity\containment_field.dm"
#include "code\modules\power\singularity\emitter.dm"