Gamemode and gamemode vote obfuscation (Plus hub entry rework) (#6276)

* adds gamemode/gamemode vote obfuscation, redesigns hub entry

* ternaries: the easiest way to obfuscate your code to the point where even you can't read it

* FUCK

* changes the inaccuracy chance from 1/10 to 1/5
This commit is contained in:
deathride58
2018-04-27 14:40:45 +00:00
committed by kevinz000
parent 681bbb1bb0
commit 862898526d
7 changed files with 57 additions and 25 deletions
+4 -4
View File
@@ -272,14 +272,14 @@ SUBSYSTEM_DEF(ticker)
message_admins("<span class='notice'>DEBUG: Bypassing prestart checks...</span>")
CHECK_TICK
if(hide_mode)
/*if(hide_mode) CIT CHANGE - comments this section out to obfuscate gamemodes. Quit self-antagging during extended just because "hurrrrr no antaggs!!!!!! i giv sec thing 2 do!!!!!!!!!" it's bullshit and everyone hates it
var/list/modes = new
for (var/datum/game_mode/M in runnable_modes)
modes += M.name
modes = sortList(modes)
to_chat(world, "<b>The gamemode is: secret!\nPossibilities:</B> [english_list(modes)]")
else
mode.announce()
mode.announce()*/
if(!CONFIG_GET(flag/ooc_during_round))
toggle_ooc(FALSE) // Turn it off
@@ -477,12 +477,12 @@ SUBSYSTEM_DEF(ticker)
/datum/controller/subsystem/ticker/proc/IsRoundInProgress()
return current_state == GAME_STATE_PLAYING
/proc/send_gamemode_vote()
/proc/send_gamemode_vote() //CIT CHANGE - adds roundstart gamemode votes
if(SSticker.current_state == GAME_STATE_PREGAME)
if(SSticker.timeLeft < 900)
SSticker.timeLeft = 900
SSticker.modevoted = TRUE
SSvote.initiate_vote("roundtype","server")
SSvote.initiate_vote("roundtype","server",TRUE)
/datum/controller/subsystem/ticker/Recover()
current_state = SSticker.current_state
+19 -9
View File
@@ -16,6 +16,8 @@ SUBSYSTEM_DEF(vote)
var/list/voting = list()
var/list/generated_actions = list()
var/obfuscated = FALSE//CIT CHANGE - adds obfuscated/admin-only votes
/datum/controller/subsystem/vote/fire() //called by master_controller
if(mode)
time_remaining = round((started_time + CONFIG_GET(number/vote_period) - world.time)/10)
@@ -42,6 +44,7 @@ SUBSYSTEM_DEF(vote)
choices.Cut()
voted.Cut()
voting.Cut()
obfuscated = FALSE //CIT CHANGE - obfuscated votes
remove_action_buttons()
/datum/controller/subsystem/vote/proc/get_result()
@@ -91,14 +94,14 @@ SUBSYSTEM_DEF(vote)
var/votes = choices[choices[i]]
if(!votes)
votes = 0
text += "\n<b>[choices[i]]:</b> [votes]"
text += "\n<b>[choices[i]]:</b> [obfuscated ? "???" : votes]" //CIT CHANGE - adds obfuscated votes
if(mode != "custom")
if(winners.len > 1)
if(winners.len > 1 && !obfuscated) //CIT CHANGE - adds obfuscated votes
text = "\n<b>Vote Tied Between:</b>"
for(var/option in winners)
text += "\n\t[option]"
. = pick(winners)
text += "\n<b>Vote Result: [.]</b>"
text += "\n<b>Vote Result: [obfuscated ? "???" : .]</b>" //CIT CHANGE - adds obfuscated votes
else
text += "\n<b>Did not vote:</b> [GLOB.clients.len-voted.len]"
else
@@ -106,6 +109,12 @@ SUBSYSTEM_DEF(vote)
log_vote(text)
remove_action_buttons()
to_chat(world, "\n<font color='purple'>[text]</font>")
if(obfuscated) //CIT CHANGE - adds obfuscated votes. this messages admins with the vote's true results
var/admintext = "Obfuscated results"
for(var/i=1,i<=choices.len,i++)
var/votes = choices[choices[i]]
admintext += "\n<b>[choices[i]]:</b> [votes]"
message_admins(admintext)
return .
/datum/controller/subsystem/vote/proc/result()
@@ -113,12 +122,12 @@ SUBSYSTEM_DEF(vote)
var/restart = 0
if(.)
switch(mode)
if("roundtype")
if("roundtype") //CIT CHANGE - adds the roundstart extended/secret vote
if(SSticker.current_state > GAME_STATE_PREGAME)//Don't change the mode if the round already started.
return message_admins("A vote has tried to change the gamemode, but the game has already started. Aborting.")
GLOB.master_mode = .
SSticker.save_mode(.)
to_chat(world, "<span class='adminnotice'><b>The mode is now: [GLOB.master_mode]</b></span>")
message_admins("The gamemode has been voted for, and has been changed to: [GLOB.master_mode]")
log_admin("Gamemode has been voted for and switched to: [GLOB.master_mode].")
if("restart")
if(. == "Restart Round")
@@ -155,7 +164,7 @@ SUBSYSTEM_DEF(vote)
return vote
return 0
/datum/controller/subsystem/vote/proc/initiate_vote(vote_type, initiator_key)
/datum/controller/subsystem/vote/proc/initiate_vote(vote_type, initiator_key, hideresults)//CIT CHANGE - adds hideresults argument to votes to allow for obfuscated votes
if(!mode)
if(started_time)
var/next_allowed_time = (started_time + CONFIG_GET(number/vote_delay))
@@ -173,12 +182,13 @@ SUBSYSTEM_DEF(vote)
return 0
reset()
obfuscated = hideresults //CIT CHANGE - adds obfuscated votes
switch(vote_type)
if("restart")
choices.Add("Restart Round","Continue Playing")
if("gamemode")
choices.Add(config.votable_modes)
if("roundtype")
if("roundtype") //CIT CHANGE - adds the roundstart secret/extended vote
choices.Add("secret", "extended")
if("custom")
question = stripped_input(usr,"What is the vote for?")
@@ -233,7 +243,7 @@ SUBSYSTEM_DEF(vote)
var/votes = choices[choices[i]]
if(!votes)
votes = 0
. += "<li><a href='?src=[REF(src)];vote=[i]'>[choices[i]]</a> ([votes] votes)</li>"
. += "<li><a href='?src=[REF(src)];vote=[i]'>[choices[i]]</a> ([obfuscated ? (admin ? "??? ([votes])" : "???") : votes] votes)</li>" // CIT CHANGE - adds obfuscated votes
. += "</ul><hr>"
if(admin)
. += "(<a href='?src=[REF(src)];vote=cancel'>Cancel Vote</a>) "
@@ -332,4 +342,4 @@ SUBSYSTEM_DEF(vote)
else if(owner.ckey)
var/datum/player_details/P = GLOB.player_details[owner.ckey]
if(P)
P.player_actions -= src
P.player_actions -= src
+4
View File
@@ -19,10 +19,14 @@
false_report_weight = 0
/datum/game_mode/extended/announced/generate_station_goals()
if(flipseclevel) //CIT CHANGE - allows the sec level to be flipped roundstart
return ..()
for(var/T in subtypesof(/datum/station_goal))
var/datum/station_goal/G = new T
station_goals += G
G.on_report()
/datum/game_mode/extended/announced/send_intercept(report = 0)
if(flipseclevel) //CIT CHANGE - allows the sec level to be flipped roundstart
return ..()
priority_announce("Thanks to the tireless efforts of our security and intelligence divisions, there are currently no credible threats to [station_name()]. All station construction projects have been authorized. Have a secure shift!", "Security Report", 'sound/ai/commandreport.ogg')
+14
View File
@@ -48,6 +48,8 @@
var/gamemode_ready = FALSE //Is the gamemode all set up and ready to start checking for ending conditions.
var/flipseclevel = FALSE //CIT CHANGE - adds a 10% chance for the alert level to be the opposite of what the gamemode is supposed to have
/datum/game_mode/proc/announce() //Shows the gamemode's name and a fast description.
to_chat(world, "<b>The gamemode is: <span class='[announce_span]'>[name]</span>!</b>")
to_chat(world, "<b>[announce_text]</b>")
@@ -82,6 +84,9 @@
report = !CONFIG_GET(flag/no_intercept_report)
addtimer(CALLBACK(GLOBAL_PROC, .proc/display_roundstart_logout_report), ROUNDSTART_LOGOUT_REPORT_TIME)
if(prob(20)) //CIT CHANGE - adds a 20% chance for the security level to be the opposite of what it normally is
flipseclevel = TRUE
if(SSdbcore.Connect())
var/sql
if(SSticker.mode)
@@ -250,6 +255,9 @@
return 0
/datum/game_mode/proc/send_intercept()
if(flipseclevel && !(config_tag == "extended"))//CIT CHANGE - lets the security level be flipped roundstart
priority_announce("Thanks to the tireless efforts of our security and intelligence divisions, there are currently no credible threats to [station_name()]. All station construction projects have been authorized. Have a secure shift!", "Security Report", 'sound/ai/commandreport.ogg')
return
var/intercepttext = "<b><i>Central Command Status Summary</i></b><hr>"
intercepttext += "<b>Central Command has intercepted and partially decoded a Syndicate transmission with vital information regarding their movements. The following report outlines the most \
likely threats to appear in your sector.</b>"
@@ -508,6 +516,12 @@
rev.remove_revolutionary(TRUE)
/datum/game_mode/proc/generate_station_goals()
if(flipseclevel && !(config_tag == "extended")) //CIT CHANGE - allows the sec level to be flipped roundstart
for(var/T in subtypesof(/datum/station_goal))
var/datum/station_goal/G = new T
station_goals += G
G.on_report()
return
var/list/possible = list()
for(var/T in subtypesof(/datum/station_goal))
var/datum/station_goal/G = T
+12 -8
View File
@@ -228,11 +228,11 @@ GLOBAL_PROTECT(security_mode)
var/list/features = list()
if(GLOB.master_mode)
/*if(GLOB.master_mode) CIT CHANGE - hides the gamemode from the hub entry, removes some useless info from the hub entry
features += GLOB.master_mode
if (!GLOB.enter_allowed)
features += "closed"
features += "closed"*/
var/s = ""
var/hostedby
@@ -240,25 +240,29 @@ GLOBAL_PROTECT(security_mode)
var/server_name = CONFIG_GET(string/servername)
if (server_name)
s += "<b>[server_name]</b> &#8212; "
features += "[CONFIG_GET(flag/norespawn) ? "no " : ""]respawn"
/*features += "[CONFIG_GET(flag/norespawn) ? "no " : ""]respawn" CIT CHANGE - removes some useless info from the hub entry
if(CONFIG_GET(flag/allow_vote_mode))
features += "vote"
if(CONFIG_GET(flag/allow_ai))
features += "AI allowed"
features += "AI allowed"*/
hostedby = CONFIG_GET(string/hostedby)
s += "<b>[station_name()]</b>";
s += " ("
s += "<a href=\"http://\">" //Change this to wherever you want the hub to link to.
s += "Default" //Replace this with something else. Or ever better, delete it and uncomment the game version.
s += "<a href=\"https://citadel-station.net/home/\">" //Change this to wherever you want the hub to link to. CIT CHANGE - links to cit's website on the hub
s += "Citadel" //Replace this with something else. Or ever better, delete it and uncomment the game version. CIT CHANGE - modifies the hub entry link
s += "</a>"
s += ")"
s += ")\]" //CIT CHANGE - encloses the server title in brackets to make the hub entry fancier
s += "<br><small><i>That furry /TG/code server your mother warned you about.</i></small><br>" //CIT CHANGE - adds a tagline!
var/n = 0
for (var/mob/M in GLOB.player_list)
if (M.client)
n++
if(get_security_level())//CIT CHANGE - makes the hub entry show the security level
features += "code [get_security_level()]"
if (n > 1)
features += "~[n] players"
else if (n > 0)
@@ -268,7 +272,7 @@ GLOBAL_PROTECT(security_mode)
features += "hosted by <b>[hostedby]</b>"
if (features)
s += ": [jointext(features, ", ")]"
s += "\[[jointext(features, ", ")]" //CIT CHANGE - replaces the colon here with a left bracket
status = s
+2 -2
View File
@@ -28,7 +28,7 @@
return
last_irc_check = rtod
var/server = CONFIG_GET(string/server)
return "[GLOB.round_id ? "Round #[GLOB.round_id]: " : ""][GLOB.clients.len] players on [SSmapping.config.map_name], Mode: [GLOB.master_mode]; Round [SSticker.HasRoundStarted() ? (SSticker.IsRoundInProgress() ? "Active" : "Finishing") : "Starting"] -- [server ? server : "[world.internet_address]:[world.port]"]"
return "[GLOB.round_id ? "Round #[GLOB.round_id]: " : ""][GLOB.clients.len] players on [SSmapping.config.map_name]; Round [SSticker.HasRoundStarted() ? (SSticker.IsRoundInProgress() ? "Active" : "Finishing") : "Starting"] -- [server ? server : "[world.internet_address]:[world.port]"]" //CIT CHANGE - obfuscates the current gamemode from players
/datum/server_tools_command/ahelp
name = "ahelp"
@@ -100,7 +100,7 @@ GLOBAL_LIST(round_end_notifiees)
var/list/text_res = results.Copy(1, 3)
var/list/refs = results.len > 3 ? results.Copy(4) : null
. = "[text_res.Join("\n")][refs ? "\nRefs: [refs.Join(" ")]" : ""]"
/datum/server_tools_command/reload_admins
name = "reload_admins"
help_text = "Forces the server to reload admins."
+2 -2
View File
@@ -36,7 +36,7 @@ INITIALIZE_IMMEDIATE(/mob/dead)
if(!statpanel("Status"))
return
stat(null, "Game Mode: [SSticker.hide_mode ? "Secret" : "[GLOB.master_mode]"]")
//stat(null, "Game Mode: [SSticker.hide_mode ? "Secret" : "[GLOB.master_mode]"]") CIT CHANGE - obfuscates gamemode from player view
if(SSticker.HasRoundStarted())
return
@@ -72,7 +72,7 @@ INITIALIZE_IMMEDIATE(/mob/dead)
if(!pick)
return
var/addr = csa[pick]
if(alert(src, "Jump to server [pick] ([addr])?", "Server Hop", "Yes", "No") != "Yes")