mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-23 21:27:01 +01:00
September 2020 Upstream Merge
This commit is contained in:
@@ -118,14 +118,30 @@ obj/machinery/computer/ship/disperser/proc/is_valid_setup()
|
||||
if(B)
|
||||
return B
|
||||
|
||||
/obj/machinery/computer/ship/disperser/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = TRUE)
|
||||
/obj/machinery/computer/ship/disperser/tgui_interact(mob/user, datum/tgui/ui, datum/tgui/parent_ui)
|
||||
if(!linked)
|
||||
display_reconnect_dialog(user, "disperser synchronization")
|
||||
return
|
||||
|
||||
var/data[0]
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, "OvermapDisperser", "[linked.name] ORB control") // 400, 550
|
||||
ui.open()
|
||||
|
||||
if (!link_parts())
|
||||
/obj/machinery/computer/ship/disperser/tgui_data(mob/user)
|
||||
var/list/data = list()
|
||||
data["faillink"] = FALSE
|
||||
data["calibration"] = null
|
||||
data["overmapdir"] = null
|
||||
data["cal_accuracy"] = 0
|
||||
data["strength"] = 0
|
||||
data["range"] = 0
|
||||
data["next_shot"] = -1
|
||||
data["nopower"] = TRUE
|
||||
data["skill"] = FALSE
|
||||
data["chargeload"] = null
|
||||
|
||||
if(!link_parts())
|
||||
data["faillink"] = TRUE
|
||||
else
|
||||
data["calibration"] = calibration
|
||||
@@ -137,56 +153,58 @@ obj/machinery/computer/ship/disperser/proc/is_valid_setup()
|
||||
data["nopower"] = !data["faillink"] && (!front.powered() || !middle.powered() || !back.powered())
|
||||
data["skill"] = user.get_skill_value(core_skill) > skill_offset
|
||||
|
||||
var/charge = "<b>UNKNOWN ERROR</b>"
|
||||
var/charge = "UNKNOWN ERROR"
|
||||
if(get_charge_type() == OVERMAP_WEAKNESS_NONE)
|
||||
charge = "<b>ERROR</b>: No valid charge detected."
|
||||
charge = "ERROR: No valid charge detected."
|
||||
else
|
||||
var/obj/structure/ship_munition/disperser_charge/B = get_charge()
|
||||
charge = B.chargedesc
|
||||
data["chargeload"] = charge
|
||||
|
||||
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if (!ui)
|
||||
ui = new(user, src, ui_key, "disperser.tmpl", "[linked.name] ORB control", 400, 550)
|
||||
ui.set_initial_data(data)
|
||||
ui.open()
|
||||
ui.set_auto_update(1)
|
||||
return data
|
||||
|
||||
/obj/machinery/computer/ship/disperser/OnTopic(mob/user, list/href_list, state)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
/obj/machinery/computer/ship/disperser/tgui_act(action, list/params, datum/tgui/ui, datum/tgui_state/state)
|
||||
if(..())
|
||||
return TRUE
|
||||
|
||||
if(!linked)
|
||||
return TOPIC_HANDLED
|
||||
return FALSE
|
||||
|
||||
if (href_list["choose"])
|
||||
overmapdir = sanitize_integer(text2num(href_list["choose"]), 0, 9, 0)
|
||||
reset_calibration()
|
||||
switch(action)
|
||||
if("choose")
|
||||
overmapdir = sanitize_integer(text2num(params["dir"]), 0, 9, 0)
|
||||
reset_calibration()
|
||||
. = TRUE
|
||||
|
||||
if(href_list["calibration"])
|
||||
var/input = input("0-9", "disperser calibration", 0) as num|null
|
||||
if(!isnull(input)) //can be zero so we explicitly check for null
|
||||
var/calnum = sanitize_integer(text2num(href_list["calibration"]), 0, caldigit)//sanitiiiiize
|
||||
calibration[calnum + 1] = sanitize_integer(input, 0, 9, 0)//must add 1 because nanoui indexes from 0
|
||||
if("calibration")
|
||||
var/input = input("0-9", "disperser calibration", 0) as num|null
|
||||
if(!isnull(input)) //can be zero so we explicitly check for null
|
||||
var/calnum = sanitize_integer(text2num(params["calibration"]), 0, caldigit)//sanitiiiiize
|
||||
calibration[calnum + 1] = sanitize_integer(input, 0, 9, 0)//must add 1 because js indexes from 0
|
||||
. = TRUE
|
||||
|
||||
if(href_list["skill_calibration"])
|
||||
for(var/i = 1 to min(caldigit, user.get_skill_value(core_skill) - skill_offset))
|
||||
calibration[i] = calexpected[i]
|
||||
if("skill_calibration")
|
||||
for(var/i = 1 to min(caldigit, usr.get_skill_value(core_skill) - skill_offset))
|
||||
calibration[i] = calexpected[i]
|
||||
. = TRUE
|
||||
|
||||
if(href_list["strength"])
|
||||
var/input = input("1-5", "disperser strength", 1) as num|null
|
||||
if(input && CanInteract(user, state))
|
||||
strength = sanitize_integer(input, 1, 5, 1)
|
||||
middle.update_idle_power_usage(strength * range * 100)
|
||||
if("strength")
|
||||
var/input = input("1-5", "disperser strength", 1) as num|null
|
||||
if(input && tgui_status(usr, state) == STATUS_INTERACTIVE)
|
||||
strength = sanitize_integer(input, 1, 5, 1)
|
||||
middle.update_idle_power_usage(strength * range * 100)
|
||||
. = TRUE
|
||||
|
||||
if(href_list["range"])
|
||||
var/input = input("1-5", "disperser radius", 1) as num|null
|
||||
if(input && CanInteract(user, state))
|
||||
range = sanitize_integer(input, 1, 5, 1)
|
||||
middle.update_idle_power_usage(strength * range * 100)
|
||||
if("range")
|
||||
var/input = input("1-5", "disperser radius", 1) as num|null
|
||||
if(input && tgui_status(usr, state) == STATUS_INTERACTIVE)
|
||||
range = sanitize_integer(input, 1, 5, 1)
|
||||
middle.update_idle_power_usage(strength * range * 100)
|
||||
. = TRUE
|
||||
|
||||
if(href_list["fire"])
|
||||
fire(user)
|
||||
if("fire")
|
||||
fire(usr)
|
||||
. = TRUE
|
||||
|
||||
return TOPIC_REFRESH
|
||||
if(. && !issilicon(usr))
|
||||
playsound(src, "terminal_type", 50, 1)
|
||||
@@ -54,22 +54,8 @@
|
||||
//
|
||||
// Topic
|
||||
//
|
||||
|
||||
/obj/machinery/computer/ship/proc/DefaultTopicState()
|
||||
return global.default_state
|
||||
|
||||
/obj/machinery/computer/ship/Topic(var/href, var/href_list = list(), var/datum/topic_state/state)
|
||||
if((. = ..()))
|
||||
return
|
||||
state = state || DefaultTopicState() || global.default_state
|
||||
if(CanUseTopic(usr, state, href_list) == STATUS_INTERACTIVE)
|
||||
CouldUseTopic(usr)
|
||||
return OnTopic(usr, href_list, state)
|
||||
CouldNotUseTopic(usr)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/computer/ship/proc/OnTopic(var/mob/user, var/href_list, var/datum/topic_state/state)
|
||||
return TOPIC_NOACTION
|
||||
/obj/machinery/computer/ship/tgui_state()
|
||||
return GLOB.tgui_default_state
|
||||
|
||||
//
|
||||
// Interaction
|
||||
@@ -80,11 +66,11 @@
|
||||
// If you perform direct interactions in here, you are responsible for ensuring that full interactivity checks have been made (i.e CanInteract).
|
||||
// The checks leading in to here only guarantee that the user should be able to view a UI.
|
||||
/obj/machinery/computer/ship/proc/interface_interact(var/mob/user)
|
||||
ui_interact(user)
|
||||
tgui_interact(user)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/computer/ship/attack_ai(mob/user)
|
||||
if(CanUseTopic(user, DefaultTopicState()) > STATUS_CLOSE)
|
||||
if(tgui_status(user, tgui_state()) > STATUS_CLOSE)
|
||||
return interface_interact(user)
|
||||
|
||||
// After a recent rework this should mostly be safe.
|
||||
@@ -98,6 +84,6 @@
|
||||
return
|
||||
if(!allowed(user))
|
||||
to_chat(user, "<span class='warning'>Access Denied.</span>")
|
||||
return 1
|
||||
if(CanUseTopic(user, DefaultTopicState()) > STATUS_CLOSE)
|
||||
return TRUE
|
||||
if(tgui_status(user, tgui_state()) > STATUS_CLOSE)
|
||||
return interface_interact(user)
|
||||
|
||||
@@ -5,92 +5,92 @@
|
||||
icon_keyboard = "tech_key"
|
||||
icon_screen = "engines"
|
||||
circuit = /obj/item/weapon/circuitboard/engine
|
||||
var/display_state = "status"
|
||||
|
||||
/obj/machinery/computer/ship/engines/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
/obj/machinery/computer/ship/engines/tgui_interact(mob/user, datum/tgui/ui)
|
||||
if(!linked)
|
||||
display_reconnect_dialog(user, "ship control systems")
|
||||
return
|
||||
|
||||
var/data[0]
|
||||
data["state"] = display_state
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, "OvermapEngines", "[linked.name] Engines Control") // 390, 530
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/computer/ship/engines/tgui_data(mob/user, datum/tgui/ui, datum/tgui_state/state)
|
||||
var/list/data = list()
|
||||
data["global_state"] = linked.engines_state
|
||||
data["global_limit"] = round(linked.thrust_limit*100)
|
||||
var/total_thrust = 0
|
||||
|
||||
var/list/enginfo[0]
|
||||
var/list/enginfo = list()
|
||||
for(var/datum/ship_engine/E in linked.engines)
|
||||
var/list/rdata[0]
|
||||
var/list/rdata = list()
|
||||
rdata["eng_type"] = E.name
|
||||
rdata["eng_on"] = E.is_on()
|
||||
rdata["eng_thrust"] = E.get_thrust()
|
||||
rdata["eng_thrust_limiter"] = round(E.get_thrust_limit()*100)
|
||||
rdata["eng_status"] = E.get_status()
|
||||
var/list/status = E.get_status()
|
||||
if(!islist(status))
|
||||
log_runtime(EXCEPTION("Warning, ship [E.name] (\ref[E]) for [linked.name] returned a non-list status!"))
|
||||
status = list("Error")
|
||||
rdata["eng_status"] = status
|
||||
rdata["eng_reference"] = "\ref[E]"
|
||||
total_thrust += E.get_thrust()
|
||||
enginfo.Add(list(rdata))
|
||||
|
||||
data["engines_info"] = enginfo
|
||||
data["total_thrust"] = total_thrust
|
||||
return data
|
||||
|
||||
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if (!ui)
|
||||
ui = new(user, src, ui_key, "engines_control.tmpl", "[linked.name] Engines Control", 390, 530)
|
||||
ui.set_initial_data(data)
|
||||
ui.open()
|
||||
ui.set_auto_update(1)
|
||||
|
||||
/obj/machinery/computer/ship/engines/OnTopic(var/mob/user, var/list/href_list, state)
|
||||
/obj/machinery/computer/ship/engines/tgui_act(action, list/params, datum/tgui/ui, datum/tgui_state/state)
|
||||
if(..())
|
||||
return ..()
|
||||
return TRUE
|
||||
|
||||
if(href_list["state"])
|
||||
display_state = href_list["state"]
|
||||
return TOPIC_REFRESH
|
||||
switch(action)
|
||||
if("global_toggle")
|
||||
linked.engines_state = !linked.engines_state
|
||||
for(var/datum/ship_engine/E in linked.engines)
|
||||
if(linked.engines_state == !E.is_on())
|
||||
E.toggle()
|
||||
. = TRUE
|
||||
|
||||
if(href_list["global_toggle"])
|
||||
linked.engines_state = !linked.engines_state
|
||||
for(var/datum/ship_engine/E in linked.engines)
|
||||
if(linked.engines_state == !E.is_on())
|
||||
E.toggle()
|
||||
return TOPIC_REFRESH
|
||||
if("set_global_limit")
|
||||
var/newlim = input("Input new thrust limit (0..100%)", "Thrust limit", linked.thrust_limit*100) as num
|
||||
if(tgui_status(usr, state) != STATUS_INTERACTIVE)
|
||||
return FALSE
|
||||
linked.thrust_limit = clamp(newlim/100, 0, 1)
|
||||
for(var/datum/ship_engine/E in linked.engines)
|
||||
E.set_thrust_limit(linked.thrust_limit)
|
||||
. = TRUE
|
||||
|
||||
if(href_list["set_global_limit"])
|
||||
var/newlim = input("Input new thrust limit (0..100%)", "Thrust limit", linked.thrust_limit*100) as num
|
||||
if(!CanInteract(user, state))
|
||||
return TOPIC_NOACTION
|
||||
linked.thrust_limit = CLAMP(newlim/100, 0, 1)
|
||||
for(var/datum/ship_engine/E in linked.engines)
|
||||
E.set_thrust_limit(linked.thrust_limit)
|
||||
return TOPIC_REFRESH
|
||||
if("global_limit")
|
||||
linked.thrust_limit = clamp(linked.thrust_limit + text2num(params["global_limit"]), 0, 1)
|
||||
for(var/datum/ship_engine/E in linked.engines)
|
||||
E.set_thrust_limit(linked.thrust_limit)
|
||||
. = TRUE
|
||||
|
||||
if(href_list["global_limit"])
|
||||
linked.thrust_limit = CLAMP(linked.thrust_limit + text2num(href_list["global_limit"]), 0, 1)
|
||||
for(var/datum/ship_engine/E in linked.engines)
|
||||
E.set_thrust_limit(linked.thrust_limit)
|
||||
return TOPIC_REFRESH
|
||||
|
||||
if(href_list["engine"])
|
||||
if(href_list["set_limit"])
|
||||
var/datum/ship_engine/E = locate(href_list["engine"])
|
||||
if("set_limit")
|
||||
var/datum/ship_engine/E = locate(params["engine"])
|
||||
var/newlim = input("Input new thrust limit (0..100)", "Thrust limit", E.get_thrust_limit()) as num
|
||||
if(!CanInteract(user, state))
|
||||
return
|
||||
var/limit = CLAMP(newlim/100, 0, 1)
|
||||
if(tgui_status(usr, state) != STATUS_INTERACTIVE)
|
||||
return FALSE
|
||||
var/limit = clamp(newlim/100, 0, 1)
|
||||
if(istype(E))
|
||||
E.set_thrust_limit(limit)
|
||||
return TOPIC_REFRESH
|
||||
if(href_list["limit"])
|
||||
var/datum/ship_engine/E = locate(href_list["engine"])
|
||||
var/limit = CLAMP(E.get_thrust_limit() + text2num(href_list["limit"]), 0, 1)
|
||||
if(istype(E))
|
||||
E.set_thrust_limit(limit)
|
||||
return TOPIC_REFRESH
|
||||
. = TRUE
|
||||
|
||||
if(href_list["toggle"])
|
||||
var/datum/ship_engine/E = locate(href_list["engine"])
|
||||
if("limit")
|
||||
var/datum/ship_engine/E = locate(params["engine"])
|
||||
var/limit = clamp(E.get_thrust_limit() + text2num(params["limit"]), 0, 1)
|
||||
if(istype(E))
|
||||
E.set_thrust_limit(limit)
|
||||
. = TRUE
|
||||
|
||||
if("toggle")
|
||||
var/datum/ship_engine/E = locate(params["engine"])
|
||||
if(istype(E))
|
||||
E.toggle()
|
||||
return TOPIC_REFRESH
|
||||
return TOPIC_REFRESH
|
||||
return TOPIC_NOACTION
|
||||
. = TRUE
|
||||
|
||||
if(. && !issilicon(usr))
|
||||
playsound(src, "terminal_type", 50, 1)
|
||||
@@ -22,6 +22,7 @@ GLOBAL_LIST_EMPTY(all_waypoints)
|
||||
circuit = /obj/item/weapon/circuitboard/helm
|
||||
core_skill = /datum/skill/pilot
|
||||
var/autopilot = 0
|
||||
var/autopilot_disabled = TRUE
|
||||
var/list/known_sectors = list()
|
||||
var/dx //desitnation
|
||||
var/dy //coordinates
|
||||
@@ -36,7 +37,7 @@ GLOBAL_LIST_EMPTY(all_waypoints)
|
||||
/obj/machinery/computer/ship/helm/proc/get_known_sectors()
|
||||
var/area/overmap/map = locate() in world
|
||||
for(var/obj/effect/overmap/visitable/sector/S in map)
|
||||
if (S.known)
|
||||
if(S.known)
|
||||
var/datum/computer_file/data/waypoint/R = new()
|
||||
R.fields["name"] = S.name
|
||||
R.fields["x"] = S.x
|
||||
@@ -45,7 +46,7 @@ GLOBAL_LIST_EMPTY(all_waypoints)
|
||||
|
||||
/obj/machinery/computer/ship/helm/process()
|
||||
..()
|
||||
if (autopilot && dx && dy)
|
||||
if(autopilot && dx && dy && !autopilot_disabled)
|
||||
var/turf/T = locate(dx,dy,global.using_map.overmap_z)
|
||||
if(linked.loc == T)
|
||||
if(linked.is_still())
|
||||
@@ -60,13 +61,13 @@ GLOBAL_LIST_EMPTY(all_waypoints)
|
||||
var/heading = linked.get_heading()
|
||||
|
||||
// Destination is current grid or speedlimit is exceeded
|
||||
if ((get_dist(linked.loc, T) <= brake_path) || speed > speedlimit)
|
||||
if((get_dist(linked.loc, T) <= brake_path) || speed > speedlimit)
|
||||
linked.decelerate()
|
||||
// Heading does not match direction
|
||||
else if (heading & ~direction)
|
||||
else if(heading & ~direction)
|
||||
linked.accelerate(turn(heading & ~direction, 180), accellimit)
|
||||
// All other cases, move toward direction
|
||||
else if (speed + acceleration <= speedlimit)
|
||||
else if(speed + acceleration <= speedlimit)
|
||||
linked.accelerate(direction, accellimit)
|
||||
linked.operator_skill = null//if this is on you can't dodge meteors
|
||||
return
|
||||
@@ -78,149 +79,176 @@ GLOBAL_LIST_EMPTY(all_waypoints)
|
||||
linked.relaymove(user, direction, accellimit)
|
||||
return 1
|
||||
|
||||
/obj/machinery/computer/ship/helm/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
var/data[0]
|
||||
|
||||
/obj/machinery/computer/ship/helm/tgui_interact(mob/user, datum/tgui/ui)
|
||||
if(!linked)
|
||||
display_reconnect_dialog(user, "helm")
|
||||
return
|
||||
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, "OvermapHelm", "[linked.name] Helm Control") // 565, 545
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/computer/ship/helm/tgui_data(mob/user)
|
||||
var/list/data = ..()
|
||||
|
||||
var/turf/T = get_turf(linked)
|
||||
var/obj/effect/overmap/visitable/sector/current_sector = locate() in T
|
||||
|
||||
data["sector"] = current_sector ? current_sector.name : "Deep Space"
|
||||
data["sector_info"] = current_sector ? current_sector.desc : "Not Available"
|
||||
data["landed"] = linked.get_landed_info()
|
||||
data["s_x"] = linked.x
|
||||
data["s_y"] = linked.y
|
||||
data["dest"] = dy && dx
|
||||
data["d_x"] = dx
|
||||
data["d_y"] = dy
|
||||
data["speedlimit"] = speedlimit ? speedlimit*1000 : "Halted"
|
||||
data["accel"] = min(round(linked.get_acceleration()*1000, 0.01),accellimit*1000)
|
||||
data["heading"] = linked.get_heading_degrees()
|
||||
data["autopilot_disabled"] = autopilot_disabled
|
||||
data["autopilot"] = autopilot
|
||||
data["manual_control"] = viewing_overmap(user)
|
||||
data["canburn"] = linked.can_burn()
|
||||
data["accellimit"] = accellimit*1000
|
||||
|
||||
var/speed = round(linked.get_speed()*1000, 0.01)
|
||||
var/speed_color = null
|
||||
if(linked.get_speed() < SHIP_SPEED_SLOW)
|
||||
speed_color = "good"
|
||||
if(linked.get_speed() > SHIP_SPEED_FAST)
|
||||
speed_color = "average"
|
||||
data["speed"] = speed
|
||||
data["speed_color"] = speed_color
|
||||
|
||||
if(linked.get_speed())
|
||||
data["ETAnext"] = "[round(linked.ETA()/10)] seconds"
|
||||
else
|
||||
var/turf/T = get_turf(linked)
|
||||
var/obj/effect/overmap/visitable/sector/current_sector = locate() in T
|
||||
data["ETAnext"] = "N/A"
|
||||
|
||||
data["sector"] = current_sector ? current_sector.name : "Deep Space"
|
||||
data["sector_info"] = current_sector ? current_sector.desc : "Not Available"
|
||||
data["landed"] = linked.get_landed_info()
|
||||
data["s_x"] = linked.x
|
||||
data["s_y"] = linked.y
|
||||
data["dest"] = dy && dx
|
||||
data["d_x"] = dx
|
||||
data["d_y"] = dy
|
||||
data["speedlimit"] = speedlimit ? speedlimit*1000 : "Halted"
|
||||
data["accel"] = min(round(linked.get_acceleration()*1000, 0.01),accellimit*1000)
|
||||
data["heading"] = linked.get_heading_degrees()
|
||||
data["autopilot"] = autopilot
|
||||
data["manual_control"] = viewing_overmap(user)
|
||||
data["canburn"] = linked.can_burn()
|
||||
data["accellimit"] = accellimit*1000
|
||||
var/list/locations[0]
|
||||
for (var/key in known_sectors)
|
||||
var/datum/computer_file/data/waypoint/R = known_sectors[key]
|
||||
var/list/rdata[0]
|
||||
rdata["name"] = R.fields["name"]
|
||||
rdata["x"] = R.fields["x"]
|
||||
rdata["y"] = R.fields["y"]
|
||||
rdata["reference"] = "\ref[R]"
|
||||
locations.Add(list(rdata))
|
||||
|
||||
var/speed = round(linked.get_speed()*1000, 0.01)
|
||||
if(linked.get_speed() < SHIP_SPEED_SLOW)
|
||||
speed = "<span class='good'>[speed]</span>"
|
||||
if(linked.get_speed() > SHIP_SPEED_FAST)
|
||||
speed = "<span class='average'>[speed]</span>"
|
||||
data["speed"] = speed
|
||||
data["locations"] = locations
|
||||
return data
|
||||
|
||||
if(linked.get_speed())
|
||||
data["ETAnext"] = "[round(linked.ETA()/10)] seconds"
|
||||
else
|
||||
data["ETAnext"] = "N/A"
|
||||
|
||||
var/list/locations[0]
|
||||
for (var/key in known_sectors)
|
||||
var/datum/computer_file/data/waypoint/R = known_sectors[key]
|
||||
var/list/rdata[0]
|
||||
rdata["name"] = R.fields["name"]
|
||||
rdata["x"] = R.fields["x"]
|
||||
rdata["y"] = R.fields["y"]
|
||||
rdata["reference"] = "\ref[R]"
|
||||
locations.Add(list(rdata))
|
||||
|
||||
data["locations"] = locations
|
||||
|
||||
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if (!ui)
|
||||
ui = new(user, src, ui_key, "helm.tmpl", "[linked.name] Helm Control", 565, 545)
|
||||
ui.set_initial_data(data)
|
||||
ui.open()
|
||||
ui.set_auto_update(1)
|
||||
|
||||
/obj/machinery/computer/ship/helm/OnTopic(var/mob/user, var/list/href_list, state)
|
||||
/obj/machinery/computer/ship/helm/tgui_act(action, list/params, datum/tgui/ui, datum/tgui_state/state)
|
||||
if(..())
|
||||
return TOPIC_HANDLED
|
||||
return TRUE
|
||||
|
||||
if(!linked)
|
||||
return TOPIC_HANDLED
|
||||
return FALSE
|
||||
|
||||
if (href_list["add"])
|
||||
var/datum/computer_file/data/waypoint/R = new()
|
||||
var/sec_name = input("Input naviation entry name", "New navigation entry", "Sector #[known_sectors.len]") as text
|
||||
if(!CanInteract(user,state))
|
||||
return TOPIC_NOACTION
|
||||
if(!sec_name)
|
||||
sec_name = "Sector #[known_sectors.len]"
|
||||
R.fields["name"] = sec_name
|
||||
if(sec_name in known_sectors)
|
||||
to_chat(user, "<span class='warning'>Sector with that name already exists, please input a different name.</span>")
|
||||
return TOPIC_REFRESH
|
||||
switch(href_list["add"])
|
||||
if("current")
|
||||
R.fields["x"] = linked.x
|
||||
R.fields["y"] = linked.y
|
||||
if("new")
|
||||
var/newx = input("Input new entry x coordinate", "Coordinate input", linked.x) as num
|
||||
if(!CanInteract(user,state))
|
||||
return TOPIC_REFRESH
|
||||
var/newy = input("Input new entry y coordinate", "Coordinate input", linked.y) as num
|
||||
if(!CanInteract(user,state))
|
||||
return TOPIC_NOACTION
|
||||
R.fields["x"] = CLAMP(newx, 1, world.maxx)
|
||||
R.fields["y"] = CLAMP(newy, 1, world.maxy)
|
||||
known_sectors[sec_name] = R
|
||||
switch(action)
|
||||
if("add")
|
||||
var/datum/computer_file/data/waypoint/R = new()
|
||||
var/sec_name = input("Input navigation entry name", "New navigation entry", "Sector #[known_sectors.len]") as text
|
||||
if(tgui_status(usr, state) != STATUS_INTERACTIVE)
|
||||
return FALSE
|
||||
if(!sec_name)
|
||||
sec_name = "Sector #[known_sectors.len]"
|
||||
R.fields["name"] = sec_name
|
||||
if(sec_name in known_sectors)
|
||||
to_chat(usr, "<span class='warning'>Sector with that name already exists, please input a different name.</span>")
|
||||
return TRUE
|
||||
switch(params["add"])
|
||||
if("current")
|
||||
R.fields["x"] = linked.x
|
||||
R.fields["y"] = linked.y
|
||||
if("new")
|
||||
var/newx = input("Input new entry x coordinate", "Coordinate input", linked.x) as num
|
||||
if(tgui_status(usr, state) != STATUS_INTERACTIVE)
|
||||
return TRUE
|
||||
var/newy = input("Input new entry y coordinate", "Coordinate input", linked.y) as num
|
||||
if(tgui_status(usr, state) != STATUS_INTERACTIVE)
|
||||
return FALSE
|
||||
R.fields["x"] = CLAMP(newx, 1, world.maxx)
|
||||
R.fields["y"] = CLAMP(newy, 1, world.maxy)
|
||||
known_sectors[sec_name] = R
|
||||
. = TRUE
|
||||
|
||||
if (href_list["remove"])
|
||||
var/datum/computer_file/data/waypoint/R = locate(href_list["remove"])
|
||||
if(R)
|
||||
known_sectors.Remove(R.fields["name"])
|
||||
qdel(R)
|
||||
if("remove")
|
||||
var/datum/computer_file/data/waypoint/R = locate(params["remove"])
|
||||
if(R)
|
||||
known_sectors.Remove(R.fields["name"])
|
||||
qdel(R)
|
||||
. = TRUE
|
||||
|
||||
if (href_list["setx"])
|
||||
var/newx = input("Input new destiniation x coordinate", "Coordinate input", dx) as num|null
|
||||
if(!CanInteract(user,state))
|
||||
return
|
||||
if (newx)
|
||||
dx = CLAMP(newx, 1, world.maxx)
|
||||
if("setcoord")
|
||||
if(params["setx"])
|
||||
var/newx = input("Input new destiniation x coordinate", "Coordinate input", dx) as num|null
|
||||
if(tgui_status(usr, state) != STATUS_INTERACTIVE)
|
||||
return
|
||||
if(newx)
|
||||
dx = CLAMP(newx, 1, world.maxx)
|
||||
|
||||
if (href_list["sety"])
|
||||
var/newy = input("Input new destiniation y coordinate", "Coordinate input", dy) as num|null
|
||||
if(!CanInteract(user,state))
|
||||
return
|
||||
if (newy)
|
||||
dy = CLAMP(newy, 1, world.maxy)
|
||||
if(params["sety"])
|
||||
var/newy = input("Input new destiniation y coordinate", "Coordinate input", dy) as num|null
|
||||
if(tgui_status(usr, state) != STATUS_INTERACTIVE)
|
||||
return
|
||||
if(newy)
|
||||
dy = CLAMP(newy, 1, world.maxy)
|
||||
. = TRUE
|
||||
|
||||
if (href_list["x"] && href_list["y"])
|
||||
dx = text2num(href_list["x"])
|
||||
dy = text2num(href_list["y"])
|
||||
if("setds")
|
||||
dx = text2num(params["x"])
|
||||
dy = text2num(params["y"])
|
||||
. = TRUE
|
||||
|
||||
if (href_list["reset"])
|
||||
dx = 0
|
||||
dy = 0
|
||||
if("reset")
|
||||
dx = 0
|
||||
dy = 0
|
||||
. = TRUE
|
||||
|
||||
if (href_list["speedlimit"])
|
||||
var/newlimit = input("Input new speed limit for autopilot (0 to brake)", "Autopilot speed limit", speedlimit*1000) as num|null
|
||||
if(newlimit)
|
||||
speedlimit = CLAMP(newlimit/1000, 0, 100)
|
||||
if (href_list["accellimit"])
|
||||
var/newlimit = input("Input new acceleration limit", "Acceleration limit", accellimit*1000) as num|null
|
||||
if(newlimit)
|
||||
accellimit = max(newlimit/1000, 0)
|
||||
if("speedlimit")
|
||||
var/newlimit = input("Input new speed limit for autopilot (0 to brake)", "Autopilot speed limit", speedlimit*1000) as num|null
|
||||
if(newlimit)
|
||||
speedlimit = CLAMP(newlimit/1000, 0, 100)
|
||||
. = TRUE
|
||||
|
||||
if (href_list["move"])
|
||||
var/ndir = text2num(href_list["move"])
|
||||
if(prob(user.skill_fail_chance(/datum/skill/pilot, 50, linked.skill_needed, factor = 1)))
|
||||
ndir = turn(ndir,pick(90,-90))
|
||||
linked.relaymove(user, ndir, accellimit)
|
||||
if("accellimit")
|
||||
var/newlimit = input("Input new acceleration limit", "Acceleration limit", accellimit*1000) as num|null
|
||||
if(newlimit)
|
||||
accellimit = max(newlimit/1000, 0)
|
||||
. = TRUE
|
||||
|
||||
if (href_list["brake"])
|
||||
linked.decelerate()
|
||||
if("move")
|
||||
var/ndir = text2num(params["dir"])
|
||||
if(prob(usr.skill_fail_chance(/datum/skill/pilot, 50, linked.skill_needed, factor = 1)))
|
||||
ndir = turn(ndir,pick(90,-90))
|
||||
linked.relaymove(usr, ndir, accellimit)
|
||||
. = TRUE
|
||||
|
||||
if (href_list["apilot"])
|
||||
autopilot = !autopilot
|
||||
if("brake")
|
||||
linked.decelerate()
|
||||
. = TRUE
|
||||
|
||||
if (href_list["manual"])
|
||||
viewing_overmap(user) ? unlook(user) : look(user)
|
||||
if("apilot")
|
||||
if(autopilot_disabled)
|
||||
autopilot = FALSE
|
||||
else
|
||||
autopilot = !autopilot
|
||||
. = TRUE
|
||||
|
||||
if("apilot_lock")
|
||||
autopilot_disabled = !autopilot_disabled
|
||||
autopilot = FALSE
|
||||
. = TRUE
|
||||
|
||||
add_fingerprint(user)
|
||||
updateUsrDialog()
|
||||
if("manual")
|
||||
viewing_overmap(usr) ? unlook(usr) : look(usr)
|
||||
. = TRUE
|
||||
|
||||
add_fingerprint(usr)
|
||||
if(. && !issilicon(usr))
|
||||
playsound(src, "terminal_type", 50, 1)
|
||||
|
||||
|
||||
/obj/machinery/computer/ship/navigation
|
||||
@@ -228,49 +256,21 @@ GLOBAL_LIST_EMPTY(all_waypoints)
|
||||
icon_keyboard = "generic_key"
|
||||
icon_screen = "helm"
|
||||
circuit = /obj/item/weapon/circuitboard/nav
|
||||
var/datum/tgui_module/ship/nav/nav_tgui
|
||||
|
||||
/obj/machinery/computer/ship/navigation/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
if(!linked)
|
||||
display_reconnect_dialog(user, "Navigation")
|
||||
return
|
||||
/obj/machinery/computer/ship/navigation/Initialize()
|
||||
. = ..()
|
||||
nav_tgui = new(src)
|
||||
|
||||
var/data[0]
|
||||
/obj/machinery/computer/ship/navigation/Destroy()
|
||||
QDEL_NULL(nav_tgui)
|
||||
. = ..()
|
||||
|
||||
/obj/machinery/computer/ship/navigation/sync_linked(user)
|
||||
return nav_tgui?.sync_linked()
|
||||
|
||||
var/turf/T = get_turf(linked)
|
||||
var/obj/effect/overmap/visitable/sector/current_sector = locate() in T
|
||||
|
||||
data["sector"] = current_sector ? current_sector.name : "Deep Space"
|
||||
data["sector_info"] = current_sector ? current_sector.desc : "Not Available"
|
||||
data["s_x"] = linked.x
|
||||
data["s_y"] = linked.y
|
||||
data["speed"] = round(linked.get_speed()*1000, 0.01)
|
||||
data["accel"] = round(linked.get_acceleration()*1000, 0.01)
|
||||
data["heading"] = linked.get_heading_degrees()
|
||||
data["viewing"] = viewing_overmap(user)
|
||||
|
||||
if(linked.get_speed())
|
||||
data["ETAnext"] = "[round(linked.ETA()/10)] seconds"
|
||||
else
|
||||
data["ETAnext"] = "N/A"
|
||||
|
||||
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if (!ui)
|
||||
ui = new(user, src, ui_key, "nav.tmpl", "[linked.name] Navigation Screen", 380, 530)
|
||||
ui.set_initial_data(data)
|
||||
ui.open()
|
||||
ui.set_auto_update(1)
|
||||
|
||||
/obj/machinery/computer/ship/navigation/OnTopic(var/mob/user, var/list/href_list)
|
||||
if(..())
|
||||
return TOPIC_HANDLED
|
||||
|
||||
if (!linked)
|
||||
return TOPIC_NOACTION
|
||||
|
||||
if (href_list["viewing"])
|
||||
viewing_overmap(user) ? unlook(user) : look(user)
|
||||
return TOPIC_REFRESH
|
||||
/obj/machinery/computer/ship/navigation/tgui_interact(mob/user, datum/tgui/ui)
|
||||
return nav_tgui?.tgui_interact(user, ui)
|
||||
|
||||
/obj/machinery/computer/ship/navigation/telescreen //little hacky but it's only used on one ship so it should be okay
|
||||
icon_state = "tele_nav"
|
||||
|
||||
@@ -20,14 +20,29 @@
|
||||
sensors = S
|
||||
break
|
||||
|
||||
/obj/machinery/computer/ship/sensors/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
/obj/machinery/computer/ship/sensors/tgui_interact(mob/user, datum/tgui/ui)
|
||||
if(!linked)
|
||||
display_reconnect_dialog(user, "sensors")
|
||||
return
|
||||
|
||||
var/data[0]
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, "OvermapShipSensors", "[linked.name] Sensors Control") // 420, 530
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/computer/ship/sensors/tgui_data(mob/user)
|
||||
var/list/data = list()
|
||||
|
||||
data["viewing"] = viewing_overmap(user)
|
||||
data["on"] = 0
|
||||
data["range"] = "N/A"
|
||||
data["health"] = 0
|
||||
data["max_health"] = 0
|
||||
data["heat"] = 0
|
||||
data["critical_heat"] = 0
|
||||
data["status"] = "MISSING"
|
||||
data["contacts"] = list()
|
||||
|
||||
if(sensors)
|
||||
data["on"] = sensors.use_power
|
||||
data["range"] = sensors.range
|
||||
@@ -53,54 +68,49 @@
|
||||
if(bearing < 0)
|
||||
bearing += 360
|
||||
contacts.Add(list(list("name"=O.name, "ref"="\ref[O]", "bearing"=bearing)))
|
||||
if(contacts.len)
|
||||
data["contacts"] = contacts
|
||||
else
|
||||
data["status"] = "MISSING"
|
||||
data["range"] = "N/A"
|
||||
data["on"] = 0
|
||||
data["contacts"] = contacts
|
||||
|
||||
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if (!ui)
|
||||
ui = new(user, src, ui_key, "shipsensors.tmpl", "[linked.name] Sensors Control", 420, 530, src)
|
||||
ui.set_initial_data(data)
|
||||
ui.open()
|
||||
ui.set_auto_update(1)
|
||||
return data
|
||||
|
||||
/obj/machinery/computer/ship/sensors/OnTopic(var/mob/user, var/list/href_list, state)
|
||||
/obj/machinery/computer/ship/sensors/tgui_act(action, list/params, datum/tgui/ui, datum/tgui_state/state)
|
||||
if(..())
|
||||
return TOPIC_HANDLED
|
||||
return TRUE
|
||||
|
||||
if (!linked)
|
||||
return TOPIC_NOACTION
|
||||
if(!linked)
|
||||
return FALSE
|
||||
|
||||
if (href_list["viewing"])
|
||||
if(user && !isAI(user))
|
||||
viewing_overmap(user) ? unlook(user) : look(user)
|
||||
return TOPIC_REFRESH
|
||||
switch(action)
|
||||
if("viewing")
|
||||
if(usr && !isAI(usr))
|
||||
viewing_overmap(usr) ? unlook(usr) : look(usr)
|
||||
. = TRUE
|
||||
|
||||
if (href_list["link"])
|
||||
find_sensors()
|
||||
return TOPIC_REFRESH
|
||||
if("link")
|
||||
find_sensors()
|
||||
. = TRUE
|
||||
|
||||
if("scan")
|
||||
var/obj/effect/overmap/O = locate(params["scan"])
|
||||
if(istype(O) && !QDELETED(O) && (O in view(7,linked)))
|
||||
new/obj/item/weapon/paper/(get_turf(src), O.get_scan_data(usr), "paper (Sensor Scan - [O])")
|
||||
playsound(src, "sound/machines/printer.ogg", 30, 1)
|
||||
. = TRUE
|
||||
|
||||
if(sensors)
|
||||
if (href_list["range"])
|
||||
var/nrange = input("Set new sensors range", "Sensor range", sensors.range) as num|null
|
||||
if(!CanInteract(user,state))
|
||||
return TOPIC_NOACTION
|
||||
if (nrange)
|
||||
sensors.set_range(CLAMP(nrange, 1, world.view))
|
||||
return TOPIC_REFRESH
|
||||
if (href_list["toggle"])
|
||||
sensors.toggle()
|
||||
return TOPIC_REFRESH
|
||||
switch(action)
|
||||
if("range")
|
||||
var/nrange = input("Set new sensors range", "Sensor range", sensors.range) as num|null
|
||||
if(tgui_status(usr, state) != STATUS_INTERACTIVE)
|
||||
return FALSE
|
||||
if(nrange)
|
||||
sensors.set_range(CLAMP(nrange, 1, world.view))
|
||||
. = TRUE
|
||||
if("toggle")
|
||||
sensors.toggle()
|
||||
. = TRUE
|
||||
|
||||
if (href_list["scan"])
|
||||
var/obj/effect/overmap/O = locate(href_list["scan"])
|
||||
if(istype(O) && !QDELETED(O) && (O in view(7,linked)))
|
||||
playsound(src, "sound/machines/dotprinter.ogg", 30, 1)
|
||||
new/obj/item/weapon/paper/(get_turf(src), O.get_scan_data(user), "paper (Sensor Scan - [O])")
|
||||
return TOPIC_HANDLED
|
||||
if(. && !issilicon(usr))
|
||||
playsound(src, "terminal_type", 50, 1)
|
||||
|
||||
/obj/machinery/computer/ship/sensors/process()
|
||||
..()
|
||||
|
||||
@@ -37,22 +37,31 @@ somewhere on that shuttle. Subtypes of these can be then used to perform ship ov
|
||||
popup.set_content("<center><strong><font color = 'red'>Error</strong></font><br>Unable to connect to [flavor].<br><a href='?src=\ref[src];sync=1'>Reconnect</a></center>")
|
||||
popup.open()
|
||||
|
||||
/obj/machinery/computer/ship/Topic(href, href_list)
|
||||
if(..())
|
||||
return TRUE
|
||||
if(href_list["sync"])
|
||||
if(sync_linked(usr))
|
||||
interface_interact(usr)
|
||||
return TRUE
|
||||
|
||||
// In computer_shims for now - we had to define it.
|
||||
// /obj/machinery/computer/ship/interface_interact(var/mob/user)
|
||||
// ui_interact(user)
|
||||
// return TRUE
|
||||
|
||||
/obj/machinery/computer/ship/OnTopic(var/mob/user, var/list/href_list)
|
||||
/obj/machinery/computer/ship/tgui_act(action, list/params, datum/tgui/ui, datum/tgui_state/state)
|
||||
if(..())
|
||||
return TOPIC_HANDLED
|
||||
if(href_list["sync"])
|
||||
sync_linked(user)
|
||||
return TOPIC_REFRESH
|
||||
if(href_list["close"])
|
||||
unlook(user)
|
||||
user.unset_machine()
|
||||
return TOPIC_HANDLED
|
||||
return TOPIC_NOACTION
|
||||
return TRUE
|
||||
switch(action)
|
||||
if("sync")
|
||||
sync_linked(usr)
|
||||
return TRUE
|
||||
if("close")
|
||||
unlook(usr)
|
||||
usr.unset_machine()
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
// Management of mob view displacement. look to shift view to the ship on the overmap; unlook to shift back.
|
||||
|
||||
@@ -60,6 +69,7 @@ somewhere on that shuttle. Subtypes of these can be then used to perform ship ov
|
||||
if(linked)
|
||||
apply_visual(user)
|
||||
user.reset_view(linked)
|
||||
user.set_machine(src)
|
||||
user.set_viewsize(world.view + extra_view)
|
||||
GLOB.moved_event.register(user, src, /obj/machinery/computer/ship/proc/unlook)
|
||||
// TODO GLOB.stat_set_event.register(user, src, /obj/machinery/computer/ship/proc/unlook)
|
||||
@@ -75,17 +85,21 @@ somewhere on that shuttle. Subtypes of these can be then used to perform ship ov
|
||||
/obj/machinery/computer/ship/proc/viewing_overmap(mob/user)
|
||||
return (weakref(user) in viewers)
|
||||
|
||||
/obj/machinery/computer/ship/CouldNotUseTopic(mob/user)
|
||||
/obj/machinery/computer/ship/tgui_status(mob/user)
|
||||
. = ..()
|
||||
if(. > STATUS_DISABLED)
|
||||
if(viewing_overmap(user))
|
||||
look(user)
|
||||
return
|
||||
unlook(user)
|
||||
|
||||
/obj/machinery/computer/ship/CouldUseTopic(mob/user)
|
||||
/obj/machinery/computer/ship/tgui_close(mob/user)
|
||||
. = ..()
|
||||
if(viewing_overmap(user))
|
||||
look(user)
|
||||
user.unset_machine()
|
||||
unlook(user)
|
||||
|
||||
/obj/machinery/computer/ship/check_eye(var/mob/user)
|
||||
if (!get_dist(user, src) > 1 || user.blinded || !linked )
|
||||
if(!get_dist(user, src) > 1 || user.blinded || !linked)
|
||||
unlook(user)
|
||||
return -1
|
||||
else
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
/obj/machinery/computer/shuttle_control/explore
|
||||
name = "general shuttle control console"
|
||||
circuit = /obj/item/weapon/circuitboard/shuttle_console/explore
|
||||
ui_template = "shuttle_control_console_exploration.tmpl"
|
||||
tgui_subtemplate = "ShuttleControlConsoleExploration"
|
||||
|
||||
/obj/machinery/computer/shuttle_control/explore/get_ui_data(var/datum/shuttle/autodock/overmap/shuttle)
|
||||
/obj/machinery/computer/shuttle_control/explore/shuttlerich_tgui_data(var/datum/shuttle/autodock/overmap/shuttle)
|
||||
. = ..()
|
||||
if(istype(shuttle))
|
||||
var/total_gas = 0
|
||||
@@ -25,22 +25,28 @@
|
||||
"fuel_span" = fuel_span
|
||||
)
|
||||
|
||||
/obj/machinery/computer/shuttle_control/explore/handle_topic_href(var/datum/shuttle/autodock/overmap/shuttle, var/list/href_list)
|
||||
/obj/machinery/computer/shuttle_control/explore/tgui_act(action, list/params)
|
||||
if(..())
|
||||
return TRUE
|
||||
|
||||
var/datum/shuttle/autodock/overmap/shuttle = SSshuttles.shuttles[shuttle_tag]
|
||||
if(!istype(shuttle))
|
||||
to_chat(usr, "<span class='warning'>Unable to establish link with the shuttle.</span>")
|
||||
return TRUE
|
||||
|
||||
if(ismob(usr))
|
||||
var/mob/user = usr
|
||||
shuttle.operator_skill = user.get_skill_value(/datum/skill/pilot)
|
||||
|
||||
if((. = ..()) != null)
|
||||
return
|
||||
|
||||
if(href_list["pick"])
|
||||
var/list/possible_d = shuttle.get_possible_destinations()
|
||||
var/D
|
||||
if(possible_d.len)
|
||||
D = input("Choose shuttle destination", "Shuttle Destination") as null|anything in possible_d
|
||||
else
|
||||
to_chat(usr,"<span class='warning'>No valid landing sites in range.</span>")
|
||||
possible_d = shuttle.get_possible_destinations()
|
||||
if(CanInteract(usr, global.default_state) && (D in possible_d))
|
||||
shuttle.set_destination(possible_d[D])
|
||||
return TOPIC_REFRESH
|
||||
switch(action)
|
||||
if("pick")
|
||||
var/list/possible_d = shuttle.get_possible_destinations()
|
||||
var/D
|
||||
if(possible_d.len)
|
||||
D = input("Choose shuttle destination", "Shuttle Destination") as null|anything in possible_d
|
||||
else
|
||||
to_chat(usr,"<span class='warning'>No valid landing sites in range.</span>")
|
||||
possible_d = shuttle.get_possible_destinations()
|
||||
if(CanInteract(usr, global.default_state) && (D in possible_d))
|
||||
shuttle.set_destination(possible_d[D])
|
||||
return TRUE
|
||||
|
||||
@@ -19,7 +19,7 @@ var/list/ship_engines = list()
|
||||
|
||||
//Returns status string for this engine
|
||||
/datum/ship_engine/proc/get_status()
|
||||
return "All systems nominal"
|
||||
return list("All systems nominal")
|
||||
|
||||
/datum/ship_engine/proc/get_thrust()
|
||||
return 1
|
||||
|
||||
@@ -103,18 +103,17 @@
|
||||
. = list()
|
||||
.+= "Location: [get_area(src)]."
|
||||
if(stat & NOPOWER)
|
||||
.+= "<span class='average'>Insufficient power to operate.</span>"
|
||||
.+= list(list("Insufficient power to operate.", "bad"))
|
||||
if(!check_fuel())
|
||||
.+= "<span class='average'>Insufficient fuel for a burn.</span>"
|
||||
.+= list(list("Insufficient fuel for a burn.", "bad"))
|
||||
if(stat & BROKEN)
|
||||
.+= "<span class='average'>Inoperable engine configuration.</span>"
|
||||
.+= list(list("Inoperable engine configuration.", "bad"))
|
||||
if(blockage)
|
||||
.+= "<span class='average'>Obstruction of airflow detected.</span>"
|
||||
.+= list(list("Obstruction of airflow detected.", "bad"))
|
||||
|
||||
.+= "Propellant total mass: [round(air_contents.get_mass(),0.01)] kg."
|
||||
.+= "Propellant used per burn: [round(air_contents.get_mass() * volume_per_burn * thrust_limit / air_contents.volume,0.01)] kg."
|
||||
.+= "Propellant pressure: [round(air_contents.return_pressure()/1000,0.1)] MPa."
|
||||
. = jointext(.,"<br>")
|
||||
|
||||
/obj/machinery/atmospherics/unary/engine/power_change()
|
||||
. = ..()
|
||||
|
||||
@@ -61,9 +61,7 @@
|
||||
. = list()
|
||||
.+= "Location: [get_area(src)]."
|
||||
if(!powered())
|
||||
.+= "Insufficient power to operate."
|
||||
|
||||
. = jointext(.,"<br>")
|
||||
.+= list(list("Insufficient power to operate.", "bad"))
|
||||
|
||||
/obj/machinery/ion_engine/proc/burn()
|
||||
if(!on && !powered())
|
||||
|
||||
Reference in New Issue
Block a user