Bluespace Navigation Gigabeacon (#44807)

About The Pull Request

This PR add "Bluespace Navigation Gigabeacon" that shuttles can use as a target for the jump computer.

You can customize locked status by multitool or name of beacons by multitool with unscrewed beacon.
If you, or emp, lock beacon you are still able see it in choice list like a "Locked" destination, but unable to jump to it.
Why It's Good For The Game

Now any spacemen can construct their own Space station on any Z lvl (that not reserved, centcom, away mission) and dock (by custom dock) his ship to it.

Now we actially have some shuttles that have ability to place custom dock.
That one is whiteship, but only if its not UFO, 4 ships in caravan ambush(for 2 need sindycate access), +1 for nuclear ops(sindycate access), but dont forgot that Admins can spawn "navigation computer" to any shuttle.).

Lavaland safari likers now can land anywhere where they can fit a ship, on lava, basalt, and plating turfs, also asteroid.

I drop some bombs to clear spot and land to lavaland.
http://recordit.co/qN10qfuift

Here i create dry dock near station and dock ship into it.
http://recordit.co/R4kXqN8rnt

all walls and other floors are forbidden to prevent you landing on the station

possibly more random gibberish?)
maybe change plating to reinforced (engine) floor.

Navigation computer now use trait blacklist to filter out z levels to where it can't place custom dock.
This make easy to add new z lvls where it can place dock.
This commit is contained in:
Dennok
2019-07-17 13:58:57 -04:00
committed by Emmett Gaines
parent bd951f8fa8
commit 1b165b26d1
7 changed files with 105 additions and 6 deletions
+22 -6
View File
@@ -10,10 +10,11 @@
var/list/jumpto_ports = list() //hashset of ports to jump to and ignore for collision purposes
var/obj/docking_port/stationary/my_port //the custom docking port placed by this console
var/obj/docking_port/mobile/shuttle_port //the mobile docking port of the connected shuttle
var/list/locked_traits = list(ZTRAIT_RESERVED, ZTRAIT_CENTCOM, ZTRAIT_AWAY, ZTRAIT_REEBE) //traits forbided for custom docking
var/view_range = 7
var/x_offset = 0
var/y_offset = 0
var/space_turfs_only = TRUE
var/list/whitelist_turfs = list(/turf/open/space, /turf/open/floor/plating, /turf/open/lava)
var/see_hidden = FALSE
var/designate_time = 0
var/turf/designating_target_loc
@@ -28,6 +29,7 @@
var/obj/docking_port/stationary/S = V
if(jumpto_ports[S.id])
z_lock |= S.z
whitelist_turfs = typecacheof(whitelist_turfs)
/obj/machinery/computer/camera_advanced/shuttle_docker/Destroy()
. = ..()
@@ -144,6 +146,7 @@
my_port.hidden = shuttle_port.hidden
my_port.setDir(the_eye.dir)
my_port.forceMove(locate(eyeobj.x - x_offset, eyeobj.y - y_offset, eyeobj.z))
if(current_user.client)
current_user.client.images -= the_eye.placed_images
@@ -161,7 +164,7 @@
if(current_user.client)
current_user.client.images += the_eye.placed_images
to_chat(current_user, "<span class='notice'>Transit location designated</span>")
return
return TRUE
/obj/machinery/computer/camera_advanced/shuttle_docker/proc/canDesignateTarget()
if(!designating_target_loc || !current_user || (eyeobj.loc != designating_target_loc) || (stat & (NOPOWER|BROKEN)) )
@@ -189,7 +192,7 @@
var/turf/eyeturf = get_turf(the_eye)
if(!eyeturf)
return SHUTTLE_DOCKER_BLOCKED
if(z_lock.len && !(eyeturf.z in z_lock))
if(!eyeturf.z || SSmapping.level_has_any_trait(eyeturf.z, locked_traits))
return SHUTTLE_DOCKER_BLOCKED
. = SHUTTLE_DOCKER_LANDING_CLEAR
@@ -227,9 +230,9 @@
if(hidden_turf_info)
. = SHUTTLE_DOCKER_BLOCKED_BY_HIDDEN_PORT
if(space_turfs_only)
if(length(whitelist_turfs))
var/turf_type = hidden_turf_info ? hidden_turf_info[2] : T.type
if(!ispath(turf_type, /turf/open/space))
if(!is_type_in_typecache(turf_type, whitelist_turfs))
return SHUTTLE_DOCKER_BLOCKED
// Checking for overlapping dock boundaries
@@ -322,12 +325,25 @@
var/list/L = list()
for(var/V in SSshuttle.stationary)
if(!V)
stack_trace("SSshuttle.stationary have null entry!")
continue
var/obj/docking_port/stationary/S = V
if(console.z_lock.len && !(S.z in console.z_lock))
continue
if(console.jumpto_ports[S.id])
L[S.name] = S
L["([L.len])[S.name]"] = S
for(var/V in SSshuttle.beacons)
if(!V)
stack_trace("SSshuttle.beacons have null entry!")
continue
var/obj/machinery/spaceship_navigation_beacon/nav_beacon = V
if(!nav_beacon.z || SSmapping.level_has_any_trait(nav_beacon.z, console.locked_traits))
break
if(!nav_beacon.locked)
L["([L.len]) [nav_beacon.name] located: [nav_beacon.x] [nav_beacon.y] [nav_beacon.z]"] = nav_beacon
else
L["([L.len]) [nav_beacon.name] locked"] = null
playsound(console, 'sound/machines/terminal_prompt.ogg', 25, 0)
var/selected = input("Choose location to jump to", "Locations", null) as null|anything in L
@@ -0,0 +1,63 @@
/obj/item/circuitboard/machine/spaceship_navigation_beacon
name = "Bluespace Navigation Gigabeacon (Machine Board)"
build_path = /obj/machinery/spaceship_navigation_beacon
req_components = list()
/obj/machinery/spaceship_navigation_beacon
name = "Bluespace Navigation Gigabeacon"
desc = "A device that creates a bluespace anchor that allow ships jump near to it."
icon = 'icons/obj/abductor.dmi'
icon_state = "core"
use_power = IDLE_POWER_USE
idle_power_usage = 0
density = TRUE
circuit = /obj/item/circuitboard/machine/spaceship_navigation_beacon
var/locked = FALSE //Locked beacons don't allow to jump to it.
/obj/machinery/spaceship_navigation_beacon/Initialize()
. = ..()
SSshuttle.beacons |= src
obj/machinery/spaceship_navigation_beacon/emp_act()
locked = TRUE
/obj/machinery/spaceship_navigation_beacon/Destroy()
SSshuttle.beacons -= src
return ..()
// update the icon_state
/obj/machinery/spaceship_navigation_beacon/update_icon()
if(powered())
icon_state = "core"
else
icon_state = "core-open"
/obj/machinery/spaceship_navigation_beacon/power_change()
. = ..()
update_icon()
/obj/machinery/spaceship_navigation_beacon/multitool_act(mob/living/user, obj/item/multitool/I)
if(panel_open)
var/new_name = "Beacon_[input("Enter the custom name for this beacon", "It be Beacon ..your input..") as text]"
if(new_name && Adjacent(user))
name = new_name
to_chat(user, "<span class='notice'>You change beacon name to [name].</span>")
else
locked =!locked
to_chat(user, "<span class='notice'>You [locked ? "" : "un"]lock [src].</span>")
return TRUE
/obj/machinery/spaceship_navigation_beacon/examine()
.=..()
. += "<span class='[locked ? "warning" : "nicegreen"]'>Status: [locked ? "LOCKED" : "Stable"] </span>"
/obj/machinery/spaceship_navigation_beacon/attackby(obj/item/W, mob/user, params)
if(default_deconstruction_screwdriver(user, "core-open", "core", W))
return
if(default_deconstruction_crowbar(W))
return
return ..()