diff --git a/code/__HELPERS/roundend.dm b/code/__HELPERS/roundend.dm index 92b44389cf9a..8aa52fd5e81c 100644 --- a/code/__HELPERS/roundend.dm +++ b/code/__HELPERS/roundend.dm @@ -237,6 +237,7 @@ GLOBAL_LIST_INIT(round_end_images, world.file2list("data/image_urls.txt")) //Set news report and mode result mode.set_round_result() SSgamemode.round_end_report() + SSgamemode.store_roundend_data() // store data on roundend for next round to_chat(world, span_infoplain(span_big(span_bold("


The round has ended.")))) log_game("The round has ended.") diff --git a/monkestation/code/modules/storytellers/converted_events/_base_event.dm b/monkestation/code/modules/storytellers/converted_events/_base_event.dm index 40bd92c1d650..22b0e6a05f3b 100644 --- a/monkestation/code/modules/storytellers/converted_events/_base_event.dm +++ b/monkestation/code/modules/storytellers/converted_events/_base_event.dm @@ -1,5 +1,4 @@ /datum/round_event_control/antagonist - reoccurence_penalty_multiplier = 0 track = EVENT_TRACK_ROLESET ///list of required roles, needed for this to form var/list/exclusive_roles diff --git a/monkestation/code/modules/storytellers/converted_events/solo/bloodcult.dm b/monkestation/code/modules/storytellers/converted_events/solo/bloodcult.dm index e7af43c5cc90..07c2a4f7ffbb 100644 --- a/monkestation/code/modules/storytellers/converted_events/solo/bloodcult.dm +++ b/monkestation/code/modules/storytellers/converted_events/solo/bloodcult.dm @@ -31,6 +31,7 @@ min_players = 30 roundstart = TRUE earliest_start = 0 SECONDS + weight = 4 /datum/round_event/antagonist/solo/bloodcult excute_round_end_reports = TRUE diff --git a/monkestation/code/modules/storytellers/converted_events/solo/malf.dm b/monkestation/code/modules/storytellers/converted_events/solo/malf.dm index af4dd9c2e6df..50949b9f652f 100644 --- a/monkestation/code/modules/storytellers/converted_events/solo/malf.dm +++ b/monkestation/code/modules/storytellers/converted_events/solo/malf.dm @@ -12,7 +12,7 @@ ) exclusive_roles = list(JOB_AI) required_enemies = 4 - weight = 2 + weight = 4 /datum/round_event_control/antagonist/solo/malf/trim_candidates(list/candidates) for(var/mob/living/player in candidates) diff --git a/monkestation/code/modules/storytellers/converted_events/solo/nuclear_operative.dm b/monkestation/code/modules/storytellers/converted_events/solo/nuclear_operative.dm index ea6d2d3869c5..2f8b08b206b1 100644 --- a/monkestation/code/modules/storytellers/converted_events/solo/nuclear_operative.dm +++ b/monkestation/code/modules/storytellers/converted_events/solo/nuclear_operative.dm @@ -33,6 +33,7 @@ min_players = 35 roundstart = TRUE earliest_start = 0 SECONDS + weight = 4 /datum/round_event/antagonist/solo/nuclear_operative excute_round_end_reports = TRUE diff --git a/monkestation/code/modules/storytellers/converted_events/solo/revolutionary.dm b/monkestation/code/modules/storytellers/converted_events/solo/revolutionary.dm index 37a4f44ed0b3..a5110178f51f 100644 --- a/monkestation/code/modules/storytellers/converted_events/solo/revolutionary.dm +++ b/monkestation/code/modules/storytellers/converted_events/solo/revolutionary.dm @@ -32,6 +32,7 @@ min_players = 35 roundstart = TRUE earliest_start = 0 SECONDS + weight = 4 /datum/antagonist/rev/head/event_trigger remove_clumsy = TRUE diff --git a/monkestation/code/modules/storytellers/gamemode_subsystem.dm b/monkestation/code/modules/storytellers/gamemode_subsystem.dm index bd2b8e36ebc5..22161071bc5f 100644 --- a/monkestation/code/modules/storytellers/gamemode_subsystem.dm +++ b/monkestation/code/modules/storytellers/gamemode_subsystem.dm @@ -141,8 +141,10 @@ SUBSYSTEM_DEF(gamemode) var/wizardmode = FALSE + var/datum/round_event_control/current_roundstart_event var/list/last_round_events = list() var/ran_roundstart = FALSE + var/list/triggered_round_events = list() /datum/controller/subsystem/gamemode/Initialize(time, zlevel) // Populate event pools @@ -170,6 +172,8 @@ SUBSYSTEM_DEF(gamemode) continue event_pools[event.track] += event //Add it to the categorized event pools + load_roundstart_data() + // return ..() @@ -1088,3 +1092,27 @@ SUBSYSTEM_DEF(gamemode) if(!istype(event)) continue event.round_end_report() + + +/datum/controller/subsystem/gamemode/proc/store_roundend_data() + var/congealed_string = "" + for(var/event_name as anything in triggered_round_events) + congealed_string += event_name + congealed_string += "," + text2file(congealed_string, "data/last_round_events.txt") + +/datum/controller/subsystem/gamemode/proc/load_roundstart_data() + var/massive_string = trim(file2text("data/last_round_events.txt")) + if(fexists("data/last_round_events.txt")) + fdel("data/last_round_events.txt") + if(!massive_string) + return + last_round_events = splittext(massive_string, ",") + + if(!length(last_round_events)) + return + for(var/event_name as anything in last_round_events) + for(var/datum/round_event_control/listed as anything in control) + if(listed.name != event_name) + continue + listed.occurrences++ diff --git a/monkestation/code/modules/storytellers/storytellers/_storyteller.dm b/monkestation/code/modules/storytellers/storytellers/_storyteller.dm index bfddfdec5d20..a07988713dd6 100644 --- a/monkestation/code/modules/storytellers/storytellers/_storyteller.dm +++ b/monkestation/code/modules/storytellers/storytellers/_storyteller.dm @@ -138,9 +138,11 @@ if(bought_event.roundstart) if(!ignores_roundstart) SSgamemode.ran_roundstart = TRUE + SSgamemode.current_roundstart_event = bought_event mode.TriggerEvent(bought_event, forced) else mode.schedule_event(bought_event, (rand(3, 4) MINUTES), total_cost, _forced = forced) + SSgamemode.triggered_round_events |= bought_event.name /// Calculates the weights of the events from a passed track. /datum/storyteller/proc/calculate_weights(track)