diff --git a/code/__DEFINES/preferences.dm b/code/__DEFINES/preferences.dm index b5674ad9dd4..bfa8b697c98 100644 --- a/code/__DEFINES/preferences.dm +++ b/code/__DEFINES/preferences.dm @@ -28,22 +28,3 @@ #define TOGGLES_DEFAULT_CHAT (CHAT_OOC|CHAT_DEAD|CHAT_GHOSTEARS|CHAT_GHOSTSIGHT|CHAT_PRAYER|CHAT_RADIO|CHAT_PULLR|CHAT_GHOSTWHISPER|CHAT_GHOSTPDA|CHAT_GHOSTRADIO) -//Antag preferences -#define BE_TRAITOR 1 -#define BE_OPERATIVE 2 -#define BE_CHANGELING 3 -#define BE_WIZARD 4 -#define BE_MALF 5 -#define BE_REV 6 -#define BE_ALIEN 7 -#define BE_PAI 8 -#define BE_CULTIST 9 -#define BE_BLOB 10 -#define BE_NINJA 11 -#define BE_MONKEY 12 -#define BE_GANG 13 -#define BE_SHADOWLING 14 -#define BE_ABDUCTOR 15 -#define BE_REVENANT 16 -#define BE_HOG_GOD 17 -#define BE_HOG_CULTIST 18 diff --git a/code/__DEFINES/role_preferences.dm b/code/__DEFINES/role_preferences.dm new file mode 100644 index 00000000000..63b85ec17b6 --- /dev/null +++ b/code/__DEFINES/role_preferences.dm @@ -0,0 +1,50 @@ + + +//Values for antag preferences, event roles, etc. unified here + + + +//These are synced with the Database, if you change the values of the defines +//then you MUST update the database! +#define ROLE_TRAITOR "traitor" +#define ROLE_OPERATIVE "operative" +#define ROLE_CHANGELING "changeling" +#define ROLE_WIZARD "wizard" +#define ROLE_MALF "malf AI" +#define ROLE_REV "revolutionary" +#define ROLE_ALIEN "xenomorph" +#define ROLE_PAI "pAI" +#define ROLE_CULTIST "cultist" +#define ROLE_BLOB "blob" +#define ROLE_NINJA "space ninja" +#define ROLE_MONKEY "monkey" +#define ROLE_GANG "gangster" +#define ROLE_SHADOWLING "shadowling" +#define ROLE_ABDUCTOR "abductor" +#define ROLE_REVENANT "revenant" +#define ROLE_HOG_GOD "hand of god: god" +#define ROLE_HOG_CULTIST "hand of god: cultist" + + +//Missing assignment means it's not a gamemode specific role, IT'S NOT A BUG OR ERROR. +//The gamemode specific ones are just so the gamemodes can query whether a player is old enough +//(in game days played) to play that role +var/global/list/special_roles = list( + ROLE_TRAITOR = /datum/game_mode/traitor, + ROLE_OPERATIVE = /datum/game_mode/nuclear, + ROLE_CHANGELING = /datum/game_mode/changeling, + ROLE_WIZARD = /datum/game_mode/wizard, + ROLE_MALF = /datum/game_mode/malfunction, + ROLE_REV = /datum/game_mode/revolution, + ROLE_ALIEN, + ROLE_PAI, + ROLE_CULTIST = /datum/game_mode/cult, + ROLE_BLOB = /datum/game_mode/blob, + ROLE_NINJA, + ROLE_MONKEY = /datum/game_mode/monkey, + ROLE_GANG = /datum/game_mode/gang, + ROLE_SHADOWLING = /datum/game_mode/shadowling, + ROLE_ABDUCTOR = /datum/game_mode/abduction, + ROLE_HOG_GOD = /datum/game_mode/hand_of_god, + ROLE_HOG_CULTIST = /datum/game_mode/hand_of_god, +) diff --git a/code/_globalvars/configuration.dm b/code/_globalvars/configuration.dm index dac3d69f6fd..550a4672621 100644 --- a/code/_globalvars/configuration.dm +++ b/code/_globalvars/configuration.dm @@ -33,23 +33,3 @@ var/MAX_EX_LIGHT_RANGE = 14 var/MAX_EX_FLASH_RANGE = 14 var/MAX_EX_FLAME_RANGE = 14 -var/list/be_special_flags = list( - "Traitor" = BE_TRAITOR, - "Operative" = BE_OPERATIVE, - "Changeling" = BE_CHANGELING, - "Wizard" = BE_WIZARD, - "Malf AI" = BE_MALF, - "Revolutionary" = BE_REV, - "Alien Lifeform" = BE_ALIEN, - "pAI" = BE_PAI, - "Cultist" = BE_CULTIST, - "Blob" = BE_BLOB, - "Ninja" = BE_NINJA, - "Monkey" = BE_MONKEY, - "Gang" = BE_GANG, - "Abductor" = BE_ABDUCTOR, - "Revenant" = BE_REVENANT, - "Shadowling" = BE_SHADOWLING, - "Hand of god, god" = BE_HOG_GOD, - "Hand of god, cultist" = BE_HOG_CULTIST - ) diff --git a/code/controllers/subsystem/pai.dm b/code/controllers/subsystem/pai.dm index 8fe3e03edbb..af09a53846a 100644 --- a/code/controllers/subsystem/pai.dm +++ b/code/controllers/subsystem/pai.dm @@ -181,7 +181,7 @@ var/datum/subsystem/pai/SSpai /datum/subsystem/pai/proc/requestRecruits() for(var/mob/dead/observer/O in player_list) - if(jobban_isbanned(O, "pAI")) + if(jobban_isbanned(O, ROLE_PAI)) continue if(asked.Find(O.key)) if(world.time < asked[O.key] + askDelay) @@ -193,7 +193,7 @@ var/datum/subsystem/pai/SSpai for(var/datum/paiCandidate/c in SSpai.candidates) if(c.key == O.key) hasSubmitted = 1 - if(!hasSubmitted && (BE_PAI in O.client.prefs.be_special)) + if(!hasSubmitted && (ROLE_PAI in O.client.prefs.be_special)) question(O.client) /datum/subsystem/pai/proc/question(client/C) diff --git a/code/datums/hud.dm b/code/datums/hud.dm index 73a1b86084c..25fa65173aa 100644 --- a/code/datums/hud.dm +++ b/code/datums/hud.dm @@ -21,6 +21,8 @@ var/datum/atom_hud/huds = list( \ var/list/hud_icons = list() //these will be the indexes for the atom's hud_list /datum/atom_hud/proc/remove_hud_from(mob/M) + if(!M) + return if(src in M.permanent_huds) return for(var/atom/A in hudatoms) @@ -28,31 +30,38 @@ var/datum/atom_hud/huds = list( \ hudusers -= M /datum/atom_hud/proc/remove_from_hud(atom/A) + if(!A) + return for(var/mob/M in hudusers) remove_from_single_hud(M, A) hudatoms -= A /datum/atom_hud/proc/remove_from_single_hud(mob/M, atom/A) //unsafe, no sanity apart from client - if(!M.client) + if(!M || !M.client || !A) return for(var/i in hud_icons) M.client.images -= A.hud_list[i] /datum/atom_hud/proc/add_hud_to(mob/M) + if(!M) + return hudusers |= M for(var/atom/A in hudatoms) add_to_single_hud(M, A) /datum/atom_hud/proc/add_to_hud(atom/A) + if(!A) + return hudatoms |= A for(var/mob/M in hudusers) add_to_single_hud(M, A) /datum/atom_hud/proc/add_to_single_hud(mob/M, atom/A) //unsafe, no sanity apart from client - if(!M.client) + if(!M || !M.client || !A) return for(var/i in hud_icons) - M.client.images |= A.hud_list[i] + if(A.hud_list[i]) + M.client.images |= A.hud_list[i] //MOB PROCS /mob/proc/reload_huds() diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 69bd3770660..81a45534cc2 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -61,10 +61,10 @@ src.key = key -/datum/mind/proc/transfer_to(mob/living/new_character) - if(!istype(new_character)) - throw EXCEPTION("transfer_to(): new_character must be mob/living") - return +/datum/mind/proc/transfer_to(mob/new_character) + //if(!istype(new_character)) + // throw EXCEPTION("transfer_to(): new_character must be mob/living") + // return if(current) //remove ourself from our old body's mind variable current.mind = null @@ -285,7 +285,7 @@ else text += "head|loyal|EMPLOYEE|headrev|rev" - if(current && current.client && (BE_REV in current.client.prefs.be_special)) + if(current && current.client && (ROLE_REV in current.client.prefs.be_special)) text += "|Enabled in Prefs" else text += "|Disabled in Prefs" @@ -303,7 +303,7 @@ else text += "NONE" - if(current && current.client && (BE_GANG in current.client.prefs.be_special)) + if(current && current.client && (ROLE_GANG in current.client.prefs.be_special)) text += "|Enabled in Prefs
" else text += "|Disabled in Prefs
" @@ -350,7 +350,7 @@ else text += "loyal|EMPLOYEE|cultist" - if(current && current.client && (BE_CULTIST in current.client.prefs.be_special)) + if(current && current.client && (ROLE_CULTIST in current.client.prefs.be_special)) text += "|Enabled in Prefs" else text += "|Disabled in Prefs" @@ -370,7 +370,7 @@ else text += "yes|NO" - if(current && current.client && (BE_WIZARD in current.client.prefs.be_special)) + if(current && current.client && (ROLE_WIZARD in current.client.prefs.be_special)) text += "|Enabled in Prefs" else text += "|Disabled in Prefs" @@ -394,7 +394,7 @@ // if (istype(changeling) && changeling.changelingdeath) // text += "
All the changelings are dead! Restart in [round((changeling.TIME_TO_GET_REVIVED-(world.time-changeling.changelingdeathtime))/10)] seconds." - if(current && current.client && (BE_CHANGELING in current.client.prefs.be_special)) + if(current && current.client && (ROLE_CHANGELING in current.client.prefs.be_special)) text += "|Enabled in Prefs" else text += "|Disabled in Prefs" @@ -419,7 +419,7 @@ else text += "operative|NANOTRASEN" - if(current && current.client && (BE_OPERATIVE in current.client.prefs.be_special)) + if(current && current.client && (ROLE_OPERATIVE in current.client.prefs.be_special)) text += "|Enabled in Prefs" else text += "|Disabled in Prefs" @@ -438,7 +438,7 @@ else text += "traitor|LOYAL" - if(current && current.client && (BE_TRAITOR in current.client.prefs.be_special)) + if(current && current.client && (ROLE_TRAITOR in current.client.prefs.be_special)) text += "|Enabled in Prefs" else text += "|Disabled in Prefs" @@ -457,7 +457,7 @@ else text += "shadowling|thrall|HUMAN" - if(current && current.client && (BE_SHADOWLING in current.client.prefs.be_special)) + if(current && current.client && (ROLE_SHADOWLING in current.client.prefs.be_special)) text += "|Enabled in Prefs" else text += "|Disabled in Prefs" @@ -476,7 +476,7 @@ else text += "Abductor|human" - if(current && current.client && (BE_ABDUCTOR in current.client.prefs.be_special)) + if(current && current.client && (ROLE_ABDUCTOR in current.client.prefs.be_special)) text += "|Enabled in Prefs" else text += "|Disabled in Prefs" @@ -499,12 +499,12 @@ else text += "red prophet|red follower|EMPLOYEE|blue follower|blue prophet" - if(current && current.client && (BE_HOG_GOD in current.client.prefs.be_special)) + if(current && current.client && (ROLE_HOG_GOD in current.client.prefs.be_special)) text += "|HOG God Enabled in Prefs" else text += "|HOG God Disabled in Prefs" - if(current && current.client && (BE_HOG_CULTIST in current.client.prefs.be_special)) + if(current && current.client && (ROLE_HOG_CULTIST in current.client.prefs.be_special)) text += "|HOG Cultist Enabled in Prefs" else text += "|HOG Disabled in Prefs" @@ -532,7 +532,7 @@ else text += "healthy|infected|human|OTHER" - if(current && current.client && (BE_MONKEY in current.client.prefs.be_special)) + if(current && current.client && (ROLE_MONKEY in current.client.prefs.be_special)) text += "|Enabled in Prefs" else text += "|Disabled in Prefs" @@ -563,7 +563,7 @@ n_e_robots++ text += "
[n_e_robots] of [ai.connected_robots.len] slaved cyborgs are emagged. Unemag" - if(current && current.client && (BE_MALF in current.client.prefs.be_special)) + if(current && current.client && (ROLE_MALF in current.client.prefs.be_special)) text += "|Enabled in Prefs" else text += "|Disabled in Prefs" @@ -1536,6 +1536,8 @@ ticker.mode.blue_deity_followers -= src ticker.mode.blue_deity_prophets -= src + current.faction |= "red god" + current.faction -= "blue god" if(src in ticker.mode.red_deity_prophets) current << "You have lost the connection with your deity, but you still believe in their grand design, You are no longer a prophet!" @@ -1553,6 +1555,8 @@ ticker.mode.red_deity_followers -= src ticker.mode.red_deity_prophets -= src + current.faction -= "red god" + current.faction |= "blue god" if(src in ticker.mode.blue_deity_prophets) current << "You have lost the connection with your deity, but you still believe in their grand design, You are no longer a prophet!" @@ -1579,6 +1583,8 @@ if(src in ticker.mode.blue_deity_followers || src in ticker.mode.blue_deity_prophets) current << "You are no longer a member of the Blue cult!" + current.faction -= "blue god" + current.faction |= "red god" ticker.mode.blue_deity_followers -= src ticker.mode.blue_deity_prophets -= src @@ -1594,6 +1600,8 @@ if(src in ticker.mode.red_deity_followers || src in ticker.mode.red_deity_prophets) current << "You are no longer a member of the Red cult!" + current.faction -= "red god" + current.faction |= "blue god" ticker.mode.red_deity_followers -= src ticker.mode.red_deity_prophets -= src diff --git a/code/game/gamemodes/abduction/abduction.dm b/code/game/gamemodes/abduction/abduction.dm index 1151de4f55f..8b280473a33 100644 --- a/code/game/gamemodes/abduction/abduction.dm +++ b/code/game/gamemodes/abduction/abduction.dm @@ -6,7 +6,7 @@ /datum/game_mode/abduction name = "abduction" config_tag = "abduction" - antag_flag = BE_ABDUCTOR + antag_flag = ROLE_ABDUCTOR recommended_enemies = 2 required_players = 15 var/max_teams = 4 diff --git a/code/game/gamemodes/antag_hud.dm b/code/game/gamemodes/antag_hud.dm index f2294177272..267cafccd31 100644 --- a/code/game/gamemodes/antag_hud.dm +++ b/code/game/gamemodes/antag_hud.dm @@ -1,9 +1,9 @@ /datum/atom_hud/antag hud_icons = list(ANTAG_HUD) -/datum/atom_hud/antag/proc/join_hud(mob/living/M) +/datum/atom_hud/antag/proc/join_hud(mob/M) if(!istype(M)) - CRASH("join_hud(): [M] ([M.type]) is not a living mob!") + CRASH("join_hud(): [M] ([M.type]) is not a mob!") if(M.mind.antag_hud) var/datum/atom_hud/antag/oldhud = M.mind.antag_hud oldhud.leave_hud(M) @@ -11,9 +11,9 @@ add_hud_to(M) M.mind.antag_hud = src -/datum/atom_hud/antag/proc/leave_hud(mob/living/M) +/datum/atom_hud/antag/proc/leave_hud(mob/M) if(!istype(M)) - CRASH("leave_hud(): [M] ([M.type]) is not a living mob!") + CRASH("leave_hud(): [M] ([M.type]) is not a mob!") remove_from_hud(M) remove_hud_from(M) M.mind.antag_hud = null @@ -21,17 +21,18 @@ //GAME_MODE PROCS //called to set a mob's antag icon state -/datum/game_mode/proc/set_antag_hud(mob/living/M, new_icon_state) +/datum/game_mode/proc/set_antag_hud(mob/M, new_icon_state) if(!istype(M)) - CRASH("set_antag_hud(): [M] ([M.type]) is not a living mob!") + CRASH("set_antag_hud(): [M] ([M.type]) is not a mob!") var/image/holder = M.hud_list[ANTAG_HUD] - holder.icon_state = new_icon_state + if(holder) + holder.icon_state = new_icon_state M.mind.antag_hud_icon_state = new_icon_state //MIND PROCS //this is called by mind.transfer_to() -/datum/mind/proc/transfer_antag_huds(mob/living/M) +/datum/mind/proc/transfer_antag_huds(mob/M) for(var/datum/atom_hud/antag/hud in huds) if(M in hud.hudusers) hud.leave_hud(M) diff --git a/code/game/gamemodes/antag_spawner.dm b/code/game/gamemodes/antag_spawner.dm index 99541008be4..066ecb1706e 100644 --- a/code/game/gamemodes/antag_spawner.dm +++ b/code/game/gamemodes/antag_spawner.dm @@ -53,7 +53,7 @@ if (used) H << "You already used this contract!" return - var/list/candidates = get_candidates(BE_WIZARD) + var/list/candidates = get_candidates(ROLE_WIZARD) if(candidates.len) src.used = 1 var/client/C = pick(candidates) @@ -135,7 +135,7 @@ borg_to_spawn = input("What type?", "Cyborg Type", type) as null|anything in possible_types if(!borg_to_spawn) return - var/list/borg_candicates = get_candidates(BE_OPERATIVE) + var/list/borg_candicates = get_candidates(ROLE_OPERATIVE) if(borg_candicates.len > 0) used = 1 var/client/C = pick(borg_candicates) @@ -171,7 +171,7 @@ /obj/item/weapon/antag_spawner/slaughter_demon/attack_self(mob/user) - var/list/demon_candidates = get_candidates(BE_ALIEN) + var/list/demon_candidates = get_candidates(ROLE_ALIEN) if(user.z != 1) user << "You should probably wait until you reach the station." return diff --git a/code/game/gamemodes/blob/blob.dm b/code/game/gamemodes/blob/blob.dm index 8f468a7abb9..adb43dff46a 100644 --- a/code/game/gamemodes/blob/blob.dm +++ b/code/game/gamemodes/blob/blob.dm @@ -9,7 +9,7 @@ var/list/blob_nodes = list() /datum/game_mode/blob name = "blob" config_tag = "blob" - antag_flag = BE_BLOB + antag_flag = ROLE_BLOB required_players = 30 required_enemies = 1 @@ -53,7 +53,7 @@ var/list/blob_nodes = list() /datum/game_mode/blob/proc/get_blob_candidates() var/list/candidates = list() for(var/mob/living/carbon/human/player in player_list) - if(!player.stat && player.mind && !player.mind.special_role && !jobban_isbanned(player, "Syndicate") && (BE_BLOB in player.client.prefs.be_special)) + if(!player.stat && player.mind && !player.mind.special_role && !jobban_isbanned(player, "Syndicate") && (ROLE_BLOB in player.client.prefs.be_special)) if(age_check(player.client)) candidates += player return candidates diff --git a/code/game/gamemodes/blob/blobs/core.dm b/code/game/gamemodes/blob/blobs/core.dm index b4abfdc9e57..e7647a048b0 100644 --- a/code/game/gamemodes/blob/blobs/core.dm +++ b/code/game/gamemodes/blob/blobs/core.dm @@ -98,7 +98,7 @@ var/list/candidates = list() if(!new_overmind) - candidates = get_candidates(BE_BLOB) + candidates = get_candidates(ROLE_BLOB) if(candidates.len) C = pick(candidates) else diff --git a/code/game/gamemodes/changeling/changeling.dm b/code/game/gamemodes/changeling/changeling.dm index 1f845c99e96..f1101aa26fb 100644 --- a/code/game/gamemodes/changeling/changeling.dm +++ b/code/game/gamemodes/changeling/changeling.dm @@ -15,7 +15,7 @@ var/list/slot2type = list("head" = /obj/item/clothing/head/changeling, "wear_mas /datum/game_mode/changeling name = "changeling" config_tag = "changeling" - antag_flag = BE_CHANGELING + antag_flag = ROLE_CHANGELING restricted_jobs = list("AI", "Cyborg") protected_jobs = list("Security Officer", "Warden", "Detective", "Head of Security", "Captain") required_players = 15 @@ -105,8 +105,8 @@ var/list/slot2type = list("head" = /obj/item/clothing/head/changeling, "wear_mas if(ticker.mode.changelings.len >= changelingcap) //Caps number of latejoin antagonists return if(ticker.mode.changelings.len <= (changelingcap - 2) || prob(100 - (config.changeling_scaling_coeff*2))) - if(BE_CHANGELING in character.client.prefs.be_special) - if(!jobban_isbanned(character.client, "changeling") && !jobban_isbanned(character.client, "Syndicate")) + if(ROLE_CHANGELING in character.client.prefs.be_special) + if(!jobban_isbanned(character.client, ROLE_CHANGELING) && !jobban_isbanned(character.client, "Syndicate")) if(age_check(character.client)) if(!(character.job in restricted_jobs)) character.mind.make_Changling() diff --git a/code/game/gamemodes/changeling/traitor_chan.dm b/code/game/gamemodes/changeling/traitor_chan.dm index 99d4b8bef22..2d906e37ed0 100644 --- a/code/game/gamemodes/changeling/traitor_chan.dm +++ b/code/game/gamemodes/changeling/traitor_chan.dm @@ -18,7 +18,7 @@ /datum/game_mode/traitor/changeling/can_start() if(!..()) return 0 - possible_changelings = get_players_for_role(BE_CHANGELING) + possible_changelings = get_players_for_role(ROLE_CHANGELING) if(possible_changelings.len < required_enemies) return 0 return 1 @@ -30,7 +30,7 @@ if(config.protect_assistant_from_antagonist) restricted_jobs += "Assistant" - var/list/datum/mind/possible_changelings = get_players_for_role(BE_CHANGELING) + var/list/datum/mind/possible_changelings = get_players_for_role(ROLE_CHANGELING) var/num_changelings = 1 @@ -66,8 +66,8 @@ ..() return if(ticker.mode.changelings.len <= (changelingcap - 2) || prob(100 / (config.changeling_scaling_coeff * 4))) - if(BE_CHANGELING in character.client.prefs.be_special) - if(!jobban_isbanned(character.client, "changeling") && !jobban_isbanned(character.client, "Syndicate")) + if(ROLE_CHANGELING in character.client.prefs.be_special) + if(!jobban_isbanned(character.client, ROLE_CHANGELING) && !jobban_isbanned(character.client, "Syndicate")) if(age_check(character.client)) if(!(character.job in restricted_jobs)) character.mind.make_Changling() diff --git a/code/game/gamemodes/cult/cult.dm b/code/game/gamemodes/cult/cult.dm index eb56a644fb6..9d30823d8c0 100644 --- a/code/game/gamemodes/cult/cult.dm +++ b/code/game/gamemodes/cult/cult.dm @@ -50,7 +50,7 @@ /datum/game_mode/cult name = "cult" config_tag = "cult" - antag_flag = BE_CULTIST + antag_flag = ROLE_CULTIST restricted_jobs = list("Chaplain","AI", "Cyborg", "Security Officer", "Warden", "Detective", "Head of Security", "Captain", "Head of Personnel") protected_jobs = list() required_players = 20 diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index 33da424db36..a6ebfca59f4 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -292,21 +292,6 @@ var/list/drafted = list() var/datum/mind/applicant = null - var/roletext - switch(role) - if(BE_CHANGELING) roletext="changeling" - if(BE_TRAITOR) roletext="traitor" - if(BE_OPERATIVE) roletext="operative" - if(BE_WIZARD) roletext="wizard" - if(BE_REV) roletext="revolutionary" - if(BE_GANG) roletext="gangster" - if(BE_CULTIST) roletext="cultist" - if(BE_MONKEY) roletext="monkey" - if(BE_ABDUCTOR) roletext="abductor" - if(BE_HOG_GOD) roletext="hand of god, god" - if(BE_HOG_CULTIST) roletext="hand of god, cultist" - - // Ultimate randomizing code right here for(var/mob/new_player/player in player_list) if(player.client && player.ready) @@ -319,7 +304,7 @@ for(var/mob/new_player/player in players) if(player.client && player.ready) if(role in player.client.prefs.be_special) - if(!jobban_isbanned(player, "Syndicate") && !jobban_isbanned(player, roletext)) //Nodrak/Carn: Antag Job-bans + if(!jobban_isbanned(player, "Syndicate") && !jobban_isbanned(player, role)) //Nodrak/Carn: Antag Job-bans if(age_check(player.client)) //Must be older than the minimum age candidates += player.mind // Get a list of all the people who want to be the antagonist for this round @@ -333,7 +318,7 @@ for(var/mob/new_player/player in players) if(player.client && player.ready) if(!(role in player.client.prefs.be_special)) // We don't have enough people who want to be antagonist, make a seperate list of people who don't want to be one - if(!jobban_isbanned(player, "Syndicate") && !jobban_isbanned(player, roletext)) //Nodrak/Carn: Antag Job-bans + if(!jobban_isbanned(player, "Syndicate") && !jobban_isbanned(player, role)) //Nodrak/Carn: Antag Job-bans drafted += player.mind if(restricted_jobs) diff --git a/code/game/gamemodes/gang/gang.dm b/code/game/gamemodes/gang/gang.dm index c641b5f6392..ac06d76921c 100644 --- a/code/game/gamemodes/gang/gang.dm +++ b/code/game/gamemodes/gang/gang.dm @@ -12,7 +12,7 @@ var/list/gang_colors_pool = list("red","orange","yellow","green","blue","purple" /datum/game_mode/gang name = "gang war" config_tag = "gang" - antag_flag = BE_GANG + antag_flag = ROLE_GANG restricted_jobs = list("Security Officer", "Warden", "Detective", "AI", "Cyborg","Captain", "Head of Personnel", "Head of Security", "Chief Engineer", "Research Director", "Chief Medical Officer") required_players = 20 required_enemies = 2 diff --git a/code/game/gamemodes/handofgod/_handofgod.dm b/code/game/gamemodes/handofgod/_handofgod.dm index f80448f5586..b0d6609c268 100644 --- a/code/game/gamemodes/handofgod/_handofgod.dm +++ b/code/game/gamemodes/handofgod/_handofgod.dm @@ -1,7 +1,6 @@ var/global/list/global_handofgod_traptypes = list() var/global/list/global_handofgod_structuretypes = list() -var/global/list/global_handofgod_itemtypes = list() /datum/game_mode @@ -21,18 +20,12 @@ var/global/list/global_handofgod_itemtypes = list() /datum/game_mode/hand_of_god name = "hand of god" config_tag = "handofgod" - antag_flag = BE_HOG_CULTIST //Followers use BE_HOG_CULTIST, Gods are picked later on with BE_HOG_GOD - - required_players = 1 //20-25+ - required_enemies = 0 //This MUST be an even number to function properly. This number counts - //all enemy players involved, as in both teams combined. Recommended: 8 - //If you want to test something by yourself, set to zero. Note that you will produce one unavoidable - //runtime due to an empty list being pick()'d. - - recommended_enemies = 2 + antag_flag = ROLE_HOG_CULTIST //Followers use ROLE_HOG_CULTIST, Gods are picked later on with ROLE_HOG_GOD + required_players = 25 + required_enemies = 8 + recommended_enemies = 8 restricted_jobs = list("Chaplain","AI", "Cyborg", "Security Officer", "Warden", "Detective", "Head of Security", "Captain", "Head of Personnel") - var/finished = 0 /datum/game_mode/hand_of_god/announce() @@ -85,29 +78,32 @@ var/global/list/global_handofgod_itemtypes = list() /datum/game_mode/hand_of_god/post_setup() //Find viable red god - var/list/red_god_possibilities = get_players_for_role(BE_HOG_GOD) + var/list/red_god_possibilities = get_players_for_role(ROLE_HOG_GOD) red_god_possibilities &= red_deity_followers //followers only if(!red_god_possibilities.len) //No candidates? just pick any follower regardless of prefs red_god_possibilities = red_deity_followers //Make red god var/datum/mind/red_god = pick_n_take(red_god_possibilities) - red_god.current.become_god("red") - ticker.mode.forge_deity_objectives(red_god) - remove_hog_follower(red_god,0) - add_god(red_god,"red") + if(red_god) + red_god.current.become_god("red") + ticker.mode.forge_deity_objectives(red_god) + remove_hog_follower(red_god,0) + add_god(red_god,"red") //Find viable blue god - var/list/blue_god_possibilities = get_players_for_role(BE_HOG_GOD) + var/list/blue_god_possibilities = get_players_for_role(ROLE_HOG_GOD) blue_god_possibilities &= blue_deity_followers //followers only if(!blue_god_possibilities.len) //No candidates? just pick any follower regardless of prefs blue_god_possibilities = blue_deity_followers + //Make blue god var/datum/mind/blue_god = pick_n_take(blue_god_possibilities) - blue_god.current.become_god("blue") - ticker.mode.forge_deity_objectives(blue_god) - remove_hog_follower(blue_god,0) - add_god(blue_god,"blue") + if(blue_god) + blue_god.current.become_god("blue") + ticker.mode.forge_deity_objectives(blue_god) + remove_hog_follower(blue_god,0) + add_god(blue_god,"blue") /////////////////// @@ -145,7 +141,7 @@ var/global/list/global_handofgod_itemtypes = list() deity.objectives += build build.gen_amount_goal(8, 16) - var/datum/objective/sacrifice_prophet/sacrifice + var/datum/objective/sacrifice_prophet/sacrifice = new sacrifice.owner = deity deity.objectives += sacrifice @@ -194,6 +190,8 @@ var/global/list/global_handofgod_itemtypes = list() if(colour == "blue") blue_deity_followers += follower_mind + H.faction |= "[colour] god" + update_hog_icons_added(follower_mind, colour) follower_mind.special_role = "Hand of God: [capitalize(colour)] Follower" follower_mind.current.attack_log += "\[[time_stamp()]\] Has been converted to the [colour] follower cult!" @@ -218,6 +216,11 @@ var/global/list/global_handofgod_itemtypes = list() update_hog_icons_removed(follower_mind,"red") update_hog_icons_removed(follower_mind,"blue") + if(follower_mind.current) + var/mob/living/carbon/human/H = follower_mind.current + H.faction -= "red god" + H.faction -= "blue god" + if(announce) follower_mind.current.attack_log += "\[[time_stamp()]\] Has been deconverted from a deity's cult!" follower_mind.current << "Your mind has been cleared from the brainwashing the followers have done to you. Now you serve yourself and the crew." @@ -296,7 +299,6 @@ var/global/list/global_handofgod_itemtypes = list() var/mob/living/carbon/human/H = A if(!H.mind) return 0 - if(side == "red") if(H.mind in ticker.mode.red_deity_prophets) return 1 @@ -305,12 +307,13 @@ var/global/list/global_handofgod_itemtypes = list() return 1 + ////////////////////// //Roundend Reporting// ////////////////////// -/datum/game_mode/proc/declare_completion_handofgod() +/datum/game_mode/hand_of_god/declare_completion() if(red_deities.len) var/text = "
The red cult:" for(var/datum/mind/red_god in red_deities) @@ -422,15 +425,15 @@ var/global/list/global_handofgod_itemtypes = list() var/rank = 0 if(side == "red") hud_key = ANTAG_HUD_HOG_RED - if(is_handofgod_redprophet(hog_mind)) + if(is_handofgod_redprophet(hog_mind.current)) rank = 1 else if(side == "blue") hud_key = ANTAG_HUD_HOG_BLUE - if(is_handofgod_blueprophet(hog_mind)) + if(is_handofgod_blueprophet(hog_mind.current)) rank = 1 - if(is_handofgod_god(hog_mind)) + if(is_handofgod_god(hog_mind.current)) rank = 2 if(hud_key) diff --git a/code/game/gamemodes/handofgod/god.dm b/code/game/gamemodes/handofgod/god.dm index 31d39ea8bfe..c6505654a6e 100644 --- a/code/game/gamemodes/handofgod/god.dm +++ b/code/game/gamemodes/handofgod/god.dm @@ -8,25 +8,31 @@ see_in_dark = 0 sight = SEE_TURFS | SEE_MOBS | SEE_OBJS | SEE_SELF languages = HUMAN | MONKEY | ALIEN | ROBOT | SLIME | DRONE | SWARMER + hud_possible = list(ANTAG_HUD) - var/faith = 0 + var/faith = 100 //For initial prophet appointing/stupid purchase var/max_faith = 100 var/side = "neutral" //Red or Blue for the gamemode var/obj/structure/divine/nexus/god_nexus = null //The source of the god's power in this realm, kill it and the god is kill var/nexus_required = FALSE //If the god dies from losing it's nexus, defaults to off so that gods don't instantly die at roundstart var/followers_required = 0 //Same as above var/alive_followers = 0 - var/mob/living/carbon/human/prophet = null //The prophet of this god var/list/structures = list() var/prophets_sacrificed_in_name = 0 -/mob/camera/god/New(loc, newName, side = "neutral") +/mob/camera/god/New() ..() - real_name = newName - name = real_name - side = side update_icons() + build_hog_construction_lists() + + //Force nexuses after 2 minutes in hand of god mode + if(ticker && ticker.mode && ticker.mode.name == "hand of god") + spawn(1200) + if(src) + if(!god_nexus) + place_nexus() + src << "You failed to place your nexus, and it has been placed for you!" /mob/camera/god/update_icons() @@ -47,10 +53,10 @@ sync_mind() src << "You are a deity!" src << "You are a deity and are worshipped by a cult! You are rather weak right now, but that will change as you gain more followers." - src << "You will need to place an anchor to this world, a Nexus, in two minutes. If you don't, one will be placed for you randomly." - src << "Your Follower count determines how many people believe in you and are a part of your cult. If this drops to zero, you will die." - src << "Your Nexus Integrity tells you the condition of your nexus. If your nexus is destroyed, you die as well, but your powers are amplified when near it." - src << "Your Faith is used to interact with the world. This will regenerate on it's own, and it goes faster when you have more followers." + src << "You will need to place an anchor to this world, a Nexus, in two minutes. If you don't, one will be placed immediately below you." + src << "Your Follower count determines how many people believe in you and are a part of your cult." + src << "Your Nexus Integrity tells you the condition of your nexus. If your nexus is destroyed, you will die." + src << "Your Faith is used to interact with the world. This will regenerate on it's own, and it goes faster when you have more followers and power pylons." src << "The first thing you should do after placing your nexus is to appoint a prophet. Only prophets can hear you talk, unless you use an expensive power." update_health_hud() @@ -62,11 +68,26 @@ /mob/camera/god/proc/add_faith(faith_amt) if(faith_amt) - faith = Clamp(faith+faith_amt, 0, max_faith) + faith = round(Clamp(faith+faith_amt, 0, max_faith)) if(hud_used && hud_used.deity_power_display) hud_used.deity_power_display.maptext = "
[faith]
" + +/mob/camera/god/proc/place_nexus() + if(god_nexus) + return 0 + + var/obj/structure/divine/nexus/N = new(get_turf(src)) + N.assign_deity(src) + god_nexus = N + nexus_required = TRUE + verbs -= /mob/camera/god/verb/constructnexus + //verbs += /mob/camera/god/verb/movenexus //Translocators have no sprite + update_health_hud() + + + /mob/camera/god/proc/update_followers() alive_followers = 0 var/list/all_followers diff --git a/code/game/gamemodes/handofgod/items.dm b/code/game/gamemodes/handofgod/items.dm index 017e0486edd..d1a957f2058 100644 --- a/code/game/gamemodes/handofgod/items.dm +++ b/code/game/gamemodes/handofgod/items.dm @@ -6,6 +6,33 @@ icon_state = "banner" item_state = "banner" desc = "A banner with Nanotrasen's logo on it." + var/moralecooldown = 0 + var/moralewait = 600 + + +/obj/item/weapon/banner/attack_self(mob/living/carbon/human/user) + if(moralecooldown + moralewait > world.time) + return + var/side = "" + if(is_handofgod_redcultist(user)) + side = "red" + else if (is_handofgod_bluecultist(user)) + side = "blue" + + if(!side) + return + user << "You increase the morale of your fellows!" + moralecooldown = world.time + + for(var/mob/living/carbon/human/H in range(4,get_turf(src))) + if((side == "red") && is_handofgod_redcultist(H) || (side == "blue") && is_handofgod_bluecultist(H)) + H << "Your morale is increased by [user]'s banner!" + H.adjustBruteLoss(-15) + H.adjustFireLoss(-15) + H.AdjustStunned(-2) + H.AdjustWeakened(-2) + H.AdjustParalysis(-2) + /obj/item/weapon/banner/red name = "red banner" @@ -16,15 +43,15 @@ /obj/item/weapon/banner/red/examine() ..() if(is_handofgod_redcultist(usr)) - usr << "A banner representing our might against the heretics." + usr << "A banner representing our might against the heretics. We may use it to increase the morale of our fellow members!" else if(is_handofgod_bluecultist(usr)) usr << "A heretical banner that should be destroyed posthaste." /obj/item/weapon/banner/blue - name = "red banner" - icon_state = "banner-red" - item_state = "banner-red" + name = "blue banner" + icon_state = "banner-blue" + item_state = "banner-blue" desc = "A banner with the logo of the blue deity" /obj/item/weapon/banner/blue/examine() @@ -33,7 +60,7 @@ if(is_handofgod_redcultist(usr)) usr << "A heretical banner that should be destroyed posthaste." else if(is_handofgod_bluecultist(usr)) - usr << "A banner representing our might against the heretics." + usr << "A banner representing our might against the heretics. We may use it to increase the morale of our fellow members!" /obj/item/weapon/storage/backpack/bannerpack @@ -58,7 +85,7 @@ //this is all part of one item set /obj/item/clothing/suit/armor/plate/crusader - name = "Crusader's Armor" + name = "Crusader's Armour" icon_state = "crusader" w_class = 4 //bulky slowdown = 2.0 //gotta pretend we're balanced. @@ -73,9 +100,9 @@ /obj/item/clothing/suit/armor/plate/crusader/examine(mob/user) ..() if(!is_handofgod_cultist(user)) - usr << "Armor that's comprised of metal and cloth." + usr << "Armour that's comprised of metal and cloth." else - usr << "Armor that was used to protect from backstabs, gunshots, explosives, and lasers. The original wearers of this type of armor were trying to avoid being murdered. Since they're not around anymore, you're not sure if they were successful or not." + usr << "Armour that was used to protect from backstabs, gunshots, explosives, and lasers. The original wearers of this type of armour were trying to avoid being murdered. Since they're not around anymore, you're not sure if they were successful or not." /obj/item/clothing/head/helmet/plate/crusader @@ -154,8 +181,8 @@ /obj/item/weapon/storage/box/itemset/crusader - name = "Crusader's Armor Set" //i can't into ck2 references - desc = "This armor is said to be based on the armor of kings on another world thousands of years ago, who tended to assassinate, conspire, and plot against everyone who tried to do the same to them. Some things never change." + name = "Crusader's Armour Set" //i can't into ck2 references + desc = "This armour is said to be based on the armor of kings on another world thousands of years ago, who tended to assassinate, conspire, and plot against everyone who tried to do the same to them. Some things never change." /obj/item/weapon/storage/box/itemset/crusader/blue/New() diff --git a/code/game/gamemodes/handofgod/objectives.dm b/code/game/gamemodes/handofgod/objectives.dm index dc66cad6c44..2d5585ca372 100644 --- a/code/game/gamemodes/handofgod/objectives.dm +++ b/code/game/gamemodes/handofgod/objectives.dm @@ -29,9 +29,10 @@ martyr_compatible = 1 /datum/objective/deicide/check_completion() - if(target && target.current && target.current.stat == DEAD) - return 1 - return 0 + if(target) + if(target.current) //Gods are deleted when they lose + return 0 + return 1 /datum/objective/deicide/find_target() diff --git a/code/game/gamemodes/handofgod/powers.dm b/code/game/gamemodes/handofgod/powers.dm index ff32219d909..241b3094872 100644 --- a/code/game/gamemodes/handofgod/powers.dm +++ b/code/game/gamemodes/handofgod/powers.dm @@ -1,18 +1,43 @@ /mob/camera/god/proc/ability_cost(cost = 0,structures = 0, requires_conduit = 0) - if(cost && faith < cost) + if(faith < cost) + src << "You lack the faith!" return 0 - if(structures && !(isturf(loc) || istype(loc, /turf/space))) - src << "Your structure would just float away, you need stable ground!" - return 0 - if(structures && (locate(/obj/structure) in get_turf(src))) - src << "There is another structure here, Select an empty spot." + + if(structures) + if(!isturf(loc) || istype(loc, /turf/space)) + src << "Your structure would just float away, you need stable ground!" + return 0 + + var/turf/T = get_turf(src) + if(T) + if(T.density) + src << "There is something blocking your structure!" + return 0 + + for(var/atom/movable/AM in T) + if(AM == src) + continue + if(AM.density) + src << "There is something blocking your structure!" + return 0 if(requires_conduit) //Organised this way as there can be multiple conduits, so it's more likely to be a conduit check. - if(!locate(/obj/structure/divine/conduit) in range(src,15)) - if(!locate(/obj/structure/divine/nexus) in range(src, 15)) - return 0 + var/valid = 0 + for(var/obj/structure/divine/conduit/C in range(src,15)) + if(C.side == side) + valid++ + break + + if(!valid) + for(var/obj/structure/divine/nexus/N in range(src,15)) + if(N.side == side) + valid++ + break + if(!valid) + src << "You must be near your Nexus or a Conduit to do this!" + return 0 return 1 @@ -34,9 +59,9 @@ set desc = "Teleports you to one of your followers." var/list/following = list() if(side == "red") - following = ticker.mode.red_deity_followers + following = ticker.mode.red_deity_followers|ticker.mode.red_deity_prophets else if(side == "blue") - following = ticker.mode.blue_deity_followers + following = ticker.mode.blue_deity_followers|ticker.mode.blue_deity_prophets else src << "You are unaligned, and thus do not have followers" return @@ -54,16 +79,19 @@ var/list/following = list() if(!ability_cost(100)) - src << "You lack the faith to make a prophet." return if(side == "red") - if(ticker.mode.red_deity_prophets.len) + var/datum/mind/old_proph = locate() in ticker.mode.red_deity_prophets + if(old_proph && old_proph.current && old_proph.current.stat != DEAD) src << "You can only have one prophet alive at a time." + return else following = ticker.mode.red_deity_followers else if(side == "blue") - if(ticker.mode.blue_deity_prophets.len) + var/datum/mind/old_proph = locate() in ticker.mode.blue_deity_prophets + if(old_proph && old_proph.current && old_proph.current.stat != DEAD) src << "You can only have one prophet alive at a time." + return else following = ticker.mode.blue_deity_followers @@ -83,7 +111,6 @@ set name = "Talk to Anyone (20)" set desc = "Allows you to send a message to anyone, regardless of their faith." if(!ability_cost(20)) - src << "You lack the faith to convene with others." return var/mob/choice = input("Choose who you wish to talk to", "Talk to ANYONE") as null|anything in mob_list if(choice) @@ -100,7 +127,6 @@ set desc = "Hits anything under you with a moderate amount of damage." if(!ability_cost(40,0,1)) - src << "You lack the faith to smite others." return if(!range(7,god_nexus)) src << "You lack the strength to smite this far from your nexus." @@ -120,7 +146,6 @@ set desc = "Knocks out the mortal below you for a brief amount of time." if(!ability_cost(20,0,1)) - src << "You lack the faith to lull mortals to sleep." return for(var/mob/living/L in get_turf(src)) @@ -136,7 +161,6 @@ set desc = "Tug at the fibres of reality itself and bend it to your whims!" if(!ability_cost(300,0,1)) - src << "You lack the faith to bend reality." return var/event = pick(/datum/round_event/meteor_wave, /datum/round_event/communications_blackout, /datum/round_event/radiation_storm, /datum/round_event/carp_migration, @@ -151,15 +175,10 @@ set name = "Construct Nexus" set desc = "Instantly creates your nexus, You can only do this once, make sure you're happy with it!" - if(ability_cost(0,1,0)) - var/obj/structure/divine/nexus/N = new(get_turf(src)) - N.deity = src - N.side = side - god_nexus = N - nexus_required = TRUE - verbs -= /mob/camera/god/verb/constructnexus - //verbs += /mob/camera/god/verb/movenexus //Translocators have no sprite - update_health_hud() + if(!ability_cost(0,1,0) || z != 1) + return + + place_nexus() /* //Transolocators have no sprite @@ -195,21 +214,23 @@ set name = "Construct Structure (75)" set desc = "Create the foundation of a divine object." - if(ability_cost(75,1,1)) - var/construct = input("Choose what you wish to create.", "Divine Construction") as null|anything in global_handofgod_structuretypes - if(!construct || !global_handofgod_structuretypes[construct] || !ability_cost(75,1,1)) //check again, they might try to cheat the input window. - return - var/obj/structure/divine/construct_type = global_handofgod_structuretypes[construct] //it's a path but we need to initial() some vars - if(!construct_type) - return + if(!ability_cost(75,1,1)) + return - src << "You lay the foundations for \a [construct], your followers must finish the construction using metal and glass." - add_faith(-75) + var/construct = input("Choose what you wish to create.", "Divine Construction") as null|anything in global_handofgod_structuretypes + if(!construct || !global_handofgod_structuretypes[construct] || !ability_cost(75,1,1)) //check again, they might try to cheat the input window. + return - var/obj/structure/divine/construction_holder/CH = new(get_turf(src)) - CH.assign_deity(src) - CH.setup_construction(construct_type) - CH.visible_message("[src] has created a transparent, unfinished [construct]. It can be finished by adding materials.") + var/obj/structure/divine/construct_type = global_handofgod_structuretypes[construct] //it's a path but we need to initial() some vars + if(!construct_type) + return + + add_faith(-75) + + var/obj/structure/divine/construction_holder/CH = new(get_turf(src)) + CH.assign_deity(src) + CH.setup_construction(construct_type) + CH.visible_message("[src] has created a transparent, unfinished [construct]. It can be finished by adding materials.") /mob/camera/god/verb/construct_traps() @@ -217,16 +238,18 @@ set name = "Construct Trap (20)" set desc = "Creates a ward or trap." - if(ability_cost(20,1,1)) - var/trap = input("Choose what you wish to create.", "Divine Traps") as null|anything in global_handofgod_traptypes - if(!trap || !global_handofgod_traptypes[trap] || !ability_cost(20,1,1)) - return + if(!ability_cost(20,1,1)) + return - src << "You lay \a [trap]." - add_faith(-20) + var/trap = input("Choose what you wish to create.", "Divine Traps") as null|anything in global_handofgod_traptypes + if(!trap || !global_handofgod_traptypes[trap] || !ability_cost(20,1,1)) + return - var/traptype = global_handofgod_traptypes[trap] - new traptype (get_turf(src)) + src << "You lay \a [trap]." + add_faith(-20) + + var/traptype = global_handofgod_traptypes[trap] + new traptype (get_turf(src)) @@ -236,25 +259,27 @@ set name = "Construct Items (20)" set desc = "Construct some items for your followers" - if(ability_cost(20,1,1)) - var/list/item_types = list() - if(side == "red") - item_types["red banner"] = /obj/item/weapon/banner/red - item_types["red bannerbackpack"] = /obj/item/weapon/storage/backpack/bannerpack/red - item_types["red armour"] = /obj/item/weapon/storage/box/itemset/crusader/red + if(!ability_cost(20,1,1)) + return - else if(side == "blue") - item_types["blue banner"] = /obj/item/weapon/banner/blue - item_types["blue bannerbackpack"] = /obj/item/weapon/storage/backpack/bannerpack/blue - item_types["blue armour"] = /obj/item/weapon/storage/box/itemset/crusader/blue + var/list/item_types = list("claymore sword" = /obj/item/weapon/claymore) + if(side == "red") + item_types["red banner"] = /obj/item/weapon/banner/red + item_types["red bannerbackpack"] = /obj/item/weapon/storage/backpack/bannerpack/red + item_types["red armour"] = /obj/item/weapon/storage/box/itemset/crusader/red + + else if(side == "blue") + item_types["blue banner"] = /obj/item/weapon/banner/blue + item_types["blue bannerbackpack"] = /obj/item/weapon/storage/backpack/bannerpack/blue + item_types["blue armour"] = /obj/item/weapon/storage/box/itemset/crusader/blue - var/item = input("Choose what you wish to create.", "Divine Items") as null|anything in item_types - if(!item || !global_handofgod_itemtypes[item] || !ability_cost(20,1,1)) - return + var/item = input("Choose what you wish to create.", "Divine Items") as null|anything in item_types + if(!item || !item_types[item] || !ability_cost(20,1,1)) + return - src << "You produce \a [item]" - add_faith(-20) + src << "You produce \a [item]" + add_faith(-20) - var/itemtype = global_handofgod_itemtypes[item] - new itemtype (get_turf(src)) + var/itemtype = item_types[item] + new itemtype (get_turf(src)) diff --git a/code/game/gamemodes/handofgod/structures.dm b/code/game/gamemodes/handofgod/structures.dm index 7197b4a8082..4d435b55098 100644 --- a/code/game/gamemodes/handofgod/structures.dm +++ b/code/game/gamemodes/handofgod/structures.dm @@ -1,10 +1,24 @@ +/proc/build_hog_construction_lists() + if(global_handofgod_traptypes.len && global_handofgod_structuretypes.len) + return + + var/list/types = typesof(/obj/structure/divine) - /obj/structure/divine - /obj/structure/divine/trap + for(var/T in types) + var/obj/structure/divine/D = T + if(initial(D.constructable)) + if(initial(D.trap)) + global_handofgod_traptypes[initial(D.name)] = T + else + global_handofgod_structuretypes[initial(D.name)] = T + /obj/structure/divine name = "divine construction site" icon = 'icons/obj/hand_of_god_structures.dmi' desc = "An unfinished divine building" anchored = 1 density = 1 + var/constructable = TRUE var/trap = FALSE var/metal_cost = 0 var/glass_cost = 0 @@ -18,12 +32,6 @@ /obj/structure/divine/New() ..() - if(!trap) - if(!global_handofgod_structuretypes[name]) - global_handofgod_structuretypes[name] = type - else - if(!global_handofgod_traptypes[name]) - global_handofgod_traptypes[name] = type /obj/structure/divine/proc/update_icons() @@ -48,7 +56,7 @@ return 0 playsound(get_turf(src), I.hitsound, 50, 1) - visible_message("\The [src] has been attack with \the [I][(user ? " by [user]/" : ".")]!") + visible_message("\The [src] has been attack with \the [I][(user ? " by [user]" : ".")]!") health = max(0, health-I.force) healthcheck() @@ -77,20 +85,29 @@ /obj/structure/divine/proc/assign_deity(mob/camera/god/new_deity, alert_old_deity = TRUE) if(!new_deity) return 0 - if(deity && alert_old_deity) - deity << "Your [name] was captured by [new_deity]'s cult!" - deity.structures -= src + if(deity) + if(alert_old_deity) + deity << "Your [name] was captured by [new_deity]'s cult!" + deity.structures -= src deity = new_deity deity.structures |= src side = deity.side update_icons() + return 1 /obj/structure/divine/construction_holder alpha = 125 + constructable = FALSE var/obj/structure/divine/construction_result = /obj/structure/divine //a path, but typed to /obj/structure/divine for initial() + +/obj/structure/divine/construction_holder/assign_deity(mob/camera/god/new_deity, alert_old_deity = TRUE) + if(..()) + color = side + + /obj/structure/divine/construction_holder/proc/setup_construction(construct_type) if(ispath(construct_type)) construction_result = construct_type @@ -161,7 +178,8 @@ /obj/structure/divine/construction_holder/proc/check_completion() if(!metal_cost && !glass_cost && !lesser_gem_cost && !greater_gem_cost) visible_message("\The [initial(construction_result.name)] is complete!") - new construction_result (get_turf(src)) + var/obj/structure/divine/D = new construction_result (get_turf(src)) + D.assign_deity(deity) qdel(src) @@ -169,7 +187,7 @@ ..() if(metal_cost || glass_cost || lesser_gem_cost || greater_gem_cost) - user << "To finish construction it requires the following materials:
" + user << "To finish construction it requires the following materials:" if(metal_cost) user << "[metal_cost] metal " if(glass_cost) @@ -186,6 +204,7 @@ icon_state = "nexus" health = 500 maxhealth = 500 + constructable = FALSE var/faith_regen_rate = 1 var/list/powerpylons = list() @@ -199,7 +218,7 @@ deity.update_health_hud() if(!health) - if(deity && deity.nexus_required) + if(!qdeleted(deity) && deity.nexus_required) deity << "Your nexus was destroyed. You feel yourself fading..." qdel(deity) visible_message("\The [src] was destroyed!") @@ -214,6 +233,7 @@ if(deity) deity.update_followers() deity.add_faith(faith_regen_rate + (powerpylons.len / 5) + (deity.alive_followers / 3)) + deity.max_faith = initial(deity.max_faith) + (deity.alive_followers*10) //10 followers = 100 max faith, so disaster() at around 20 followers /obj/structure/divine/nexus/Destroy() @@ -231,6 +251,7 @@ glass_cost = 10 +/* //No good sprites, and not enough items to make it viable yet /obj/structure/divine/forge name = "forge" desc = "A forge fueled by divine might, it allows the creation of sacred and powerful artifacts. It requires common materials to craft objects." @@ -240,7 +261,7 @@ density = 0 maxhealth = 250 metal_cost = 40 - +*/ /obj/structure/divine/convertaltar name = "conversion taltar" @@ -248,9 +269,11 @@ icon_state = "convertaltar" density = 0 metal_cost = 20 + can_buckle = 1 /obj/structure/divine/convertaltar/attack_hand(mob/living/user) + ..() var/mob/living/carbon/human/H = locate() in get_turf(src) if(!is_handofgod_cultist(user)) user << "You try to use it, but unfortunately you don't know any rituals." @@ -274,9 +297,11 @@ icon_state = "sacrificealtar" density = 0 metal_cost = 30 + can_buckle = 1 /obj/structure/divine/sacrificealtar/attack_hand(mob/living/user) + ..() var/mob/living/L = locate() in get_turf(src) if(!is_handofgod_cultist(user)) user << "You try to use it, but unfortunately you don't know any rituals." @@ -329,7 +354,7 @@ /obj/structure/divine/healingfountain name = "healing fountain" desc = "A fountain containing the waters of life... or death, depending on where your allegiances lie" - icon_state = "puddle" + icon_state = "fountain" metal_cost = 15 glass_cost = 10 autocolours = FALSE @@ -349,13 +374,16 @@ user << "The water feels warm ans soothing as you touch it. The fountain immediately dries up shortly afterwards." user.reagents.add_reagent("doctorsdelight",20) update_icons() + spawn(time_between_uses) + if(src) + update_icons() /obj/structure/divine/healingfountain/update_icons() if(last_process + time_between_uses > world.time) icon_state = "fountain-dry" else - icon_state = "fountain" + icon_state = "fountain-[side]" /obj/structure/divine/powerpylon @@ -405,7 +433,7 @@ /obj/structure/divine/defensepylon/assign_deity(mob/camera/god/new_deity, alert_old_deity = TRUE) if(..() && pylon_gun) - pylon_gun.faction = side + pylon_gun.faction = "[side] god" pylon_gun.side = side diff --git a/code/game/gamemodes/handofgod/traps.dm b/code/game/gamemodes/handofgod/traps.dm index a2eef75831e..18022cf350e 100644 --- a/code/game/gamemodes/handofgod/traps.dm +++ b/code/game/gamemodes/handofgod/traps.dm @@ -22,9 +22,7 @@ last_trigger = world.time alpha = 200 trap_effect(L) - spawn(time_between_triggers) - if(src) - alpha = 30 + animate(src, alpha = 30, time = time_between_triggers) /obj/structure/divine/trap/examine(mob/user) @@ -33,9 +31,7 @@ return user << "You reveal a trap!" alpha = 200 - spawn(time_between_triggers) - if(src) - alpha = 30 + animate(src, alpha = 30, time = time_between_triggers) /obj/structure/divine/trap/proc/trap_effect(mob/living/L) @@ -99,7 +95,7 @@ /obj/structure/divine/trap/ward - name = "Divine Ward" + name = "divine ward" desc = "A divine barrier, It looks like you could destroy it with enough effort, or wait for it to dissipate..." icon_state = "ward" health = 150 diff --git a/code/game/gamemodes/malfunction/malfunction.dm b/code/game/gamemodes/malfunction/malfunction.dm index cdc1436890d..7185afec1eb 100644 --- a/code/game/gamemodes/malfunction/malfunction.dm +++ b/code/game/gamemodes/malfunction/malfunction.dm @@ -4,7 +4,7 @@ /datum/game_mode/malfunction name = "AI malfunction" config_tag = "malfunction" - antag_flag = BE_MALF + antag_flag = ROLE_MALF required_players = 25 required_enemies = 1 recommended_enemies = 1 @@ -29,11 +29,11 @@ required_players = max(required_enemies+1, required_players) //to prevent issues if players are set too low return ..() -/datum/game_mode/malfunction/get_players_for_role(role = BE_MALF) +/datum/game_mode/malfunction/get_players_for_role(role = ROLE_MALF) var/datum/job/ai/DummyAIjob = new for(var/mob/new_player/player in player_list) if(player.client && player.ready) - if(BE_MALF in player.client.prefs.be_special) + if(ROLE_MALF in player.client.prefs.be_special) if(!jobban_isbanned(player, "Syndicate") && !jobban_isbanned(player, "AI") && DummyAIjob.player_old_enough(player.client)) antag_candidates += player.mind antag_candidates = shuffle(antag_candidates) diff --git a/code/game/gamemodes/monkey/monkey.dm b/code/game/gamemodes/monkey/monkey.dm index 647230a4963..12f24f40b6e 100644 --- a/code/game/gamemodes/monkey/monkey.dm +++ b/code/game/gamemodes/monkey/monkey.dm @@ -4,7 +4,7 @@ /datum/game_mode/monkey name = "monkey" config_tag = "monkey" - antag_flag = BE_MONKEY + antag_flag = ROLE_MONKEY required_players = 20 required_enemies = 1 diff --git a/code/game/gamemodes/nuclear/nuclear.dm b/code/game/gamemodes/nuclear/nuclear.dm index 939cce46b06..847470b9dd4 100644 --- a/code/game/gamemodes/nuclear/nuclear.dm +++ b/code/game/gamemodes/nuclear/nuclear.dm @@ -8,7 +8,7 @@ required_players = 20 // 20 players - 5 players to be the nuke ops = 15 players remaining required_enemies = 5 recommended_enemies = 5 - antag_flag = BE_OPERATIVE + antag_flag = ROLE_OPERATIVE enemy_minimum_age = 14 var/const/agents_possible = 5 //If we ever need more syndicate agents. diff --git a/code/game/gamemodes/revolution/revolution.dm b/code/game/gamemodes/revolution/revolution.dm index 7b98750dd58..e74b03f8710 100644 --- a/code/game/gamemodes/revolution/revolution.dm +++ b/code/game/gamemodes/revolution/revolution.dm @@ -13,7 +13,7 @@ /datum/game_mode/revolution name = "revolution" config_tag = "revolution" - antag_flag = BE_REV + antag_flag = ROLE_REV restricted_jobs = list("Security Officer", "Warden", "Detective", "AI", "Cyborg","Captain", "Head of Personnel", "Head of Security", "Chief Engineer", "Research Director", "Chief Medical Officer") required_players = 20 required_enemies = 1 @@ -187,7 +187,7 @@ var/list/promotable_revs = list() for(var/datum/mind/khrushchev in revolutionaries) if(khrushchev.current && khrushchev.current.client && khrushchev.current.stat != DEAD) - if(BE_REV in khrushchev.current.client.prefs.be_special) + if(ROLE_REV in khrushchev.current.client.prefs.be_special) promotable_revs += khrushchev if(promotable_revs) var/datum/mind/stalin = pick(promotable_revs) diff --git a/code/game/gamemodes/shadowling/shadowling.dm b/code/game/gamemodes/shadowling/shadowling.dm index 39b72b87b2c..73e9b258dff 100644 --- a/code/game/gamemodes/shadowling/shadowling.dm +++ b/code/game/gamemodes/shadowling/shadowling.dm @@ -67,7 +67,7 @@ Made by Xhuis /datum/game_mode/shadowling name = "shadowling" config_tag = "shadowling" - antag_flag = BE_SHADOWLING + antag_flag = ROLE_SHADOWLING required_players = 30 required_enemies = 2 recommended_enemies = 2 diff --git a/code/game/gamemodes/traitor/traitor.dm b/code/game/gamemodes/traitor/traitor.dm index a9061a49969..0af84e59029 100644 --- a/code/game/gamemodes/traitor/traitor.dm +++ b/code/game/gamemodes/traitor/traitor.dm @@ -9,7 +9,7 @@ /datum/game_mode/traitor name = "traitor" config_tag = "traitor" - antag_flag = BE_TRAITOR + antag_flag = ROLE_TRAITOR restricted_jobs = list("Cyborg")//They are part of the AI if he is traitor so are they, they use to get double chances protected_jobs = list("Security Officer", "Warden", "Detective", "Head of Security", "Captain")//AI", Currently out of the list as malf does not work for shit required_players = 0 @@ -74,8 +74,8 @@ if(ticker.mode.traitors.len >= traitorcap) //Upper cap for number of latejoin antagonists return if(ticker.mode.traitors.len <= (traitorcap - 2) || prob(100 / (config.traitor_scaling_coeff * 2))) - if(BE_TRAITOR in character.client.prefs.be_special) - if(!jobban_isbanned(character.client, "traitor") && !jobban_isbanned(character.client, "Syndicate")) + if(ROLE_TRAITOR in character.client.prefs.be_special) + if(!jobban_isbanned(character.client, ROLE_TRAITOR) && !jobban_isbanned(character.client, "Syndicate")) if(age_check(character.client)) if(!(character.job in restricted_jobs)) add_latejoin_traitor(character.mind) diff --git a/code/game/gamemodes/wizard/artefact.dm b/code/game/gamemodes/wizard/artefact.dm index 97a531cfaa8..a1ab355b0b1 100644 --- a/code/game/gamemodes/wizard/artefact.dm +++ b/code/game/gamemodes/wizard/artefact.dm @@ -243,7 +243,7 @@ var/global/list/multiverse = list() usr.mind.special_role = "[usr.real_name] Prime" evil = FALSE else - var/list/candidates = get_candidates(BE_WIZARD) + var/list/candidates = get_candidates(ROLE_WIZARD) if(candidates.len) var/client/C = pick(candidates) spawn_copy(C, get_turf(user.loc), user) diff --git a/code/game/gamemodes/wizard/raginmages.dm b/code/game/gamemodes/wizard/raginmages.dm index 5e0190f3ead..24e7765ac94 100644 --- a/code/game/gamemodes/wizard/raginmages.dm +++ b/code/game/gamemodes/wizard/raginmages.dm @@ -78,8 +78,8 @@ spawn(rand(500, 700)) message_admins("SWF is still pissed, sending another wizard - [max_mages - mages_made] left.") for(var/mob/dead/observer/G in player_list) - if(G.client && !G.client.holder && !G.client.is_afk() && (BE_WIZARD in G.client.prefs.be_special)) - if(!jobban_isbanned(G, "wizard") && !jobban_isbanned(G, "Syndicate")) + if(G.client && !G.client.holder && !G.client.is_afk() && (ROLE_WIZARD in G.client.prefs.be_special)) + if(!jobban_isbanned(G, ROLE_WIZARD) && !jobban_isbanned(G, "Syndicate")) if(age_check(G.client)) candidates += G if(!candidates.len) diff --git a/code/game/gamemodes/wizard/soulstone.dm b/code/game/gamemodes/wizard/soulstone.dm index e19a6ae1100..635c98a2bba 100644 --- a/code/game/gamemodes/wizard/soulstone.dm +++ b/code/game/gamemodes/wizard/soulstone.dm @@ -243,7 +243,7 @@ /obj/item/device/soulstone/proc/getCultGhost(obj/item/device/soulstone/C, mob/living/carbon/human/T, mob/U) - var/list/candidates = get_candidates(BE_CULTIST) + var/list/candidates = get_candidates(ROLE_CULTIST) shuffle(candidates) diff --git a/code/game/gamemodes/wizard/wizard.dm b/code/game/gamemodes/wizard/wizard.dm index c500f390b6a..fba8f319a58 100644 --- a/code/game/gamemodes/wizard/wizard.dm +++ b/code/game/gamemodes/wizard/wizard.dm @@ -4,7 +4,7 @@ /datum/game_mode/wizard name = "wizard" config_tag = "wizard" - antag_flag = BE_WIZARD + antag_flag = ROLE_WIZARD required_players = 20 required_enemies = 1 recommended_enemies = 1 diff --git a/code/game/jobs/job/job.dm b/code/game/jobs/job/job.dm index ca5fb09823c..12b5328e579 100644 --- a/code/game/jobs/job/job.dm +++ b/code/game/jobs/job/job.dm @@ -170,6 +170,6 @@ /datum/outfit/job/proc/announce_head(var/mob/living/carbon/human/H, var/channels) //tells the given channel that the given mob is the new department head. See communications.dm for valid channels. spawn(4) //to allow some initialization - if(announcement_systems.len) + if(H && announcement_systems.len) var/obj/machinery/announcement_system/announcer = pick(announcement_systems) announcer.announce("NEWHEAD", H.real_name, H.job, channels) diff --git a/code/game/machinery/turrets.dm b/code/game/machinery/turrets.dm index 48d5f9d9739..4cc40393fc7 100644 --- a/code/game/machinery/turrets.dm +++ b/code/game/machinery/turrets.dm @@ -363,10 +363,11 @@ /obj/machinery/gun_turret/New() ..() - take_damage(0) //check your health - icon_state = "[base_icon_state]" + "0" if(!base) base = src + take_damage(0) //check your health + icon_state = "[base_icon_state]" + "0" + /obj/machinery/gun_turret/ex_act(severity, target) switch(severity) @@ -400,8 +401,6 @@ die() return state = 2 - if(!base) - state = 2 update_icon() return diff --git a/code/game/objects/effects/spiders.dm b/code/game/objects/effects/spiders.dm index 6815d522d29..020dfc4267f 100644 --- a/code/game/objects/effects/spiders.dm +++ b/code/game/objects/effects/spiders.dm @@ -198,7 +198,7 @@ S.poison_per_bite = poison_per_bite S.poison_type = poison_type if(player_spiders) - var/list/candidates = get_candidates(BE_ALIEN, ALIEN_AFK_BRACKET) + var/list/candidates = get_candidates(ROLE_ALIEN, ALIEN_AFK_BRACKET) shuffle(candidates) diff --git a/code/modules/admin/verbs/one_click_antag.dm b/code/modules/admin/verbs/one_click_antag.dm index 787d6dd9372..53a702938ba 100644 --- a/code/modules/admin/verbs/one_click_antag.dm +++ b/code/modules/admin/verbs/one_click_antag.dm @@ -65,11 +65,11 @@ var/mob/living/carbon/human/H = null for(var/mob/living/carbon/human/applicant in player_list) - if(BE_TRAITOR in applicant.client.prefs.be_special) + if(ROLE_TRAITOR in applicant.client.prefs.be_special) if(!applicant.stat) if(applicant.mind) if (!applicant.mind.special_role) - if(!jobban_isbanned(applicant, "traitor") && !jobban_isbanned(applicant, "Syndicate")) + if(!jobban_isbanned(applicant, ROLE_TRAITOR) && !jobban_isbanned(applicant, "Syndicate")) if(temp.age_check(applicant.client)) if(!(applicant.job in temp.restricted_jobs)) candidates += applicant @@ -101,11 +101,11 @@ var/mob/living/carbon/human/H = null for(var/mob/living/carbon/human/applicant in player_list) - if(BE_CHANGELING in applicant.client.prefs.be_special) + if(ROLE_CHANGELING in applicant.client.prefs.be_special) if(!applicant.stat) if(applicant.mind) if (!applicant.mind.special_role) - if(!jobban_isbanned(applicant, "changeling") && !jobban_isbanned(applicant, "Syndicate")) + if(!jobban_isbanned(applicant, ROLE_CHANGELING) && !jobban_isbanned(applicant, "Syndicate")) if(temp.age_check(applicant.client)) if(!(applicant.job in temp.restricted_jobs)) candidates += applicant @@ -135,11 +135,11 @@ var/mob/living/carbon/human/H = null for(var/mob/living/carbon/human/applicant in player_list) - if(BE_REV in applicant.client.prefs.be_special) + if(ROLE_REV in applicant.client.prefs.be_special) if(applicant.stat == CONSCIOUS) if(applicant.mind) if(!applicant.mind.special_role) - if(!jobban_isbanned(applicant, "revolutionary") && !jobban_isbanned(applicant, "Syndicate")) + if(!jobban_isbanned(applicant, ROLE_REV) && !jobban_isbanned(applicant, "Syndicate")) if(temp.age_check(applicant.client)) if(!(applicant.job in temp.restricted_jobs)) candidates += applicant @@ -206,11 +206,11 @@ var/mob/living/carbon/human/H = null for(var/mob/living/carbon/human/applicant in player_list) - if(BE_CULTIST in applicant.client.prefs.be_special) + if(ROLE_CULTIST in applicant.client.prefs.be_special) if(applicant.stat == CONSCIOUS) if(applicant.mind) if(!applicant.mind.special_role) - if(!jobban_isbanned(applicant, "cultist") && !jobban_isbanned(applicant, "Syndicate")) + if(!jobban_isbanned(applicant, ROLE_CULTIST) && !jobban_isbanned(applicant, "Syndicate")) if(temp.age_check(applicant.client)) if(!(applicant.job in temp.restricted_jobs)) candidates += applicant @@ -386,11 +386,11 @@ var/mob/living/carbon/human/H = null for(var/mob/living/carbon/human/applicant in player_list) - if(BE_GANG in applicant.client.prefs.be_special) + if(ROLE_GANG in applicant.client.prefs.be_special) if(!applicant.stat) if(applicant.mind) if(!applicant.mind.special_role) - if(!jobban_isbanned(applicant, "gangster") && !jobban_isbanned(applicant, "Syndicate")) + if(!jobban_isbanned(applicant, ROLE_GANG) && !jobban_isbanned(applicant, "Syndicate")) if(temp.age_check(applicant.client)) if(!(applicant.job in temp.restricted_jobs)) candidates += applicant @@ -584,7 +584,7 @@ var/list/mob/living/carbon/human/candidates = list() var/mob/living/carbon/human/H = null for(var/mob/living/carbon/human/applicant in player_list) - if(BE_SHADOWLING in applicant.client.prefs.be_special) + if(ROLE_SHADOWLING in applicant.client.prefs.be_special) if(!applicant.stat) if(applicant.mind) if(!applicant.mind.special_role) diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 1b1fbc8f80c..5f9b1b83f15 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -198,7 +198,7 @@ var/list/candidates = list() for(var/mob/M in player_list) if(M.stat != DEAD) continue //we are not dead! - if(!(BE_ALIEN in M.client.prefs.be_special)) continue //we don't want to be an alium + if(!(ROLE_ALIEN in M.client.prefs.be_special)) continue //we don't want to be an alium if(M.client.is_afk()) continue //we are afk if(M.mind && M.mind.current && M.mind.current.stat != DEAD) continue //we have a live body we are tied to candidates += M.ckey diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 88ed2918201..e76b4d11a2f 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -2,26 +2,6 @@ var/list/preferences_datums = list() -var/global/list/special_roles = list( //keep synced with the defines BE_* in setup.dm -//some autodetection here. - "traitor" = /datum/game_mode/traitor, //0 - "operative" = /datum/game_mode/nuclear, //1 - "changeling" = /datum/game_mode/changeling, //2 - "wizard" = /datum/game_mode/wizard, //3 - "malf AI" = /datum/game_mode/malfunction, //4 - "revolutionary" = /datum/game_mode/revolution, //5 - "alien", //6 - "pAI/posibrain", //7 - "cultist" = /datum/game_mode/cult, //8 - "blob" = /datum/game_mode/blob, //9 - "ninja", //10 - "monkey" = /datum/game_mode/monkey, //11 - "gangster" = /datum/game_mode/gang, //12 - "shadowling" = /datum/game_mode/shadowling, //13 - "abductor" = /datum/game_mode/abduction, //14 - "hand of god, god" = /datum/game_mode/hand_of_god, //15 - "hand of god, culstist" = /datum/game_mode/hand_of_god, //16 -) /datum/preferences @@ -367,7 +347,7 @@ var/global/list/special_roles = list( //keep synced with the defines BE_* in set dat += "" - dat += "

Antagonist Settings

" + dat += "

Special Role Settings

" if(jobban_isbanned(user, "Syndicate")) dat += "You are banned from antagonist roles." @@ -376,7 +356,7 @@ var/global/list/special_roles = list( //keep synced with the defines BE_* in set for (var/i in special_roles) if(jobban_isbanned(user, i)) - dat += "Be [i]: BANNED
" + dat += "Be [capitalize(i)]: BANNED
" else var/days_remaining = null if(config.use_age_restriction_for_jobs && ispath(special_roles[i])) //If it's a game mode antag, check if the player meets the minimum age @@ -384,12 +364,10 @@ var/global/list/special_roles = list( //keep synced with the defines BE_* in set var/datum/game_mode/temp_mode = new mode_path days_remaining = temp_mode.get_remaining_days(user.client) - var/antagkey = capitalize(i) - if(days_remaining) - dat += "Be [i]: \[IN [days_remaining] DAYS]
" + dat += "Be [capitalize(i)]: \[IN [days_remaining] DAYS]
" else - dat += "Be [i]: [(antagkey in be_special) ? "Yes" : "No"]
" + dat += "Be [capitalize(i)]: [(i in be_special) ? "Yes" : "No"]
" dat += "" @@ -1000,7 +978,7 @@ var/global/list/special_roles = list( //keep synced with the defines BE_* in set toggles ^= ANNOUNCE_LOGIN if("be_special") - var/be_special_type = text2num(href_list["be_special_type"]) + var/be_special_type = href_list["be_special_type"] if(be_special_type in be_special) be_special -= be_special_type else diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index 799317416d3..517214b0abd 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -52,14 +52,45 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car var/B_revenant = 32768 var/list/archived = list(B_traitor,B_operative,B_changeling,B_wizard,B_malf,B_rev,B_alien,B_pai,B_cultist,B_blob,B_ninja,B_monkey,B_gang,B_shadowling,B_abductor,B_revenant) - var/list/new_be_special = list() + + be_special = list() for(var/flag in archived) if(old_be_special & flag) - new_be_special += flag - - be_special = new_be_special.Copy() - + //this is shitty, but this proc should only be run once per player and then never again for the rest of eternity, + switch(flag) + if(1) //why aren't these the variables above? Good question, it's because byond complains the expression isn't constant, when it is. + be_special += ROLE_TRAITOR + if(2) + be_special += ROLE_OPERATIVE + if(4) + be_special += ROLE_CHANGELING + if(8) + be_special += ROLE_WIZARD + if(16) + be_special += ROLE_MALF + if(32) + be_special += ROLE_REV + if(64) + be_special += ROLE_ALIEN + if(128) + be_special += ROLE_PAI + if(256) + be_special += ROLE_CULTIST + if(512) + be_special += ROLE_BLOB + if(1024) + be_special += ROLE_NINJA + if(2048) + be_special += ROLE_MONKEY + if(4096) + be_special += ROLE_GANG + if(8192) + be_special += ROLE_SHADOWLING + if(16384) + be_special += ROLE_ABDUCTOR + if(32768) + be_special += ROLE_REVENANT /datum/preferences/proc/update_preferences(current_version) diff --git a/code/modules/client/preferences_toggles.dm b/code/modules/client/preferences_toggles.dm index 66705a05f59..6a1be869732 100644 --- a/code/modules/client/preferences_toggles.dm +++ b/code/modules/client/preferences_toggles.dm @@ -215,18 +215,33 @@ feedback_add_details("admin_verb", "SAmbi") //If you are copy-pasting this, I bet you read this comment expecting to see the same thing :^) //be special -/client/verb/toggle_be_special(role in be_special_flags) +/client/verb/toggle_be_special(/*role in be_special_flags*/) set name = "Toggle SpecialRole Candidacy" set category = "Preferences" set desc = "Toggles which special roles you would like to be a candidate for, during events." - var/role_flag = be_special_flags[role] - if(!role_flag) return + + var/list/options = list() + + for(var/role in special_roles) + var/key = capitalize(role) + if(role in prefs.be_special) + key += " (Enabled)" + else + key += " (Disabled)" + options[key] = role + + var/a_input = input(src,"Special role candicacy","Special roles") as null|anything in options + if(!a_input || !options[a_input]) + return + + var/role_flag = options[a_input] if(role_flag in prefs.be_special) prefs.be_special -= role_flag else prefs.be_special += role_flag + prefs.save_preferences() - src << "You will [(prefs.be_special & role_flag) ? "now" : "no longer"] be considered for [role] events (where possible)." + src << "You will [(role_flag in prefs.be_special) ? "now" : "no longer"] be considered for [capitalize(role_flag)] events (where possible)." feedback_add_details("admin_verb","TBeSpecial") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/verb/toggle_member_publicity() diff --git a/code/modules/events/alien_infestation.dm b/code/modules/events/alien_infestation.dm index d244d7a8626..f043ed095a9 100644 --- a/code/modules/events/alien_infestation.dm +++ b/code/modules/events/alien_infestation.dm @@ -35,7 +35,7 @@ if(temp_vent_parent.other_atmosmch.len > 20) //Stops Aliens getting stuck in small networks. See: Security, Virology vents += temp_vent - var/list/candidates = get_candidates(BE_ALIEN, ALIEN_AFK_BRACKET) + var/list/candidates = get_candidates(ROLE_ALIEN, ALIEN_AFK_BRACKET) while(spawncount > 0 && vents.len && candidates.len) var/obj/vent = pick_n_take(vents) diff --git a/code/modules/events/wizard/imposter.dm b/code/modules/events/wizard/imposter.dm index 9a155830455..f6f0d3bd4b9 100644 --- a/code/modules/events/wizard/imposter.dm +++ b/code/modules/events/wizard/imposter.dm @@ -10,7 +10,7 @@ for(var/datum/mind/M in ticker.mode.wizards) if(!ishuman(M.current)) continue var/mob/living/carbon/human/W = M.current - var/list/candidates = get_candidates(BE_WIZARD) + var/list/candidates = get_candidates(ROLE_WIZARD) if(!candidates) return //Sad Trombone var/client/C = pick(candidates) diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index b6649aada21..4ec0ffb2304 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -362,3 +362,9 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp ManualFollow(target) if(href_list["reenter"]) reenter_corpse() + + +//We don't want to update the current var +//But we will still carry a mind. +/mob/dead/observer/mind_initialize() + return diff --git a/code/modules/mob/living/carbon/alien/special/alien_embryo.dm b/code/modules/mob/living/carbon/alien/special/alien_embryo.dm index bb7abd6f7f9..049b5ceb22d 100644 --- a/code/modules/mob/living/carbon/alien/special/alien_embryo.dm +++ b/code/modules/mob/living/carbon/alien/special/alien_embryo.dm @@ -67,7 +67,7 @@ var/const/ALIEN_AFK_BRACKET = 450 // 45 seconds /obj/item/organ/internal/body_egg/alien_embryo/proc/AttemptGrow(gib_on_success = 1) if(!owner) return - var/list/candidates = get_candidates(BE_ALIEN, ALIEN_AFK_BRACKET) + var/list/candidates = get_candidates(ROLE_ALIEN, ALIEN_AFK_BRACKET) var/client/C = null // To stop clientless larva, we will check that our host has a client diff --git a/code/modules/mob/living/living_defines.dm b/code/modules/mob/living/living_defines.dm index 0c4d370dca7..27bd2ccb751 100644 --- a/code/modules/mob/living/living_defines.dm +++ b/code/modules/mob/living/living_defines.dm @@ -42,7 +42,6 @@ var/metabolism_efficiency = 1 //more or less efficiency to metabolize helpful/harmful reagents and regulate body temperature.. var/list/image/staticOverlays = list() var/has_limbs = 0 //does the mob have distinct limbs?(arms,legs, chest,head) - var/list/datum/action/actions = list() var/list/pipes_shown = list() var/last_played_vent diff --git a/code/modules/mob/living/simple_animal/guardian/guardian.dm b/code/modules/mob/living/simple_animal/guardian/guardian.dm index 6940476fed3..9bc16167c99 100644 --- a/code/modules/mob/living/simple_animal/guardian/guardian.dm +++ b/code/modules/mob/living/simple_animal/guardian/guardian.dm @@ -526,7 +526,7 @@ return used = TRUE user << "[use_message]" - var/list/candidates = get_candidates(BE_ALIEN, ALIEN_AFK_BRACKET) + var/list/candidates = get_candidates(ROLE_ALIEN, ALIEN_AFK_BRACKET) shuffle(candidates) diff --git a/code/modules/mob/living/simple_animal/morph/morph.dm b/code/modules/mob/living/simple_animal/morph/morph.dm index c815f567578..9b5b8dc4892 100644 --- a/code/modules/mob/living/simple_animal/morph/morph.dm +++ b/code/modules/mob/living/simple_animal/morph/morph.dm @@ -195,7 +195,7 @@ /datum/round_event/morph/proc/get_morph(end_if_fail = 0) key_of_morph = null if(!key_of_morph) - var/list/candidates = get_candidates(BE_ALIEN) + var/list/candidates = get_candidates(ROLE_ALIEN) if(!candidates.len) if(end_if_fail) return 0 diff --git a/code/modules/mob/living/simple_animal/revenant/revenant.dm b/code/modules/mob/living/simple_animal/revenant/revenant.dm index c90283d76ba..09ac892b2e7 100644 --- a/code/modules/mob/living/simple_animal/revenant/revenant.dm +++ b/code/modules/mob/living/simple_animal/revenant/revenant.dm @@ -385,7 +385,7 @@ break message_admins("The new revenant's old client either could not be found or is in a new, living mob - grabbing a random candidate instead...") else - var/list/candidates = get_candidates(BE_REVENANT) + var/list/candidates = get_candidates(ROLE_REVENANT) if(!candidates.len) message_admins("No candidates were found for the new revenant. Oh well!") return 0 diff --git a/code/modules/mob/living/simple_animal/revenant/revenant_spawn_event.dm b/code/modules/mob/living/simple_animal/revenant/revenant_spawn_event.dm index 0cb19dab3da..d21e9c04b03 100644 --- a/code/modules/mob/living/simple_animal/revenant/revenant_spawn_event.dm +++ b/code/modules/mob/living/simple_animal/revenant/revenant_spawn_event.dm @@ -21,7 +21,7 @@ return key_of_revenant = null if(!key_of_revenant) - var/list/candidates = get_candidates(BE_REVENANT) + var/list/candidates = get_candidates(ROLE_REVENANT) if(!candidates.len) if(end_if_fail) return 0 diff --git a/code/modules/mob/living/simple_animal/slaughter/slaughterevent.dm b/code/modules/mob/living/simple_animal/slaughter/slaughterevent.dm index cbc845bc69d..557271fc79b 100644 --- a/code/modules/mob/living/simple_animal/slaughter/slaughterevent.dm +++ b/code/modules/mob/living/simple_animal/slaughter/slaughterevent.dm @@ -15,7 +15,7 @@ /datum/round_event/slaughter/proc/get_slaughter(end_if_fail = 0) key_of_slaughter = null if(!key_of_slaughter) - var/list/candidates = get_candidates(BE_ALIEN) + var/list/candidates = get_candidates(ROLE_ALIEN) if(!candidates.len) if(end_if_fail) return 0 diff --git a/code/modules/mob/login.dm b/code/modules/mob/login.dm index f262ddefc1f..11ecdcaae72 100644 --- a/code/modules/mob/login.dm +++ b/code/modules/mob/login.dm @@ -56,6 +56,8 @@ client.screen += client.void + sync_mind() + // Calling update_interface() in /mob/Login() causes the Cyborg to immediately be ghosted; because of winget(). // Calling it in the overriden Login, such as /mob/living/Login() doesn't cause this. /mob/proc/update_interface() diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index 54262819d23..beb51711799 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -6,6 +6,7 @@ hud_possible = list(ANTAG_HUD) pressure_resistance = 8 var/datum/mind/mind + var/list/datum/action/actions = list() var/stat = 0 //Whether a mob is alive or dead. TODO: Move this to living - Nodrak diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm index e186a902c8f..85afb664104 100644 --- a/code/modules/mob/transform_procs.dm +++ b/code/modules/mob/transform_procs.dm @@ -433,11 +433,9 @@ gib(src) -/mob/proc/become_god(var/side) - if(client) - src << sound(null, repeat = 0, wait = 0, wolume = 85, channel = 1) - - var/mob/camera/god/G = new(loc, side = side) +/mob/proc/become_god(var/side_colour) + var/mob/camera/god/G = new /mob/camera/god(loc) + G.side = side_colour G.invisibility = 40 if(mind) mind.transfer_to(G) @@ -446,6 +444,7 @@ G.job = "Deity" G.rename_self("deity", 0) + G.update_icons() . = G qdel(src) diff --git a/code/modules/ninja/ninja_event.dm b/code/modules/ninja/ninja_event.dm index 2e1e6528256..fda579af7ef 100644 --- a/code/modules/ninja/ninja_event.dm +++ b/code/modules/ninja/ninja_event.dm @@ -54,7 +54,7 @@ Contents: //selecting a candidate player if(!key) - var/list/candidates = get_candidates(BE_NINJA) + var/list/candidates = get_candidates(ROLE_NINJA) if(!candidates.len) return kill() var/client/C = pick(candidates) diff --git a/code/modules/research/xenobiology/xenobiology.dm b/code/modules/research/xenobiology/xenobiology.dm index bee67a1fcec..dcf15871879 100644 --- a/code/modules/research/xenobiology/xenobiology.dm +++ b/code/modules/research/xenobiology/xenobiology.dm @@ -176,7 +176,7 @@ user << "You offer the sentience potion to [M]..." being_used = 1 - var/list/candidates = get_candidates(BE_ALIEN, ALIEN_AFK_BRACKET) + var/list/candidates = get_candidates(ROLE_ALIEN, ALIEN_AFK_BRACKET) shuffle(candidates) diff --git a/data/mode.txt b/data/mode.txt index cf1ffd5c991..436f08da95e 100644 --- a/data/mode.txt +++ b/data/mode.txt @@ -1 +1 @@ -extended \ No newline at end of file +handofgod diff --git a/icons/mob/feet.dmi b/icons/mob/feet.dmi index b10dcd92954..a1ede7661c1 100644 Binary files a/icons/mob/feet.dmi and b/icons/mob/feet.dmi differ diff --git a/icons/mob/mob.dmi b/icons/mob/mob.dmi index 466c4a4ab97..cb484189936 100644 Binary files a/icons/mob/mob.dmi and b/icons/mob/mob.dmi differ diff --git a/icons/mob/screen_gen.dmi b/icons/mob/screen_gen.dmi index 88ba26d27c9..12772089da7 100644 Binary files a/icons/mob/screen_gen.dmi and b/icons/mob/screen_gen.dmi differ diff --git a/icons/mob/suit.dmi b/icons/mob/suit.dmi index 25622951cd2..c0f65d7f7cf 100644 Binary files a/icons/mob/suit.dmi and b/icons/mob/suit.dmi differ diff --git a/icons/obj/hand_of_god_structures.dmi b/icons/obj/hand_of_god_structures.dmi index da18b0a01fb..42b2a125f84 100644 Binary files a/icons/obj/hand_of_god_structures.dmi and b/icons/obj/hand_of_god_structures.dmi differ diff --git a/icons/obj/items.dmi b/icons/obj/items.dmi index 3e7f29d78c2..48dbbbc1d46 100644 Binary files a/icons/obj/items.dmi and b/icons/obj/items.dmi differ diff --git a/icons/obj/storage.dmi b/icons/obj/storage.dmi index 92283417a29..92dcdc033fe 100644 Binary files a/icons/obj/storage.dmi and b/icons/obj/storage.dmi differ diff --git a/tgstation.dme b/tgstation.dme index 0a04b559eef..281a61551fe 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -33,6 +33,7 @@ #include "code\__DEFINES\pipe_construction.dm" #include "code\__DEFINES\preferences.dm" #include "code\__DEFINES\qdel.dm" +#include "code\__DEFINES\role_preferences.dm" #include "code\__DEFINES\say.dm" #include "code\__DEFINES\sight.dm" #include "code\__DEFINES\stat.dm"