mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-24 04:27:35 +01:00
Gamemode configuration
This commit is contained in:
@@ -18,18 +18,12 @@
|
||||
var/vote_no_default = 0 // vote does not default to nochange/norestart (tbi)
|
||||
var/vote_no_dead = 0 // dead people can't vote (tbi)
|
||||
// var/enable_authentication = 0 // goon authentication
|
||||
var/traitor_scaling = 0 //if amount of traitors scales based on amount of players
|
||||
var/protect_roles_from_antagonist = 0// If security and such can be tratior/cult/other
|
||||
var/continuous_rounds = 0 // Gamemodes which end instantly will instead keep on going until the round ends by escape shuttle or nuke.
|
||||
var/allow_Metadata = 0 // Metadata is supported.
|
||||
var/popup_admin_pm = 0 //adminPMs to non-admins show in a pop-up 'reply' window when set to 1.
|
||||
var/list/resource_urls = null
|
||||
var/antag_hud_allowed = 0 // Ghosts can turn on Antagovision to see a HUD of who is the bad guys this round.
|
||||
var/antag_hud_restricted = 0 // Ghosts that turn on Antagovision cannot rejoin the round.
|
||||
var/list/mode_names = list()
|
||||
var/list/modes = list() // allowed modes
|
||||
var/list/votable_modes = list() // votable modes
|
||||
var/list/probabilities = list() // relative probability of each mode
|
||||
|
||||
var/respawn = 0
|
||||
var/guest_jobban = 1
|
||||
var/panic_bunker_threshold = 150 // above this player count threshold, never-before-seen players are blocked from connecting
|
||||
@@ -46,16 +40,10 @@
|
||||
|
||||
var/list_afk_minimum = 5 // How long people have to be AFK before it's listed on the "List AFK players" verb
|
||||
|
||||
var/traitor_objectives_amount = 2
|
||||
var/shadowling_max_age = 0
|
||||
|
||||
var/max_maint_drones = 5 //This many drones can spawn,
|
||||
var/allow_drone_spawn = 1 //assuming the admin allow them to.
|
||||
var/drone_build_time = 1200 //A drone will become available every X ticks since last drone spawn. Default is 2 minutes.
|
||||
|
||||
var/usealienwhitelist = 0
|
||||
var/limitalienplayers = 0
|
||||
|
||||
var/server
|
||||
var/banappeals
|
||||
var/wikiurl = "http://example.org"
|
||||
@@ -109,7 +97,6 @@
|
||||
var/forum_playerinfo_url
|
||||
|
||||
var/ban_legacy_system = 0 //Defines whether the server uses the legacy banning system with the files in /data or the SQL system. Config option in config.txt
|
||||
var/use_age_restriction_for_antags = 0 //Do antags use account age restrictions? --requires database
|
||||
|
||||
var/simultaneous_pm_warning_timeout = 100
|
||||
|
||||
@@ -151,9 +138,6 @@
|
||||
//cube monkey limit
|
||||
var/cubemonkeycap = 20
|
||||
|
||||
// Makes gamemodes respect player limits
|
||||
var/enable_gamemode_player_limit = 0
|
||||
|
||||
/// BYOND account age limit for notifcations of new accounts (Any accounts older than this value will not send notifications on first join)
|
||||
var/byond_account_age_threshold = 7
|
||||
|
||||
@@ -166,19 +150,6 @@
|
||||
/// Enable auto profiler of rounds
|
||||
var/auto_profile = FALSE
|
||||
|
||||
/datum/configuration/New()
|
||||
for(var/T in subtypesof(/datum/game_mode))
|
||||
var/datum/game_mode/M = T
|
||||
|
||||
if(initial(M.config_tag))
|
||||
if(!(initial(M.config_tag) in modes)) // ensure each mode is added only once
|
||||
src.modes += initial(M.config_tag)
|
||||
src.mode_names[initial(M.config_tag)] = initial(M.name)
|
||||
src.probabilities[initial(M.config_tag)] = initial(M.probability)
|
||||
if(initial(M.votable))
|
||||
src.votable_modes += initial(M.config_tag)
|
||||
src.votable_modes += "secret"
|
||||
|
||||
/datum/configuration/proc/load(filename, type = "config") //the type can also be game_options, in which case it uses a different switch. not making it separate to not copypaste code - Urist
|
||||
if(IsAdminAdvancedProcCall())
|
||||
to_chat(usr, "<span class='boldannounce'>Config reload blocked: Advanced ProcCall detected.</span>")
|
||||
@@ -217,9 +188,6 @@
|
||||
if("ban_legacy_system")
|
||||
config.ban_legacy_system = 1
|
||||
|
||||
if("shadowling_max_age")
|
||||
config.shadowling_max_age = text2num(value)
|
||||
|
||||
if("ssd_warning")
|
||||
config.ssd_warning = 1
|
||||
|
||||
@@ -326,6 +294,7 @@
|
||||
config.donationsurl = value
|
||||
|
||||
if("guest_ban")
|
||||
#warn AA clear this up
|
||||
GLOB.guests_allowed = 0
|
||||
|
||||
if("panic_bunker_threshold")
|
||||
@@ -337,27 +306,6 @@
|
||||
if("allow_metadata")
|
||||
config.allow_Metadata = 1
|
||||
|
||||
if("traitor_scaling")
|
||||
config.traitor_scaling = 1
|
||||
|
||||
if("protect_roles_from_antagonist")
|
||||
config.protect_roles_from_antagonist = 1
|
||||
|
||||
if("probability")
|
||||
var/prob_pos = findtext(value, " ")
|
||||
var/prob_name = null
|
||||
var/prob_value = null
|
||||
|
||||
if(prob_pos)
|
||||
prob_name = lowertext(copytext(value, 1, prob_pos))
|
||||
prob_value = copytext(value, prob_pos + 1)
|
||||
if(prob_name in config.modes)
|
||||
config.probabilities[prob_name] = text2num(prob_value)
|
||||
else
|
||||
log_config("Unknown game mode probability configuration definition: [prob_name].")
|
||||
else
|
||||
log_config("Incorrect probability configuration definition: [prob_name] [prob_value].")
|
||||
|
||||
if("forbid_singulo_possession")
|
||||
forbid_singulo_possession = 1
|
||||
|
||||
@@ -379,12 +327,6 @@
|
||||
if("automute_on")
|
||||
automute_on = 1
|
||||
|
||||
if("usealienwhitelist")
|
||||
usealienwhitelist = 1
|
||||
|
||||
if("continuous_rounds")
|
||||
config.continuous_rounds = 1
|
||||
|
||||
if("ghost_interaction")
|
||||
config.ghost_interaction = 1
|
||||
|
||||
@@ -392,6 +334,7 @@
|
||||
config.comms_password = value
|
||||
|
||||
if("python_path")
|
||||
#warn AA clear this up
|
||||
if(value)
|
||||
GLOB.python_path = value
|
||||
else
|
||||
@@ -437,6 +380,7 @@
|
||||
config.shutdown_on_reboot = 1
|
||||
|
||||
if("shutdown_shell_command")
|
||||
#warn AA clear this up
|
||||
GLOB.shutdown_shell_command = value
|
||||
|
||||
if("disable_karma")
|
||||
@@ -447,8 +391,6 @@
|
||||
|
||||
if("developer_express_start")
|
||||
config.developer_express_start = 1
|
||||
if("enable_gamemode_player_limit")
|
||||
config.enable_gamemode_player_limit = 1
|
||||
if("byond_account_age_threshold")
|
||||
config.byond_account_age_threshold = text2num(value)
|
||||
if("centcom_ban_db_url")
|
||||
@@ -493,8 +435,6 @@
|
||||
config.bones_can_break = value
|
||||
if("shuttle_refuel_delay")
|
||||
config.shuttle_refuel_delay = text2num(value)
|
||||
if("traitor_objectives_amount")
|
||||
config.traitor_objectives_amount = text2num(value)
|
||||
if("reactionary_explosions")
|
||||
config.reactionary_explosions = 1
|
||||
if("bombcap")
|
||||
@@ -506,6 +446,7 @@
|
||||
if(BombCap > 128)
|
||||
BombCap = 128
|
||||
|
||||
#warn AA clear this up
|
||||
GLOB.max_ex_devastation_range = round(BombCap/4)
|
||||
GLOB.max_ex_heavy_range = round(BombCap/2)
|
||||
GLOB.max_ex_light_range = BombCap
|
||||
@@ -522,25 +463,3 @@
|
||||
else
|
||||
log_config("Unknown setting in configuration: '[name]'")
|
||||
|
||||
/datum/configuration/proc/pick_mode(mode_name)
|
||||
for(var/T in subtypesof(/datum/game_mode))
|
||||
var/datum/game_mode/M = T
|
||||
if(initial(M.config_tag) && initial(M.config_tag) == mode_name)
|
||||
return new T()
|
||||
return new /datum/game_mode/extended()
|
||||
|
||||
/datum/configuration/proc/get_runnable_modes()
|
||||
var/list/datum/game_mode/runnable_modes = new
|
||||
for(var/T in subtypesof(/datum/game_mode))
|
||||
var/datum/game_mode/M = new T()
|
||||
// to_chat(world, "DEBUG: [T], tag=[M.config_tag], prob=[probabilities[M.config_tag]]")
|
||||
if(!(M.config_tag in modes))
|
||||
qdel(M)
|
||||
continue
|
||||
if(probabilities[M.config_tag]<=0)
|
||||
qdel(M)
|
||||
continue
|
||||
if(M.can_start())
|
||||
runnable_modes[M] = probabilities[M.config_tag]
|
||||
// to_chat(world, "DEBUG: runnable_mode\[[runnable_modes.len]\] = [M.config_tag]")
|
||||
return runnable_modes
|
||||
|
||||
@@ -17,6 +17,8 @@ GLOBAL_DATUM_INIT(configuration, /datum/server_configuration, new())
|
||||
var/datum/configuration_section/discord_configuration/discord
|
||||
/// Holder for the Event configuration datum
|
||||
var/datum/configuration_section/event_configuration/event
|
||||
/// Holder for the gamemode configuration datum
|
||||
var/datum/configuration_section/gamemode_configuration/gamemode
|
||||
/// Holder for the gateway configuration datum
|
||||
var/datum/configuration_section/gateway_configuration/gateway
|
||||
/// Holder for the job configuration datum
|
||||
@@ -48,6 +50,7 @@ GLOBAL_DATUM_INIT(configuration, /datum/server_configuration, new())
|
||||
database = new()
|
||||
discord = new()
|
||||
event = new()
|
||||
gamemode = new()
|
||||
gateway = new()
|
||||
jobs = new()
|
||||
logging = new()
|
||||
@@ -69,6 +72,7 @@ GLOBAL_DATUM_INIT(configuration, /datum/server_configuration, new())
|
||||
database.load_data(raw_config_data["database_configuration"])
|
||||
discord.load_data(raw_config_data["discord_configuration"])
|
||||
event.load_data(raw_config_data["event_configuration"])
|
||||
gamemode.load_data(raw_config_data["gamemode_configuration"])
|
||||
gateway.load_data(raw_config_data["gateway_configuration"])
|
||||
jobs.load_data(raw_config_data["job_configuration"])
|
||||
logging.load_data(raw_config_data["logging_configuration"])
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
/// Config holder for everything regarding gamemodes
|
||||
/datum/configuration_section/gamemode_configuration
|
||||
/// List of all gamemodes (value: config-tag)
|
||||
var/list/gamemodes = list()
|
||||
/// Assoc list of gamemode names (key: config-tag | value: mode name)
|
||||
var/list/gamemode_names = list()
|
||||
/// Assoc list of gamemode probabilities (key: config-tag | value: probability)
|
||||
var/list/probabilities = list()
|
||||
/// List of all gamemodes that can be voted for (value: config-tag)
|
||||
var/list/votable_modes = list()
|
||||
/// Should antags be restricted based on account age?
|
||||
var/antag_account_age_restriction = FALSE
|
||||
/// Max age (in SSmobs cycles, [2 seconds]) before a shadowling starts to take damage if they have not hatched
|
||||
var/shadowling_max_age = 600 // 20 mins
|
||||
/// Scale amount of traitors with population
|
||||
var/traitor_scaling = TRUE
|
||||
/// Prevent mindshield roles getting antagonist status
|
||||
var/prevent_mindshield_antags = TRUE
|
||||
/// Rounds such as rev, wizard and malf end instantly when the antag has won. Enable the setting below to not do that.
|
||||
var/disable_certain_round_early_end = FALSE
|
||||
/// Amount of objectives traitors should get. Does not include escape or hijack.
|
||||
var/traitor_objectives_amount = 2
|
||||
/// Enable player limits on gamemodes? Disabling can be useful for testing
|
||||
var/enable_gamemode_player_limit = TRUE
|
||||
|
||||
// Dynamically setup a list of all gamemodes
|
||||
/datum/configuration_section/gamemode_configuration/New()
|
||||
for(var/T in subtypesof(/datum/game_mode))
|
||||
var/datum/game_mode/M = T
|
||||
|
||||
if(initial(M.config_tag))
|
||||
// Ensure each mode is added only once
|
||||
if(!(initial(M.config_tag) in gamemodes))
|
||||
gamemodes += initial(M.config_tag)
|
||||
gamemode_names[initial(M.config_tag)] = initial(M.name)
|
||||
probabilities[initial(M.config_tag)] = initial(M.probability)
|
||||
|
||||
if(initial(M.votable))
|
||||
votable_modes += initial(M.config_tag)
|
||||
|
||||
// Add secret to the votable pool
|
||||
votable_modes += "secret"
|
||||
|
||||
/datum/configuration_section/gamemode_configuration/load_data(list/data)
|
||||
// Use the load wrappers here. That way the default isnt made 'null' if you comment out the config line
|
||||
CONFIG_LOAD_BOOL(antag_account_age_restriction, data["antag_account_age_restrictions"])
|
||||
CONFIG_LOAD_BOOL(traitor_scaling, data["traitor_scaling"])
|
||||
CONFIG_LOAD_BOOL(prevent_mindshield_antags, data["prevent_mindshield_antag"])
|
||||
CONFIG_LOAD_BOOL(disable_certain_round_early_end, data["disable_certain_round_early_end"])
|
||||
CONFIG_LOAD_BOOL(enable_gamemode_player_limit, data["enable_gamemode_player_limit"])
|
||||
|
||||
CONFIG_LOAD_NUM(traitor_objectives_amount, data["traitor_objective_amount"])
|
||||
CONFIG_LOAD_NUM(shadowling_max_age, data["shadowling_max_age"])
|
||||
|
||||
// Load gamemode probabilities
|
||||
if(islist(data["gamemode_probabilities"]))
|
||||
for(var/list/assocset in data["gamemode_probabilities"])
|
||||
// Make sure it exists
|
||||
if(assocset["gamemode"] in gamemodes)
|
||||
probabilities[assocset["gamemode"]] = assocset["probability"]
|
||||
else
|
||||
stack_trace("Gamemode [assocset["gamemode"]] has a probability in config, but does not exist!")
|
||||
|
||||
/datum/configuration_section/gamemode_configuration/proc/pick_mode(mode_name)
|
||||
for(var/T in subtypesof(/datum/game_mode))
|
||||
var/datum/game_mode/M = T
|
||||
// If the tag exists, and its the same as the mode
|
||||
if(initial(M.config_tag) && (initial(M.config_tag) == mode_name))
|
||||
return new T()
|
||||
|
||||
// Default to extended if it didnt work
|
||||
return new /datum/game_mode/extended()
|
||||
|
||||
/datum/configuration_section/gamemode_configuration/proc/get_runnable_modes()
|
||||
var/list/datum/game_mode/runnable_modes = new
|
||||
for(var/T in subtypesof(/datum/game_mode))
|
||||
var/datum/game_mode/M = new T()
|
||||
|
||||
if(!(M.config_tag in gamemodes))
|
||||
qdel(M)
|
||||
continue
|
||||
|
||||
if(probabilities[M.config_tag]<=0)
|
||||
qdel(M)
|
||||
continue
|
||||
|
||||
if(M.can_start())
|
||||
runnable_modes[M] = probabilities[M.config_tag]
|
||||
|
||||
return runnable_modes
|
||||
@@ -115,7 +115,7 @@ SUBSYSTEM_DEF(ticker)
|
||||
next_autotransfer = world.time + config.vote_autotransfer_interval
|
||||
|
||||
var/game_finished = SSshuttle.emergency.mode >= SHUTTLE_ENDGAME || mode.station_was_nuked
|
||||
if(config.continuous_rounds)
|
||||
if(GLOB.configuration.gamemode.disable_certain_round_early_end)
|
||||
mode.check_finished() // some modes contain var-changing code in here, so call even if we don't uses result
|
||||
else
|
||||
game_finished |= mode.check_finished()
|
||||
@@ -144,7 +144,7 @@ SUBSYSTEM_DEF(ticker)
|
||||
var/list/datum/game_mode/runnable_modes
|
||||
|
||||
if(GLOB.master_mode == "random" || GLOB.master_mode == "secret")
|
||||
runnable_modes = config.get_runnable_modes()
|
||||
runnable_modes = GLOB.configuration.gamemode.get_runnable_modes()
|
||||
if(!length(runnable_modes))
|
||||
to_chat(world, "<B>Unable to choose playable game mode.</B> Reverting to pre-game lobby.")
|
||||
force_start = FALSE
|
||||
@@ -152,9 +152,9 @@ SUBSYSTEM_DEF(ticker)
|
||||
Master.SetRunLevel(RUNLEVEL_LOBBY)
|
||||
return FALSE
|
||||
if(GLOB.secret_force_mode != "secret")
|
||||
var/datum/game_mode/M = config.pick_mode(GLOB.secret_force_mode)
|
||||
var/datum/game_mode/M = GLOB.configuration.gamemode.pick_mode(GLOB.secret_force_mode)
|
||||
if(M.can_start())
|
||||
mode = config.pick_mode(GLOB.secret_force_mode)
|
||||
mode = GLOB.configuration.gamemode.pick_mode(GLOB.secret_force_mode)
|
||||
SSjobs.ResetOccupations()
|
||||
if(!mode)
|
||||
mode = pickweight(runnable_modes)
|
||||
@@ -162,7 +162,7 @@ SUBSYSTEM_DEF(ticker)
|
||||
var/mtype = mode.type
|
||||
mode = new mtype
|
||||
else
|
||||
mode = config.pick_mode(GLOB.master_mode)
|
||||
mode = GLOB.configuration.gamemode.pick_mode(GLOB.master_mode)
|
||||
|
||||
if(!mode.can_start())
|
||||
to_chat(world, "<B>Unable to start [mode.name].</B> Not enough players, [mode.required_players] players needed. Reverting to pre-game lobby.")
|
||||
|
||||
@@ -211,7 +211,7 @@ SUBSYSTEM_DEF(vote)
|
||||
if("gamemode")
|
||||
if(SSticker.current_state >= 2)
|
||||
return 0
|
||||
choices.Add(config.votable_modes)
|
||||
choices.Add(GLOB.configuration.gamemode.votable_modes)
|
||||
if("crew_transfer")
|
||||
if(check_rights(R_ADMIN|R_MOD))
|
||||
if(SSticker.current_state <= 2)
|
||||
|
||||
@@ -25,13 +25,13 @@
|
||||
if(istype(S,/obj/effect/proc_holder/spell/targeted/lichdom) && S != src)
|
||||
return ..()
|
||||
if(existence_stops_round_end)
|
||||
config.continuous_rounds = 0
|
||||
GLOB.configuration.gamemode.disable_certain_round_early_end = FALSE
|
||||
return ..()
|
||||
|
||||
/obj/effect/proc_holder/spell/targeted/lichdom/cast(list/targets, mob/user = usr)
|
||||
if(!config.continuous_rounds)
|
||||
existence_stops_round_end = 1
|
||||
config.continuous_rounds = 1
|
||||
if(!GLOB.configuration.gamemode.disable_certain_round_early_end)
|
||||
existence_stops_round_end = TRUE
|
||||
GLOB.configuration.gamemode.disable_certain_round_early_end = TRUE
|
||||
|
||||
for(var/mob/M in targets)
|
||||
var/list/hand_items = list()
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
/datum/game_mode/traitor/autotraitor/pre_setup()
|
||||
|
||||
if(config.protect_roles_from_antagonist)
|
||||
if(GLOB.configuration.gamemode.prevent_mindshield_antags)
|
||||
restricted_jobs += protected_jobs
|
||||
|
||||
possible_traitors = get_players_for_role(ROLE_TRAITOR)
|
||||
@@ -35,7 +35,7 @@
|
||||
if(!possible_traitors.len)
|
||||
return 0
|
||||
|
||||
if(config.traitor_scaling)
|
||||
if(GLOB.configuration.gamemode.traitor_scaling)
|
||||
num_traitors = max_traitors - 1 + prob(traitor_prob)
|
||||
log_game("Number of traitors: [num_traitors]")
|
||||
message_admins("Players counted: [num_players] Number of traitors chosen: [num_traitors]")
|
||||
|
||||
@@ -41,7 +41,7 @@ GLOBAL_LIST_INIT(possible_changeling_IDs, list("Alpha","Beta","Gamma","Delta","E
|
||||
to_chat(world, "<B>There are alien changelings on the station. Do not let the changelings succeed!</B>")
|
||||
|
||||
/datum/game_mode/changeling/pre_setup()
|
||||
if(config.protect_roles_from_antagonist)
|
||||
if(GLOB.configuration.gamemode.prevent_mindshield_antags)
|
||||
restricted_jobs += protected_jobs
|
||||
|
||||
var/list/datum/mind/possible_changelings = get_players_for_role(ROLE_CHANGELING)
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
|
||||
/datum/game_mode/traitor/changeling/pre_setup()
|
||||
if(config.protect_roles_from_antagonist)
|
||||
if(GLOB.configuration.gamemode.prevent_mindshield_antags)
|
||||
restricted_jobs += protected_jobs
|
||||
|
||||
var/list/datum/mind/possible_changelings = get_players_for_role(ROLE_CHANGELING)
|
||||
|
||||
@@ -62,7 +62,7 @@ GLOBAL_LIST_EMPTY(all_cults)
|
||||
to_chat(world, "<B>Some crewmembers are attempting to start a cult!<BR>\nCultists - complete your objectives. Convert crewmembers to your cause by using the offer rune. Remember - there is no you, there is only the cult.<BR>\nPersonnel - Do not let the cult succeed in its mission. Brainwashing them with holy water reverts them to whatever CentComm-allowed faith they had.</B>")
|
||||
|
||||
/datum/game_mode/cult/pre_setup()
|
||||
if(config.protect_roles_from_antagonist)
|
||||
if(GLOB.configuration.gamemode.prevent_mindshield_antags)
|
||||
restricted_jobs += protected_jobs
|
||||
|
||||
var/list/cultists_possible = get_players_for_role(ROLE_CULTIST)
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
if((player.client)&&(player.ready))
|
||||
playerC++
|
||||
|
||||
if(!config.enable_gamemode_player_limit || (playerC >= required_players))
|
||||
if(!GLOB.configuration.gamemode.enable_gamemode_player_limit || (playerC >= required_players))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
/datum/game_mode/revolution/pre_setup()
|
||||
possible_revolutionaries = get_players_for_role(ROLE_REV)
|
||||
|
||||
if(config.protect_roles_from_antagonist)
|
||||
if(GLOB.configuration.gamemode.prevent_mindshield_antags)
|
||||
restricted_jobs += protected_jobs
|
||||
|
||||
|
||||
@@ -214,7 +214,7 @@
|
||||
//Checks if the round is over//
|
||||
///////////////////////////////
|
||||
/datum/game_mode/revolution/check_finished()
|
||||
if(config.continuous_rounds)
|
||||
if(GLOB.configuration.gamemode.disable_certain_round_early_end)
|
||||
if(finished != 0)
|
||||
SSshuttle.emergencyNoEscape = 0
|
||||
if(SSshuttle.emergency.mode == SHUTTLE_STRANDED)
|
||||
|
||||
@@ -81,7 +81,7 @@ Made by Xhuis
|
||||
to_chat(world, "<b>There are alien <span class='deadsay'>shadowlings</span> on the station. Crew: Kill the shadowlings before they can eat or enthrall the crew. Shadowlings: Enthrall the crew while remaining in hiding.</b>")
|
||||
|
||||
/datum/game_mode/shadowling/pre_setup()
|
||||
if(config.protect_roles_from_antagonist)
|
||||
if(GLOB.configuration.gamemode.prevent_mindshield_antags)
|
||||
restricted_jobs += protected_jobs
|
||||
|
||||
var/list/datum/mind/possible_shadowlings = get_players_for_role(ROLE_SHADOWLING)
|
||||
@@ -216,13 +216,13 @@ Made by Xhuis
|
||||
if(shadow.current.stat == DEAD)
|
||||
continue
|
||||
shadows_alive++
|
||||
if(shadow.special_role == SPECIAL_ROLE_SHADOWLING && config.shadowling_max_age)
|
||||
if(shadow.special_role == SPECIAL_ROLE_SHADOWLING && GLOB.configuration.gamemode.shadowling_max_age)
|
||||
if(ishuman(shadow.current))
|
||||
var/mob/living/carbon/human/H = shadow.current
|
||||
if(!isshadowling(H))
|
||||
for(var/obj/effect/proc_holder/spell/targeted/shadowling_hatch/hatch_ability in shadow.spell_list)
|
||||
hatch_ability.cycles_unused++
|
||||
if(!H.stunned && prob(20) && hatch_ability.cycles_unused > config.shadowling_max_age)
|
||||
if(!H.stunned && prob(20) && hatch_ability.cycles_unused > GLOB.configuration.gamemode.shadowling_max_age)
|
||||
var/shadow_nag_messages = list("You can barely hold yourself in this lesser form!", "The urge to become something greater is overwhelming!", "You feel a burning passion to hatch free of this shell and assume godhood!")
|
||||
H.take_overall_damage(0, 3)
|
||||
to_chat(H, "<span class='userdanger'>[pick(shadow_nag_messages)]</span>")
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
/datum/game_mode/traitor/pre_setup()
|
||||
|
||||
if(config.protect_roles_from_antagonist)
|
||||
if(GLOB.configuration.gamemode.prevent_mindshield_antags)
|
||||
restricted_jobs += protected_jobs
|
||||
|
||||
var/list/possible_traitors = get_players_for_role(ROLE_TRAITOR)
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
var/num_traitors = 1
|
||||
|
||||
if(config.traitor_scaling)
|
||||
if(GLOB.configuration.gamemode.traitor_scaling)
|
||||
num_traitors = max(1, round((num_players())/(traitor_scaling_coeff)))
|
||||
else
|
||||
num_traitors = max(1, min(num_players(), traitors_possible))
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
|
||||
/datum/game_mode/traitor/vampire/pre_setup()
|
||||
if(config.protect_roles_from_antagonist)
|
||||
if(GLOB.configuration.gamemode.prevent_mindshield_antags)
|
||||
restricted_jobs += protected_jobs
|
||||
|
||||
var/list/datum/mind/possible_vampires = get_players_for_role(ROLE_VAMPIRE)
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
/datum/game_mode/vampire/pre_setup()
|
||||
|
||||
if(config.protect_roles_from_antagonist)
|
||||
if(GLOB.configuration.gamemode.prevent_mindshield_antags)
|
||||
restricted_jobs += protected_jobs
|
||||
|
||||
var/list/datum/mind/possible_vampires = get_players_for_role(ROLE_VAMPIRE)
|
||||
|
||||
@@ -34,10 +34,7 @@
|
||||
else
|
||||
return TRUE
|
||||
|
||||
//todo: admin aliens
|
||||
/proc/is_alien_whitelisted(mob/M, species)
|
||||
if(!config.usealienwhitelist)
|
||||
return TRUE
|
||||
if(config.disable_karma)
|
||||
return TRUE
|
||||
if(species == "human" || species == "Human")
|
||||
|
||||
@@ -114,12 +114,9 @@
|
||||
|
||||
if("Body")
|
||||
var/list/race_list = list("Human", "Tajaran", "Skrell", "Unathi", "Diona", "Vulpkanin")
|
||||
if(config.usealienwhitelist)
|
||||
for(var/Spec in GLOB.whitelisted_species)
|
||||
if(is_alien_whitelisted(H, Spec))
|
||||
race_list += Spec
|
||||
else
|
||||
race_list += GLOB.whitelisted_species
|
||||
for(var/Spec in GLOB.whitelisted_species)
|
||||
if(is_alien_whitelisted(H, Spec))
|
||||
race_list += Spec
|
||||
|
||||
var/datum/ui_module/appearance_changer/AC = ui_users[user]
|
||||
if(!AC)
|
||||
|
||||
@@ -1171,8 +1171,8 @@
|
||||
if(SSticker && SSticker.mode)
|
||||
return alert(usr, "The game has already started.", null, null, null, null)
|
||||
var/dat = {"<b>What mode do you wish to play?</b><hr>"}
|
||||
for(var/mode in config.modes)
|
||||
dat += {"<A href='?src=[UID()];c_mode2=[mode]'>[config.mode_names[mode]]</A><br>"}
|
||||
for(var/mode in GLOB.configuration.gamemode.gamemodes)
|
||||
dat += {"<A href='?src=[UID()];c_mode2=[mode]'>[GLOB.configuration.gamemode.gamemode_names[mode]]</A><br>"}
|
||||
dat += {"<A href='?src=[UID()];c_mode2=secret'>Secret</A><br>"}
|
||||
dat += {"<A href='?src=[UID()];c_mode2=random'>Random</A><br>"}
|
||||
dat += {"Now: [GLOB.master_mode]"}
|
||||
@@ -1186,8 +1186,8 @@
|
||||
if(GLOB.master_mode != "secret")
|
||||
return alert(usr, "The game mode has to be secret!", null, null, null, null)
|
||||
var/dat = {"<b>What game mode do you want to force secret to be? Use this if you want to change the game mode, but want the players to believe it's secret. This will only work if the current game mode is secret.</b><hr>"}
|
||||
for(var/mode in config.modes)
|
||||
dat += {"<A href='?src=[UID()];f_secret2=[mode]'>[config.mode_names[mode]]</A><br>"}
|
||||
for(var/mode in GLOB.configuration.gamemode.gamemodes)
|
||||
dat += {"<A href='?src=[UID()];f_secret2=[mode]'>[GLOB.configuration.gamemode.gamemode_names[mode]]</A><br>"}
|
||||
dat += {"<A href='?src=[UID()];f_secret2=secret'>Random (default)</A><br>"}
|
||||
dat += {"Now: [GLOB.secret_force_mode]"}
|
||||
usr << browse(dat, "window=f_secret")
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
/datum/admins/proc/makeTraitors()
|
||||
var/datum/game_mode/traitor/temp = new
|
||||
|
||||
if(config.protect_roles_from_antagonist)
|
||||
if(GLOB.configuration.gamemode.prevent_mindshield_antags)
|
||||
temp.restricted_jobs += temp.protected_jobs
|
||||
|
||||
var/list/mob/living/carbon/human/candidates = list()
|
||||
@@ -76,7 +76,7 @@
|
||||
/datum/admins/proc/makeChangelings()
|
||||
|
||||
var/datum/game_mode/changeling/temp = new
|
||||
if(config.protect_roles_from_antagonist)
|
||||
if(GLOB.configuration.gamemode.prevent_mindshield_antags)
|
||||
temp.restricted_jobs += temp.protected_jobs
|
||||
|
||||
var/list/mob/living/carbon/human/candidates = list()
|
||||
@@ -106,7 +106,7 @@
|
||||
/datum/admins/proc/makeRevs()
|
||||
|
||||
var/datum/game_mode/revolution/temp = new
|
||||
if(config.protect_roles_from_antagonist)
|
||||
if(GLOB.configuration.gamemode.prevent_mindshield_antags)
|
||||
temp.restricted_jobs += temp.protected_jobs
|
||||
|
||||
var/list/mob/living/carbon/human/candidates = list()
|
||||
@@ -156,7 +156,7 @@
|
||||
/datum/admins/proc/makeCult()
|
||||
|
||||
var/datum/game_mode/cult/temp = new
|
||||
if(config.protect_roles_from_antagonist)
|
||||
if(GLOB.configuration.gamemode.prevent_mindshield_antags)
|
||||
temp.restricted_jobs += temp.protected_jobs
|
||||
|
||||
var/list/mob/living/carbon/human/candidates = list()
|
||||
@@ -517,7 +517,7 @@
|
||||
/datum/admins/proc/makeVampires()
|
||||
|
||||
var/datum/game_mode/vampire/temp = new
|
||||
if(config.protect_roles_from_antagonist)
|
||||
if(GLOB.configuration.gamemode.prevent_mindshield_antags)
|
||||
temp.restricted_jobs += temp.protected_jobs
|
||||
|
||||
var/list/mob/living/carbon/human/candidates = list()
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
objective_count += 1 //Exchange counts towards number of objectives
|
||||
|
||||
|
||||
var/objective_amount = config.traitor_objectives_amount
|
||||
var/objective_amount = GLOB.configuration.gamemode.traitor_objectives_amount
|
||||
|
||||
if(is_hijacker && objective_count <= objective_amount) //Don't assign hijack if it would exceed the number of objectives set in config.traitor_objectives_amount
|
||||
if (!(locate(/datum/objective/hijack) in objectives))
|
||||
@@ -154,7 +154,7 @@
|
||||
|
||||
objective_count += forge_single_objective()
|
||||
|
||||
for(var/i = objective_count, i < config.traitor_objectives_amount)
|
||||
for(var/i = objective_count, i < GLOB.configuration.gamemode.traitor_objectives_amount)
|
||||
var/datum/objective/assassinate/kill_objective = new
|
||||
kill_objective.owner = owner
|
||||
kill_objective.find_target()
|
||||
|
||||
@@ -38,7 +38,7 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
|
||||
return 0
|
||||
if(!role)
|
||||
return 0
|
||||
if(!config.use_age_restriction_for_antags)
|
||||
if(!GLOB.configuration.gamemode.antag_account_age_restriction)
|
||||
return 0
|
||||
if(!isnum(C.player_age))
|
||||
return 0 //This is only a number if the db connection is established, otherwise it is text: "Requires database", meaning these restrictions cannot be enforced
|
||||
@@ -1318,17 +1318,10 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
|
||||
if("species")
|
||||
var/list/new_species = list("Human", "Tajaran", "Skrell", "Unathi", "Diona", "Vulpkanin")
|
||||
var/prev_species = species
|
||||
// var/whitelisted = 0
|
||||
|
||||
if(config.usealienwhitelist) //If we're using the whitelist, make sure to check it!
|
||||
for(var/Spec in GLOB.whitelisted_species)
|
||||
if(is_alien_whitelisted(user,Spec))
|
||||
new_species += Spec
|
||||
// whitelisted = 1
|
||||
// if(!whitelisted)
|
||||
// alert(user, "You cannot change your species as you need to be whitelisted. If you wish to be whitelisted contact an admin in-game, on the forums, or on IRC.")
|
||||
else //Not using the whitelist? Aliens for everyone!
|
||||
new_species += GLOB.whitelisted_species
|
||||
for(var/Spec in GLOB.whitelisted_species)
|
||||
if(is_alien_whitelisted(user,Spec))
|
||||
new_species += Spec
|
||||
|
||||
species = input("Please select a species", "Character Generation", null) in sortTim(new_species, /proc/cmp_text_asc)
|
||||
var/datum/species/NS = GLOB.all_species[species]
|
||||
@@ -1411,18 +1404,6 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
|
||||
if("language")
|
||||
// var/languages_available
|
||||
var/list/new_languages = list("None")
|
||||
/*
|
||||
if(config.usealienwhitelist)
|
||||
for(var/L in GLOB.all_languages)
|
||||
var/datum/language/lang = GLOB.all_languages[L]
|
||||
if((!(lang.flags & RESTRICTED)) && (is_alien_whitelisted(user, L)||(!( lang.flags & WHITELISTED ))))
|
||||
new_languages += lang
|
||||
languages_available = 1
|
||||
|
||||
if(!(languages_available))
|
||||
alert(user, "There are not currently any available secondary languages.")
|
||||
else
|
||||
*/
|
||||
for(var/L in GLOB.all_languages)
|
||||
var/datum/language/lang = GLOB.all_languages[L]
|
||||
if(!(lang.flags & RESTRICTED))
|
||||
|
||||
@@ -320,7 +320,7 @@
|
||||
for(var/current_species_name in GLOB.all_species)
|
||||
var/datum/species/current_species = GLOB.all_species[current_species_name]
|
||||
|
||||
if(check_whitelist && config.usealienwhitelist && !check_rights(R_ADMIN, 0, src)) //If we're using the whitelist, make sure to check it!
|
||||
if(check_whitelist && !check_rights(R_ADMIN, 0, src)) //If we're using the whitelist, make sure to check it!
|
||||
if(whitelist.len && !(current_species_name in whitelist))
|
||||
continue
|
||||
if(blacklist.len && (current_species_name in blacklist))
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
return
|
||||
|
||||
var/player_age_check = check_client_age(usr.client, 14) // 14 days to play as a drone
|
||||
if(player_age_check && config.use_age_restriction_for_antags)
|
||||
if(player_age_check && GLOB.configuration.gamemode.antag_account_age_restriction)
|
||||
to_chat(usr, "<span class='warning'>This role is not yet available to you. You need to wait another [player_age_check] days.</span>")
|
||||
return
|
||||
|
||||
|
||||
@@ -216,7 +216,7 @@
|
||||
return
|
||||
if(client.prefs.species in GLOB.whitelisted_species)
|
||||
|
||||
if(!is_alien_whitelisted(src, client.prefs.species) && config.usealienwhitelist)
|
||||
if(!is_alien_whitelisted(src, client.prefs.species))
|
||||
to_chat(src, alert("You are currently not whitelisted to play [client.prefs.species]."))
|
||||
return FALSE
|
||||
|
||||
@@ -235,7 +235,7 @@
|
||||
client.prefs.load_random_character_slot(client)
|
||||
|
||||
if(client.prefs.species in GLOB.whitelisted_species)
|
||||
if(!is_alien_whitelisted(src, client.prefs.species) && config.usealienwhitelist)
|
||||
if(!is_alien_whitelisted(src, client.prefs.species))
|
||||
to_chat(src, alert("You are currently not whitelisted to play [client.prefs.species]."))
|
||||
return FALSE
|
||||
|
||||
@@ -608,7 +608,7 @@
|
||||
|
||||
/mob/new_player/proc/is_species_whitelisted(datum/species/S)
|
||||
if(!S) return 1
|
||||
return is_alien_whitelisted(src, S.name) || !config.usealienwhitelist || !(IS_WHITELISTED in S.species_traits)
|
||||
return is_alien_whitelisted(src, S.name) || !(IS_WHITELISTED in S.species_traits)
|
||||
|
||||
/mob/new_player/get_gender()
|
||||
if(!client || !client.prefs) ..()
|
||||
|
||||
@@ -47,7 +47,7 @@ GLOBAL_VAR_INIT(ert_request_answered, FALSE)
|
||||
return 0
|
||||
|
||||
var/player_age_check = check_client_age(client, GLOB.responseteam_age)
|
||||
if(player_age_check && config.use_age_restriction_for_antags)
|
||||
if(player_age_check && GLOB.configuration.gamemode.antag_account_age_restriction)
|
||||
to_chat(src, "<span class='warning'>This role is not yet available to you. You need to wait another [player_age_check] days.</span>")
|
||||
return 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user