From d26f642daf4ab6ca59edb9f48b23390220acaa53 Mon Sep 17 00:00:00 2001 From: KorPhaeron Date: Sun, 1 Nov 2015 03:36:01 -0600 Subject: [PATCH 1/2] Jobbans --- code/game/gamemodes/cult/cult.dm | 2 ++ code/game/gamemodes/game_mode.dm | 11 ++++++ code/game/gamemodes/gang/gang.dm | 2 ++ code/game/gamemodes/revolution/revolution.dm | 2 ++ html/changelogs/Kor-Jobban.yml | 36 ++++++++++++++++++++ 5 files changed, 53 insertions(+) create mode 100644 html/changelogs/Kor-Jobban.yml diff --git a/code/game/gamemodes/cult/cult.dm b/code/game/gamemodes/cult/cult.dm index 86068219c85..bcede43f5a8 100644 --- a/code/game/gamemodes/cult/cult.dm +++ b/code/game/gamemodes/cult/cult.dm @@ -187,6 +187,8 @@ cult_mind.current.cult_add_comm() update_cult_icons_added(cult_mind) cult_mind.current.attack_log += "\[[time_stamp()]\] Has been converted to the cult!" + if(jobban_isbanned(cult_mind.current, "Cultist")) + replace_jobbaned_player(cult_mind.current, "Cultist") return 1 diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index cb0b63bf3e4..09c8615de79 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -533,3 +533,14 @@ return 0 return max(0, enemy_minimum_age - C.player_age) + + +/datum/game_mode/proc/replace_jobbaned_player(mob/living/M, role_type) + var/list/mob/dead/observer/candidates = pollCandidates("Do you want to play as a [role_type]?", "[role_type]", null, FALSE, 100) + var/mob/dead/observer/theghost = null + if(candidates.len) + theghost = pick(candidates) + M << "Your mob has been taken over by a ghost! Appeal your job ban if you want to avoid this in the future!" + message_admins("[key_name_admin(theghost)] has taken control of ([key_name_admin(M)]) to replace a jobbaned player.") + M.ghostize() + M.key = theghost.key diff --git a/code/game/gamemodes/gang/gang.dm b/code/game/gamemodes/gang/gang.dm index f6b6aed3925..7a7ba415cba 100644 --- a/code/game/gamemodes/gang/gang.dm +++ b/code/game/gamemodes/gang/gang.dm @@ -184,6 +184,8 @@ var/list/gang_colors_pool = list("red","orange","yellow","green","blue","purple" gangster_mind.current.attack_log += "\[[time_stamp()]\] Has been converted to the [G.name] Gang!" gangster_mind.special_role = "[G.name] Gangster" G.add_gang_hud(gangster_mind) + if(jobban_isbanned(gangster_mind.current, "Gangster")) + replace_jobbaned_player(gangster_mind.current, "Gangster") return 2 //////////////////////////////////////////////////////////////////// //Deals with players reverting to neutral (Not a gangster anymore)// diff --git a/code/game/gamemodes/revolution/revolution.dm b/code/game/gamemodes/revolution/revolution.dm index 98cce988565..eed7e8bb950 100644 --- a/code/game/gamemodes/revolution/revolution.dm +++ b/code/game/gamemodes/revolution/revolution.dm @@ -252,6 +252,8 @@ rev_mind.current.attack_log += "\[[time_stamp()]\] Has been converted to the revolution!" rev_mind.special_role = "Revolutionary" update_rev_icons_added(rev_mind) + if(jobban_isbanned(rev_mind.current, "Revolutionary")) + replace_jobbaned_player(rev_mind.current, "Revolutionary") return 1 ////////////////////////////////////////////////////////////////////////////// //Deals with players being converted from the revolution (Not a rev anymore)// // Modified to handle borged MMIs. Accepts another var if the target is being borged at the time -- Polymorph. diff --git a/html/changelogs/Kor-Jobban.yml b/html/changelogs/Kor-Jobban.yml new file mode 100644 index 00000000000..f86c6a5d52c --- /dev/null +++ b/html/changelogs/Kor-Jobban.yml @@ -0,0 +1,36 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# spellcheck (typo fixes) +# experiment +# tgs (TG-ported fixes?) +################################# + +# Your name. +author: Kor + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, this gets changed to [] after reading. Just remove the brackets when you add new shit. +# Please surround your changes in double quotes ("). It works without them, but if you use certain characters it screws up compiling. The quotes will not show up in the changelog. +changes: + - rscadd: "Converting (to cultist, rev, or gangster) a jobbaned player will now automatically offer control of their character to ghosts." From 46da6c62c5355cd652faddacd1502c327d12d64b Mon Sep 17 00:00:00 2001 From: KorPhaeron Date: Wed, 4 Nov 2015 02:28:31 -0600 Subject: [PATCH 2/2] Preferences --- code/game/gamemodes/cult/cult.dm | 2 +- code/game/gamemodes/game_mode.dm | 4 ++-- code/game/gamemodes/gang/gang.dm | 2 +- code/game/gamemodes/revolution/revolution.dm | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/code/game/gamemodes/cult/cult.dm b/code/game/gamemodes/cult/cult.dm index bcede43f5a8..cd25af1f64a 100644 --- a/code/game/gamemodes/cult/cult.dm +++ b/code/game/gamemodes/cult/cult.dm @@ -188,7 +188,7 @@ update_cult_icons_added(cult_mind) cult_mind.current.attack_log += "\[[time_stamp()]\] Has been converted to the cult!" if(jobban_isbanned(cult_mind.current, "Cultist")) - replace_jobbaned_player(cult_mind.current, "Cultist") + replace_jobbaned_player(cult_mind.current, "Cultist", BE_CULTIST) return 1 diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index 09c8615de79..5102d80a274 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -535,8 +535,8 @@ return max(0, enemy_minimum_age - C.player_age) -/datum/game_mode/proc/replace_jobbaned_player(mob/living/M, role_type) - var/list/mob/dead/observer/candidates = pollCandidates("Do you want to play as a [role_type]?", "[role_type]", null, FALSE, 100) +/datum/game_mode/proc/replace_jobbaned_player(mob/living/M, role_type, pref) + var/list/mob/dead/observer/candidates = pollCandidates("Do you want to play as a [role_type]?", "[role_type]", null, pref, 100) var/mob/dead/observer/theghost = null if(candidates.len) theghost = pick(candidates) diff --git a/code/game/gamemodes/gang/gang.dm b/code/game/gamemodes/gang/gang.dm index 7a7ba415cba..005e89da0ff 100644 --- a/code/game/gamemodes/gang/gang.dm +++ b/code/game/gamemodes/gang/gang.dm @@ -185,7 +185,7 @@ var/list/gang_colors_pool = list("red","orange","yellow","green","blue","purple" gangster_mind.special_role = "[G.name] Gangster" G.add_gang_hud(gangster_mind) if(jobban_isbanned(gangster_mind.current, "Gangster")) - replace_jobbaned_player(gangster_mind.current, "Gangster") + replace_jobbaned_player(gangster_mind.current, "Gangster", BE_GANG) return 2 //////////////////////////////////////////////////////////////////// //Deals with players reverting to neutral (Not a gangster anymore)// diff --git a/code/game/gamemodes/revolution/revolution.dm b/code/game/gamemodes/revolution/revolution.dm index eed7e8bb950..b40f42080eb 100644 --- a/code/game/gamemodes/revolution/revolution.dm +++ b/code/game/gamemodes/revolution/revolution.dm @@ -253,7 +253,7 @@ rev_mind.special_role = "Revolutionary" update_rev_icons_added(rev_mind) if(jobban_isbanned(rev_mind.current, "Revolutionary")) - replace_jobbaned_player(rev_mind.current, "Revolutionary") + replace_jobbaned_player(rev_mind.current, "Revolutionary", BE_REV) return 1 ////////////////////////////////////////////////////////////////////////////// //Deals with players being converted from the revolution (Not a rev anymore)// // Modified to handle borged MMIs. Accepts another var if the target is being borged at the time -- Polymorph.