This commit is contained in:
TrilbySpaceClone
2020-01-13 11:54:14 -05:00
106 changed files with 205 additions and 61 deletions
@@ -341,7 +341,7 @@
if(probabilities[M.config_tag]<=0)
qdel(M)
continue
if(M.config_tag in SSvote.stored_modetier_results && SSvote.stored_modetier_results[M.config_tag] < Get(/datum/config_entry/number/dropped_modes))
if(CONFIG_GET(flag/modetier_voting) && !(M.config_tag in SSvote.stored_modetier_results))
qdel(M)
continue
if(min_pop[M.config_tag])
@@ -396,7 +396,6 @@
config_entry_value = TRUE
/datum/config_entry/flag/modetier_voting
config_entry_value = TRUE
/datum/config_entry/number/dropped_modes
config_entry_value = 3
+6 -6
View File
@@ -188,6 +188,12 @@ SUBSYSTEM_DEF(ticker)
tipped = TRUE
if(timeLeft <= 0)
if(SSvote.mode && (SSvote.mode == "roundtype" || SSvote.mode == "dynamic" || SSvote.mode == "mode tiers"))
SSvote.result()
SSpersistence.SaveSavedVotes()
for(var/client/C in SSvote.voting)
C << browse(null, "window=vote;can_close=0")
SSvote.reset()
current_state = GAME_STATE_SETTING_UP
Master.SetRunLevel(RUNLEVEL_SETUP)
if(start_immediately)
@@ -221,12 +227,6 @@ SUBSYSTEM_DEF(ticker)
var/init_start = world.timeofday
//Create and announce mode
var/list/datum/game_mode/runnable_modes
if(SSvote.mode && (SSvote.mode == "roundtype" || SSvote.mode == "dynamic" || SSvote.mode == "mode tiers"))
SSvote.result()
SSpersistence.SaveSavedVotes()
for(var/client/C in SSvote.voting)
C << browse(null, "window=vote;can_close=0")
SSvote.reset()
if(GLOB.master_mode == "random" || GLOB.master_mode == "secret")
runnable_modes = config.get_runnable_modes()
+76 -35
View File
@@ -102,17 +102,18 @@ SUBSYSTEM_DEF(vote)
var/list/d[][] = new/list(choices.len,choices.len) // the basic vote matrix, how many times a beats b
for(var/ckey in voted)
var/list/this_vote = voted[ckey]
for(var/a in 1 to choices.len)
for(var/b in a+1 to choices.len)
var/a_rank = this_vote.Find(a)
var/b_rank = this_vote.Find(b)
a_rank = a_rank ? a_rank : choices.len+1
b_rank = b_rank ? b_rank : choices.len+1
if(a_rank<b_rank)
d[a][b]++
else if(b_rank<a_rank)
d[b][a]++
//if equal, do nothing
if(islist(this_vote))
for(var/a in 1 to choices.len)
for(var/b in a+1 to choices.len)
var/a_rank = this_vote.Find(a)
var/b_rank = this_vote.Find(b)
a_rank = a_rank ? a_rank : choices.len+1
b_rank = b_rank ? b_rank : choices.len+1
if(a_rank<b_rank)
d[a][b]++
else if(b_rank<a_rank)
d[b][a]++
//if equal, do nothing
var/list/p[][] = new/list(choices.len,choices.len) //matrix of shortest path from a to b
for(var/i in 1 to choices.len)
for(var/j in 1 to choices.len)
@@ -142,15 +143,18 @@ SUBSYSTEM_DEF(vote)
// https://en.wikipedia.org/wiki/Majority_judgment
var/list/scores_by_choice = list()
for(var/choice in choices)
scores_by_choice[choice] = list()
scores_by_choice += "[choice]"
scores_by_choice["[choice]"] = list()
for(var/ckey in voted)
var/list/this_vote = voted[ckey]
var/list/pretty_vote = list()
for(var/choice in this_vote)
sorted_insert(scores_by_choice[choice],this_vote[choice],/proc/cmp_numeric_asc)
// START BALLOT GATHERING
pretty_vote += choice
pretty_vote[choice] = GLOB.vote_score_options[this_vote[choice]]
for(var/choice in choices)
if("[choice]" in this_vote && "[choice]" in scores_by_choice)
sorted_insert(scores_by_choice["[choice]"],this_vote["[choice]"],/proc/cmp_numeric_asc)
// START BALLOT GATHERING
pretty_vote += "[choice]"
if(this_vote["[choice]"] in GLOB.vote_score_options)
pretty_vote["[choice]"] = GLOB.vote_score_options[this_vote["[choice]"]]
SSblackbox.record_feedback("associative","voting_ballots",1,pretty_vote)
// END BALLOT GATHERING
for(var/score_name in scores_by_choice)
@@ -186,11 +190,13 @@ SUBSYSTEM_DEF(vote)
/datum/controller/subsystem/vote/proc/calculate_scores(var/blackbox_text)
var/list/scores_by_choice = list()
for(var/choice in choices)
scores_by_choice[choice] = list()
scores_by_choice += "[choice]"
scores_by_choice["[choice]"] = list()
for(var/ckey in voted)
var/list/this_vote = voted[ckey]
for(var/choice in this_vote)
sorted_insert(scores_by_choice[choice],this_vote[choice],/proc/cmp_numeric_asc)
for(var/choice in choices)
if("[choice]" in this_vote && "[choice]" in scores_by_choice)
sorted_insert(scores_by_choice["[choice]"],this_vote["[choice]"],/proc/cmp_numeric_asc)
var/middle_score = round(GLOB.vote_score_options.len/2,1)
for(var/score_name in scores_by_choice)
var/list/score = scores_by_choice[score_name]
@@ -212,6 +218,7 @@ SUBSYSTEM_DEF(vote)
calculate_condorcet_votes(vote_title_text)
if(vote_system == SCORE_VOTING)
calculate_majority_judgement_vote(vote_title_text)
calculate_scores(vote_title_text)
var/list/winners = get_result()
var/was_roundtype_vote = mode == "roundtype" || mode == "dynamic"
if(winners.len > 0)
@@ -219,13 +226,20 @@ SUBSYSTEM_DEF(vote)
stored_gamemode_votes = list()
if(!obfuscated && vote_system == RANKED_CHOICE_VOTING)
text += "\nIt should be noted that this is not a raw tally of votes (impossible in ranked choice) but the score determined by the schulze method of voting, so the numbers will look weird!"
for(var/i=1,i<=choices.len,i++)
var/votes = choices[choices[i]]
if(!votes)
votes = 0
if(was_roundtype_vote)
stored_gamemode_votes[choices[i]] = votes
text += "\n<b>[choices[i]]:</b> [obfuscated ? "???" : votes]" //CIT CHANGE - adds obfuscated votes
if(mode == "mode tiers")
for(var/score_name in scores)
var/score = scores[score_name]
if(!score)
score = 0
text = "\n<b>[score_name]:</b> [obfuscated ? "???" : score]"
else
for(var/i=1,i<=choices.len,i++)
var/votes = choices[choices[i]]
if(!votes)
votes = 0
if(was_roundtype_vote)
stored_gamemode_votes[choices[i]] = votes
text += "\n<b>[choices[i]]:</b> [obfuscated ? "???" : votes]" //CIT CHANGE - adds obfuscated votes
if(mode != "custom")
if(winners.len > 1 && !obfuscated) //CIT CHANGE - adds obfuscated votes
text = "\n<b>Vote Tied Between:</b>"
@@ -247,8 +261,9 @@ SUBSYSTEM_DEF(vote)
if(RANKED_CHOICE_VOTING)
for(var/i=1,i<=voted.len,i++)
var/list/myvote = voted[voted[i]]
for(var/j=1,j<=myvote.len,j++)
SSblackbox.record_feedback("nested tally","voting",1,list(vote_title_text,"[j]\th",choices[myvote[j]]))
if(islist(myvote))
for(var/j=1,j<=myvote.len,j++)
SSblackbox.record_feedback("nested tally","voting",1,list(vote_title_text,"[j]\th",choices[myvote[j]]))
if(obfuscated) //CIT CHANGE - adds obfuscated votes. this messages admins with the vote's true results
var/admintext = "Obfuscated results"
if(vote_system == RANKED_CHOICE_VOTING)
@@ -276,7 +291,7 @@ SUBSYSTEM_DEF(vote)
if(CONFIG_GET(flag/modetier_voting))
reset()
started_time = 0
initiate_vote("mode tiers","server",hideresults=FALSE,votesystem=RANKED_CHOICE_VOTING,forced=TRUE, vote_time = 30 MINUTES)
initiate_vote("mode tiers","server",hideresults=FALSE,votesystem=SCORE_VOTING,forced=TRUE, vote_time = 30 MINUTES)
to_chat(world,"<b>The vote will end right as the round starts.</b>")
return .
if("restart")
@@ -290,7 +305,14 @@ SUBSYSTEM_DEF(vote)
else
GLOB.master_mode = .
if("mode tiers")
stored_modetier_results = choices.Copy()
var/list/raw_score_numbers = list()
for(var/score_name in scores)
sorted_insert(raw_score_numbers,scores[score_name],/proc/cmp_numeric_asc)
stored_modetier_results = scores.Copy()
for(var/score_name in stored_modetier_results)
if(stored_modetier_results[score_name] <= raw_score_numbers[CONFIG_GET(number/dropped_modes)])
stored_modetier_results -= score_name
stored_modetier_results += "traitor"
if("dynamic")
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.")
@@ -417,6 +439,7 @@ SUBSYSTEM_DEF(vote)
for(var/tag in modes_to_add)
if(probabilities[tag] <= 0)
modes_to_add -= tag
modes_to_add -= "traitor" // makes it so that traitor is always available
choices.Add(modes_to_add)
if("dynamic")
for(var/T in config.storyteller_cache)
@@ -516,7 +539,7 @@ SUBSYSTEM_DEF(vote)
if(RANKED_CHOICE_VOTING)
var/list/myvote = voted[C.ckey]
for(var/i=1,i<=choices.len,i++)
var/vote = (myvote ? (myvote.Find(i)) : 0)
var/vote = (islist(myvote) ? (myvote.Find(i)) : 0)
if(vote)
. += "<li><b><a href='?src=[REF(src)];vote=[i]'>[choices[i]]</a> ([vote])</b></li>"
else
@@ -615,8 +638,12 @@ SUBSYSTEM_DEF(vote)
if(usr.ckey in voted)
if(!(usr.ckey in SSpersistence.saved_votes))
SSpersistence.saved_votes[usr.ckey] = list()
SSpersistence.saved_votes[usr.ckey][mode] = voted[usr.ckey]
saved += usr.ckey
if(islist(voted[usr.ckey]))
SSpersistence.saved_votes[usr.ckey][mode] = voted[usr.ckey]
saved += usr.ckey
else
voted[usr.ckey] = list()
to_chat(usr,"Your vote was malformed! Start over!")
if("load")
if(!(usr.ckey in SSpersistence.saved_votes))
SSpersistence.LoadSavedVote(usr.ckey)
@@ -627,7 +654,21 @@ SUBSYSTEM_DEF(vote)
else
SSpersistence.saved_votes[usr.ckey][mode] = list()
voted[usr.ckey] = SSpersistence.saved_votes[usr.ckey][mode]
saved += usr.ckey
if(islist(voted[usr.ckey]))
var/malformed = FALSE
if(vote_system == SCORE_VOTING)
for(var/thing in voted[usr.ckey])
if(!(thing in choices))
malformed = TRUE
if(!malformed)
saved += usr.ckey
else
to_chat(usr,"Your saved vote was malformed! Start over!")
SSpersistence.saved_votes[usr.ckey] -= mode
voted -= usr.ckey
else
to_chat(usr,"Your saved vote was malformed! Start over!")
voted -= usr.ckey
else
if(vote_system == SCORE_VOTING)
submit_vote(round(text2num(href_list["vote"])),round(text2num(href_list["score"])))
+6 -1
View File
@@ -380,9 +380,14 @@
/datum/map_template/shuttle/emergency/gorilla
suffix = "gorilla"
name = "Gorilla Cargo Freighter"
description = "A rustic, barely excuseable shuttle transporting important cargo. Not for crew who are about to go ape."
description = "(Emag only) A rustic, barely excuseable shuttle transporting important cargo. Not for crew who are about to go ape."
credit_cost = 2000
/datum/map_template/shuttle/emergency/gorilla/prerequisites_met()
if("emagged" in SSshuttle.shuttle_purchase_requirements_met)
return TRUE
return FALSE
/datum/map_template/shuttle/ferry/base
suffix = "base"
name = "transport ferry"
+3 -1
View File
@@ -99,10 +99,12 @@
id = "Mesmerize"
alert_type = /obj/screen/alert/status_effect/mesmerized
/datum/status_effect/no_combat_mode/mesmerize/on_apply()
/datum/status_effect/no_combat_mode/mesmerize/on_creation(mob/living/new_owner, set_duration)
. = ..()
ADD_TRAIT(owner, TRAIT_MUTE, "mesmerize")
/datum/status_effect/no_combat_mode/mesmerize/on_remove()
. = ..()
REMOVE_TRAIT(owner, TRAIT_MUTE, "mesmerize")
/obj/screen/alert/status_effect/mesmerized
+2 -2
View File
@@ -139,9 +139,9 @@
/datum/world_topic/status/Run(list/input, addr)
if(!key_valid) //If we have a key, then it's safe to trust that this isn't a malicious packet. Also prevents the extra info from leaking
if(GLOB.topic_status_lastcache <= world.time + 5)
if(GLOB.topic_status_lastcache >= world.time)
return GLOB.topic_status_cache
GLOB.topic_status_lastcache = world.time
GLOB.topic_status_lastcache = world.time + 5
. = list()
.["version"] = GLOB.game_version
.["mode"] = "hidden" //CIT CHANGE - hides the gamemode in topic() calls to prevent meta'ing the gamemode
+11 -3
View File
@@ -101,13 +101,23 @@
item_state = "synth"
instrumentId = "piano"
instrumentExt = "ogg"
var/static/list/insTypes = list("accordion" = "mid", "bikehorn" = "ogg", "glockenspiel" = "mid", "guitar" = "ogg", "harmonica" = "mid", "piano" = "ogg", "recorder" = "mid", "saxophone" = "mid", "trombone" = "mid", "violin" = "mid", "xylophone" = "mid") //No eguitar you ear-rapey fuckers.
var/static/list/insTypes = list("accordion" = "mid", "bikehorn" = "ogg", "glockenspiel" = "mid", "banjo" = "ogg", "guitar" = "ogg", "harmonica" = "mid", "piano" = "ogg", "recorder" = "mid", "saxophone" = "mid", "trombone" = "mid", "violin" = "mid", "xylophone" = "mid") //No eguitar you ear-rapey fuckers.
actions_types = list(/datum/action/item_action/synthswitch)
/obj/item/instrument/piano_synth/proc/changeInstrument(name = "piano")
song.instrumentDir = name
song.instrumentExt = insTypes[name]
/obj/item/instrument/banjo
name = "banjo"
desc = "A 'Mura' brand banjo. It's pretty much just a drum with a neck and strings."
icon_state = "banjo"
item_state = "banjo"
instrumentExt = "ogg"
attack_verb = list("scruggs-styled", "hum-diggitied", "shin-digged", "clawhammered")
hitsound = 'sound/weapons/banjoslap.ogg'
instrumentId = "banjo"
/obj/item/instrument/guitar
name = "guitar"
desc = "It's made of wood and has bronze strings."
@@ -263,8 +273,6 @@
throw_range = 15
hitsound = 'sound/items/bikehorn.ogg'
///
/obj/item/musicaltuner
name = "musical tuner"
desc = "A device for tuning musical instruments both manual and electronic alike."
@@ -91,7 +91,7 @@
target.Stun(40) //Utterly useless without this, its okay since there are so many checks to go through
target.apply_status_effect(STATUS_EFFECT_MESMERIZE, 45) //So you cant rotate with combat mode, plus fancy status alert
if(do_mob(user, target, 40, 0, TRUE, extra_checks=CALLBACK(src, .proc/ContinueActive, user, target)))
if(do_mob(user, target, 40, 0, TRUE, extra_checks = CALLBACK(src, .proc/ContinueActive, user, target)))
PowerActivatedSuccessfully() // PAY COST! BEGIN COOLDOWN!
var/power_time = 90 + level_current * 12
target.apply_status_effect(STATUS_EFFECT_MESMERIZE, power_time + 80)
+5 -4
View File
@@ -2,8 +2,9 @@ GLOBAL_LIST_EMPTY(clientmessages)
/proc/addclientmessage(var/ckey, var/message)
ckey = ckey(ckey)
if (!ckey || !message)
if(!ckey || !message)
return
if (!(ckey in GLOB.clientmessages))
GLOB.clientmessages[ckey] = list()
GLOB.clientmessages[ckey] += message
var/list/L = GLOB.clientmessages[ckey]
if(!L)
GLOB.clientmessages[ckey] = L = list()
L += message
+1 -1
View File
@@ -25,7 +25,7 @@
else
log_admin("Client [ckey] was just autokicked for flooding keysends; likely abuse but potentially lagspike.")
message_admins("Client [ckey] was just autokicked for flooding keysends; likely abuse but potentially lagspike.")
QDEL_IN(src, 1)
qdel(src)
return
///Check if the key is short enough to even be a real key
@@ -244,6 +244,10 @@
name = "Shark"
icon_state = "shark"
/datum/sprite_accessory/mam_snouts/hshark
name = "hShark"
icon_state = "hshark"
/datum/sprite_accessory/mam_snouts/toucan
name = "Toucan"
icon_state = "toucan"
+2 -2
View File
@@ -833,8 +833,8 @@ Nothing else in the console has ID requirements.
for(var/i in 1 to length(ui))
if(!findtextEx(ui[i], RDSCREEN_NOBREAK))
ui[i] += "<br>"
ui[i] = replacetextEx(ui[i], RDSCREEN_NOBREAK, "")
return ui.Join("")
. = ui.Join("")
return replacetextEx(., RDSCREEN_NOBREAK, "")
/obj/machinery/computer/rdconsole/Topic(raw, ls)
if(..())
+6
View File
@@ -131,6 +131,12 @@
/obj/item/clothing/suit/drfreeze_coat = 1,
/obj/item/clothing/suit/gothcoat = 2,
/obj/item/clothing/under/draculass = 1,
/obj/item/clothing/under/christmas/christmasmaler = 3,
/obj/item/clothing/under/christmas/christmasmaleg = 3,
/obj/item/clothing/under/christmas/christmasfemaler = 3,
/obj/item/clothing/under/christmas/christmasfemaleg = 3,
/obj/item/clothing/head/christmashat = 3,
/obj/item/clothing/head/christmashatg = 3,
/obj/item/clothing/under/drfreeze = 1) //End of Cit Changes
refill_canister = /obj/item/vending_refill/autodrobe
+4
View File
@@ -123,15 +123,19 @@
/obj/item/clothing/ears/headphones = 10,
/obj/item/clothing/suit/apron/purple_bartender = 4,
/obj/item/clothing/under/rank/bartender/purple = 4,
/* Commenting out until next Christmas or made automatic
/obj/item/clothing/under/christmas/christmasmaler = 3,
/obj/item/clothing/under/christmas/christmasmaleg = 3,
/obj/item/clothing/under/christmas/christmasfemaler = 3,
/obj/item/clothing/under/christmas/christmasfemaleg = 3,
*/
/obj/item/clothing/suit/hooded/wintercoat/christmascoatr = 3,
/obj/item/clothing/suit/hooded/wintercoat/christmascoatg = 3,
/obj/item/clothing/suit/hooded/wintercoat/christmascoatrg = 3,
/*Commenting out until next Christmas or made automatic
/obj/item/clothing/head/christmashat = 3,
/obj/item/clothing/head/christmashatg = 3,
*/
/obj/item/clothing/shoes/winterboots/christmasbootsr = 3,
/obj/item/clothing/shoes/winterboots/christmasbootsg = 3,
/obj/item/clothing/shoes/winterboots/santaboots = 3,