diff --git a/code/modules/overmap/overmap_object.dm b/code/modules/overmap/overmap_object.dm index fd2798e7d6..25d088fb56 100644 --- a/code/modules/overmap/overmap_object.dm +++ b/code/modules/overmap/overmap_object.dm @@ -5,13 +5,49 @@ var/known = 1 //shows up on nav computers automatically var/scannable //if set to TRUE will show up on ship sensors for detailed scans + var/scanner_name //name for scans, replaces name once scanned + var/scanner_desc //description for scans + + var/skybox_icon //Icon file to use for skybox + var/skybox_icon_state //Icon state to use for skybox + var/skybox_pixel_x //Shift from lower left corner of skybox + var/skybox_pixel_y //Shift from lower left corner of skybox + var/image/cached_skybox_image //Cachey //Overlay of how this object should look on other skyboxes /obj/effect/overmap/proc/get_skybox_representation() - return + if(!cached_skybox_image) + build_skybox_representation() + return cached_skybox_image + +/obj/effect/overmap/proc/build_skybox_representation() + if(!skybox_icon) + return + var/image/I = image(icon = skybox_icon, icon_state = skybox_icon_state) + if(isnull(skybox_pixel_x)) + skybox_pixel_x = rand(200,600) + if(isnull(skybox_pixel_y)) + skybox_pixel_y = rand(200,600) + I.pixel_x = skybox_pixel_x + I.pixel_y = skybox_pixel_y + cached_skybox_image = I + +/obj/effect/overmap/proc/expire_skybox_representation() + cached_skybox_image = null + +/obj/effect/overmap/proc/update_skybox_representation() + expire_skybox_representation() + build_skybox_representation() + for(var/obj/effect/overmap/visitable/O in loc) + SSskybox.rebuild_skyboxes(O.map_z) /obj/effect/overmap/proc/get_scan_data(mob/user) - return desc + if(scanner_name && (name != scanner_name)) //A silly check, but 'name' is part of appearance, so more expensive than you might think + name = scanner_name + + var/dat = {"\[b\]Scan conducted at\[/b\]: [stationtime2text()] [stationdate2text()]\n\[b\]Grid coordinates\[/b\]: [x],[y]\n\n[scanner_desc]"} + + return dat /obj/effect/overmap/Initialize() . = ..() diff --git a/code/modules/overmap/overmap_planet.dm b/code/modules/overmap/overmap_planet.dm index 28a8bf10d1..dcb8fc1af3 100644 --- a/code/modules/overmap/overmap_planet.dm +++ b/code/modules/overmap/overmap_planet.dm @@ -22,29 +22,29 @@ /obj/effect/overmap/visitable/planet/get_skybox_representation() var/image/skybox_image = image('icons/skybox/planet.dmi', "") - skybox_image.overlays += get_base_image() + skybox_image.add_overlay(get_base_image()) // for(var/datum/exoplanet_theme/theme in themes) -// skybox_image.overlays += theme.get_planet_image_extra() +// skybox_image.add_overlay(theme.get_planet_image_extra()) if(mountain_color) var/image/mountains = image('icons/skybox/planet.dmi', "mountains") mountains.color = mountain_color mountains.appearance_flags = PIXEL_SCALE - skybox_image.overlays += mountains + skybox_image.add_overlay(mountains) if(water_color) var/image/water = image('icons/skybox/planet.dmi', "water") water.color = water_color water.appearance_flags = PIXEL_SCALE // water.transform = water.transform.Turn(rand(0,360)) - skybox_image.overlays += water + skybox_image.add_overlay(water) if(icecaps) var/image/ice = image('icons/skybox/planet.dmi', icecaps) ice.color = ice_color ice.appearance_flags = PIXEL_SCALE - skybox_image.overlays += ice + skybox_image.add_overlay(ice) if(atmosphere && atmosphere.return_pressure() > SOUND_MINIMUM_PRESSURE) @@ -55,20 +55,20 @@ var/image/clouds = image('icons/skybox/planet.dmi', "weak_clouds") if(water_color) - clouds.overlays += image('icons/skybox/planet.dmi', "clouds") + clouds.add_overlay(image('icons/skybox/planet.dmi', "clouds")) clouds.color = atmo_color - skybox_image.overlays += clouds + skybox_image.add_overlay(clouds) var/image/atmo = image('icons/skybox/planet.dmi', "atmoring") skybox_image.underlays += atmo var/image/shadow = image('icons/skybox/planet.dmi', "shadow") shadow.blend_mode = BLEND_MULTIPLY - skybox_image.overlays += shadow + skybox_image.add_overlay(shadow) var/image/light = image('icons/skybox/planet.dmi', "lightrim") - skybox_image.overlays += light + skybox_image.add_overlay(light) if(has_rings) var/image/rings = image('icons/skybox/planet_rings.dmi') @@ -79,7 +79,7 @@ rings.color = ring_color rings.pixel_x = -128 rings.pixel_y = -128 - skybox_image.overlays += rings + skybox_image.add_overlay(rings) skybox_image.pixel_x = rand(0,64) + skybox_offset_x skybox_image.pixel_y = rand(128,256) + skybox_offset_y diff --git a/code/modules/overmap/overmap_shuttle.dm b/code/modules/overmap/overmap_shuttle.dm index ad07f274bc..4a571c1a06 100644 --- a/code/modules/overmap/overmap_shuttle.dm +++ b/code/modules/overmap/overmap_shuttle.dm @@ -42,7 +42,7 @@ if(moving_status == SHUTTLE_INTRANSIT) return FALSE //already going somewhere, current_location may be an intransit location instead of in a sector var/our_sector = waypoint_sector(current_location) - if(!our_sector && myship?.landmark && next_location == myship.landmark) + if(myship?.landmark && next_location == myship.landmark) return TRUE //We're not on the overmap yet (admin spawned probably), and we're trying to hook up with our openspace sector return get_dist(our_sector, waypoint_sector(next_location)) <= range diff --git a/code/modules/overmap/sectors.dm b/code/modules/overmap/sectors.dm index 316dfdf378..8037ddf285 100644 --- a/code/modules/overmap/sectors.dm +++ b/code/modules/overmap/sectors.dm @@ -4,8 +4,9 @@ /obj/effect/overmap/visitable name = "map object" scannable = TRUE + scanner_desc = "!! No Data Available !!" - var/list/map_z = null + var/list/map_z = list() var/list/extra_z_levels //if you need to manually insist that these z-levels are part of this sector, for things like edge-of-map step trigger transitions rather than multi-z complexes var/list/initial_generic_waypoints //store landmark_tag of landmarks that should be added to the actual lists below on init. @@ -30,8 +31,7 @@ if(. == INITIALIZE_HINT_QDEL) return - if(!map_z) // If map_z is already defined, we don't need to find where we are - find_z_levels() // This populates map_z and assigns z levels to the ship. + find_z_levels() // This populates map_z and assigns z levels to the ship. register_z_levels() // This makes external calls to update global z level information. if(!global.using_map.overmap_z) @@ -57,8 +57,6 @@ //This is called later in the init order by SSshuttles to populate sector objects. Importantly for subtypes, shuttles will be created by then. /obj/effect/overmap/visitable/proc/populate_sector_objects() - for(var/obj/machinery/computer/ship/S in global.machines) - S.attempt_hook_up(src) /obj/effect/overmap/visitable/proc/get_areas() . = list() @@ -104,7 +102,7 @@ //Helper for init. /obj/effect/overmap/visitable/proc/check_ownership(obj/object) - if((object.z in map_z) && !(get_area(object) in SSshuttles.shuttle_areas)) + if((get_z(object) in map_z) && !(get_area(object) in SSshuttles.shuttle_areas)) return 1 //If shuttle_name is false, will add to generic waypoints; otherwise will add to restricted. Does not do checks. diff --git a/code/modules/overmap/ships/computers/helm.dm b/code/modules/overmap/ships/computers/helm.dm index 0682915198..cd23a5305e 100644 --- a/code/modules/overmap/ships/computers/helm.dm +++ b/code/modules/overmap/ships/computers/helm.dm @@ -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 @@ -35,7 +36,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 @@ -44,7 +45,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()) @@ -59,13 +60,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 diff --git a/code/modules/overmap/ships/computers/sensors.dm b/code/modules/overmap/ships/computers/sensors.dm index f750481ddc..9c68cb26fa 100644 --- a/code/modules/overmap/ships/computers/sensors.dm +++ b/code/modules/overmap/ships/computers/sensors.dm @@ -6,7 +6,6 @@ circuit = /obj/item/weapon/circuitboard/sensors extra_view = 4 var/obj/machinery/shipsensors/sensors - whitelisted_types = list(/obj/effect/overmap/visitable) // Stationary emplacements can support sensors /obj/machinery/computer/ship/sensors/attempt_hook_up(obj/effect/overmap/visitable/ship/sector) if(!(. = ..())) diff --git a/code/modules/overmap/ships/computers/ship.dm b/code/modules/overmap/ships/computers/ship.dm index 9ce2029978..1ce24f41b6 100644 --- a/code/modules/overmap/ships/computers/ship.dm +++ b/code/modules/overmap/ships/computers/ship.dm @@ -7,28 +7,17 @@ somewhere on that shuttle. Subtypes of these can be then used to perform ship ov var/obj/effect/overmap/visitable/ship/linked var/list/viewers // Weakrefs to mobs in direct-view mode. var/extra_view = 0 // how much the view is increased by when the mob is in overmap mode. - var/list/whitelisted_types = list(/obj/effect/overmap/visitable/ship) - var/list/blacklisted_types = list() - -/obj/machinery/computer/ship/New() - . = ..() - var/list/L = list() - for(var/type in whitelisted_types) - L |= typesof(type) - for(var/type in blacklisted_types) - L -= typesof(type) - whitelisted_types = L // A late init operation called in SSshuttles, used to attach the thing to the right ship. -/obj/machinery/computer/ship/proc/attempt_hook_up(obj/effect/overmap/visitable/sector) - if(!sector || !(sector.type in whitelisted_types)) - return FALSE +/obj/machinery/computer/ship/proc/attempt_hook_up(obj/effect/overmap/visitable/ship/sector) + if(!istype(sector)) + return if(sector.check_ownership(src)) linked = sector - return TRUE + return 1 /obj/machinery/computer/ship/proc/sync_linked(var/user = null) - var/obj/effect/overmap/visitable/sector = get_overmap_sector(z) + var/obj/effect/overmap/visitable/ship/sector = get_overmap_sector(z) if(!sector) return . = attempt_hook_up_recursive(sector) @@ -36,10 +25,10 @@ somewhere on that shuttle. Subtypes of these can be then used to perform ship ov to_chat(user, "[src] reconnected to [linked]") user << browse(null, "window=[src]") // close reconnect dialog -/obj/machinery/computer/ship/proc/attempt_hook_up_recursive(obj/effect/overmap/visitable/sector) +/obj/machinery/computer/ship/proc/attempt_hook_up_recursive(obj/effect/overmap/visitable/ship/sector) if(attempt_hook_up(sector)) return sector - for(var/obj/effect/overmap/visitable/candidate in sector) + for(var/obj/effect/overmap/visitable/ship/candidate in sector) if((. = .(candidate))) return @@ -48,6 +37,14 @@ somewhere on that shuttle. Subtypes of these can be then used to perform ship ov popup.set_content("