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