Revert "Singulo engine buff (#26929)" (#27360)

This reverts commit 627fe1e059.
This commit is contained in:
Burzah
2024-11-14 20:11:53 +00:00
committed by GitHub
parent f49b312661
commit bff89a13f0
14 changed files with 94 additions and 578 deletions
-6
View File
@@ -104,12 +104,6 @@
#define STAGE_FIVE 9
#define STAGE_SIX 11 //From supermatter shard
#define STAGE_TWO_THRESHOLD 200
#define STAGE_THREE_THRESHOLD 500
#define STAGE_FOUR_THRESHOLD 1000
#define STAGE_FIVE_THRESHOLD 2000
#define STAGE_SIX_THRESHOLD 3000
/// A define for the center of the coordinate map of big machinery
#define MACH_CENTER 2
+2 -2
View File
@@ -27,11 +27,11 @@
continue
processing_list += thing.contents
/proc/radiation_pulse(atom/source, intensity, range_modifier, log = FALSE, can_contaminate = TRUE, source_radius = 0)
/proc/radiation_pulse(atom/source, intensity, range_modifier, log = FALSE, can_contaminate = TRUE)
if(!SSradiation.can_fire)
return
for(var/dir in GLOB.cardinal)
new /datum/radiation_wave(source, dir, intensity, range_modifier, can_contaminate, source_radius)
new /datum/radiation_wave(source, dir, intensity, range_modifier, can_contaminate)
var/list/things = get_rad_contents(source) //copypasta because I don't want to put special code in waves to handle their origin
for(var/k in 1 to length(things))
+4 -6
View File
@@ -11,8 +11,6 @@
var/remaining_contam
/// Higher than 1 makes it drop off faster, 0.5 makes it drop off half etc
var/range_modifier
/// The distance from the source point the wave can cover without losing any strength.
var/source_radius
/// The direction of movement
var/move_dir
/// The directions to the side of the wave, stored for easy looping
@@ -20,7 +18,7 @@
/// Whether or not this radiation wave can create contaminated objects
var/can_contaminate
/datum/radiation_wave/New(atom/_source, dir, _intensity = 0, _range_modifier = RAD_DISTANCE_COEFFICIENT, _can_contaminate = TRUE, _source_radius = 0)
/datum/radiation_wave/New(atom/_source, dir, _intensity = 0, _range_modifier = RAD_DISTANCE_COEFFICIENT, _can_contaminate = TRUE)
source = "[_source] \[[_source.UID()]\]"
@@ -35,7 +33,7 @@
remaining_contam = intensity
range_modifier = _range_modifier
can_contaminate = _can_contaminate
source_radius = _source_radius
START_PROCESSING(SSradiation, src)
/datum/radiation_wave/Destroy()
@@ -52,8 +50,8 @@
var/list/atoms = get_rad_atoms()
var/strength
if(steps > source_radius + 1)
strength = INVERSE_SQUARE(intensity, max(range_modifier * (steps - source_radius), 1), 1)
if(steps > 1)
strength = INVERSE_SQUARE(intensity, max(range_modifier * steps, 1), 1)
else
strength = intensity
@@ -356,12 +356,6 @@
build_path = /obj/machinery/computer/sm_monitor
origin_tech = "programming=2;powerstorage=2"
/obj/item/circuitboard/singulo_monitor
board_name = "Singularity Monitoring Console"
icon_state = "engineering"
build_path = /obj/machinery/computer/singulo_monitor
origin_tech = "programming=2;powerstorage=2"
// RD console circuits, so that de/reconstructing one of the special consoles doesn't ruin everything forever
/obj/item/circuitboard/rdconsole
board_name = "RD Console"
@@ -1,202 +0,0 @@
/obj/machinery/computer/singulo_monitor
name = "singularity monitoring console"
desc = "Used to monitor singularities."
icon_keyboard = "power_key"
icon_screen = "singumon_0"
circuit = /obj/item/circuitboard/singulo_monitor
light_color = LIGHT_COLOR_YELLOW
/// Cache-list of all singularities
var/list/singularities
/// Last energy level of the singularity so we know if it went up or down between cycles
var/last_energy
/// Last size of the singularity so we know if it went up or down between cycles
var/last_size
/// Reference to the active singularity
var/obj/singularity/active
/// Channel to send warning through to the engineers
var/warning_channel = "Engineering"
/// Channel to send breach containment alert
var/breach_channel = "Common"
/// Radio for sending announcements
var/obj/item/radio/singu_radio
/// List of field generators containing the singulo
var/list/field_gens
/obj/machinery/computer/singulo_monitor/Initialize(mapload)
. = ..()
singu_radio = new(src)
singu_radio.listening = FALSE
singu_radio.follow_target = src
singu_radio.config(list("[warning_channel]" = 0, "[breach_channel]" = 0))
/obj/machinery/computer/singulo_monitor/Destroy()
active = null
QDEL_NULL(singu_radio)
field_gens.Cut()
singularities.Cut()
return ..()
/obj/machinery/computer/singulo_monitor/attack_ai(mob/user)
attack_hand(user)
/obj/machinery/computer/singulo_monitor/attack_hand(mob/user)
add_fingerprint(user)
if(stat & (BROKEN|NOPOWER))
return
ui_interact(user)
/obj/machinery/computer/singulo_monitor/ui_state(mob/user)
return GLOB.default_state
/obj/machinery/computer/singulo_monitor/ui_interact(mob/user, datum/tgui/ui = null)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
ui = new(user, src, "SingularityMonitor", name)
ui.open()
/obj/machinery/computer/singulo_monitor/ui_data(mob/user)
var/list/data = list()
if(istype(active))
var/turf/T = get_turf(active)
// If we somehow dissipate during this proc, handle it somewhat
if(!T)
active = null
refresh()
return
data["active"] = TRUE
data["singulo_stage"] = (active.current_size + 1) / 2
data["singulo_potential_stage"] = (active.allowed_size + 1) / 2
data["singulo_energy"] = active.energy
switch(active.allowed_size)
if(STAGE_ONE)
data["singulo_high"] = STAGE_TWO_THRESHOLD
data["singulo_low"] = 0
if(STAGE_TWO)
data["singulo_high"] = STAGE_THREE_THRESHOLD
data["singulo_low"] = STAGE_TWO_THRESHOLD
if(STAGE_THREE)
data["singulo_high"] = STAGE_FOUR_THRESHOLD
data["singulo_low"] = STAGE_THREE_THRESHOLD
if(STAGE_FOUR)
data["singulo_high"] = STAGE_FIVE_THRESHOLD
data["singulo_low"] = STAGE_FOUR_THRESHOLD
else
data["singulo_high"] = STAGE_SIX_THRESHOLD
data["singulo_low"] = STAGE_FIVE_THRESHOLD
var/list/generators = list()
var/index = 1
for(var/obj/machinery/field/generator/generator in field_gens)
generators.Add(list(list(
"charge" = generator.energy,
"gen_index" = index++
)))
data["generators"] = generators
else
var/list/singulos = list()
for(var/obj/singularity/S in singularities)
var/area/A = get_area(S)
if(!A)
continue
singulos.Add(list(list(
"area_name" = A.name,
"energy" = S.energy,
"stage" = (S.current_size + 1) / 2,
"singularity_id" = S.singulo_id
)))
data["active"] = FALSE
data["singularities"] = singulos
return data
/**
* Supermatter List Refresher
*
* This proc loops through the list of supermatters in the atmos SS and adds them to this console's cache list
*/
/obj/machinery/computer/singulo_monitor/proc/refresh()
singularities = list()
var/turf/T = get_turf(ui_host()) // Get the UI host incase this ever turned into a singularity monitoring module for AIs to use or something
if(!T)
return
for(var/obj/singularity/S in GLOB.singularities)
// not within coverage, not on a tile, not a gravitational singularity
if(S.type != /obj/singularity || !(is_station_level(S.z) || is_mining_level(S.z) || atoms_share_level(S, T)))
continue
singularities.Add(S)
if(!(active in singularities))
active = null
/obj/machinery/computer/singulo_monitor/proc/send_alerts()
// Breach alerts
if(active.current_size > (last_size + 2) || active.current_size >= STAGE_FIVE)// We should only see a singulo grow 2 stages at once when breaching containment.
singu_radio.autosay("<b>Warning: The singularity in [get_area(active)] has exceeded containment field limits!</b>", name, breach_channel)
for(var/obj/machinery/field/generator/gen in field_gens)
if(!gen || (gen.active < 2))
singu_radio.autosay("<b>Warning: The containment field of the singularity in [get_area(active)] has been disabled!</b>", name, breach_channel)
return
if(active.energy > last_energy)// We only want to give warnings while the situation is getting worse.
if(active.energy >= (STAGE_FIVE_THRESHOLD - 100))
singu_radio.autosay("<b>Warning: The singularity is approaching an uncontainable level!</b>", name, warning_channel)
return
var/warning_threshold
// The field can contain energy of up to 1 stage above the current one.
switch(active.current_size)
if(STAGE_ONE)
warning_threshold = STAGE_THREE_THRESHOLD
if(STAGE_TWO)
warning_threshold = STAGE_FOUR_THRESHOLD
else
warning_threshold = 0
// Stage 5 and above is not containable regardless, so we don't care about them in this case.
if(warning_threshold && (active.energy >= (warning_threshold - 100)))
singu_radio.autosay("<b>Warning: The singularity in [get_area(active)] is nearing containment field limits!</b>", name, warning_channel)
return
/obj/machinery/computer/singulo_monitor/process()
if(stat & (NOPOWER|BROKEN))
return FALSE
if(active)
if(last_energy != active.energy)
send_alerts()
last_size = active.current_size
last_energy = active.energy
icon_screen = (((active.allowed_size + 1) / 2) == 4 && active.energy >= (STAGE_FIVE_THRESHOLD - 100)) ? "singumon_pre5" : "singumon_[(active.allowed_size + 1) / 2]"
else
icon_screen = "singumon_0"
update_icon()
return TRUE
/obj/machinery/computer/singulo_monitor/ui_act(action, params)
if(..())
return
if(stat & (BROKEN|NOPOWER))
return
. = TRUE
switch(action)
if("refresh")
refresh()
if("view")
var/newuid = text2num(params["view"])
for(var/obj/singularity/S in singularities)
if(S.singulo_id == newuid)
active = S
if(active)
field_gens = active.find_field_gens()
break
if("back")
active = null
@@ -64,7 +64,7 @@
if(ismachinery(mover) || isstructure(mover) || ismecha(mover))
bump_field(mover)
/obj/machinery/field/containment/proc/set_master(master1, master2)
/obj/machinery/field/containment/proc/set_master(master1,master2)
if(!master1 || !master2)
return 0
FG1 = master1
@@ -99,7 +99,7 @@
/obj/machinery/field/proc/shock_field(mob/living/user)
if(isliving(user))
var/shock_damage = min(rand(30, 40), rand(30, 40))
var/shock_damage = min(rand(30,40),rand(30,40))
if(isliving(user) && !issilicon(user))
var/stun = (min(shock_damage, 15)) STATUS_EFFECT_CONSTANT
@@ -60,50 +60,6 @@ GLOBAL_LIST_EMPTY(field_generator_fields)
if(active == FG_ONLINE)
calc_energy()
/**
* Gets a list of generators that form a field that is enclosing a given singularity, if such a field exists.
*
* Arguments:
* * _dir - The direction in which we are currently going
* * singulo - The singularity we are looking to contain
* * containment_gens - A list of generators which is the portion of the potential result we have so far.
*/
/obj/machinery/field/generator/proc/find_containment_gens(_dir, obj/singularity/singulo, list/containment_gens = list())
// We can't go in a direction that doesn't exist
if(!dir)
return
containment_gens |= src
// This is used to evaluate a path before returning it. We don't want to stop after the first dead end.
var/list/temp_gens = list()
for(var/obj/machinery/field/generator/gen in connected_gens)
// We don't ever want to do anything with the generator behind us so this check comes first
if(get_dir(src, gen) == turn(_dir, 180))
continue
// If we completed a full circle and it contains the singularity return it. Otherwise continue
if(gen in containment_gens)
if(singulo.in_containment(containment_gens))
return containment_gens
continue
// Go right if we can, forward if we can't go right, and left if we can't go forward
if(get_dir(src, gen) == turn(_dir, -90))
temp_gens = gen.find_containment_gens(turn(_dir, -90), singulo, containment_gens)
if(length(temp_gens))
return temp_gens
if(get_dir(src, gen) == _dir)
temp_gens = gen.find_containment_gens(_dir, singulo, containment_gens)
if(length(temp_gens))
return temp_gens
if(get_dir(src, gen) == turn(_dir, 90))
temp_gens = gen.find_containment_gens(turn(_dir, 90), singulo, containment_gens)
if(length(temp_gens))
return temp_gens
// We got to a dead end, temp_gens should be empty here.
return temp_gens
/obj/machinery/field/generator/attack_hand(mob/user)
if(state == FG_WELDED)
if(get_dist(src, user) <= 1)//Need to actually touch the thing to turn it on
@@ -115,7 +71,7 @@ GLOBAL_LIST_EMPTY(field_generator_fields)
"<span class='notice'>You turn on [src].</span>", \
"<span class='italics'>You hear heavy droning.</span>")
turn_on()
investigate_log("<font color='green'>activated</font> by [user.key].", "singulo")
investigate_log("<font color='green'>activated</font> by [user.key].","singulo")
add_fingerprint(user)
else
@@ -327,11 +283,11 @@ GLOBAL_LIST_EMPTY(field_generator_fields)
T = loc
for(var/dist in 0 to steps) // creates each field tile
var/field_dir = get_dir(T, get_step(G.loc, NSEW))
var/field_dir = get_dir(T,get_step(G.loc, NSEW))
T = get_step(T, NSEW)
if(!locate(/obj/machinery/field/containment) in T)
var/obj/machinery/field/containment/CF = new/obj/machinery/field/containment()
CF.set_master(src, G)
CF.set_master(src,G)
CF.loc = T
CF.dir = field_dir
fields += CF
@@ -380,7 +336,7 @@ GLOBAL_LIST_EMPTY(field_generator_fields)
// [src ? "[get_location_name(src, TRUE)] [COORD(src)]" : "nonexistent location"] [ADMIN_JMP(src)] works much better and actually works at all
// Oh and yes, this exact comment was pasted from the exact same thing I did to tcomms code. Dont at me.
message_admins("A singularity exists and a containment field has failed on the same Z-Level. Singulo location: [O ? "[get_location_name(O, TRUE)] [COORD(O)]" : "nonexistent location"] [ADMIN_JMP(O)] | Field generator location: [src ? "[get_location_name(src, TRUE)] [COORD(src)]" : "nonexistent location"] [ADMIN_JMP(src)]")
investigate_log("has <font color='red'>failed</font> whilst a singulo exists.", "singulo")
investigate_log("has <font color='red'>failed</font> whilst a singulo exists.","singulo")
O.last_warning = world.time
/obj/machinery/field/generator/shock_field(mob/living/user)
@@ -1,6 +1,3 @@
/// Amount of singulos created during the round(note that this will include teslas as well)
GLOBAL_VAR_INIT(global_singulo_id, 1)
/obj/singularity
name = "gravitational singularity"
desc = "A gravitational singularity."
@@ -38,12 +35,9 @@ GLOBAL_VAR_INIT(global_singulo_id, 1)
var/isnt_shutting_down = FALSE
/// Init list that has all the areas that we can possibly move to, to reduce processing impact
var/list/all_possible_areas = list()
/// Id for monitoring.
var/singulo_id = 1
/obj/singularity/Initialize(mapload, starting_energy = 50)
. = ..()
singulo_id = GLOB.global_singulo_id++
//CARN: admin-alert for chuckle-fuckery.
admin_investigate_setup()
@@ -115,15 +109,15 @@ GLOBAL_VAR_INIT(global_singulo_id, 1)
switch(severity)
if(1)
if(current_size <= STAGE_TWO)
investigate_log("has been destroyed by a heavy explosion.", "singulo")
investigate_log("has been destroyed by a heavy explosion.","singulo")
qdel(src)
return
else
energy -= round(((energy + 1) / 2), 1)
energy -= round(((energy+1)/2),1)
if(2)
energy -= round(((energy + 1) / 3), 1)
energy -= round(((energy+1)/3),1)
if(3)
energy -= round(((energy + 1) / 4), 1)
energy -= round(((energy+1)/4),1)
return
@@ -149,7 +143,7 @@ GLOBAL_VAR_INIT(global_singulo_id, 1)
// it might mean we are stuck in a corner somewere. So move around to try to expand.
move()
if(current_size >= STAGE_TWO)
radiation_pulse(src, (energy * 4.5) + 1000, RAD_DISTANCE_COEFFICIENT, source_radius = consume_range + 1)
radiation_pulse(src, min(5000, (energy * 4.5) + 1000), RAD_DISTANCE_COEFFICIENT * 0.5)
if(prob(event_chance))//Chance for it to run a special event TODO:Come up with one or two more that fit
event()
eat()
@@ -169,7 +163,7 @@ GLOBAL_VAR_INIT(global_singulo_id, 1)
var/count = locate(/obj/machinery/field/containment) in urange(30, src, 1)
if(!count)
message_admins("A singularity has been created without containment fields active at [x], [y], [z] (<A href='byond://?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>JMP</a>)")
investigate_log("was created. [count ? "" : "<font color='red'>No containment fields were active</font>"]", "singulo")
investigate_log("was created. [count?"":"<font color='red'>No containment fields were active</font>"]","singulo")
/obj/singularity/proc/do_dissipate()
if(!dissipate)
@@ -203,7 +197,7 @@ GLOBAL_VAR_INIT(global_singulo_id, 1)
vis_contents -= warp
qdel(warp)
if(STAGE_TWO)
if((check_turfs_in(1, 1))&&(check_turfs_in(2, 1))&&(check_turfs_in(4, 1))&&(check_turfs_in(8, 1)))
if((check_turfs_in(1,1))&&(check_turfs_in(2,1))&&(check_turfs_in(4,1))&&(check_turfs_in(8,1)))
current_size = STAGE_TWO
icon = 'icons/effects/96x96.dmi'
icon_state = "singularity_s3"
@@ -218,7 +212,7 @@ GLOBAL_VAR_INIT(global_singulo_id, 1)
warp = new(src)
vis_contents += warp
if(STAGE_THREE)
if((check_turfs_in(1, 2))&&(check_turfs_in(2, 2))&&(check_turfs_in(4, 2))&&(check_turfs_in(8, 2)))
if((check_turfs_in(1,2))&&(check_turfs_in(2,2))&&(check_turfs_in(4,2))&&(check_turfs_in(8,2)))
current_size = STAGE_THREE
icon = 'icons/effects/160x160.dmi'
icon_state = "singularity_s5"
@@ -233,7 +227,7 @@ GLOBAL_VAR_INIT(global_singulo_id, 1)
warp = new(src)
vis_contents += warp
if(STAGE_FOUR)
if((check_turfs_in(1, 3))&&(check_turfs_in(2, 3))&&(check_turfs_in(4, 3))&&(check_turfs_in(8, 3)))
if((check_turfs_in(1,3))&&(check_turfs_in(2,3))&&(check_turfs_in(4,3))&&(check_turfs_in(8,3)))
current_size = STAGE_FOUR
icon = 'icons/effects/224x224.dmi'
icon_state = "singularity_s7"
@@ -244,6 +238,7 @@ GLOBAL_VAR_INIT(global_singulo_id, 1)
dissipate_delay = 10
dissipate_track = 0
dissipate_strength = 10
notify_dead()
if(STAGE_FIVE)//this one also lacks a check for gens because it eats everything
current_size = STAGE_FIVE
icon = 'icons/effects/288x288.dmi'
@@ -262,10 +257,8 @@ GLOBAL_VAR_INIT(global_singulo_id, 1)
grav_pull = 15
consume_range = 5
dissipate = FALSE
if(current_size >= STAGE_FIVE)
notify_dead()
if(current_size == allowed_size)
investigate_log("<font color='red'>grew to size [current_size]</font>", "singulo")
investigate_log("<font color='red'>grew to size [current_size]</font>","singulo")
return 1
else if(current_size < (--temp_allowed_size))
expand(temp_allowed_size)
@@ -275,20 +268,20 @@ GLOBAL_VAR_INIT(global_singulo_id, 1)
/obj/singularity/proc/check_energy()
if(energy <= 0)
investigate_log("collapsed.", "singulo")
investigate_log("collapsed.","singulo")
qdel(src)
return 0
switch(energy)//Some of these numbers might need to be changed up later -Mport
if(1 to (STAGE_TWO_THRESHOLD - 1))
if(1 to 199)
allowed_size = STAGE_ONE
if(STAGE_TWO_THRESHOLD to (STAGE_THREE_THRESHOLD - 1))
if(200 to 499)
allowed_size = STAGE_TWO
if(STAGE_THREE_THRESHOLD to (STAGE_FOUR_THRESHOLD - 1))
if(500 to 999)
allowed_size = STAGE_THREE
if(STAGE_FOUR_THRESHOLD to (STAGE_FIVE_THRESHOLD - 1))
if(1000 to 1999)
allowed_size = STAGE_FOUR
if(STAGE_FIVE_THRESHOLD to INFINITY)
if(energy >= STAGE_SIX_THRESHOLD && consumedSupermatter)
if(2000 to INFINITY)
if(energy >= 3000 && consumedSupermatter)
allowed_size = STAGE_SIX
else
allowed_size = STAGE_FIVE
@@ -327,7 +320,7 @@ GLOBAL_VAR_INIT(global_singulo_id, 1)
qdel(A)
else
visible_message("<span class='userdanger'>[GET_CULT_DATA(entity_name, A.name)] strikes down [src]!</span>")
investigate_log("has been destroyed by Nar'Sie", "singulo")
investigate_log("has been destroyed by Nar'Sie","singulo")
qdel(src)
return
@@ -376,7 +369,7 @@ GLOBAL_VAR_INIT(global_singulo_id, 1)
var/list/turfs = list()
var/turf/T = src.loc
for(var/i = 1 to steps)
T = get_step(T, direction)
T = get_step(T,direction)
if(!isturf(T))
return 0
turfs.Add(T)
@@ -391,12 +384,12 @@ GLOBAL_VAR_INIT(global_singulo_id, 1)
dir3 = 2
var/turf/T2 = T
for(var/j = 1 to steps-1)
T2 = get_step(T2, dir2)
T2 = get_step(T2,dir2)
if(!isturf(T2))
return 0
turfs.Add(T2)
for(var/k = 1 to steps-1)
T = get_step(T, dir3)
T = get_step(T,dir3)
if(!isturf(T))
return 0
turfs.Add(T)
@@ -407,21 +400,6 @@ GLOBAL_VAR_INIT(global_singulo_id, 1)
return 0
return 1
// Returns a list of the field generators generating the containing field(if there is one within 10 tiles)
/obj/singularity/proc/find_field_gens()
for(var/_dir in list(NORTH, SOUTH, EAST, WEST))
var/turf/T = loc
for(var/i in 1 to 10)
T = get_step(T, _dir)
var/obj/cur_field_obj
cur_field_obj = locate(/obj/machinery/field/generator) in T
if(cur_field_obj)
var/obj/machinery/field/generator/gen = cur_field_obj
return gen.find_containment_gens(turn(_dir, -90), src)
cur_field_obj = locate(/obj/machinery/field/containment) in T
if(cur_field_obj)
var/obj/machinery/field/containment/field = cur_field_obj
return field.FG1.find_containment_gens(turn(_dir, -90), src)
/obj/singularity/proc/can_move(turf/T)
if(!T)
@@ -508,8 +486,8 @@ GLOBAL_VAR_INIT(global_singulo_id, 1)
/obj/singularity/singularity_act()
var/gain = (energy/2)
var/dist = max((current_size - 2), 1)
explosion(loc, (dist), (dist * 2), (dist * 4))
var/dist = max((current_size - 2),1)
explosion(src.loc,(dist),(dist*2),(dist*4))
qdel(src)
return(gain)
@@ -586,28 +564,3 @@ GLOBAL_VAR_INIT(global_singulo_id, 1)
/obj/singularity/deadchat_controlled/Initialize(mapload, starting_energy)
. = ..()
deadchat_plays(mode = DEADCHAT_DEMOCRACY_MODE)
/**
* Gets a list of field generators that generate the field that contains the singularity
* and returns their most extreme coordinates.
**/
/obj/singularity/proc/in_containment(list/containment_gens)
if(!length(containment_gens))
return FALSE
var/max_x = -1
var/max_y = -1
var/min_x = -1
var/min_y = -1
for(var/obj/machinery/field/generator/gen in containment_gens)
if(gen.x > max_x || max_x < 0)
max_x = gen.x
if(gen.y > max_y || max_y < 0)
max_y = gen.y
if(gen.x < min_x || min_x < 0)
min_x = gen.x
if(gen.y < min_y || min_y < 0)
min_y = gen.y
return (x <= max_x && x >= min_x && y <= max_y && y >= min_y)
@@ -302,16 +302,6 @@
build_path = /obj/item/circuitboard/sm_monitor
category = list("Computer Boards")
/datum/design/singulo_monitor
name = "Console Board (Singularity Monitoring)"
desc = "Allows for the construction of circuit boards used to build a singularity monitoring console."
id = "singulo_monitor"
req_tech = list("programming" = 2, "powerstorage" = 2)
build_type = IMPRINTER
materials = list(MAT_GLASS = 1000)
build_path = /obj/item/circuitboard/singulo_monitor
category = list("Computer Boards")
/datum/design/ordercomp
name = "Console Board (Supply Ordering Console)"
desc = "Allows for the construction of circuit boards used to build a supply ordering console."
@@ -123,7 +123,7 @@
/datum/supply_packs/engineering/engine/sing_gen
name = "Singularity Generator Crate"
contains = list(/obj/machinery/the_singularitygen, /obj/item/circuitboard/singulo_monitor)
contains = list(/obj/machinery/the_singularitygen)
cost = 350
containername = "singularity generator crate"
Binary file not shown.

