From 41f9ebc80a76db6d1733dd651cca785c3c4e5d2a Mon Sep 17 00:00:00 2001 From: JaySparrow Date: Sun, 8 Nov 2020 13:56:58 -0600 Subject: [PATCH] Dynamic tweaks And a couple bugfixes. Heart attacks only target the station z level. Diseases now only spawn once. --- .../gamemodes/dynamic/dynamic_rulesets.dm | 2 +- .../dynamic/dynamic_rulesets_events.dm | 169 +++++------------- .../dynamic/dynamic_rulesets_midround.dm | 4 +- .../dynamic/dynamic_rulesets_roundstart.dm | 21 +-- code/modules/events/heart_attack.dm | 2 +- 5 files changed, 49 insertions(+), 149 deletions(-) diff --git a/code/game/gamemodes/dynamic/dynamic_rulesets.dm b/code/game/gamemodes/dynamic/dynamic_rulesets.dm index b1e115b0..fa944b17 100644 --- a/code/game/gamemodes/dynamic/dynamic_rulesets.dm +++ b/code/game/gamemodes/dynamic/dynamic_rulesets.dm @@ -27,7 +27,7 @@ var/list/exclusive_roles = list() /// If set, there needs to be a certain amount of players doing those roles (among the players who won't be drafted) for the rule to be drafted IMPORTANT: DOES NOT WORK ON ROUNDSTART RULESETS. var/list/enemy_roles = list() - /// If enemy_roles was set, this is the amount of enemy job workers needed per GLOB.dynamic_chaos_level range (0-0.5, 0.5-1.0) IMPORTANT: DOES NOT WORK ON ROUNDSTART RULESETS. + /// If enemy_roles was set, this is the amount of enemy job workers needed per threat_level range (0-10,10-20,etc) IMPORTANT: DOES NOT WORK ON ROUNDSTART RULESETS. var/required_enemies = list(1,1,0,0,0,0,0,0,0,0) /// The rule needs this many candidates (post-trimming) to be executed (example: Cult needs 4 players at round start) var/required_candidates = 0 diff --git a/code/game/gamemodes/dynamic/dynamic_rulesets_events.dm b/code/game/gamemodes/dynamic/dynamic_rulesets_events.dm index c5dbea95..9b489fab 100644 --- a/code/game/gamemodes/dynamic/dynamic_rulesets_events.dm +++ b/code/game/gamemodes/dynamic/dynamic_rulesets_events.dm @@ -26,9 +26,8 @@ continue // Dead players cannot count as opponents if (M.mind && M.mind.assigned_role && (M.mind.assigned_role in enemy_roles) && (!(M in candidates) || (M.mind.assigned_role in restricted_roles))) job_check++ // Checking for "enemies" (such as sec officers). To be counters, they must either not be candidates to that rule, or have a job that restricts them from it - - var/chaos = min(max(round(GLOB.dynamic_chaos_level * 2), 0), 9) - if (job_check < required_enemies[chaos]) + var/threat = max(min(round(mode.threat_level/10),9),1) //min() to stop index errors at 100 threat //Max to stop breaking at 0 threat. + if (job_check < required_enemies[threat]) return FALSE return ..() @@ -104,7 +103,7 @@ typepath = /datum/round_event/pirates antag_flag = ROLE_TRAITOR enemy_roles = list("AI","Security Officer","Head of Security","Captain") - required_enemies = list(2,2,2,2,1,1,1,1,0,0) + required_enemies = list(3,3,2,2,2,1,1,1,1,0) weight = 3 cost = 0 earliest_start = 50 MINUTES @@ -120,82 +119,6 @@ return FALSE return ..() -/* //not currently functional -////////////////////////////////////////// -// // -// LEWD // -// // -////////////////////////////////////////// - -//Might move this to midround antags, but I don't want it messing with the weights of regular antags right now -//Only drops one horny antag at a time anyways - -/datum/dynamic_ruleset/event/lewd - name = "Horny Traitor" - //config_tag = "pirates" - //typepath = /datum/round_event/pirates - antag_flag = ROLE_LEWD_TRAITOR - antag_datum = /datum/antagonist/traitor/lewd - enemy_roles = list() - required_enemies = list(0,0,0,0,0,0,0,0,0,0) - protected_roles = list("AI","Cyborg") - restricted_roles = list("Cyborg","AI") - weight = 300 //JAY CHANGE THIS WHEN YOU ARE DONE TESTING - cost = 0 - earliest_start = 50 MINUTES - //blocking_rules = list(/datum/dynamic_ruleset/roundstart/nuclear,/datum/dynamic_ruleset/midround/from_ghosts/nuclear) - requirements = list(10,10,10,10,10,10,10,10,10,10) - high_population_requirement = 10 - occurances_max = 2 - chaos_min = 0 - chaos_max = 2.5 - minimum_required_age = 7 - admin_required = TRUE - var/list/mob/living/carbon/human/lewd_candidates = list() - var/list/mob/living/carbon/human/targets = list() - var/num_lewd_traitors = 1 //The number of lewds to drop in - var/numTraitors = 0 //Variable for later. Don't touch. - earliest_start = 0 MINUTES - - -/datum/dynamic_ruleset/event/lewd/ready(forced = FALSE) - //to_chat(GLOB.admins, "makeLewd_traitors called") - //var/datum/game_mode/traitor/lewd/temp = new - - //if(CONFIG_GET(flag/protect_roles_from_antagonist)) - //continue - - //if(CONFIG_GET(flag/protect_assistant_from_antagonist)) - //continue - - //var/mob/living/carbon/human/T = null - - for(var/mob/living/carbon/human/target in CURRENT_LIVING_PLAYERS) - if(target.client.prefs.noncon) - if(!(target.job in restricted_roles)) - targets += target - - if(lewd_candidates.len) - numTraitors = min(candidates.len, targets.len, num_lewd_traitors) - if(numTraitors == 0) - to_chat(GLOB.admins, "No lewd traitors created. Are there any valid targets?") - return 0 - return ..() - - - return 0 - - -/datum/dynamic_ruleset/event/lewd/execute(forced = FALSE) - var/mob/living/carbon/human/H = null - if(numTraitors) - for(var/i = 0, i 15 && mode.threat > 15 && prob(30)) name = "Clogged Vents: Catastrophic" cost = 15 - required_enemies = list(4,4,4,3,3,3,2,1,1,0) + required_enemies = list(4,4,4,3,3,3,2,1,1,1) typepath = /datum/round_event/vent_clog/catastrophic chaos_min = 1.8 else @@ -293,12 +216,12 @@ //config_tag = "meteor_wave" typepath = /datum/round_event/meteor_wave enemy_roles = list("Chief Engineer","Station Engineer","Atmospheric Technician","Captain","Cyborg") - required_enemies = list(2,2,2,2,2,1,1,1,0,0) + required_enemies = list(2,2,2,2,2,2,2,2,1,1) cost = 0 weight = 2 earliest_start = 45 MINUTES repeatable_weight_decrease = 2 - requirements = list(101,101,15,15,15,15,15,15,10,10) + requirements = list(101,101,25,25,20,20,15,15,10,10) high_population_requirement = 30 //property_weights = list("extended" = -2) occurances_max = 2 @@ -315,14 +238,14 @@ name = "Meteor Wave: Catastrophic" cost = 10 typepath = /datum/round_event/meteor_wave/catastrophic - required_enemies = list(3,3,3,3,3,2,2,1,1,0) + required_enemies = list(3,3,3,3,3,2,2,2,2,2) requirements = list(101,101,40,30,30,30,30,30,30,30) chaos_min = 2.0 else name = "Meteor Wave: Normal" cost = 5 typepath = /datum/round_event/meteor_wave - chaos_min = 1.2 + chaos_min = 1.5 required_enemies = list(2,2,2,2,1,1,1,1,0,0) return ..() @@ -338,11 +261,11 @@ typepath = /datum/round_event/anomaly/anomaly_bluespace enemy_roles = list("Chief Engineer","Station Engineer","Atmospheric Technician","Research Director","Scientist","Captain") required_enemies = list(2,2,2,1,1,1,1,1,1,0) - weight = 3 + weight = 2 earliest_start = 20 MINUTES repeatable_weight_decrease = 2 cost = 0 - requirements = list(101,101,5,5,5,5,5,5,5,5) + requirements = list(101,101,10,5,5,5,5,5,5,5) high_population_requirement = 5 repeatable = TRUE //property_weights = list("extended" = 1) @@ -358,8 +281,8 @@ weight = 3 earliest_start = 20 MINUTES repeatable_weight_decrease = 2 - cost = 3 - requirements = list(101,5,5,5,5,5,5,5,5,5) + cost = 2 + requirements = list(101,101,10,5,5,5,5,5,5,5) high_population_requirement = 10 repeatable = TRUE //property_weights = list("extended" = 1) @@ -370,10 +293,10 @@ name = "Anomaly: Gravitational" //config_tag = "anomaly_gravitational" typepath = /datum/round_event/anomaly/anomaly_grav - weight = 4 + weight = 3 repeatable_weight_decrease = 1 cost = 0 - requirements = list(5,4,3,2,1,0,0,0,0,0) + requirements = list(101,4,3,2,1,0,0,0,0,0) high_population_requirement = 5 repeatable = TRUE //property_weights = list("extended" = 1) @@ -407,7 +330,7 @@ cost = 0 enemy_roles = list("Chief Engineer","Station Engineer","Atmospheric Technician","Research Director","Scientist","Captain","Cyborg") required_enemies = list(3,3,3,2,2,2,2,2,2,0) - requirements = list(101,101,10,10,10,10,10,10,10,10) + requirements = list(101,101,101,10,10,10,10,10,10,10) high_population_requirement = 10 repeatable = TRUE //property_weights = list("extended" = 1) @@ -427,7 +350,7 @@ required_enemies = list(0,0,0,0,0,0,0,0,0,0) weight = 0 //This is changed in nuclearbomb.dm occurances_max = 1 - requirements = list(10,5,0,0,0,0,0,0,0,0) //SECURE THAT DISK + requirements = list(10,10,10,10,10,10,10,10,10,10) //SECURE THAT DISK cost = 50 chaos_min = 0.5 @@ -457,7 +380,7 @@ repeatable_weight_decrease = 1 cost = 0 enemy_roles = list("Chief Engineer","Station Engineer","Atmospheric Technician","Research Director","Scientist","Captain","Cyborg") - required_enemies = list(2,1,1,1,1,1,0,0,0,0) + required_enemies = list(3,2,2,2,1,1,1,0,0,0) requirements = list(101,25,20,15,15,15,10,10,10,10) high_population_requirement = 10 repeatable = TRUE @@ -469,10 +392,10 @@ name = "Carp Migration" //config_tag = "carp_migration" typepath = /datum/round_event/carp_migration - weight = 5 - repeatable_weight_decrease = 3 + weight = 4 + repeatable_weight_decrease = 2 cost = 4 - requirements = list(101,5,5,1,1,1,1,1,1,1) + requirements = list(101,5,5,5,5,1,1,1,1,1) high_population_requirement = 10 earliest_start = 10 MINUTES repeatable = TRUE @@ -563,8 +486,8 @@ weight = 2 earliest_start = 30 MINUTES repeatable_weight_decrease = 1 - enemy_roles = list("Medical Doctor","Chief Medical Officer") - required_enemies = list(2,2,2,2,2,2,2,2,2,0) + enemy_roles = list("Medical Doctor","Chief Medical Officer", "Chemist") + required_enemies = list(3,3,2,2,2,2,2,2,2,1) requirements = list(101,101,101,10,5,5,5,5,5,5) high_population_requirement = 5 repeatable = TRUE @@ -579,7 +502,7 @@ weight = 2 repeatable_weight_decrease = 2 enemy_roles = list("Chemist","Chief Medical Officer","Geneticist","Medical Doctor","AI","Captain") - required_enemies = list(1,1,1,1,1,1,1,1,1,0) + required_enemies = list(2,2,2,2,1,1,1,1,1,0) requirements = list(5,5,5,5,5,5,5,5,5,5) high_population_requirement = 5 //property_weights = list("extended" = 1,"chaos" = 1) @@ -592,13 +515,13 @@ cost = 0 weight = 1 enemy_roles = list("Head of Security","Security Officer","AI","Captain","Shaft Miner") - required_enemies = list(2,2,2,2,2,2,2,2,2,0) + required_enemies = list(2,2,2,2,2,2,2,2,2,2) requirements = list(101,101,40,35,30,30,30,30,25,20) high_population_requirement = 30 earliest_start = 40 MINUTES //property_weights = list("teamwork" = 1,"chaos" = 1, "extended" = -1) occurances_max = 1 - chaos_min = 1.0 + chaos_min = 1.3 /datum/dynamic_ruleset/event/wormholes @@ -624,12 +547,12 @@ weight = 1 earliest_start = 40 MINUTES enemy_roles = list("AI","Security Officer","Head of Security","Captain","Station Engineer","Atmos Technician","Chief Engineer") - required_enemies = list(4,4,4,4,3,3,3,3,2,0) + required_enemies = list(4,4,4,4,3,3,3,3,2,2) requirements = list(101,101,50,40,40,40,40,35,30,30) high_population_requirement = 5 //property_weights = list("extended" = -2) occurances_max = 1 - chaos_min = 2.0 + chaos_min = 1.5 /datum/dynamic_ruleset/event/sentient_disease name = "Sentient Disease" @@ -640,7 +563,7 @@ required_candidates = 1 weight = 4 cost = -5 - requirements = list(101,30,20,20,15,10,10,10,10,5) // yes, it can even happen in "extended"! + requirements = list(101,101,20,20,15,10,10,10,10,5) // yes, it can even happen in "extended"! //property_weights = list("story_potential" = 1, "extended" = 1, "valid" = -2) high_population_requirement = 5 occurances_max = 1 @@ -655,7 +578,7 @@ required_candidates = 1 weight = 4 cost = 5 - requirements = list(101,30,27,24,21,18,15,15,10,10) + requirements = list(101,101,23,21,18,18,15,15,10,10) high_population_requirement = 15 //property_weights = list("story_potential" = -2, "extended" = -1) occurances_max = 1 //Skyrat change. @@ -667,7 +590,7 @@ typepath = /datum/round_event/immovable_rod enemy_roles = list("Research Director","Chief Engineer","Station Engineer","Captain","Chaplain","AI") required_enemies = list(2,2,2,2,2,2,1,1,1,0) - requirements = list(101,101,18,16,14,12,10,8,6,6) + requirements = list(101,101,20,18,16,14,12,10,8,6) high_population_requirement = 15 cost = 0 occurances_max = 2 @@ -741,29 +664,16 @@ repeatable = TRUE occurances_max = 2 -/datum/dynamic_ruleset/event/disease_outbreak/execute() //I do not know why this is necessary - var/datum/round_event_control/E = locate(/datum/round_event_control/disease_outbreak) in SSevents.control - var/datum/round_event/event = E.runEvent() //But it is. - event.announceWhen = -1 //So it isn't double announced. - return ..() - -/datum/dynamic_ruleset/event/falsealarm //I THINK IT WORKS +/datum/dynamic_ruleset/event/falsealarm name = "False Alarm" controller = /datum/round_event_control/falsealarm typepath = /datum/round_event/falsealarm - requirements = list(0,0,0,0,0,0,0,0,0,0) + requirements = list(5,5,5,5,5,5,5,5,5,5) //Tell me lieeeess high_population_requirement = 0 weight = 5 repeatable = TRUE occurances_max = 5 -///datum/dynamic_ruleset/event/falsealarm/execute() //I do not know why this is necessary - //var/datum/round_event_control/E = locate(/datum/round_event_control/falsealarm) in SSevents.control - //var/datum/round_event/event = E.runEvent() - //event.announceWhen = -1 //So it isn't double announced. - //E.runEvent() - //return ..() - /datum/dynamic_ruleset/event/grid_check name = "Grid Check" typepath = /datum/round_event/grid_check @@ -801,7 +711,7 @@ typepath = /datum/round_event/grey_tide enemy_roles = list("Chief Engineer","Station Engineer","Captain","Atmospheric Technician","AI","Cyborg") required_enemies = list(3,2,2,2,2,2,1,1,1,0) - requirements = list(101,101,5,5,5,5,5,5,5,5) + requirements = list(101,101,101,5,5,5,5,5,5,5) high_population_requirement = 0 repeatable = TRUE weight = 4 @@ -813,7 +723,8 @@ typepath = /datum/round_event/ghost_role/sentience requirements = list(101,101,0,0,0,0,0,0,0,0) high_population_requirement = 0 - weight = 1 + weight = 5 + repeatable_weight_decrease = 1 /datum/dynamic_ruleset/event/shuttle_loan name = "Shuttle Loan" @@ -844,8 +755,8 @@ /datum/dynamic_ruleset/event/spontaneous_appendicitis name = "Spontaneous Appendicitis" typepath = /datum/round_event/spontaneous_appendicitis - enemy_roles = list("Medical Doctor","Chief Medical Officer") - required_enemies = list(2,2,1,1,1,1,1,1,1,0) + enemy_roles = list("Medical Doctor","Chief Medical Officer","Roboticist") + required_enemies = list(2,2,2,2,2,2,2,1,1,1) requirements = list(5,5,5,5,5,5,5,5,0,0) high_population_requirement = 5 weight = 5 diff --git a/code/game/gamemodes/dynamic/dynamic_rulesets_midround.dm b/code/game/gamemodes/dynamic/dynamic_rulesets_midround.dm index 8aaab0cb..65afdc7c 100644 --- a/code/game/gamemodes/dynamic/dynamic_rulesets_midround.dm +++ b/code/game/gamemodes/dynamic/dynamic_rulesets_midround.dm @@ -282,8 +282,8 @@ antag_flag = ROLE_LEWD_TRAITOR antag_datum = /datum/antagonist/traitor/lewd //minimum_required_age = 7 - protected_roles = list("AI","Cyborg") - restricted_roles = list("Cyborg","AI") + protected_roles = list("AI","Cyborg", "Positronic Brain") + restricted_roles = list("Cyborg","AI", "Positronic Brain") required_candidates = 1 weight = 2 cost = 0 diff --git a/code/game/gamemodes/dynamic/dynamic_rulesets_roundstart.dm b/code/game/gamemodes/dynamic/dynamic_rulesets_roundstart.dm index f6c90a90..5d55c210 100644 --- a/code/game/gamemodes/dynamic/dynamic_rulesets_roundstart.dm +++ b/code/game/gamemodes/dynamic/dynamic_rulesets_roundstart.dm @@ -16,7 +16,7 @@ required_candidates = 1 weight = 5 cost = 10 - requirements = list(101,40,30,25,20,20,15,15,15,15) + requirements = list(101,101,30,25,20,20,15,15,15,15) high_population_requirement = 10 var/autotraitor_cooldown = 450 // 15 minutes (ticks once per 2 sec) chaos_min = 2.5 @@ -31,9 +31,9 @@ //protected_roles = list("Security Officer", "Warden", "Detective", "Head of Security", "Captain", "Head of Personnel", "Chief Engineer", "Chief Medical Officer", "Research Director", "Cyborg") restricted_roles = list("Cyborg") //required_candidates = 1 - //weight = 5 + weight = 5 cost = 0 - requirements = list(101,25,25,20,20,15,15,10,10,5) + requirements = list(101,25,25,20,20,15,15,10,10,10) high_population_requirement = 10 //var/autotraitor_cooldown = 450 // 15 minutes (ticks once per 2 sec) chaos_min = 2.0 @@ -76,9 +76,9 @@ protected_roles = list("AI","Cyborg") restricted_roles = list("Cyborg","AI") required_candidates = 1 - weight = 3 + weight = 2 cost = 0 - requirements = list(101,10,10,10,10,10,10,10,10,10) + requirements = list(10,10,10,10,10,10,10,10,10,10) high_population_requirement = 10 chaos_min = 0.1 chaos_max = 2.5 @@ -115,17 +115,6 @@ M.mind.restricted_roles = restricted_roles return TRUE -/* -/datum/dynamic_ruleset/roundstart/traitor/lewd/execute() - var/datum/mind/M = null - if(numTraitors) - for(var/i = 0, i