diff --git a/code/game/gamemodes/dynamic/dynamic_rulesets_midround.dm b/code/game/gamemodes/dynamic/dynamic_rulesets_midround.dm index b3d937baf05..54195914233 100644 --- a/code/game/gamemodes/dynamic/dynamic_rulesets_midround.dm +++ b/code/game/gamemodes/dynamic/dynamic_rulesets_midround.dm @@ -749,23 +749,45 @@ /// Midround Space Pirates Ruleset (From Ghosts) /datum/dynamic_ruleset/midround/pirates name = "Space Pirates" + midround_ruleset_style = MIDROUND_RULESET_STYLE_LIGHT + antag_flag = "Space Pirates" + required_type = /mob/dead/observer + required_enemies = list(2,2,1,1,1,1,1,0,0,0) + required_candidates = 0 + weight = 3 + cost = 8 + minimum_players = 20 + repeatable = TRUE + +/datum/dynamic_ruleset/midround/pirates/acceptable(population=0, threat=0) + if (SSmapping.is_planetary() || GLOB.light_pirate_gangs.len == 0) + return FALSE + return ..() + +/datum/dynamic_ruleset/midround/pirates/execute() + send_pirate_threat(GLOB.light_pirate_gangs) + return ..() + +/// Dangerous Space Pirates ruleset +/datum/dynamic_ruleset/midround/dangerous_pirates + name = "Dangerous Space Pirates" midround_ruleset_style = MIDROUND_RULESET_STYLE_HEAVY antag_flag = "Space Pirates" required_type = /mob/dead/observer required_enemies = list(2,2,1,1,1,1,1,0,0,0) required_candidates = 0 - weight = 4 + weight = 3 cost = 8 - minimum_players = 27 + minimum_players = 25 repeatable = TRUE -/datum/dynamic_ruleset/midround/pirates/acceptable(population=0, threat=0) - if (SSmapping.is_planetary()) +/datum/dynamic_ruleset/midround/dangerous_pirates/acceptable(population=0, threat=0) + if (SSmapping.is_planetary() || GLOB.heavy_pirate_gangs.len == 0) return FALSE return ..() -/datum/dynamic_ruleset/midround/pirates/execute() - send_pirate_threat() +/datum/dynamic_ruleset/midround/dangerous_pirates/execute() + send_pirate_threat(GLOB.heavy_pirate_gangs) return ..() /// Midround Obsessed Ruleset (From Living) diff --git a/code/modules/antagonists/pirate/pirate_event.dm b/code/modules/antagonists/pirate/pirate_event.dm index f421b4dcc47..978dd5cf621 100644 --- a/code/modules/antagonists/pirate/pirate_event.dm +++ b/code/modules/antagonists/pirate/pirate_event.dm @@ -17,14 +17,17 @@ /datum/round_event/pirates ///admin chosen pirate team - var/datum/pirate_gang/chosen_gang + var/list/datum/pirate_gang/gang_list /datum/round_event/pirates/start() - send_pirate_threat(chosen_gang) + send_pirate_threat(gang_list) -/proc/send_pirate_threat(datum/pirate_gang/chosen_gang) +/proc/send_pirate_threat(list/pirate_selection) + var/datum/pirate_gang/chosen_gang = pick_n_take(pirate_selection) + ///If there was nothing to pull from our requested list, stop here. if(!chosen_gang) - chosen_gang = pick_n_take(GLOB.pirate_gangs) + message_admins("Error attempting to run the space pirate event, as the given pirate gangs list was empty.") + return //set payoff var/payoff = 0 var/datum/bank_account/account = SSeconomy.get_dep_account(ACCOUNT_CAR) @@ -90,6 +93,6 @@ /datum/event_admin_setup/listed_options/pirates/apply_to_event(datum/round_event/pirates/event) if(isnull(chosen)) - event.chosen_gang = null + event.gang_list = GLOB.light_pirate_gangs + GLOB.heavy_pirate_gangs else - event.chosen_gang = new chosen + event.gang_list = list(new chosen) diff --git a/code/modules/antagonists/pirate/pirate_gangs.dm b/code/modules/antagonists/pirate/pirate_gangs.dm index f7f7b95dc7f..41d34b0c92b 100644 --- a/code/modules/antagonists/pirate/pirate_gangs.dm +++ b/code/modules/antagonists/pirate/pirate_gangs.dm @@ -1,15 +1,16 @@ -///global list of all pirate gangs that can show up today. these will be taken out of the global list as spawned so dupes cannot spawn. -GLOBAL_LIST_INIT(pirate_gangs, init_pirate_gangs()) +///global lists of all pirate gangs that can show up today. they will be taken out of the global lists as spawned so dupes cannot spawn. +GLOBAL_LIST_INIT(light_pirate_gangs, init_pirate_gangs(is_heavy = FALSE)) +GLOBAL_LIST_INIT(heavy_pirate_gangs, init_pirate_gangs(is_heavy = TRUE)) ///initializes the pirate gangs glob list, adding all subtypes that can roll today. -/proc/init_pirate_gangs() +/proc/init_pirate_gangs(is_heavy) var/list/pirate_gangs = list() for(var/type in subtypesof(/datum/pirate_gang)) var/datum/pirate_gang/possible_gang = new type if(!possible_gang.can_roll()) qdel(possible_gang) - else + else if(possible_gang.is_heavy_threat == is_heavy) pirate_gangs += possible_gang return pirate_gangs @@ -18,6 +19,8 @@ GLOBAL_LIST_INIT(pirate_gangs, init_pirate_gangs()) ///name of this gang, for spawning feedback var/name = "Space Bugs" + ///Whether or not this pirate crew is a heavy-level threat + var/is_heavy_threat = FALSE ///the random ship name chosen from pirates.json var/ship_name ///the ship they load in on. @@ -97,6 +100,7 @@ GLOBAL_LIST_INIT(pirate_gangs, init_pirate_gangs()) /datum/pirate_gang/skeletons name = "Skeleton Pirates" + is_heavy_threat = TRUE ship_template_id = "dutchman" ship_name_pool = "skeleton_names" //just points to THE ONE AND ONLY