mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-01-28 01:42:50 +00:00
Merge pull request #12842 from Heroman3003/poi-guarantee
Adds PoI loader landmarks
This commit is contained in:
73
code/game/objects/effects/landmarks_poi_vr.dm
Normal file
73
code/game/objects/effects/landmarks_poi_vr.dm
Normal file
@@ -0,0 +1,73 @@
|
||||
var/global/list/global_used_pois = list()
|
||||
|
||||
|
||||
|
||||
/obj/effect/landmark/poi_loader
|
||||
name = "PoI Loader"
|
||||
var/size_x
|
||||
var/size_y
|
||||
var/poi_type = null
|
||||
var/remove_from_pool = TRUE
|
||||
|
||||
/obj/effect/landmark/poi_loader/New()
|
||||
INITIALIZE_IMMEDIATE(/obj/effect/landmark/poi_loader)
|
||||
|
||||
/obj/effect/landmark/poi_loader/Initialize()
|
||||
src.load_poi()
|
||||
return ..()
|
||||
|
||||
/obj/effect/landmark/poi_loader/proc/get_turfs_to_clean()
|
||||
return block(locate(src.x, src.y, src.z), locate((src.x + size_x - 1), (src.y + size_y - 1), src.z))
|
||||
|
||||
/obj/effect/landmark/poi_loader/proc/annihilate_bounds()
|
||||
//var/deleted_atoms = 0
|
||||
//admin_notice("<span class='danger'>Annihilating objects in poi loading location.</span>", R_DEBUG)
|
||||
var/list/turfs_to_clean = get_turfs_to_clean()
|
||||
if(turfs_to_clean.len)
|
||||
for(var/x in 1 to 2) // Requires two passes to get everything.
|
||||
for(var/turf/T in turfs_to_clean)
|
||||
for(var/atom/movable/AM in T)
|
||||
//++deleted_atoms
|
||||
qdel(AM)
|
||||
//admin_notice("<span class='danger'>Annihilated [deleted_atoms] objects.</span>", R_DEBUG)
|
||||
|
||||
/obj/effect/landmark/poi_loader/proc/load_poi()
|
||||
var/turf/T = get_turf(src)
|
||||
if(!isturf(T))
|
||||
to_world_log("[log_info_line(src)] not on a turf! Cannot place poi template.")
|
||||
return
|
||||
|
||||
// Choose a poi
|
||||
if(!poi_type)
|
||||
return
|
||||
|
||||
if(!(global_used_pois.len) || !(global_used_pois[poi_type]))
|
||||
global_used_pois[poi_type] = list()
|
||||
var/list/poi_list = global_used_pois[poi_type]
|
||||
for(var/map in SSmapping.map_templates)
|
||||
var/template = SSmapping.map_templates[map]
|
||||
if(istype(template, poi_type))
|
||||
poi_list += template
|
||||
|
||||
var/datum/map_template/template_to_use = null
|
||||
|
||||
var/list/our_poi_list = global_used_pois[poi_type]
|
||||
|
||||
if(!our_poi_list.len)
|
||||
return
|
||||
else
|
||||
template_to_use = pick(our_poi_list)
|
||||
|
||||
if(!template_to_use)
|
||||
return
|
||||
|
||||
//admin_notice("<span class='danger'>Chosen Predefined PoI Map: [chosen_type.name]</span>", R_DEBUG)
|
||||
|
||||
if(remove_from_pool)
|
||||
global_used_pois[poi_type] -= template_to_use
|
||||
|
||||
// Annihilate movable atoms
|
||||
annihilate_bounds()
|
||||
//CHECK_TICK //Don't let anything else happen for now
|
||||
// Actually load it
|
||||
template_to_use.load(T)
|
||||
@@ -497,9 +497,10 @@
|
||||
associated_map_datum = /datum/map_z_level/gb_lateload/gb_south_wilds
|
||||
/datum/map_template/gb_lateload/wilds/south/type3/on_map_loaded(z)
|
||||
. = ..()
|
||||
seed_submaps(list(Z_LEVEL_GB_WILD_S), 6, /area/submap/groundbase/poi/wildvillage/plot/square, /datum/map_template/groundbase/wildvillage/square) //POI seeding
|
||||
seed_submaps(list(Z_LEVEL_GB_WILD_S), 2, /area/submap/groundbase/poi/wildvillage/plot/wide, /datum/map_template/groundbase/wildvillage/wide)
|
||||
seed_submaps(list(Z_LEVEL_GB_WILD_S), 1, /area/submap/groundbase/poi/wildvillage/plot/long, /datum/map_template/groundbase/wildvillage/long)
|
||||
// Using landmarks for this now.
|
||||
//seed_submaps(list(Z_LEVEL_GB_WILD_S), 6, /area/submap/groundbase/poi/wildvillage/plot/square, /datum/map_template/groundbase/wildvillage/square) //POI seeding
|
||||
//seed_submaps(list(Z_LEVEL_GB_WILD_S), 2, /area/submap/groundbase/poi/wildvillage/plot/wide, /datum/map_template/groundbase/wildvillage/wide)
|
||||
//seed_submaps(list(Z_LEVEL_GB_WILD_S), 1, /area/submap/groundbase/poi/wildvillage/plot/long, /datum/map_template/groundbase/wildvillage/long)
|
||||
|
||||
/datum/map_template/gb_lateload/wilds/east/type1
|
||||
name = "Eastern Wilds 1"
|
||||
|
||||
@@ -885,7 +885,7 @@
|
||||
name = "Cave 49"
|
||||
mappath = 'pois/cave49c.dmm'
|
||||
|
||||
/datum/map_template/groundbase/maintcaves/cavething
|
||||
/datum/map_template/groundbase/maintcaves/cavething
|
||||
name = "Cavething 1"
|
||||
mappath = 'pois/cavething1.dmm'
|
||||
cost = 10
|
||||
@@ -939,6 +939,26 @@
|
||||
cost = 3
|
||||
allow_duplicates = FALSE
|
||||
|
||||
|
||||
/obj/effect/landmark/poi_loader/gb_square
|
||||
name = "Square House Loader"
|
||||
size_x = 12
|
||||
size_y = 12
|
||||
poi_type = /datum/map_template/groundbase/wildvillage/square
|
||||
|
||||
/obj/effect/landmark/poi_loader/gb_wide
|
||||
name = "Wide House Loader"
|
||||
size_x = 17
|
||||
size_y = 12
|
||||
poi_type = /datum/map_template/groundbase/wildvillage/wide
|
||||
|
||||
/obj/effect/landmark/poi_loader/gb_long
|
||||
name = "Long House Loader"
|
||||
size_x = 17
|
||||
size_y = 24
|
||||
poi_type = /datum/map_template/groundbase/wildvillage/long
|
||||
|
||||
|
||||
/area/submap/groundbase/poi/wildvillage
|
||||
name = "POI - Wilderness Village"
|
||||
icon = 'icons/turf/areas_vr.dmi'
|
||||
|
||||
@@ -2,9 +2,21 @@
|
||||
"a" = (
|
||||
/turf/unsimulated/wall/planetary/virgo3c,
|
||||
/area/submap/groundbase/wilderness/south)
|
||||
"b" = (
|
||||
/obj/effect/landmark/poi_loader/gb_square,
|
||||
/turf/simulated/floor/outdoors/grass/virgo3c,
|
||||
/area/submap/groundbase/poi/wildvillage/plot/square)
|
||||
"c" = (
|
||||
/turf/simulated/mineral/cave/virgo3c,
|
||||
/area/submap/groundbase/wilderness/south/cave)
|
||||
"d" = (
|
||||
/obj/effect/landmark/poi_loader/gb_wide,
|
||||
/turf/simulated/floor/outdoors/grass/virgo3c,
|
||||
/area/submap/groundbase/poi/wildvillage/plot/wide)
|
||||
"e" = (
|
||||
/obj/effect/landmark/poi_loader/gb_long,
|
||||
/turf/simulated/floor/outdoors/grass/virgo3c,
|
||||
/area/submap/groundbase/poi/wildvillage/plot/long)
|
||||
"f" = (
|
||||
/turf/simulated/floor/outdoors/grass/forest/virgo3c,
|
||||
/area/submap/groundbase/poi/wildvillage/plot/square)
|
||||
@@ -7243,7 +7255,7 @@ F
|
||||
F
|
||||
F
|
||||
F
|
||||
F
|
||||
b
|
||||
v
|
||||
F
|
||||
F
|
||||
@@ -7256,7 +7268,7 @@ F
|
||||
F
|
||||
F
|
||||
F
|
||||
F
|
||||
b
|
||||
v
|
||||
F
|
||||
F
|
||||
@@ -7269,7 +7281,7 @@ F
|
||||
F
|
||||
F
|
||||
F
|
||||
F
|
||||
b
|
||||
v
|
||||
O
|
||||
O
|
||||
@@ -9083,7 +9095,7 @@ E
|
||||
E
|
||||
E
|
||||
E
|
||||
E
|
||||
d
|
||||
v
|
||||
n
|
||||
n
|
||||
@@ -9108,7 +9120,7 @@ n
|
||||
n
|
||||
n
|
||||
n
|
||||
n
|
||||
e
|
||||
v
|
||||
E
|
||||
E
|
||||
@@ -9121,7 +9133,7 @@ E
|
||||
E
|
||||
E
|
||||
E
|
||||
E
|
||||
d
|
||||
v
|
||||
A
|
||||
A
|
||||
@@ -11645,7 +11657,7 @@ F
|
||||
F
|
||||
F
|
||||
F
|
||||
F
|
||||
b
|
||||
v
|
||||
F
|
||||
F
|
||||
@@ -11658,7 +11670,7 @@ F
|
||||
F
|
||||
F
|
||||
F
|
||||
F
|
||||
b
|
||||
v
|
||||
F
|
||||
F
|
||||
@@ -11671,7 +11683,7 @@ F
|
||||
F
|
||||
F
|
||||
F
|
||||
F
|
||||
b
|
||||
v
|
||||
w
|
||||
O
|
||||
|
||||
@@ -1092,6 +1092,7 @@
|
||||
#include "code\game\objects\effects\item_pickup_ghost.dm"
|
||||
#include "code\game\objects\effects\job_start_landmarks.dm"
|
||||
#include "code\game\objects\effects\landmarks.dm"
|
||||
#include "code\game\objects\effects\landmarks_poi_vr.dm"
|
||||
#include "code\game\objects\effects\landmarks_vr.dm"
|
||||
#include "code\game\objects\effects\manifest.dm"
|
||||
#include "code\game\objects\effects\mines.dm"
|
||||
|
||||
Reference in New Issue
Block a user