From 469c15f64396f9ed22f5c85459fa9cfb1e4742dd Mon Sep 17 00:00:00 2001 From: VerySoft Date: Sat, 1 Jul 2023 18:09:12 -0400 Subject: [PATCH] for the future ababa --- code/game/area/Away Mission areas.dm | 73 ++++++++++++++----- code/modules/lighting/lighting_fake_sun_vr.dm | 18 ++++- maps/offmap_vr/common_offmaps.dm | 6 +- 3 files changed, 72 insertions(+), 25 deletions(-) diff --git a/code/game/area/Away Mission areas.dm b/code/game/area/Away Mission areas.dm index 1edf5b23f17..66cc056add9 100644 --- a/code/game/area/Away Mission areas.dm +++ b/code/game/area/Away Mission areas.dm @@ -1,4 +1,4 @@ -/area/awaymission +/area name = "\improper Unknown Location" icon_state = "away" var/list/valid_spawn_turfs = list() @@ -6,55 +6,90 @@ var/list/valid_flora = list() var/mobcountmax = 0 var/floracountmax = 0 + var/semirandom = FALSE + var/semirandom_groups = 0 + var/semirandom_group_min = 0 + var/semirandom_group_max = 10 + var/mob_intent = "default" //"default" uses default settings, use "hostile", "retaliate", or "passive" respectively -/area/awaymission/proc/EvalValidSpawnTurfs() +/area/proc/EvalValidSpawnTurfs() //Adds turfs to the valid)turfs list, used for spawning. - if(mobcountmax || floracountmax) + if(mobcountmax || floracountmax || semirandom) for(var/turf/simulated/floor/F in src) valid_spawn_turfs += F for(var/turf/unsimulated/floor/F in src) valid_spawn_turfs += F -/area/awaymission/LateInitialize() +/area/LateInitialize() ..() EvalValidSpawnTurfs() - + if(!valid_spawn_turfs.len && (mobcountmax || floracountmax)) - to_world_log("Error! [src] does not have any turfs!") + log_and_message_admins("Error! [src] does not have any turfs!") return TRUE //Handles random mob placement for mobcountmax, as defined/randomized in initialize of each individual area. - if(mobcountmax) + if(mobcountmax || semirandom) spawn_mob_on_turf() //Handles random flora placement for floracountmax, as defined/randomized in initialize of each individual area. if(floracountmax) spawn_flora_on_turf() - - to_world("Away mission spawning done.") -/area/awaymission/proc/spawn_mob_on_turf() + message_admins("Away mission spawning done.") + +/area/proc/spawn_mob_on_turf() if(!valid_mobs.len) to_world_log("[src] does not have a set valid mobs list!") return TRUE - + var/mob/M var/turf/Turf - for(var/mobscount = 0 to mobcountmax) - M = pick(valid_mobs) - Turf = pick(valid_spawn_turfs) - valid_spawn_turfs -= Turf - new M(Turf) + if(semirandom) + for(var/groupscount = 0 to (semirandom_groups - 1)) + var/ourgroup = pickweight(valid_mobs) + var/goodnum = rand(semirandom_group_min, semirandom_group_max) + for(var/mobscount = 0 to (goodnum - 1)) + M = pickweight(ourgroup) + Turf = pick(valid_spawn_turfs) + valid_spawn_turfs -= Turf + var/mob/ourmob = new M(Turf) + adjust_mob(ourmob) + else + for(var/mobscount = 0 to mobcountmax) + M = pickweight(valid_mobs) + Turf = pick(valid_spawn_turfs) + valid_spawn_turfs -= Turf + var/mob/ourmob = new M(Turf) + adjust_mob(ourmob) -/area/awaymission/proc/spawn_flora_on_turf() +/area/proc/adjust_mob(var/mob/living/M) + if(!isliving(M)) + log_admin("[src] spawned [M.type], which is not mob/living, FIXIT") + return + var/datum/ai_holder/AI = M.ai_holder + switch(mob_intent) + if("default") + return + if("hostile") + AI.hostile = TRUE + AI.retaliate = TRUE + if("retaliate") + AI.hostile = FALSE + AI.retaliate = TRUE + if("passive") + AI.hostile = FALSE + AI.retaliate = FALSE + +/area/proc/spawn_flora_on_turf() if(!valid_flora.len) to_world_log("[src] does not have a set valid flora list!") return TRUE - + var/obj/F var/turf/Turf for(var/floracount = 0 to floracountmax) F = pick(valid_flora) Turf = pick(valid_spawn_turfs) valid_spawn_turfs -= Turf - new F(Turf) \ No newline at end of file + new F(Turf) diff --git a/code/modules/lighting/lighting_fake_sun_vr.dm b/code/modules/lighting/lighting_fake_sun_vr.dm index 98f3674337b..18f65ee88d0 100644 --- a/code/modules/lighting/lighting_fake_sun_vr.dm +++ b/code/modules/lighting/lighting_fake_sun_vr.dm @@ -5,6 +5,9 @@ icon_state = "fakesun" invisibility = INVISIBILITY_ABSTRACT var/atom/movable/sun_visuals/sun + var/family = null //Allows multipe maps that are THEORETICALLY connected to use the same settings when not in a connected Z stack + var/shared_settings //Automatically set if using the family var + var/static/world_suns = list() //List of all the fake_suns in the world, used for checking for family members var/list/possible_light_setups = list( list( @@ -78,13 +81,26 @@ ) +/obj/effect/fake_sun/New(loc, ...) + . = ..() + world_suns += src + /obj/effect/fake_sun/Initialize() ..() return INITIALIZE_HINT_LATELOAD /obj/effect/fake_sun/LateInitialize() . = ..() - var/list/choice = pick(possible_light_setups) + var/list/choice + if(family) //Allows one to make multiple fake_suns to use the same settings + for(var/obj/effect/fake_sun/l in world_suns) //check all the suns that exist + if(l.family == family && l.shared_settings) //do you have settings we need? + choice = l.shared_settings + break + if(!choice) //We didn't get anything from our family, let's pick something + choice = pick(possible_light_setups) + if(family) //Let's pass our settings on to our family + shared_settings = choice if(choice["brightness"] <= LIGHTING_SOFT_THRESHOLD) // dark! return diff --git a/maps/offmap_vr/common_offmaps.dm b/maps/offmap_vr/common_offmaps.dm index 1e2d4f9f6bb..69567512a22 100644 --- a/maps/offmap_vr/common_offmaps.dm +++ b/maps/offmap_vr/common_offmaps.dm @@ -254,7 +254,7 @@ name = "Redgate Submap" desc = "Please do not use this." mappath = null - associated_map_datum = null + associated_map_datum = /datum/map_z_level/common_lateload/redgate_destination /datum/map_z_level/common_lateload/redgate_destination name = "Redgate Destination" @@ -269,25 +269,21 @@ name = "Teppi Ranch" desc = "An abandoned teppi ranch!" mappath = 'maps/redgate/teppiranch.dmm' - associated_map_datum = /datum/map_z_level/common_lateload/redgate_destination /datum/map_template/common_lateload/redgate/innland name = "Innland" desc = "Caves and grass and a tavern, woah!" mappath = 'maps/redgate/innland.dmm' - associated_map_datum = /datum/map_z_level/common_lateload/redgate_destination /datum/map_template/common_lateload/redgate/abandonedisland name = "Abandoned Island" desc = "It seems like it used to be people here!" mappath = 'maps/redgate/abandonedisland.dmm' - associated_map_datum = /datum/map_z_level/common_lateload/redgate_destination /datum/map_template/common_lateload/redgate/darkadventure name = "Dark Adventure" desc = "This place seems broken!" mappath = 'maps/redgate/darkadventure.dmm' - associated_map_datum = /datum/map_z_level/common_lateload/redgate_destination ////////////////////////////////////////////////////////////////////////////////////// // Admin-use z-levels for loading whenever an admin feels like