mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-24 05:23:22 +01:00
Exoplanet ruins, away sites, overmap submaps and maploader goodies. (#12933)
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
/datum/submap
|
||||
var/name
|
||||
var/pref_name
|
||||
var/decl/submap_archetype/archetype
|
||||
var/associated_z
|
||||
|
||||
/datum/submap/New(var/existing_z)
|
||||
SSmapping.submaps[src] = TRUE
|
||||
associated_z = existing_z
|
||||
|
||||
/datum/submap/Destroy()
|
||||
SSmapping.submaps -= src
|
||||
. = ..()
|
||||
|
||||
/datum/submap/proc/setup_submap(var/decl/submap_archetype/_archetype)
|
||||
|
||||
if(!istype(_archetype))
|
||||
log_game( "Submap error - [name] - null or invalid archetype supplied ([_archetype]).")
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
// Not much point doing this when it has presumably been done already.
|
||||
if(_archetype == archetype)
|
||||
log_game( "Submap error - [name] - submap already set up.")
|
||||
return
|
||||
|
||||
archetype = _archetype
|
||||
if(!pref_name)
|
||||
pref_name = archetype.descriptor
|
||||
|
||||
log_game("Starting submap setup - '[name]', [archetype], [associated_z]z.")
|
||||
|
||||
if(!associated_z)
|
||||
log_game( "Submap error - [name]/[archetype ? archetype.descriptor : "NO ARCHETYPE"] could not find an associated z-level for spawnpoint placement.")
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
var/obj/effect/overmap/visitable/cell = map_sectors["[associated_z]"]
|
||||
if(istype(cell))
|
||||
sync_cell(cell)
|
||||
|
||||
/datum/submap/proc/sync_cell(var/obj/effect/overmap/visitable/cell)
|
||||
name = cell.name
|
||||
|
||||
/datum/submap/proc/available()
|
||||
return TRUE
|
||||
@@ -0,0 +1,15 @@
|
||||
/decl/submap_archetype
|
||||
var/map
|
||||
var/descriptor = "generic ship archetype"
|
||||
|
||||
/decl/submap_archetype/Destroy()
|
||||
if(SSmapping.submap_archetypes[descriptor] == src)
|
||||
SSmapping.submap_archetypes -= descriptor
|
||||
. = ..()
|
||||
|
||||
// Generic ships to populate the list.
|
||||
/decl/submap_archetype/derelict
|
||||
descriptor = "drifting wreck"
|
||||
|
||||
/decl/submap_archetype/abandoned_ship
|
||||
descriptor = "abandoned ship"
|
||||
@@ -0,0 +1,25 @@
|
||||
/obj/effect/submap_landmark
|
||||
icon = 'icons/misc/mark.dmi'
|
||||
invisibility = INVISIBILITY_MAXIMUM
|
||||
anchored = TRUE
|
||||
simulated = FALSE
|
||||
density = FALSE
|
||||
opacity = FALSE
|
||||
|
||||
/obj/effect/submap_landmark/joinable_submap
|
||||
icon_state = "x4"
|
||||
var/archetype
|
||||
var/submap_datum_type = /datum/submap
|
||||
|
||||
/obj/effect/submap_landmark/joinable_submap/Initialize(var/mapload)
|
||||
. = ..(mapload)
|
||||
if(!SSmapping.submaps[name] && SSmapping.submap_archetypes[archetype])
|
||||
var/datum/submap/submap = new submap_datum_type(z)
|
||||
submap.name = name
|
||||
submap.setup_submap(SSmapping.submap_archetypes[archetype])
|
||||
else
|
||||
if(SSmapping.submaps[name])
|
||||
log_debug( "Submap error - mapped landmark is duplicate of existing.")
|
||||
else
|
||||
log_debug( "Submap error - mapped landmark had invalid archetype.")
|
||||
return INITIALIZE_HINT_QDEL
|
||||
Reference in New Issue
Block a user