fixeronis.

This commit is contained in:
Ghommie
2019-11-10 06:41:42 +01:00
parent 3ddbee8878
commit 03da6d6960
4 changed files with 38 additions and 38 deletions
+21 -21
View File
@@ -2,21 +2,21 @@
/// For admin logging and round end screen.
var/name = ""
/// For admin logging and round end screen, do not change this unless making a new rule type.
var/ruletype = ""
var/ruletype = ""
/// For config purposes, similar to config_tag for secret game modes.
var/config_tag = null
/// If set to TRUE, the rule won't be discarded after being executed, and dynamic will call rule_process() every time it ticks.
var/persistent = FALSE
var/persistent = FALSE
/// If set to TRUE, dynamic mode will be able to draft this ruleset again later on. (doesn't apply for roundstart rules)
var/repeatable = FALSE
var/repeatable = FALSE
/// If set higher than 0 decreases weight by itself causing the ruleset to appear less often the more it is repeated.
var/repeatable_weight_decrease = 2
var/repeatable_weight_decrease = 2
/// List of players that are being drafted for this rule
var/list/mob/candidates = list()
var/list/mob/candidates = list()
/// List of players that were selected for this rule
var/list/datum/mind/assigned = list()
var/list/datum/mind/assigned = list()
/// Preferences flag such as ROLE_WIZARD that need to be turned on for players to be antag
var/antag_flag = null
var/antag_flag = null
/// The antagonist datum that is assigned to the mobs mind on ruleset execution.
var/datum/antagonist/antag_datum = null
/// The required minimum account age for this ruleset.
@@ -24,19 +24,19 @@
/// If set, and config flag protect_roles_from_antagonist is false, then the rule will not pick players from these roles.
var/list/protected_roles = list()
/// If set, rule will deny candidates from those roles always.
var/list/restricted_roles = list()
var/list/restricted_roles = list()
/// If set, rule will only accept candidates from those roles, IMPORTANT: DOES NOT WORK ON ROUNDSTART RULESETS.
var/list/exclusive_roles = list()
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()
var/list/enemy_roles = list()
/// 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)
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
var/required_candidates = 0
/// 1 -> 9, probability for this rule to be picked against other rules
var/weight = 5
var/weight = 5
/// Threat cost for this rule, this is decreased from the mode's threat when the rule is executed.
var/cost = 0
var/cost = 0
/// A flag that determines how the ruleset is handled
/// HIGHLANDER_RULESET are rulesets can end the round.
/// TRAITOR_RULESET and MINOR_RULESET can't end the round and have no difference right now.
@@ -46,18 +46,18 @@
/// Requirements are the threat level requirements per pop range.
/// With the default values, The rule will never get drafted below 10 threat level (aka: "peaceful extended"), and it requires a higher threat level at lower pops.
var/list/requirements = list(40,30,20,10,10,10,10,10,10,10)
/// An alternative, static requirement used instead when pop is over mode's high_pop_limit.
/// An alternative, static requirement used instead when pop is over mode's high_pop_limit.
var/high_population_requirement = 10
/// Reference to the mode, use this instead of SSticker.mode.
var/datum/game_mode/dynamic/mode = null
/// If a role is to be considered another for the purpose of banning.
var/antag_flag_override = null
var/antag_flag_override = null
/// If a ruleset type which is in this list has been executed, then the ruleset will not be executed.
var/list/blocking_rules = list()
/// The minimum amount of players required for the rule to be considered.
/// The minimum amount of players required for the rule to be considered.
var/minimum_players = 0
/// The maximum amount of players required for the rule to be considered.
/// Anything below zero or exactly zero is ignored.
/// Anything below zero or exactly zero is ignored.
var/maximum_players = 0
@@ -105,7 +105,7 @@
return (threat_level >= high_population_requirement)
else
pop_per_requirement = pop_per_requirement > 0 ? pop_per_requirement : mode.pop_per_requirement
var/indice_pop = min(10,round(population/pop_per_requirement)+1)
var/indice_pop = min(requirements.len,round(population/pop_per_requirement)+1)
return (threat_level >= requirements[indice_pop])
/// This is called if persistent variable is true everytime SSTicker ticks.
@@ -128,8 +128,8 @@
/// Here you can perform any additional checks you want. (such as checking the map etc)
/// Remember that on roundstart no one knows what their job is at this point.
/// IMPORTANT: If ready() returns TRUE, that means pre_execute() or execute() should never fail!
/datum/dynamic_ruleset/proc/ready(forced = 0)
if (required_candidates > candidates.len)
/datum/dynamic_ruleset/proc/ready(forced = 0)
if (required_candidates > candidates.len)
return FALSE
return TRUE
@@ -17,7 +17,7 @@
candidates.Remove(P)
continue
else
if(!antag_flag in P.client.prefs.be_special || is_banned_from(P.ckey, list(antag_flag, ROLE_SYNDICATE)))
if(!(antag_flag in P.client.prefs.be_special) || is_banned_from(P.ckey, list(antag_flag, ROLE_SYNDICATE)))
candidates.Remove(P)
continue
if (P.mind.assigned_role in restricted_roles) // Does their job allow for it?
@@ -44,7 +44,7 @@
candidates.Remove(M)
continue
else
if(!antag_flag in M.client.prefs.be_special || is_banned_from(M.ckey, list(antag_flag, ROLE_SYNDICATE)))
if(!(antag_flag in M.client.prefs.be_special) || is_banned_from(M.ckey, list(antag_flag, ROLE_SYNDICATE)))
candidates.Remove(M)
continue
if (M.mind)
@@ -317,14 +317,14 @@
cost = 35
requirements = list(90,90,90,80,60,40,30,20,10,10)
high_population_requirement = 10
var/operative_cap = list(2,2,3,3,4,5,5,5,5,5)
var/list/operative_cap = list(2,2,3,3,4,5,5,5,5,5)
var/datum/team/nuclear/nuke_team
flags = HIGHLANDER_RULESET
/datum/dynamic_ruleset/midround/from_ghosts/nuclear/acceptable(population=0, threat=0)
if (locate(/datum/dynamic_ruleset/roundstart/nuclear) in mode.executed_rules)
return FALSE // Unavailable if nuke ops were already sent at roundstart
var/indice_pop = min(10,round(living_players.len/5)+1)
var/indice_pop = min(operative_cap.len, round(living_players.len/5)+1)
required_candidates = operative_cap[indice_pop]
return ..()
@@ -123,7 +123,7 @@
/datum/dynamic_ruleset/roundstart/changeling/execute()
var/team_mode = FALSE
if(prob(team_mode_probability))
if(prob(team_mode_probability))
team_mode = TRUE
var/list/team_objectives = subtypesof(/datum/objective/changeling_team_objective)
var/list/possible_team_objectives = list()
@@ -171,13 +171,13 @@
/datum/dynamic_ruleset/roundstart/wizard/pre_execute()
if(GLOB.wizardstart.len == 0)
return FALSE
var/mob/M = pick_n_take(candidates)
if (M)
assigned += M.mind
M.mind.assigned_role = ROLE_WIZARD
M.mind.special_role = ROLE_WIZARD
return TRUE
/datum/dynamic_ruleset/roundstart/wizard/execute()
@@ -185,7 +185,7 @@
M.current.forceMove(pick(GLOB.wizardstart))
M.add_antag_datum(new antag_datum())
return TRUE
//////////////////////////////////////////////
// //
// BLOOD CULT //
@@ -207,16 +207,16 @@
high_population_requirement = 10
pop_per_requirement = 5
flags = HIGHLANDER_RULESET
var/cultist_cap = list(2,2,2,3,3,4,4,4,4,4)
var/list/cultist_cap = list(2,2,2,3,3,4,4,4,4,4)
var/datum/team/cult/main_cult
/datum/dynamic_ruleset/roundstart/bloodcult/ready(forced = FALSE)
var/indice_pop = min(10,round(mode.roundstart_pop_ready/pop_per_requirement)+1)
var/indice_pop = min(cultist_cap.len, round(mode.roundstart_pop_ready/pop_per_requirement)+1)
required_candidates = cultist_cap[indice_pop]
. = ..()
/datum/dynamic_ruleset/roundstart/bloodcult/pre_execute()
var/indice_pop = min(10,round(mode.roundstart_pop_ready/pop_per_requirement)+1)
var/indice_pop = min(cultist_cap.len, round(mode.roundstart_pop_ready/pop_per_requirement)+1)
var/cultists = cultist_cap[indice_pop]
for(var/cultists_number = 1 to cultists)
if(candidates.len <= 0)
@@ -233,7 +233,7 @@
var/datum/antagonist/cult/new_cultist = new antag_datum()
new_cultist.cult_team = main_cult
new_cultist.give_equipment = TRUE
M.add_antag_datum(new_cultist)
M.add_antag_datum(new_cultist)
main_cult.setup_objectives()
return TRUE
@@ -267,18 +267,18 @@
high_population_requirement = 10
pop_per_requirement = 5
flags = HIGHLANDER_RULESET
var/operative_cap = list(2,2,2,3,3,3,4,4,5,5)
var/list/operative_cap = list(2,2,2,3,3,3,4,4,5,5)
var/datum/team/nuclear/nuke_team
/datum/dynamic_ruleset/roundstart/nuclear/ready(forced = FALSE)
var/indice_pop = min(10,round(mode.roundstart_pop_ready/pop_per_requirement)+1)
var/indice_pop = min(operative_cap.len,round(mode.roundstart_pop_ready/pop_per_requirement)+1)
required_candidates = operative_cap[indice_pop]
. = ..()
/datum/dynamic_ruleset/roundstart/nuclear/pre_execute()
// If ready() did its job, candidates should have 5 or more members in it
var/indice_pop = min(10,round(mode.roundstart_pop_ready/5)+1)
var/indice_pop = min(operative_cap.len, round(mode.roundstart_pop_ready/5)+1)
var/operatives = operative_cap[indice_pop]
for(var/operatives_number = 1 to operatives)
if(candidates.len <= 0)
@@ -385,7 +385,7 @@
revolution.update_heads()
SSshuttle.registerHostileEnvironment(src)
return TRUE
/datum/dynamic_ruleset/roundstart/revs/rule_process()
if(check_rev_victory())
finished = 1
@@ -599,7 +599,7 @@
high_population_requirement = 101
var/devil_limit = 4 // Hard limit on devils if scaling is turned off
/datum/dynamic_ruleset/roundstart/devil/pre_execute()
/datum/dynamic_ruleset/roundstart/devil/pre_execute()
var/tsc = CONFIG_GET(number/traitor_scaling_coeff)
var/num_devils = 1