diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm index be2495aac44..13a4c60d3ef 100644 --- a/code/__DEFINES/misc.dm +++ b/code/__DEFINES/misc.dm @@ -460,17 +460,20 @@ example: //Map template flags /// Lets multiple copies of the template to be spawned -#define TEMPLATE_FLAG_ALLOW_DUPLICATES 1 -/// Makes it ignore away site budget and just spawn (works only for away sites) +#define TEMPLATE_FLAG_ALLOW_DUPLICATES BITFLAG(1) +/// If it should ignore away site budget and just spawn (works only for away sites) /// A site needs to be set to spawn in current sector to be considered still -#define TEMPLATE_FLAG_SPAWN_GUARANTEED 2 -/// if it should destroy objects it spawns on top of -#define TEMPLATE_FLAG_CLEAR_CONTENTS 4 -/// if it should forbid ruins from spawning on top of it -#define TEMPLATE_FLAG_NO_RUINS 8 +#define TEMPLATE_FLAG_SPAWN_GUARANTEED BITFLAG(2) +/// If it should destroy objects it spawns on top of +#define TEMPLATE_FLAG_CLEAR_CONTENTS BITFLAG(3) +/// If it should forbid ruins from spawning on top of it +#define TEMPLATE_FLAG_NO_RUINS BITFLAG(4) +/// If it should always spawn if today is a port of call day +#define TEMPLATE_FLAG_PORT_SPAWN BITFLAG(5) //Ruin map template flags -#define TEMPLATE_FLAG_RUIN_STARTS_DISALLOWED 32 // Ruin is not available during spawning unless another ruin permits it, or whitelisted by the exoplanet +/// Ruin is not available during spawning unless another ruin permits it, or whitelisted by the exoplanet +#define TEMPLATE_FLAG_RUIN_STARTS_DISALLOWED BITFLAG(6) #define LANDING_ZONE_RADIUS 15 // Used for autoplacing landmarks on exoplanets diff --git a/code/controllers/subsystems/initialization/atlas.dm b/code/controllers/subsystems/initialization/atlas.dm index ae14bc986a3..4e627df880b 100644 --- a/code/controllers/subsystems/initialization/atlas.dm +++ b/code/controllers/subsystems/initialization/atlas.dm @@ -302,6 +302,18 @@ SUBSYSTEM_DEF(atlas) if (!possible_sectors.len) crash_with("No space sectors located in SSatlas.") +/// Checks if today is a Port of Call day at current_sector. +/// Returns FALSE if no port_of_call defined in current_map.ports_of_call, or if today is not listed as a Port of Call day in current_sector.scheduled_port_visits +/datum/controller/subsystem/atlas/proc/is_port_call_day() + if(!current_map || !current_sector) + return FALSE + if(current_map.ports_of_call && length(current_sector.scheduled_port_visits)) + /// Get today + var/today = GLOB.all_days[GLOB.all_days.Find(time2text(world.realtime, "Day"))] + if(today in current_sector.scheduled_port_visits) //checks if today is a port of call day + return TRUE + return FALSE + // Called when there's a fatal, unrecoverable error in mapload. This reboots the server. /world/proc/map_panic(reason) to_chat(world, "Fatal error during map setup, unable to continue! Server will reboot in 60 seconds.") diff --git a/code/modules/background/space_sectors/coalition/coalition.dm b/code/modules/background/space_sectors/coalition/coalition.dm index 6fd68311d95..94febaa56dd 100644 --- a/code/modules/background/space_sectors/coalition/coalition.dm +++ b/code/modules/background/space_sectors/coalition/coalition.dm @@ -65,7 +65,7 @@ cargo_price_coef = list("nt" = 1.1, "hpi" = 0.7, "zhu" = 0.4, "een" = 1.0, "get" = 1.1, "arz" = 1.8, "blm" = 0.9, "iac" = 1.2, "zsc" = 1.8, "vfc" = 0.9, "bis" = 0.4, "xmg" = 0.7, "npi" = 0.8) ports_of_call = list("the corporate district of Aoyama") - scheduled_port_visits = list("Thursday", "Sunday") + scheduled_port_visits = list("Saturday", "Sunday") starlight_color = "#e2719b" starlight_power = 2//placeholder starlight_range = 4//placeholder diff --git a/code/modules/background/space_sectors/space_sector.dm b/code/modules/background/space_sectors/space_sector.dm index cce9ddd4c75..a8345f605b4 100644 --- a/code/modules/background/space_sectors/space_sector.dm +++ b/code/modules/background/space_sectors/space_sector.dm @@ -136,7 +136,7 @@ /datum/space_sector/proc/setup_current_sector() SHOULD_CALL_PARENT(TRUE) - if(SSatlas.current_map.ports_of_call && length(scheduled_port_visits)) + if(SSatlas.current_map.ports_of_call && length(SSatlas.current_sector.scheduled_port_visits)) var/current_day_index = GLOB.all_days.Find(time2text(world.realtime, "Day")) var/days_calculated = 0 // The main problem to consider here is that you have to loop around for two weeks to find all the days, basically. @@ -151,7 +151,7 @@ next_port_visit = current_day_index break - next_port_visit_string = days_calculated == 0 ? "today" : days_calculated == 1 ? "in [days_calculated] day" : "in [days_calculated] days" + next_port_visit_string = days_calculated == 0 ? "Today" : days_calculated == 1 ? "in [days_calculated] day" : "in [days_calculated] days" // For now, i've put processing to only happen if the sector has a radio station // but if, in the future, you add more stuff for the processor to handle, feel free to move it out of the if block diff --git a/code/modules/maps/ruins.dm b/code/modules/maps/ruins.dm index 36f025de5f8..261f08ea142 100644 --- a/code/modules/maps/ruins.dm +++ b/code/modules/maps/ruins.dm @@ -41,6 +41,17 @@ GLOBAL_LIST_EMPTY(banned_ruin_ids) handled_ruin_paths += ruin.type continue + if((ruin.template_flags & TEMPLATE_FLAG_PORT_SPAWN)) + if(SSatlas.is_port_call_day()) + force_spawn |= ruin + for(var/ruin_path in ruin.force_ruins) + var/datum/map_template/ruin/force_ruin = new ruin_path + force_spawn |= force_ruin + // No matter if it spawns or not, we want it removed from further consideration, it either spawns here or not at all + potentialRuins -= ruin + handled_ruin_paths += ruin.type + continue + available[ruin] = ruin.spawn_weight for(var/ruin_path in ruin.allow_ruins) diff --git a/html/changelogs/Ben10083 - PortofCall.yml b/html/changelogs/Ben10083 - PortofCall.yml new file mode 100644 index 00000000000..b9d88bc2142 --- /dev/null +++ b/html/changelogs/Ben10083 - PortofCall.yml @@ -0,0 +1,44 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +# balance +# admin +# backend +# security +# refactor +################################# + +# Your name. +author: Ben10083 + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - rscdel: "Point Verdant now only spawns when the day is a Port of Call day." + - backend: "New template flag for ruins added, flag has ruin always spawn when today is a Port of Call, otherwise will not spawn." + - tweak: "Haneunim port of call days now Saturday and Sunday" + - backend: "New atlas subsystem proc to check if today is a port of call day." diff --git a/maps/_common/mapsystem/map.dm b/maps/_common/mapsystem/map.dm index 4a6a7944c26..6e8e3a5dc3c 100644 --- a/maps/_common/mapsystem/map.dm +++ b/maps/_common/mapsystem/map.dm @@ -269,6 +269,11 @@ guaranteed += site if ((site.template_flags & TEMPLATE_FLAG_ALLOW_DUPLICATES) && !(site.template_flags & TEMPLATE_FLAG_RUIN_STARTS_DISALLOWED)) available[site] = site.spawn_weight + else if((site.template_flags & TEMPLATE_FLAG_PORT_SPAWN) && (site.spawns_in_current_sector())) + if(SSatlas.is_port_call_day()) //we check here as we only want sites with PORT_SPAWN flag to spawn if this is true, else we want it not considered. + guaranteed += site + if ((site.template_flags & TEMPLATE_FLAG_ALLOW_DUPLICATES) && !(site.template_flags & TEMPLATE_FLAG_RUIN_STARTS_DISALLOWED)) + available[site] = site.spawn_weight else if (!(site.template_flags & TEMPLATE_FLAG_RUIN_STARTS_DISALLOWED) && (site.spawns_in_current_sector())) available[site] = site.spawn_weight by_type[site.type] = site diff --git a/maps/away/away_site/konyang/point_verdant/point_verdant.dm b/maps/away/away_site/konyang/point_verdant/point_verdant.dm index 3aae6b4183b..9a67b21daad 100644 --- a/maps/away/away_site/konyang/point_verdant/point_verdant.dm +++ b/maps/away/away_site/konyang/point_verdant/point_verdant.dm @@ -6,7 +6,7 @@ suffixes = list("away_site/konyang/point_verdant/point_verdant-1.dmm","away_site/konyang/point_verdant/point_verdant-2.dmm","away_site/konyang/point_verdant/point_verdant-3.dmm") spawn_weight = 1 spawn_cost = 1 - template_flags = TEMPLATE_FLAG_SPAWN_GUARANTEED + template_flags = TEMPLATE_FLAG_PORT_SPAWN unit_test_groups = list(2)