Before

Width:  |  Height:  |  Size: 147 KiB

After

Width:  |  Height:  |  Size: 137 KiB

-1
View File
@@ -915,7 +915,6 @@
#include "code\game\machinery\computer\robot_control.dm"
#include "code\game\machinery\computer\security_records.dm"
#include "code\game\machinery\computer\sm_monitor.dm"
#include "code\game\machinery\computer\singulo_monitor.dm"
#include "code\game\machinery\computer\station_alert.dm"
#include "code\game\machinery\computer\arcade_games\recruiter.dm"
#include "code\game\machinery\doors\airlock.dm"
@@ -1,166 +0,0 @@
import { sortBy } from 'common/collections';
import { flow } from 'common/fp';
import { toFixed } from 'common/math';
import { useBackend } from '../backend';
import { Section, Box, Button, Stack, Table, LabeledList, ProgressBar } from '../components';
import { getGasColor, getGasLabel } from '../constants';
import { Window } from '../layouts';
import { TableRow, TableCell } from '../components/Table';
export const SingularityMonitor = (props, context) => {
const { act, data } = useBackend(context);
if (data.active === 0) {
return <SingularityMonitorListView />;
} else {
return <SingularityMonitorDataView />;
}
};
const logScale = (value) => Math.log2(16 + Math.max(0, value)) - 4;
const SingularityMonitorListView = (props, context) => {
const { act, data } = useBackend(context);
const { singularities = [] } = data;
return (
<Window width={450} height={185}>
<Window.Content scrollable>
<Section
fill
title="Detected Singularities"
buttons={<Button icon="sync" content="Refresh" onClick={() => act('refresh')} />}
>
<Table>
{singularities.map((singulo) => (
<Table.Row key={singulo.singularity_id}>
<Table.Cell>{singulo.singularity_id + '. ' + singulo.area_name}</Table.Cell>
<Table.Cell collapsing color="label">
Stage:
</Table.Cell>
<Table.Cell collapsing width="120px">
<ProgressBar
value={singulo.stage}
minValue={0}
maxValue={6}
ranges={{
good: [1, 2],
average: [3, 4],
bad: [5, 6],
}}
>
{toFixed(singulo.stage)}
</ProgressBar>
</Table.Cell>
<Table.Cell collapsing>
<Button
content="Details"
onClick={() =>
act('view', {
view: singulo.singularity_id,
})
}
/>
</Table.Cell>
</Table.Row>
))}
</Table>
</Section>
</Window.Content>
</Window>
);
};
const SingularityMonitorDataView = (props, context) => {
const { act, data } = useBackend(context);
const {
active,
singulo_stage,
singulo_potential_stage,
singulo_energy,
singulo_high,
singulo_low,
generators = [],
} = data;
return (
<Window width={550} height={185}>
<Window.Content>
<Stack fill>
<Stack.Item width="270px">
<Section fill scrollable title="Metrics">
<LabeledList>
<LabeledList.Item label="Stage">
<ProgressBar
value={singulo_stage}
minValue={0}
maxValue={6}
ranges={{
good: [1, 2],
average: [3, 4],
bad: [5, 6],
}}
>
{toFixed(singulo_stage)}
</ProgressBar>
</LabeledList.Item>
<LabeledList.Item label="Potential Stage">
<ProgressBar
value={singulo_potential_stage}
minValue={0}
maxValue={6}
ranges={{
good: [1, singulo_stage + 0.5],
average: [singulo_stage + 0.5, singulo_stage + 1.5],
bad: [singulo_stage + 1.5, singulo_stage + 2],
}}
>
{toFixed(singulo_potential_stage)}
</ProgressBar>
</LabeledList.Item>
<LabeledList.Item label="Energy">
<ProgressBar
value={singulo_energy}
minValue={singulo_low}
maxValue={singulo_high}
ranges={{
good: [0.67 * singulo_high + 0.33 * singulo_low, singulo_high],
average: [0.33 * singulo_high + 0.67 * singulo_low, 0.67 * singulo_high + 0.33 * singulo_low],
bad: [singulo_low, 0.33 * singulo_high + 0.67 * singulo_low],
}}
>
{toFixed(singulo_energy) + 'MJ'}
</ProgressBar>
</LabeledList.Item>
</LabeledList>
</Section>
</Stack.Item>
<Stack.Item grow basis={0}>
<Section
fill
scrollable
title="Field Generators"
buttons={<Button icon="arrow-left" content="Back" onClick={() => act('back')} />}
>
<LabeledList>
{generators.map((generator) => (
<LabeledList.Item key={generator.gen_index} label="Remaining Charge">
<ProgressBar
value={generator.charge}
minValue={0}
maxValue={125}
ranges={{
good: [80, 125],
average: [30, 80],
bad: [0, 30],
}}
>
{toFixed(generator.charge)}
</ProgressBar>
</LabeledList.Item>
))}
</LabeledList>
</Section>
</Stack.Item>
</Stack>
</Window.Content>
</Window>
);
};
File diff suppressed because one or more lines are too long