diff --git a/code/controllers/subsystems/vis_overlays.dm b/code/controllers/subsystems/vis_overlays.dm index 0806e4c954d..8abc02f928a 100644 --- a/code/controllers/subsystems/vis_overlays.dm +++ b/code/controllers/subsystems/vis_overlays.dm @@ -29,18 +29,18 @@ SUBSYSTEM_DEF(vis_overlays) return //the "thing" var can be anything with vis_contents which includes images - in the future someone should totally allow vis overlays to be passed in as an arg instead of all this bullshit -/datum/controller/subsystem/vis_overlays/proc/add_vis_overlay(atom/movable/thing, icon, iconstate, layer, plane, dir, alpha = 255, add_appearance_flags = NONE, unique = FALSE) +/datum/controller/subsystem/vis_overlays/proc/add_vis_overlay(atom/movable/thing, icon, iconstate, layer, plane, dir, alpha = 255, add_appearance_flags = NONE, add_vis_flags = NONE, unique = FALSE) var/obj/effect/overlay/vis/overlay if(!unique) . = "[icon]|[iconstate]|[layer]|[plane]|[dir]|[alpha]|[add_appearance_flags]" overlay = vis_overlay_cache[.] if(!overlay) - overlay = _create_new_vis_overlay(icon, iconstate, layer, plane, dir, alpha, add_appearance_flags) + overlay = _create_new_vis_overlay(icon, iconstate, layer, plane, dir, alpha, add_appearance_flags, add_vis_flags) vis_overlay_cache[.] = overlay else overlay.unused = 0 else - overlay = _create_new_vis_overlay(icon, iconstate, layer, plane, dir, alpha, add_appearance_flags) + overlay = _create_new_vis_overlay(icon, iconstate, layer, plane, dir, alpha, add_appearance_flags, add_vis_flags) overlay.cache_expiration = -1 var/cache_id = "\ref[overlay]@{[world.time]}" vis_overlay_cache[cache_id] = overlay @@ -56,7 +56,7 @@ SUBSYSTEM_DEF(vis_overlays) thing.managed_vis_overlays += overlay return overlay -/datum/controller/subsystem/vis_overlays/proc/_create_new_vis_overlay(icon, iconstate, layer, plane, dir, alpha, add_appearance_flags) +/datum/controller/subsystem/vis_overlays/proc/_create_new_vis_overlay(icon, iconstate, layer, plane, dir, alpha, add_appearance_flags, add_vis_flags) var/obj/effect/overlay/vis/overlay = new overlay.icon = icon overlay.icon_state = iconstate @@ -65,6 +65,7 @@ SUBSYSTEM_DEF(vis_overlays) overlay.dir = dir overlay.alpha = alpha overlay.appearance_flags |= add_appearance_flags + overlay.vis_flags |= add_vis_flags return overlay @@ -75,3 +76,14 @@ SUBSYSTEM_DEF(vis_overlays) thing.managed_vis_overlays -= overlays if(!length(thing.managed_vis_overlays)) thing.managed_vis_overlays = null + +/atom/proc/add_vis_overlay(icon, iconstate, layer, plane, dir, alpha, add_appearance_flags, add_vis_flags, unique) + // The extremely minimal version where you just pass a string and nothing else + if(istext(icon)) + iconstate = icon + icon = src.icon + + return SSvis_overlays.add_vis_overlay(src, icon, iconstate, layer, plane, dir, alpha, add_appearance_flags, add_vis_flags, unique) + +/atom/proc/remove_vis_overlay(list/overlays) + return SSvis_overlays.remove_vis_overlay(src, overlays) diff --git a/code/modules/overmap/overmap_object.dm b/code/modules/overmap/overmap_object.dm index ccf3df8be7f..f79741bd3ad 100644 --- a/code/modules/overmap/overmap_object.dm +++ b/code/modules/overmap/overmap_object.dm @@ -3,20 +3,39 @@ icon = 'icons/obj/overmap.dmi' icon_state = "object" - 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 + /// If set to TRUE will show up on ship sensors for detailed scans + var/scannable + /// Description for scans + var/scanner_desc + + /// Icon file to use for skybox + var/skybox_icon + /// Icon state to use for skybox + var/skybox_icon_state + /// Shift from lower left corner of skybox + var/skybox_pixel_x + /// Shift from lower left corner of skybox + var/skybox_pixel_y + /// Cachey + var/image/cached_skybox_image + + /// For showing to the pilot of the ship, so they see the 'real' appearance, despite others seeing the unknown ones + var/image/real_appearance light_system = MOVABLE_LIGHT light_on = FALSE +/obj/effect/overmap/Initialize() + . = ..() + if(!global.using_map.use_overmap) + return INITIALIZE_HINT_QDEL + +/obj/effect/overmap/Destroy() + real_appearance?.loc = null + real_appearance = null + return ..() + //Overlay of how this object should look on other skyboxes /obj/effect/overmap/proc/get_skybox_representation() if(!cached_skybox_image) @@ -45,23 +64,10 @@ SSskybox.rebuild_skyboxes(O.map_z) /obj/effect/overmap/proc/get_scan_data(mob/user) - 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() - . = ..() - if(!global.using_map.use_overmap) - return INITIALIZE_HINT_QDEL - - if(known) - plane = PLANE_LIGHTING_ABOVE - for(var/obj/machinery/computer/ship/helm/H in global.machines) - H.get_known_sectors() - /obj/effect/overmap/Crossed(var/obj/effect/overmap/visitable/other) if(istype(other)) for(var/obj/effect/overmap/visitable/O in loc) diff --git a/code/modules/overmap/overmap_planet.dm b/code/modules/overmap/overmap_planet.dm index dcb8fc1af39..73dd092638e 100644 --- a/code/modules/overmap/overmap_planet.dm +++ b/code/modules/overmap/overmap_planet.dm @@ -1,8 +1,11 @@ /obj/effect/overmap/visitable/planet name = "planet" - icon_state = "globe" + icon_state = "lush" in_space = 0 + unknown_name = "unknown planet" + unknown_state = "planet" + var/datum/gas_mixture/atmosphere var/atmosphere_color = "FFFFFF" diff --git a/code/modules/overmap/sectors.dm b/code/modules/overmap/sectors.dm index b91b5470e7e..cce1f94cce0 100644 --- a/code/modules/overmap/sectors.dm +++ b/code/modules/overmap/sectors.dm @@ -6,6 +6,15 @@ scannable = TRUE scanner_desc = "!! No Data Available !!" + icon_state = "generic" + + /// Shows up on nav computers automatically + var/known = TRUE + /// Name prior to being scanned if !known + var/unknown_name = "unknown sector" + /// Icon_state prior to being scanned if !known + var/unknown_state = "field" + 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 @@ -50,6 +59,19 @@ LAZYADD(SSshuttles.sectors_to_initialize, src) //Queued for further init. Will populate the waypoint lists; waypoints not spawned yet will be added in as they spawn. SSshuttles.process_init_queues() + if(known) + plane = PLANE_LIGHTING_ABOVE + for(var/obj/machinery/computer/ship/helm/H in global.machines) + H.get_known_sectors() + else + real_appearance = image(icon, src, icon_state) + real_appearance.override = TRUE + name = unknown_name + icon_state = unknown_state + color = null + desc = "Scan this to find out more information." + + // You generally shouldn't destroy these. /obj/effect/overmap/visitable/Destroy() testing("Deleting [src] overmap sector at [x],[y]") @@ -98,6 +120,15 @@ global.using_map.map_levels -= map_z */ +/obj/effect/overmap/visitable/get_scan_data() + if(!known) + known = TRUE + name = initial(name) + icon_state = initial(icon_state) + color = initial(color) + desc = initial(desc) + return ..() + /obj/effect/overmap/visitable/proc/get_space_zlevels() if(in_space) return map_z @@ -170,9 +201,9 @@ return FALSE has_distress_beacon = TRUE - admin_chat_message(message = "Overmap panic button hit on z[z] ([scanner_name || name]) by '[user?.ckey || "Unknown"]'", color = "#FF2222") //VOREStation Add + admin_chat_message(message = "Overmap panic button hit on z[z] ([name]) by '[user?.ckey || "Unknown"]'", color = "#FF2222") //VOREStation Add var/message = "This is an automated distress signal from a MIL-DTL-93352-compliant beacon transmitting on [PUB_FREQ*0.1]kHz. \ - This beacon was launched from '[scanner_name || name]'. I can provide this additional information to rescuers: [get_distress_info()]. \ + This beacon was launched from '[name]'. I can provide this additional information to rescuers: [get_distress_info()]. \ Per the Interplanetary Convention on Space SAR, those receiving this message must attempt rescue, \ or relay the message to those who can. This message will repeat one time in 5 minutes. Thank you for your urgent assistance." @@ -193,7 +224,7 @@ return "\[X:[x], Y:[y]\]" /obj/effect/overmap/visitable/proc/distress_update() - var/message = "This is the final message from the distress beacon launched from '[scanner_name || name]'. I can provide this additional information to rescuers: [get_distress_info()]. \ + var/message = "This is the final message from the distress beacon launched from '[name]'. I can provide this additional information to rescuers: [get_distress_info()]. \ Please render assistance under your obligations per the Interplanetary Convention on Space SAR, or relay this message to a party who can. Thank you for your urgent assistance." for(var/zlevel in levels_for_distress) diff --git a/code/modules/overmap/ships/computers/ship.dm b/code/modules/overmap/ships/computers/ship.dm index 5c886fb55af..46d56e29f78 100644 --- a/code/modules/overmap/ships/computers/ship.dm +++ b/code/modules/overmap/ships/computers/ship.dm @@ -69,6 +69,8 @@ somewhere on that shuttle. Subtypes of these can be then used to perform ship ov if(linked) apply_visual(user) user.reset_view(linked) + if(linked.real_appearance) + user.client?.images += linked.real_appearance user.set_machine(src) if(isliving(user)) var/mob/living/L = user @@ -81,6 +83,8 @@ somewhere on that shuttle. Subtypes of these can be then used to perform ship ov /obj/machinery/computer/ship/proc/unlook(var/mob/user) user.reset_view() + if(linked?.real_appearance) + user.client?.images -= linked.real_appearance if(isliving(user)) var/mob/living/L = user L.looking_elsewhere = 0 diff --git a/code/modules/overmap/ships/ship.dm b/code/modules/overmap/ships/ship.dm index 99ecdcf154b..e048805738a 100644 --- a/code/modules/overmap/ships/ship.dm +++ b/code/modules/overmap/ships/ship.dm @@ -14,10 +14,13 @@ desc = "This marker represents a spaceship. Scan it for more information." scanner_desc = "Unknown spacefaring vessel." dir = NORTH - icon_state = "ship" + icon_state = "ship_nosprite" appearance_flags = TILE_BOUND|KEEP_TOGETHER|LONG_GLIDE //VOREStation Edit light_power = 4 - var/moving_state = "ship_moving" + + unknown_name = "unknown ship" + unknown_state = "ship" + known = FALSE // Ships start 'unknown' on the map and require scanning var/vessel_mass = 10000 //tonnes, arbitrary number, affects acceleration provided by engines var/vessel_size = SHIP_SIZE_LARGE //arbitrary number, affects how likely are we to evade meteors @@ -38,6 +41,9 @@ var/skill_needed = SKILL_ADEPT //piloting skill needed to steer it without going in random dir var/operator_skill + /// Vis contents overlay holding the ship's vector when in motion + var/obj/effect/overlay/vis/vector + /obj/effect/overmap/visitable/ship/Initialize() . = ..() min_speed = round(min_speed, SHIP_MOVE_RESOLUTION) @@ -45,11 +51,14 @@ SSshuttles.ships += src position_x = ((loc.x - 1) * WORLD_ICON_SIZE) + (WORLD_ICON_SIZE/2) + pixel_x + 1 position_y = ((loc.y - 1) * WORLD_ICON_SIZE) + (WORLD_ICON_SIZE/2) + pixel_y + 1 + vector = add_vis_overlay("vector", dir = SOUTH, layer = 10, unique = TRUE) + vector.vis_flags = (VIS_INHERIT_PLANE|VIS_INHERIT_ID) /obj/effect/overmap/visitable/ship/Destroy() STOP_PROCESSING(SSprocessing, src) + remove_vis_overlay(vector) SSshuttles.ships -= src - . = ..() + return ..() /obj/effect/overmap/visitable/ship/relaymove(mob/user, direction, accel_limit) accelerate(direction, accel_limit) @@ -200,11 +209,13 @@ /obj/effect/overmap/visitable/ship/update_icon() if(!is_still()) - icon_state = moving_state - transform = matrix().Turn(get_heading_degrees()) + var/heading = get_heading_degrees() + dir = angle2dir(round(heading, 90)) + vector.dir = NORTH + vector.transform = matrix().Turn(heading) else - icon_state = initial(icon_state) - transform = null + dir = NORTH + vector.dir = SOUTH ..() /obj/effect/overmap/visitable/ship/set_dir(new_dir) diff --git a/icons/obj/overmap.dmi b/icons/obj/overmap.dmi index d46f1065f2b..348ad77da46 100644 Binary files a/icons/obj/overmap.dmi and b/icons/obj/overmap.dmi differ