Merge branch 'master' of https://github.com/Citadel-Station-13/Citadel-Station-13 into station_traits
This commit is contained in:
@@ -35,67 +35,63 @@
|
||||
. = ..()
|
||||
. += distance_multiplier < 1 ? "Bluespace shortcut module installed. Route is [distance_multiplier]x the original length." : ""
|
||||
|
||||
/obj/machinery/computer/custom_shuttle/ui_interact(mob/user)
|
||||
/obj/machinery/computer/custom_shuttle/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, "CustomShuttleConsole", name)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/computer/custom_shuttle/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
var/list/options = params2list(possible_destinations)
|
||||
var/obj/docking_port/mobile/M = SSshuttle.getShuttle(shuttleId)
|
||||
var/dat = "[M ? "Current Location : [M.getStatusText()]" : "Shuttle link required."]<br><br>"
|
||||
data["docked_location"] = M ? M.get_status_text_tgui() : null
|
||||
if(M)
|
||||
dat += "<A href='?src=[REF(src)];calculate=1'>Run Flight Calculations</A><br>"
|
||||
dat += "<b>Shuttle Data</b><hr>"
|
||||
dat += "Shuttle Mass: [calculated_mass/10]tons<br>"
|
||||
dat += "Engine Force: [calculated_dforce]kN ([calculated_engine_count] engines)<br>"
|
||||
dat += "Sublight Speed: [calculated_speed]ms<sup>-1</sup><br>"
|
||||
dat += calculated_speed < 1 ? "<b>INSUFFICIENT ENGINE POWER</b><br>" : ""
|
||||
dat += calculated_non_operational_thrusters > 0 ? "<b>Warning: [calculated_non_operational_thrusters] thrusters offline.</b><br>" : ""
|
||||
dat += "Fuel Consumption: [calculated_consumption]units per distance<br>"
|
||||
dat += "Engine Cooldown: [calculated_cooldown]s<hr>"
|
||||
var/destination_found
|
||||
calculateStats(FALSE, 0, TRUE)
|
||||
data["ship_name"] = M.area_type ? M.area_type:name : "ERROR"
|
||||
data["shuttle_mass"] = calculated_mass/10
|
||||
data["engine_force"] = calculated_dforce
|
||||
data["engines"] = calculated_engine_count
|
||||
data["calculated_speed"] = calculated_speed
|
||||
data["damaged_engines"] = calculated_non_operational_thrusters
|
||||
data["calculated_consumption"] = calculated_consumption
|
||||
data["calculated_cooldown"] = calculated_cooldown
|
||||
data["locations"] = list()
|
||||
for(var/obj/docking_port/stationary/S in SSshuttle.stationary)
|
||||
if(!options.Find(S.id))
|
||||
continue
|
||||
if(!M.check_dock(S, silent=TRUE))
|
||||
if(!M.check_dock(S, silent = TRUE))
|
||||
continue
|
||||
if(calculated_speed == 0)
|
||||
break
|
||||
destination_found = TRUE
|
||||
var/dist = round(calculateDistance(S))
|
||||
dat += "<A href='?src=[REF(src)];setloc=[S.id]'>Target [S.name] (Dist: [dist] | Fuel Cost: [round(dist * calculated_consumption)] | Time: [round(dist / calculated_speed)])</A><br>"
|
||||
if(!destination_found)
|
||||
dat += "<B>No valid destinations</B><br>"
|
||||
dat += "<hr>[targetLocation ? "Target Location : [targetLocation]" : "No Target Location"]"
|
||||
dat += "<hr><A href='?src=[REF(src)];fly=1'>Initate Flight</A><br>"
|
||||
dat += "<A href='?src=[REF(user)];mach_close=computer'>Close</a>"
|
||||
var/list/location_data = list(
|
||||
id = S.id,
|
||||
name = S.name,
|
||||
dist = round(calculateDistance(S))
|
||||
)
|
||||
data["locations"] += list(location_data)
|
||||
data["destination"] = targetLocation
|
||||
return data
|
||||
|
||||
popup = new(user, "computer", M ? M.name : "shuttle", 350, 450)
|
||||
popup.set_content("<center>[dat]</center>")
|
||||
popup.open()
|
||||
|
||||
/obj/machinery/computer/custom_shuttle/Topic(href, href_list)
|
||||
if(..())
|
||||
/obj/machinery/computer/custom_shuttle/ui_act(action, params)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
usr.set_machine(src)
|
||||
src.add_fingerprint(usr)
|
||||
if(!allowed(usr))
|
||||
to_chat(usr, "<span class='danger'>Access denied.</span>")
|
||||
return
|
||||
|
||||
if(href_list["calculate"])
|
||||
calculateStats()
|
||||
ui_interact(usr)
|
||||
return
|
||||
var/obj/docking_port/mobile/M = SSshuttle.getShuttle(shuttleId)
|
||||
if(!M)
|
||||
to_chat(usr, "<span class='danger'>Shuttle Link Required.</span>")
|
||||
return
|
||||
if(M.launch_status == ENDGAME_LAUNCHED)
|
||||
return
|
||||
if(href_list["setloc"])
|
||||
SetTargetLocation(href_list["setloc"])
|
||||
ui_interact(usr)
|
||||
return
|
||||
else if(href_list["fly"])
|
||||
Fly()
|
||||
ui_interact(usr)
|
||||
return
|
||||
|
||||
switch(action)
|
||||
if("setloc")
|
||||
SetTargetLocation(params["setloc"])
|
||||
if("fly")
|
||||
Fly()
|
||||
return
|
||||
|
||||
/obj/machinery/computer/custom_shuttle/proc/calculateDistance(var/obj/docking_port/stationary/port)
|
||||
var/deltaX = port.x - x
|
||||
|
||||
@@ -162,7 +162,7 @@
|
||||
for(var/i in 1 to areas_to_move.len)
|
||||
CHECK_TICK
|
||||
var/area/internal_area = areas_to_move[i]
|
||||
internal_area.afterShuttleMove(new_parallax_dir) //areas
|
||||
internal_area.afterShuttleMove(new_parallax_dir, parallax_speed) //areas
|
||||
|
||||
for(var/i in 1 to old_turfs.len)
|
||||
CHECK_TICK
|
||||
|
||||
@@ -461,11 +461,11 @@
|
||||
for(var/area/shuttle/escape/E in GLOB.sortedAreas)
|
||||
areas += E
|
||||
hyperspace_sound(HYPERSPACE_END, areas)
|
||||
if(time_left <= PARALLAX_LOOP_TIME)
|
||||
if(time_left <= parallax_speed)
|
||||
var/area_parallax = FALSE
|
||||
for(var/place in shuttle_areas)
|
||||
var/area/shuttle/shuttle_area = place
|
||||
if(shuttle_area.parallax_movedir)
|
||||
if(shuttle_area.parallax_moving)
|
||||
area_parallax = TRUE
|
||||
break
|
||||
if(area_parallax)
|
||||
|
||||
@@ -356,7 +356,7 @@
|
||||
playsound(console, 'sound/machines/terminal_prompt_confirm.ogg', 25, 0)
|
||||
remote_eye.setLoc(T)
|
||||
to_chat(target, "<span class='notice'>Jumped to [selected]</span>")
|
||||
C.overlay_fullscreen("flash", /atom/movable/screen/fullscreen/flash/static)
|
||||
C.overlay_fullscreen("flash", /atom/movable/screen/fullscreen/tiled/flash/static)
|
||||
C.clear_fullscreen("flash", 3)
|
||||
else
|
||||
playsound(console, 'sound/machines/terminal_prompt_deny.ogg', 25, 0)
|
||||
|
||||
@@ -117,8 +117,6 @@ All ShuttleMove procs go here
|
||||
if(rotation)
|
||||
shuttleRotate(rotation)
|
||||
|
||||
update_parallax_contents()
|
||||
|
||||
return TRUE
|
||||
|
||||
/atom/movable/proc/lateShuttleMove(turf/oldT, list/movement_force, move_dir)
|
||||
@@ -153,16 +151,21 @@ All ShuttleMove procs go here
|
||||
//The old turf has now been given back to the area that turf originaly belonged to
|
||||
|
||||
var/area/old_dest_area = newT.loc
|
||||
parallax_movedir = old_dest_area.parallax_movedir
|
||||
|
||||
parallax_moving = old_dest_area.parallax_moving
|
||||
parallax_move_angle = old_dest_area.parallax_move_angle
|
||||
parallax_move_speed = old_dest_area.parallax_move_speed
|
||||
old_dest_area.contents -= newT
|
||||
contents += newT
|
||||
newT.change_area(old_dest_area, src)
|
||||
return TRUE
|
||||
|
||||
// Called on areas after everything has been moved
|
||||
/area/proc/afterShuttleMove(new_parallax_dir)
|
||||
parallax_movedir = new_parallax_dir
|
||||
/area/proc/afterShuttleMove(new_parallax_dir, speed)
|
||||
if(!new_parallax_dir)
|
||||
parallax_moving = FALSE
|
||||
return
|
||||
parallax_move_angle = dir2angle(new_parallax_dir)
|
||||
parallax_move_speed = speed
|
||||
return TRUE
|
||||
|
||||
/area/proc/lateShuttleMove()
|
||||
@@ -309,6 +312,7 @@ All ShuttleMove procs go here
|
||||
if(buckled)
|
||||
shake_force *= 0.25
|
||||
shake_camera(src, shake_force, 1)
|
||||
client?.parallax_holder?.Reset(auto_z_change = FALSE, force = TRUE)
|
||||
|
||||
/mob/living/lateShuttleMove(turf/oldT, list/movement_force, move_dir)
|
||||
if(buckled)
|
||||
|
||||
@@ -367,6 +367,9 @@
|
||||
var/can_move_docking_ports = FALSE
|
||||
var/list/hidden_turfs = list()
|
||||
|
||||
/// parallax speed in seconds per loop
|
||||
var/parallax_speed = 25
|
||||
|
||||
/obj/docking_port/mobile/register(replace = FALSE)
|
||||
. = ..()
|
||||
if(!id)
|
||||
@@ -709,27 +712,24 @@
|
||||
create_ripples(destination, tl)
|
||||
|
||||
var/obj/docking_port/stationary/S0 = get_docked()
|
||||
if(istype(S0, /obj/docking_port/stationary/transit) && timeLeft(1) <= PARALLAX_LOOP_TIME)
|
||||
if(istype(S0, /obj/docking_port/stationary/transit) && timeLeft(1) <= parallax_speed)
|
||||
var/parallax_ongoing = FALSE
|
||||
for(var/place in shuttle_areas)
|
||||
var/area/shuttle/shuttle_area = place
|
||||
if(shuttle_area.parallax_movedir)
|
||||
parallax_slowdown()
|
||||
if(shuttle_area.parallax_moving)
|
||||
parallax_ongoing = TRUE
|
||||
if(parallax_ongoing)
|
||||
parallax_slowdown()
|
||||
|
||||
/obj/docking_port/mobile/proc/parallax_slowdown()
|
||||
for(var/place in shuttle_areas)
|
||||
var/area/shuttle/shuttle_area = place
|
||||
shuttle_area.parallax_movedir = FALSE
|
||||
if(assigned_transit?.assigned_area)
|
||||
assigned_transit.assigned_area.parallax_movedir = FALSE
|
||||
var/list/L0 = return_ordered_turfs(x, y, z, dir)
|
||||
for (var/thing in L0)
|
||||
var/turf/T = thing
|
||||
if(!T || !istype(T.loc, area_type))
|
||||
continue
|
||||
for (var/thing2 in T)
|
||||
var/atom/movable/AM = thing2
|
||||
if (length(AM.client_mobs_in_contents))
|
||||
AM.update_parallax_contents()
|
||||
for(var/mob/M in GLOB.player_list)
|
||||
var/area/A = get_area(M)
|
||||
if(A in shuttle_areas)
|
||||
M.client?.parallax_holder?.StopScrolling(A.parallax_move_angle, parallax_speed)
|
||||
for(var/area/shuttle_area in shuttle_areas + assigned_transit?.assigned_area)
|
||||
shuttle_area.parallax_moving = FALSE
|
||||
shuttle_area.parallax_move_speed = 0
|
||||
shuttle_area.parallax_move_angle = 0
|
||||
|
||||
/obj/docking_port/mobile/proc/check_transit_zone()
|
||||
if(assigned_transit)
|
||||
|
||||
Reference in New Issue
Block a user