mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Merge pull request #7137 from atlantiscze/buildable-smes-fix
Buildable smes minor changes
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
var/building_terminal = 0 //Suggestions about how to avoid clickspam building several terminals accepted!
|
||||
var/input_level_max = 200000
|
||||
var/output_level_max = 200000
|
||||
var/should_be_mapped = 0 // If this is set to 0 it will send out warning on New()
|
||||
|
||||
/obj/machinery/power/smes/New()
|
||||
..()
|
||||
@@ -53,6 +54,13 @@
|
||||
if(!terminal.powernet)
|
||||
terminal.connect_to_network()
|
||||
updateicon()
|
||||
|
||||
|
||||
|
||||
|
||||
if(!should_be_mapped)
|
||||
warning("Non-buildable or Non-magical SMES at [src.x]X [src.y]Y [src.z]Z")
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/power/smes/proc/updateicon()
|
||||
@@ -387,6 +395,7 @@
|
||||
desc = "A high-capacity superconducting magnetic energy storage (SMES) unit. Magically produces power."
|
||||
capacity = 9000000
|
||||
output = 250000
|
||||
should_be_mapped = 1
|
||||
|
||||
/obj/machinery/power/smes/magical/process()
|
||||
charge = 5000000
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
var/cur_coils = 1 // Current amount of installed coils
|
||||
var/safeties_enabled = 1 // If 0 modifications can be done without discharging the SMES, at risk of critical failure.
|
||||
var/failing = 0 // If 1 critical failure has occured and SMES explosion is imminent.
|
||||
should_be_mapped = 1
|
||||
|
||||
/obj/machinery/power/smes/buildable/New()
|
||||
component_parts = list()
|
||||
@@ -86,6 +87,8 @@
|
||||
var/obj/item/clothing/gloves/G = h_user.gloves
|
||||
if(G.siemens_coefficient == 0)
|
||||
user_protected = 1
|
||||
log_game("SMES FAILURE: <b>[src.x]X [src.y]Y [src.z]Z</b> User: [usr.ckey], Intensity: [intensity]/100")
|
||||
message_admins("SMES FAILURE: <b>[src.x]X [src.y]Y [src.z]Z</b> User: [usr.ckey], Intensity: [intensity]/100 - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[src.x];Y=[src.y];Z=[src.z]'>JMP</a>")
|
||||
|
||||
|
||||
switch (intensity)
|
||||
@@ -134,7 +137,7 @@
|
||||
empulse(src.loc, 8, 16)
|
||||
charge = 0
|
||||
apcs_overload(1, 10)
|
||||
src.visible_message("\icon[src] <b>[src]</b> beeps: \"Caution. Output regulators malfunction. Uncontrolled discharge detected.\"")
|
||||
src.ping("Caution. Output regulators malfunction. Uncontrolled discharge detected.")
|
||||
|
||||
if (61 to INFINITY)
|
||||
// Massive overcharge
|
||||
@@ -149,14 +152,21 @@
|
||||
empulse(src.loc, 32, 64)
|
||||
charge = 0
|
||||
apcs_overload(5, 25)
|
||||
src.visible_message("\icon[src] <b>[src]</b> beeps: \"Caution. Output regulators malfunction. Significant uncontrolled discharge detected.\"")
|
||||
src.ping("Caution. Output regulators malfunction. Significant uncontrolled discharge detected.")
|
||||
|
||||
if (prob(50))
|
||||
src.visible_message("\icon[src] <b>[src]</b> beeps: \"DANGER! Magnetic containment field unstable! Containment field failure imminent!\"")
|
||||
// Added admin-notifications so they can stop it when griffed.
|
||||
log_game("SMES explosion imminent.")
|
||||
message_admins("SMES explosion imminent.")
|
||||
src.ping("DANGER! Magnetic containment field unstable! Containment field failure imminent!")
|
||||
failing = 1
|
||||
// 30 - 60 seconds and then BAM!
|
||||
spawn(rand(300,600))
|
||||
src.visible_message("\icon[src] <b>[src]</b> beeps: \"DANGER! Magnetic containment field failure in 3 ... 2 ... 1 ...\"")
|
||||
if(!failing) // Admin can manually set this var back to 0 to stop overload, for use when griffed.
|
||||
update_icon()
|
||||
src.ping("Magnetic containment stabilised.")
|
||||
return
|
||||
src.ping("DANGER! Magnetic containment field failure in 3 ... 2 ... 1 ...")
|
||||
explosion(src.loc,1,2,4,8)
|
||||
// Not sure if this is necessary, but just in case the SMES *somehow* survived..
|
||||
del(src)
|
||||
@@ -173,7 +183,7 @@
|
||||
var/obj/machinery/power/apc/A = T.master
|
||||
if (prob(overload_chance))
|
||||
A.overload_lighting()
|
||||
else if (prob(failure_chance))
|
||||
if (prob(failure_chance))
|
||||
A.set_broken()
|
||||
|
||||
// Failing SMES has special icon overlay.
|
||||
|
||||
Reference in New Issue
Block a user