Skip to content

Commit

Permalink
overmaps: entity update (#5634)
Browse files Browse the repository at this point in the history
- repaths things to /entity and /tiled
- basic ticked physics movement system
- basic cross/uncross/etc system for tiled

---------

Co-authored-by: silicons <no@you.cat>
  • Loading branch information
silicons and silicons authored Jun 20, 2023
1 parent 2333345 commit b41f1ab
Show file tree
Hide file tree
Showing 186 changed files with 755 additions and 755 deletions.
58 changes: 31 additions & 27 deletions citadel.dme
Original file line number Diff line number Diff line change
Expand Up @@ -3727,38 +3727,42 @@
#include "code\modules\organs\subtypes\nano.dm"
#include "code\modules\organs\subtypes\unbreakable.dm"
#include "code\modules\organs\subtypes\unseverable.dm"
#include "code\modules\overmap\abductor_vr.dm"
#include "code\modules\overmap\bluespace_rift.dm"
#include "code\modules\overmap\champagne.dm"
#include "code\modules\overmap\overmap_object.dm"
#include "code\modules\overmap\overmap_planet.dm"
#include "code\modules\overmap\overmap_shuttle.dm"
#include "code\modules\overmap\public.dm"
#include "code\modules\overmap\sectors.dm"
#include "code\modules\overmap\spacetravel.dm"
#include "code\modules\overmap\turfs.dm"
#include "code\modules\overmap\disperser\disperser.dm"
#include "code\modules\overmap\disperser\disperser_charge.dm"
#include "code\modules\overmap\disperser\disperser_circuit.dm"
#include "code\modules\overmap\disperser\disperser_console.dm"
#include "code\modules\overmap\disperser\disperser_fire.dm"
#include "code\modules\overmap\entity\entity.dm"
#include "code\modules\overmap\entity\physics.dm"
#include "code\modules\overmap\events\event_handler.dm"
#include "code\modules\overmap\events\generation.dm"
#include "code\modules\overmap\events\overmap_event.dm"
#include "code\modules\overmap\ships\landable.dm"
#include "code\modules\overmap\ships\panicbutton.dm"
#include "code\modules\overmap\ships\ship.dm"
#include "code\modules\overmap\ships\computers\computer_shims.dm"
#include "code\modules\overmap\ships\computers\engine_control.dm"
#include "code\modules\overmap\ships\computers\helm.dm"
#include "code\modules\overmap\ships\computers\sensors.dm"
#include "code\modules\overmap\ships\computers\ship.dm"
#include "code\modules\overmap\ships\computers\shuttle.dm"
#include "code\modules\overmap\ships\engines\engine.dm"
#include "code\modules\overmap\ships\engines\gas_thruster.dm"
#include "code\modules\overmap\ships\engines\gas_thruster_vr.dm"
#include "code\modules\overmap\ships\engines\ion_thruster.dm"
#include "code\modules\overmap\legacy\abductor_vr.dm"
#include "code\modules\overmap\legacy\bluespace_rift.dm"
#include "code\modules\overmap\legacy\champagne.dm"
#include "code\modules\overmap\legacy\legacy.dm"
#include "code\modules\overmap\legacy\overmap_planet.dm"
#include "code\modules\overmap\legacy\overmap_shuttle.dm"
#include "code\modules\overmap\legacy\sectors.dm"
#include "code\modules\overmap\legacy\spacetravel.dm"
#include "code\modules\overmap\legacy\disperser\disperser.dm"
#include "code\modules\overmap\legacy\disperser\disperser_charge.dm"
#include "code\modules\overmap\legacy\disperser\disperser_circuit.dm"
#include "code\modules\overmap\legacy\disperser\disperser_console.dm"
#include "code\modules\overmap\legacy\disperser\disperser_fire.dm"
#include "code\modules\overmap\legacy\ships\landable.dm"
#include "code\modules\overmap\legacy\ships\panicbutton.dm"
#include "code\modules\overmap\legacy\ships\ship.dm"
#include "code\modules\overmap\legacy\ships\computers\computer_shims.dm"
#include "code\modules\overmap\legacy\ships\computers\engine_control.dm"
#include "code\modules\overmap\legacy\ships\computers\helm.dm"
#include "code\modules\overmap\legacy\ships\computers\sensors.dm"
#include "code\modules\overmap\legacy\ships\computers\ship.dm"
#include "code\modules\overmap\legacy\ships\computers\shuttle.dm"
#include "code\modules\overmap\legacy\ships\engines\engine.dm"
#include "code\modules\overmap\legacy\ships\engines\gas_thruster.dm"
#include "code\modules\overmap\legacy\ships\engines\gas_thruster_vr.dm"
#include "code\modules\overmap\legacy\ships\engines\ion_thruster.dm"
#include "code\modules\overmap\map\area.dm"
#include "code\modules\overmap\map\object.dm"
#include "code\modules\overmap\map\turf.dm"
#include "code\modules\overmap\tiled\tiled.dm"
#include "code\modules\paperwork\adminpaper.dm"
#include "code\modules\paperwork\carbonpaper.dm"
#include "code\modules\paperwork\clipboard.dm"
Expand Down
2 changes: 1 addition & 1 deletion code/__DEFINES/shuttle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#define SLANDMARK_FLAG_AUTOSET 1
/// Zero-G shuttles moved here will lose gravity unless the area has ambient gravity.
#define SLANDMARK_FLAG_ZERO_G 2
// Overmap landable shuttles (/obj/effect/overmap/visitable/ship/landable on a /datum/shuttle/autodock/overmap)
// Overmap landable shuttles (/obj/overmap/entity/visitable/ship/landable on a /datum/shuttle/autodock/overmap)
/// Ship is at any other shuttle landmark.
#define SHIP_STATUS_LANDED 1
/// Ship is at it's shuttle datum's transition shuttle landmark.
Expand Down
6 changes: 3 additions & 3 deletions code/controllers/subsystem/parallax.dm
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ SUBSYSTEM_DEF(parallax)
/datum/controller/subsystem/parallax/proc/get_parallax_vis_contents(z)
. = list()
// overmaps
var/obj/effect/overmap/visitable/v = get_overmap_sector(z)
var/obj/overmap/entity/visitable/v = get_overmap_sector(z)
if(istype(v))
for(var/obj/effect/overmap/other in v.loc)
for(var/obj/overmap/other in v.loc)
if(other == v)
continue
var/atom/movable/AM = other.get_parallax_image()
Expand Down Expand Up @@ -89,7 +89,7 @@ SUBSYSTEM_DEF(parallax)
*/
/datum/controller/subsystem/parallax/proc/get_parallax_motion(z)
// right now we only care about overmaps
var/obj/effect/overmap/visitable/ship/V = get_overmap_sector(z)
var/obj/overmap/entity/visitable/ship/V = get_overmap_sector(z)
if(!istype(V))
return
if(!V.is_moving())
Expand Down
8 changes: 4 additions & 4 deletions code/controllers/subsystem/shuttles.dm
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ SUBSYSTEM_DEF(shuttle)
registered_shuttle_landmarks[shuttle_landmark_tag] = shuttle_landmark
last_landmark_registration_time = world.time

var/obj/effect/overmap/visitable/O = landmarks_still_needed[shuttle_landmark_tag]
var/obj/overmap/entity/visitable/O = landmarks_still_needed[shuttle_landmark_tag]
if(O) // These need to be added to sectors, which we handle.
try_add_landmark_tag(shuttle_landmark_tag, O)
landmarks_still_needed -= shuttle_landmark_tag
Expand All @@ -144,7 +144,7 @@ SUBSYSTEM_DEF(shuttle)

// Checks if the given sector's landmarks have initialized; if so, registers them with the sector, if not, marks them for assignment after they come in.
// Also adds automatic landmarks that were waiting on their sector to spawn.
/datum/controller/subsystem/shuttle/proc/initialize_sector(obj/effect/overmap/visitable/given_sector)
/datum/controller/subsystem/shuttle/proc/initialize_sector(obj/overmap/entity/visitable/given_sector)
given_sector.populate_sector_objects() // This is a late init operation that sets up the sector's map_z and does non-overmap-related init tasks.

for(var/landmark_tag in given_sector.initial_generic_waypoints)
Expand All @@ -164,7 +164,7 @@ SUBSYSTEM_DEF(shuttle)
landmarks_awaiting_sector -= landmark

// Attempts to add a landmark instance with a sector (returns false if landmark isn't registered yet)
/datum/controller/subsystem/shuttle/proc/try_add_landmark_tag(landmark_tag, obj/effect/overmap/visitable/given_sector)
/datum/controller/subsystem/shuttle/proc/try_add_landmark_tag(landmark_tag, obj/overmap/entity/visitable/given_sector)
var/obj/effect/shuttle_landmark/landmark = get_landmark(landmark_tag)
if(!landmark)
return
Expand Down Expand Up @@ -210,7 +210,7 @@ SUBSYSTEM_DEF(shuttle)
return
overmap_halted = !overmap_halted
for(var/ship in ships)
var/obj/effect/overmap/visitable/ship/ship_effect = ship
var/obj/overmap/entity/visitable/ship/ship_effect = ship
overmap_halted ? ship_effect.halt() : ship_effect.unhalt()

/datum/controller/subsystem/shuttle/stat_entry()
Expand Down
4 changes: 2 additions & 2 deletions code/datums/announce/location/overmap_sector.dm
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/datum/announce_location/overmap_sector
/// our overmap sector
var/obj/effect/overmap/visitable/sector
var/obj/overmap/entity/visitable/sector

/datum/announce_location/overmap_sector/New(obj/effect/overmap/visitable/sector)
/datum/announce_location/overmap_sector/New(obj/overmap/entity/visitable/sector)
src.sector = sector
if(!sector)
CRASH("Invalid sector: [sector]")
Expand Down
18 changes: 9 additions & 9 deletions code/game/machinery/holopad.dm
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ GLOBAL_VAR_INIT(holopad_connectivity_rebuild_queued, FALSE)
* returns if we can reach another holopad
*/
/obj/machinery/holopad/proc/holocall_connectivity(obj/machinery/holopad/other)
var/obj/effect/overmap/visitable/our_sector = get_overmap_sector(get_z(src))
var/obj/effect/overmap/visitable/their_sector = get_overmap_sector(get_z(other))
var/obj/overmap/entity/visitable/our_sector = get_overmap_sector(get_z(src))
var/obj/overmap/entity/visitable/their_sector = get_overmap_sector(get_z(other))
if(!our_sector || !their_sector)
return !(sector_only || other.sector_only) && (get_z(src) == get_z(other))
if(our_sector != their_sector)
Expand All @@ -216,12 +216,12 @@ GLOBAL_VAR_INIT(holopad_connectivity_rebuild_queued, FALSE)
*/
/obj/machinery/holopad/proc/holocall_query()
. = list()
var/obj/effect/overmap/visitable/our_sector = get_overmap_sector(get_z(src))
var/obj/overmap/entity/visitable/our_sector = get_overmap_sector(get_z(src))
for(var/id in GLOB.holopad_lookup)
var/obj/machinery/holopad/pad = GLOB.holopad_lookup[id]
if(!pad.operable() || !pad.call_visibility)
continue
var/obj/effect/overmap/visitable/their_sector = get_overmap_sector(get_z(pad))
var/obj/overmap/entity/visitable/their_sector = get_overmap_sector(get_z(pad))
if(!our_sector || !their_sector)
if((sector_only || pad.sector_only) || (get_z(src) != get_z(pad)))
continue
Expand All @@ -243,9 +243,9 @@ GLOBAL_VAR_INIT(holopad_connectivity_rebuild_queued, FALSE)
/obj/machinery/holopad/proc/holocall_name(obj/machinery/holopad/in_respects_to)
if(holopad_name)
return holopad_name
var/obj/effect/overmap/visitable/sector = get_overmap_sector(get_z(src))
var/obj/overmap/entity/visitable/sector = get_overmap_sector(get_z(src))
if(in_respects_to && call_anonymous_sector)
var/obj/effect/overmap/visitable/other = get_overmap_sector(in_respects_to)
var/obj/overmap/entity/visitable/other = get_overmap_sector(in_respects_to)
if(sector != other)
return "Anonymous"
return "[sector? "[sector.scanner_name || sector.name]: " : ""][get_area(src)?:name] - [holopad_uid]"
Expand All @@ -264,7 +264,7 @@ GLOBAL_VAR_INIT(holopad_connectivity_rebuild_queued, FALSE)
/obj/machinery/holopad/proc/ui_connectivity_data()
var/list/built = list()
for(var/obj/machinery/holopad/pad as anything in holocall_query())
var/obj/effect/overmap/visitable/sector = get_overmap_sector(get_z(pad))
var/obj/overmap/entity/visitable/sector = get_overmap_sector(get_z(pad))
var/sector_name = sector?.scanner_name || sector?.name
built[++built.len] = list(
"id" = pad.holopad_uid,
Expand Down Expand Up @@ -924,7 +924,7 @@ GLOBAL_VAR_INIT(holopad_connectivity_rebuild_queued, FALSE)

/datum/holocall/proc/ui_caller_id_source()
// todo: overmap sector names for anonymous.
var/obj/effect/overmap/visitable/sector = get_overmap_sector(get_z(source))
var/obj/overmap/entity/visitable/sector = get_overmap_sector(get_z(source))
var/scanner_name = sector?.scanner_name || sector?.name || "Unknown"
return list(
"name" = (source.call_anonymous_sector && cross_sector)? "Anonymous" : source.holocall_name(),
Expand All @@ -937,7 +937,7 @@ GLOBAL_VAR_INIT(holopad_connectivity_rebuild_queued, FALSE)

/datum/holocall/proc/ui_caller_id_destination()
// todo: overmap sector names for anonymous.
var/obj/effect/overmap/visitable/sector = get_overmap_sector(get_z(destination))
var/obj/overmap/entity/visitable/sector = get_overmap_sector(get_z(destination))
var/scanner_name = sector?.scanner_name || sector?.name || "Unknown"
return list(
"name" = (destination.call_anonymous_sector && cross_sector)? "Anonymous" : destination.holocall_name(),
Expand Down
6 changes: 3 additions & 3 deletions code/game/mecha/combat/fighter.dm
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
if(!(LEGACY_MAP_DATUM).use_overmap || !occupant || !can_ztravel())
return ..()

var/obj/effect/overmap/visitable/our_ship = get_overmap_sector(z)
var/obj/overmap/entity/visitable/our_ship = get_overmap_sector(z)

//We're not on the overmap
if(!our_ship)
Expand Down Expand Up @@ -106,7 +106,7 @@
new_x = rand(TRANSITIONEDGE + 2, world.maxx - TRANSITIONEDGE - 2)

var/list/choices = list()
for(var/obj/effect/overmap/visitable/V in range(1, our_ship))
for(var/obj/overmap/entity/visitable/V in range(1, our_ship))
choices[V.name] = V

var/choice = input("Choose an overmap destination:", "Destination", null) as null|anything in choices
Expand All @@ -116,7 +116,7 @@
setDir(backwards)
return
else
var/obj/effect/overmap/visitable/V = choices[choice]
var/obj/overmap/entity/visitable/V = choices[choice]
if(occupant != this_occupant || this_x != x || this_y != y || this_z != z || get_dist(V,our_ship) > 1) //Sanity after user input
to_chat(occupant, "<span class='warning'>You or they appear to have moved!</span>")
return
Expand Down
6 changes: 3 additions & 3 deletions code/modules/events/cult.dm
Original file line number Diff line number Diff line change
Expand Up @@ -111,17 +111,17 @@

// Overmap version
/datum/event/cult/overmap/announce()
if(istype(victim, /obj/effect/overmap/visitable/ship/talon))
if(istype(victim, /obj/overmap/entity/visitable/ship/talon))
command_announcement.Announce("Attention ITV Talon. You have run into a hostile sub-sector. High potential for humanoid and non-humanoid entities to warp on your ship. Brace.", "Screaming Signals Intercepted")
else
command_announcement.Announce("Attention [station_name()], the ship has run into a hostile sub-sector and reports of humanoid and non-humanoid entities are warping onto the ships! Advise immediate removal of these intruders before productivy aboard gets hindered!", "Screaming Signals Intercepted", new_sound = 'sound/effects/c_alarm.mp3')//,volume=5)
return

/datum/event/cult/overmap/start() // override - cancel if not main ship since it doesn't properly target the actual triggering ship
if(istype(victim, /obj/effect/overmap/visitable/ship/landable))
if(istype(victim, /obj/overmap/entity/visitable/ship/landable))
kill()
return
if(istype(victim, /obj/effect/overmap/visitable/ship/talon)) //Forces the location to be the Talon.
if(istype(victim, /obj/overmap/entity/visitable/ship/talon)) //Forces the location to be the Talon.
isTalon = 1
location = 5
return ..()
Expand Down
2 changes: 1 addition & 1 deletion code/modules/events/event.dm
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
var/datum/event_meta/event_meta = null
var/list/affecting_z = null // List of z-levels to affect, null lets the event choose (usally station_levels)
var/has_skybox_image = FALSE // True if SSskybox should query this event for an image to put in the skybox.
var/obj/effect/overmap/visitable/ship/victim = null // Ship that triggered this event on itself. Some messages might be different etc.
var/obj/overmap/entity/visitable/ship/victim = null // Ship that triggered this event on itself. Some messages might be different etc.

/datum/event/nothing

Expand Down
6 changes: 3 additions & 3 deletions code/modules/events/hostile_migration_vr.dm
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@

// Overmap version
/datum/event/hostile_migration/overmap/announce()
if(istype(victim, /obj/effect/overmap/visitable/ship/talon))
if(istype(victim, /obj/overmap/entity/visitable/ship/talon))
command_announcement.Announce("Unidentified hostile lifesigns detected migrating towards ITV Talon through the exterior pipes. Secure any exterior access, including ducting and ventilation.","Hostile Vermin Boarding Alert")
return
else
Expand All @@ -123,10 +123,10 @@

// override: cancel if not main ship as this is too dumb to target the actual ship crossing it.
/datum/event/hostile_migration/overmap/start()
if(istype(victim, /obj/effect/overmap/visitable/ship/landable))
if(istype(victim, /obj/overmap/entity/visitable/ship/landable))
kill()
return
if(istype(victim, /obj/effect/overmap/visitable/ship/talon)) //Forces the location to the Talon.
if(istype(victim, /obj/overmap/entity/visitable/ship/talon)) //Forces the location to the Talon.
isTalon = 1
location = 8
return ..()
Expand Down
2 changes: 1 addition & 1 deletion code/modules/events/infestation.dm
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@

// override: cancel if not main ship as this is too dumb to target the actual ship crossing it.
/datum/event/infestation/overmap/start()
if(istype(victim, /obj/effect/overmap/visitable/ship/landable))
if(istype(victim, /obj/overmap/entity/visitable/ship/landable))
kill()
return
return ..()
Expand Down
6 changes: 3 additions & 3 deletions code/modules/events/pirate.dm
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@

// Overmap version
/datum/event/pirate/overmap/announce()
if(istype(victim, /obj/effect/overmap/visitable/ship/talon))
if(istype(victim, /obj/overmap/entity/visitable/ship/talon))
if(piratestring == "human")
command_announcement.Announce("Attention, Crew of the ITV Talon, thanks for delivering your ship to us suckers!", "Incoming Transmission")
if (piratestring == "vox")
Expand All @@ -158,9 +158,9 @@
command_announcement.Announce("Attention [station_name()], a tiny teleportation matrix has been detected on the nearby vessel. Prepare Crew to repell small boarders.", "Boarding Alert", new_sound = sound('sound/effects/siren.ogg', volume=25))

/datum/event/pirate/overmap/start() // override - cancel if not main ship since it doesn't properly target the actual triggering ship
if(istype(victim, /obj/effect/overmap/visitable/ship/landable))
if(istype(victim, /obj/overmap/entity/visitable/ship/landable))
kill()
if(istype(victim, /obj/effect/overmap/visitable/ship/talon)) //Forces the location to be the Talon.
if(istype(victim, /obj/overmap/entity/visitable/ship/talon)) //Forces the location to be the Talon.
isTalon = 1
location = 5
return ..()
Expand Down
4 changes: 2 additions & 2 deletions code/modules/mapping/map.dm
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@
/datum/map/station/proc/get_map_levels(var/srcz, var/long_range = TRUE, var/om_range = 0)
// Overmap behavior
if(use_overmap)
var/obj/effect/overmap/visitable/O = get_overmap_sector(srcz)
var/obj/overmap/entity/visitable/O = get_overmap_sector(srcz)
if(!istype(O))
return list(srcz)

Expand All @@ -342,7 +342,7 @@
// Otherwise every sector we're on top of
var/list/connections = list()
var/turf/T = get_turf(O)
for(var/obj/effect/overmap/visitable/V in range(om_range, T))
for(var/obj/overmap/entity/visitable/V in range(om_range, T))
connections |= V.map_z // Adding list to list adds contents
return connections

Expand Down
2 changes: 1 addition & 1 deletion code/modules/maps/away_missions/140x140/carpfarm.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/obj/effect/overmap/visitable/sector/gateway/carpfarm
/obj/overmap/entity/visitable/sector/gateway/carpfarm
initial_generic_waypoints = list("carpfarm1", "carpfarm2")
scanner_name = "Carp-Infested Outpost"
scanner_desc = @{"[i]Registration[/i]: UNKNOWN
Expand Down
2 changes: 1 addition & 1 deletion code/modules/maps/away_missions/140x140/listeningpost.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/obj/effect/overmap/visitable/sector/gateway/listeningpost
/obj/overmap/entity/visitable/sector/gateway/listeningpost
initial_generic_waypoints = list("tether_excursion_listeningpost")
scanner_name = "Strange Asteroid"
scanner_desc = @{"[i]Registration[/i]: UNKNOWN
Expand Down
2 changes: 1 addition & 1 deletion code/modules/maps/away_missions/140x140/snow_outpost.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/obj/effect/overmap/visitable/sector/gateway/snowoutpost
/obj/overmap/entity/visitable/sector/gateway/snowoutpost
initial_generic_waypoints = list("tether_excursion_snow_outpost")
in_space = 0
scanner_name = "Snowy Outpost"
Expand Down
2 changes: 1 addition & 1 deletion code/modules/maps/away_missions/140x140/snowfield.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/obj/effect/overmap/visitable/sector/gateway/snowfield
/obj/overmap/entity/visitable/sector/gateway/snowfield
initial_generic_waypoints = list("tether_excursion_snowfield")
in_space = 0
scanner_name = "Snowy Field"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
defer_initialisation = TRUE //We're not loaded until an admin does it

// The 'ship'
/obj/effect/overmap/visitable/ship/landable/generic_shuttle
/obj/overmap/entity/visitable/ship/landable/generic_shuttle
scanner_name = "Private Vessel"
scanner_desc = @{"[i]Registration[/i]: PRIVATE
[i]Class[/i]: Small Shuttle
Expand Down
2 changes: 1 addition & 1 deletion code/modules/maps/misc_maps/lavaland/_lavaland.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Shuttle Path for lava land
// -- Datums -- //
/*/obj/effect/overmap/visitable/sector/lavaland
/*/obj/overmap/entity/visitable/sector/lavaland
name = "Mineral Rich Planet" // The name of the destination
desc = "Sensors indicate that this is a world filled with minerals. There seems to be a thin atmosphere on the planet."
icon_state = "globe"
Expand Down
Loading

0 comments on commit b41f1ab

Please sign in to comment.