From 4133e98dfeb3327ae636889612422d7246c0aac8 Mon Sep 17 00:00:00 2001 From: Crazylemon Date: Fri, 25 Dec 2015 22:51:02 -0800 Subject: [PATCH] Port of RemieRichard's infinite antag system This is just the first chunk, of fixing around the be_special flag stuff It will probably break everything as-is --- code/__DEFINES/preferences.dm | 17 ---- code/__DEFINES/role_preferences.dm | 54 +++++++++++++ code/__HELPERS/game.dm | 8 +- code/_globalvars/configuration.dm | 19 ----- code/datums/mind.dm | 14 ++-- .../game/gamemodes/autotraitor/autotraitor.dm | 8 +- code/game/gamemodes/blob/blob.dm | 2 +- code/game/gamemodes/game_mode.dm | 55 +------------ .../game/gamemodes/malfunction/malfunction.dm | 2 +- code/game/jobs/job_controller.dm | 2 +- code/modules/admin/verbs/one_click_antag.dm | 34 ++++---- code/modules/admin/verbs/randomverbs.dm | 2 +- code/modules/hydroponics/seed_mobs.dm | 78 +------------------ .../modules/mob/living/silicon/pai/recruit.dm | 6 +- .../mob/living/silicon/robot/drone/drone.dm | 2 +- .../modules/mob/living/simple_animal/borer.dm | 2 +- paradise.dme | 1 + 17 files changed, 99 insertions(+), 207 deletions(-) create mode 100644 code/__DEFINES/role_preferences.dm diff --git a/code/__DEFINES/preferences.dm b/code/__DEFINES/preferences.dm index 1f170276c8f..1753045cb8c 100644 --- a/code/__DEFINES/preferences.dm +++ b/code/__DEFINES/preferences.dm @@ -26,20 +26,3 @@ #define MEMBER_PUBLIC 8192 #define TOGGLES_DEFAULT (CHAT_OOC|CHAT_DEAD|CHAT_GHOSTEARS|CHAT_GHOSTSIGHT|CHAT_PRAYER|CHAT_RADIO|CHAT_ATTACKLOGS|CHAT_LOOC|MEMBER_PUBLIC) - -#define BE_TRAITOR 1 -#define BE_OPERATIVE 2 -#define BE_CHANGELING 4 -#define BE_WIZARD 8 -#define BE_MALF 16 -#define BE_REV 32 -#define BE_ALIEN 64 -#define BE_PAI 128 -#define BE_CULTIST 256 -#define BE_NINJA 512 -#define BE_RAIDER 1024 -#define BE_VAMPIRE 2048 -#define BE_MUTINEER 4096 -#define BE_BLOB 8192 -#define BE_SHADOWLING 16384 -#define BE_REVENANT 32768 \ No newline at end of file diff --git a/code/__DEFINES/role_preferences.dm b/code/__DEFINES/role_preferences.dm new file mode 100644 index 00000000000..50c52f107bc --- /dev/null +++ b/code/__DEFINES/role_preferences.dm @@ -0,0 +1,54 @@ + + +//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" // We're prolly gonna port this one day or another +#define ROLE_HOG_CULTIST "hand of god: cultist" +#define ROLE_RAIDER "vox raider" +#define ROLE_VAMPIRE "vampire" + + +//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, + ROLE_RAIDER = /datum/game_mode/heist, + ROLE_VAMPIRE = /datum/game_mode/vampire, +) diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index 0d51ed39ec1..f821b19e665 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -290,17 +290,17 @@ proc/isInSight(var/atom/A, var/atom/B) return M return null -/proc/get_candidates(be_special_flag=0, afk_bracket=3000, override_age=0, override_jobban=0) - var/roletext = get_roletext(be_special_flag) +/proc/get_candidates(be_special_type, afk_bracket=3000, override_age=0, override_jobban=0) + var/roletext = get_roletext(be_special_type) var/list/candidates = list() // Keep looping until we find a non-afk candidate within the time bracket (we limit the bracket to 10 minutes (6000)) while(!candidates.len && afk_bracket < 6000) for(var/mob/dead/observer/G in player_list) if(G.client != null) if(!(G.mind && G.mind.current && G.mind.current.stat != DEAD)) - if(!G.client.is_afk(afk_bracket) && (G.client.prefs.be_special & be_special_flag)) + if(!G.client.is_afk(afk_bracket) && (be_special_type in G.client.prefs.be_special)) if(!override_jobban || (!jobban_isbanned(G, roletext) && !jobban_isbanned(G,"Syndicate"))) - if(override_age || player_old_enough_antag(G.client,be_special_flag)) + if(override_age || player_old_enough_antag(G.client,be_special_type)) candidates += G.client afk_bracket += 600 // Add a minute to the bracket, for every attempt diff --git a/code/_globalvars/configuration.dm b/code/_globalvars/configuration.dm index 61bfd723241..4cfa038cd1e 100644 --- a/code/_globalvars/configuration.dm +++ b/code/_globalvars/configuration.dm @@ -31,25 +31,6 @@ 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" = BE_ALIEN, - "pAI" = BE_PAI, - "cultist" = BE_CULTIST, - "ninja" = BE_NINJA, - "raider" = BE_RAIDER, - "vampire" = BE_VAMPIRE, - "mutineer" = BE_MUTINEER, - "blob" = BE_BLOB, - "shadowling" = BE_SHADOWLING, - "revenant" = BE_REVENANT -) - //Random event stuff, apparently used var/eventchance = 10 //% per 5 mins var/event = 0 diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 712c1b41e1c..860ebdd01b9 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -180,7 +180,7 @@ else text += "EMPLOYEE|headrev|rev" - if(current && current.client && current.client.prefs.be_special & BE_REV) + if(current && current.client && (ROLE_REV in current.client.prefs.be_special)) text += "|Enabled in Prefs" else text += "|Disabled in Prefs" @@ -205,7 +205,7 @@ text += "EMPLOYEE|cultist" - if(current && current.client && current.client.prefs.be_special & BE_CULTIST) + if(current && current.client && (ROLE_CULTIST in current.client.prefs.be_special)) text += "|Enabled in Prefs" else text += "|Disabled in Prefs" @@ -225,7 +225,7 @@ else text += "yes|NO" - if(current && current.client && current.client.prefs.be_special & BE_WIZARD) + if(current && current.client && (ROLE_WIZARD in current.client.prefs.be_special)) text += "|Enabled in Prefs" else text += "|Disabled in Prefs" @@ -246,7 +246,7 @@ else text += "yes|NO" - if(current && current.client && current.client.prefs.be_special & BE_CHANGELING) + if(current && current.client && (ROLE_CHANGELING in current.client.prefs.be_special)) text += "|Enabled in Prefs" else text += "|Disabled in Prefs" @@ -294,7 +294,7 @@ else text += "operative|NANOTRASEN" - if(current && current.client && current.client.prefs.be_special & BE_OPERATIVE) + if(current && current.client && (ROLE_OPERATIVE in current.client.prefs.be_special)) text += "|Enabled in Prefs" else text += "|Disabled in Prefs" @@ -316,7 +316,7 @@ else text += "traitor|EMPLOYEE" - if(current && current.client && current.client.prefs.be_special & BE_TRAITOR) + if(current && current.client && (ROLE_TRAITOR in current.client.prefs.be_special)) text += "|Enabled in Prefs" else text += "|Disabled in Prefs" @@ -335,7 +335,7 @@ else text += "shadowling|thrall|HUMAN" - if(current && current.client && current.client.prefs.be_special & BE_SHADOWLING) + if(current && current.client && (ROLE_SHADOWLING in current.client.prefs.be_special)) text += "|Enabled in Prefs" else text += "|Disabled in Prefs" diff --git a/code/game/gamemodes/autotraitor/autotraitor.dm b/code/game/gamemodes/autotraitor/autotraitor.dm index 8a9e9cc54b2..551d1a8e9b9 100644 --- a/code/game/gamemodes/autotraitor/autotraitor.dm +++ b/code/game/gamemodes/autotraitor/autotraitor.dm @@ -76,13 +76,13 @@ var/traitorcount = 0 var/possible_traitors[0] for(var/mob/living/player in mob_list) - if (player.client && player.stat != 2) + if (player.client && player.stat != DEAD) playercount += 1 - if (player.client && player.mind && player.mind.special_role && player.stat != 2) + if (player.client && player.mind && player.mind.special_role && player.stat != DEAD) traitorcount += 1 - if (player.client && player.mind && !player.mind.special_role && player.stat != 2) + if (player.client && player.mind && !player.mind.special_role && player.stat != DEAD) if (ishuman(player) || isrobot(player) || isAI(player)) - if (player.client && player.client.prefs.be_special & BE_TRAITOR && !jobban_isbanned(player, "traitor") && !jobban_isbanned(player, "Syndicate")) + if (player.client && (ROLE_TRAITOR in player.client.prefs.be_special) && !jobban_isbanned(player, "traitor") && !jobban_isbanned(player, "Syndicate")) possible_traitors += player.mind for(var/datum/mind/player in possible_traitors) for(var/job in restricted_jobs) diff --git a/code/game/gamemodes/blob/blob.dm b/code/game/gamemodes/blob/blob.dm index 1cbd8dd7a1e..ed1f5a5ffbd 100644 --- a/code/game/gamemodes/blob/blob.dm +++ b/code/game/gamemodes/blob/blob.dm @@ -58,7 +58,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") && (player.client.prefs.be_special & BE_BLOB)) + if(!player.stat && player.mind && !player.mind.special_role && !jobban_isbanned(player, "Syndicate") && (ROLE_BLOB in player.client.prefs.be_special)) candidates += player return candidates diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index 244ae984ac8..54591061d33 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -254,7 +254,7 @@ // Get a list of all the people who want to be the antagonist for this round, except those with incompatible species for(var/mob/new_player/player in players) - if(player.client.prefs.be_special & role && !(player.client.prefs.species in protected_species)) + if((role in player.client.prefs.be_special) && !(player.client.prefs.species in protected_species)) log_debug("[player.key] had [roletext] enabled, so we are drafting them.") candidates += player.mind players -= player @@ -276,57 +276,6 @@ if(player.assigned_role == job) candidates -= player - /*if(candidates.len < recommended_enemies) - for(var/mob/new_player/player in players) - if(player.client && player.ready) - if(!(player.client.prefs.be_special & role)) // 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 - drafted += player.mind - - if(restricted_jobs) - for(var/datum/mind/player in drafted) // Remove people who can't be an antagonist - for(var/job in restricted_jobs) - if(player.assigned_role == job) - drafted -= player - - drafted = shuffle(drafted) // Will hopefully increase randomness, Donkie - - while(candidates.len < recommended_enemies) // Pick randomlly just the number of people we need and add them to our list of candidates - if(drafted.len > 0) - applicant = pick(drafted) - if(applicant) - candidates += applicant - log_debug("[applicant.key] was force-drafted as [roletext], because there aren't enough candidates.") - drafted.Remove(applicant) - - else // Not enough scrubs, ABORT ABORT ABORT - break - - if(candidates.len < recommended_enemies && override_jobbans) //If we still don't have enough people, we're going to start drafting banned people. - for(var/mob/new_player/player in players) - if (player.client && player.ready) - if(jobban_isbanned(player, "Syndicate") || jobban_isbanned(player, roletext)) //Nodrak/Carn: Antag Job-bans - drafted += player.mind - - if(restricted_jobs) - for(var/datum/mind/player in drafted) // Remove people who can't be an antagonist - for(var/job in restricted_jobs) - if(player.assigned_role == job) - drafted -= player - - drafted = shuffle(drafted) // Will hopefully increase randomness, Donkie - - while(candidates.len < recommended_enemies) // Pick randomlly just the number of people we need and add them to our list of candidates - if(drafted.len > 0) - applicant = pick(drafted) - if(applicant) - candidates += applicant - drafted.Remove(applicant) - log_debug("[applicant.key] was force-drafted as [roletext], because there aren't enough candidates.") - - else // Not enough scrubs, ABORT ABORT ABORT - break - */ return candidates // Returns: The number of people who had the antagonist role set to yes, regardless of recomended_enemies, if that number is greater than recommended_enemies // recommended_enemies if the number of people with that role set to yes is less than recomended_enemies, @@ -336,7 +285,7 @@ /datum/game_mode/proc/latespawn(var/mob) /* -/datum/game_mode/proc/check_player_role_pref(var/role, var/mob/new_player/player) +/datum/game_mode/proc/check_player_role_pref(var/role, var/mob/player) if(player.preferences.be_special & role) return 1 return 0 diff --git a/code/game/gamemodes/malfunction/malfunction.dm b/code/game/gamemodes/malfunction/malfunction.dm index f206fee3591..476c4585236 100644 --- a/code/game/gamemodes/malfunction/malfunction.dm +++ b/code/game/gamemodes/malfunction/malfunction.dm @@ -31,7 +31,7 @@ var/datum/job/ai/DummyAIjob = new for(var/mob/new_player/player in player_list) if(player.client && player.ready) - if(player.client.prefs.be_special & BE_MALF) + if(ROLE_MALF in player.client.prefs.be_special) if(!jobban_isbanned(player, "Syndicate") && !jobban_isbanned(player, "AI") && !jobban_isbanned(player, roletext) && DummyAIjob.player_old_enough(player.client)) if(player_old_enough_antag(player.client,role)) antag_candidates += player.mind diff --git a/code/game/jobs/job_controller.dm b/code/game/jobs/job_controller.dm index 9a34e2e1524..f25fd419da8 100644 --- a/code/game/jobs/job_controller.dm +++ b/code/game/jobs/job_controller.dm @@ -94,7 +94,7 @@ var/global/datum/controller/occupations/job_master if(!job.player_old_enough(player.client)) Debug("FOC player not old enough, Player: [player]") continue - if(flag && (!player.client.prefs.be_special & flag)) + if(flag && (!(flag in player.client.prefs.be_special)) Debug("FOC flag failed, Player: [player], Flag: [flag], ") continue if(player.mind && job.title in player.mind.restricted_roles) diff --git a/code/modules/admin/verbs/one_click_antag.dm b/code/modules/admin/verbs/one_click_antag.dm index ad25fab49ce..798dd02b85f 100644 --- a/code/modules/admin/verbs/one_click_antag.dm +++ b/code/modules/admin/verbs/one_click_antag.dm @@ -33,7 +33,7 @@ client/proc/one_click_antag() var/datum/mind/themind = null for(var/mob/living/silicon/ai/ai in player_list) - if(ai.client && ai.client.prefs.be_special & BE_MALF) + if(ai.client && (ROLE_MALF in ai.client.prefs.be_special)) AIs += ai if(AIs.len) @@ -57,8 +57,8 @@ client/proc/one_click_antag() var/mob/living/carbon/human/H = null for(var/mob/living/carbon/human/applicant in player_list) - if(applicant.client.prefs.be_special & BE_TRAITOR) - if(player_old_enough_antag(applicant.client,BE_TRAITOR)) + if(ROLE_TRAITOR in applicant.client.prefs.be_special) + if(player_old_enough_antag(applicant.client,ROLE_TRAITOR)) if(!applicant.stat) if(applicant.mind) if (!applicant.mind.special_role) @@ -91,8 +91,8 @@ client/proc/one_click_antag() var/mob/living/carbon/human/H = null for(var/mob/living/carbon/human/applicant in player_list) - if(applicant.client.prefs.be_special & BE_CHANGELING) - if(player_old_enough_antag(applicant.client,BE_CHANGELING)) + if(ROLE_CHANGELING in applicant.client.prefs.be_special) + if(player_old_enough_antag(applicant.client,ROLE_CHANGELING)) if(!applicant.stat) if(applicant.mind) if (!applicant.mind.special_role) @@ -123,8 +123,8 @@ client/proc/one_click_antag() var/mob/living/carbon/human/H = null for(var/mob/living/carbon/human/applicant in player_list) - if(applicant.client.prefs.be_special & BE_REV) - if(player_old_enough_antag(applicant.client,BE_REV)) + if(ROLE_REV in applicant.client.prefs.be_special) + if(player_old_enough_antag(applicant.client,ROLE_REV)) if(applicant.stat == CONSCIOUS) if(applicant.mind) if(!applicant.mind.special_role) @@ -150,9 +150,9 @@ client/proc/one_click_antag() var/time_passed = world.time for(var/mob/G in respawnable_list) - if(istype(G) && G.client && G.client.prefs.be_special & BE_WIZARD) + if(istype(G) && G.client && (ROLE_WIZARD in G.client.prefs.be_special)) if(!jobban_isbanned(G, "wizard") && !jobban_isbanned(G, "Syndicate")) - if(player_old_enough_antag(G.client,BE_WIZARD)) + if(player_old_enough_antag(G.client,ROLE_WIZARD)) spawn(0) switch(G.timed_alert("Do you wish to be considered for the position of Space Wizard Foundation 'diplomat'?","Please answer in 30 seconds!","No",300,"Yes","No"))//alert(G, "Do you wish to be considered for the position of Space Wizard Foundation 'diplomat'?","Please answer in 30 seconds!","Yes","No")) if("Yes") @@ -192,8 +192,8 @@ client/proc/one_click_antag() var/mob/living/carbon/human/H = null for(var/mob/living/carbon/human/applicant in player_list) - if(applicant.client.prefs.be_special & BE_CULTIST) - if(player_old_enough_antag(applicant.client,BE_CULTIST)) + if(ROLE_CULTIST in applicant.client.prefs.be_special) + if(player_old_enough_antag(applicant.client,ROLE_CULTIST)) if(applicant.stat == CONSCIOUS) if(applicant.mind) if(!applicant.mind.special_role) @@ -224,9 +224,9 @@ client/proc/one_click_antag() var/time_passed = world.time for(var/mob/G in respawnable_list) - if(istype(G) && G.client && G.client.prefs.be_special & BE_OPERATIVE) + if(istype(G) && G.client && (ROLE_OPERATIVE in G.client.prefs.be_special)) if(!jobban_isbanned(G, "operative") && !jobban_isbanned(G, "Syndicate")) - if(player_old_enough_antag(G.client,BE_OPERATIVE)) + if(player_old_enough_antag(G.client,ROLE_OPERATIVE)) spawn(0) switch(alert(G,"Do you wish to be considered for a nuke team being sent in?","Please answer in 30 seconds!","Yes","No")) if("Yes") @@ -442,8 +442,8 @@ client/proc/one_click_antag() //Generates a list of candidates from active ghosts. for(var/mob/G in respawnable_list) - if(istype(G) && G.client && G.client.prefs.be_special & BE_RAIDER) - if(player_old_enough_antag(G.client,BE_RAIDER)) + if(istype(G) && G.client && (ROLE_RAIDER in G.client.prefs.be_special)) + if(player_old_enough_antag(G.client,ROLE_RAIDER)) if(!jobban_isbanned(G, "raider") && !jobban_isbanned(G, "Syndicate")) spawn(0) switch(alert(G,"Do you wish to be considered for a vox raiding party arriving on the station?","Please answer in 30 seconds!","Yes","No")) @@ -543,8 +543,8 @@ client/proc/one_click_antag() var/mob/living/carbon/human/H = null for(var/mob/living/carbon/human/applicant in player_list) - if(applicant.client.prefs.be_special & BE_VAMPIRE) - if(player_old_enough_antag(applicant.client,BE_VAMPIRE)) + if(ROLE_VAMPIRE in applicant.client.prefs.be_special) + if(player_old_enough_antag(applicant.client,ROLE_VAMPIRE)) 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 40d8bc80671..e428f25fc39 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -444,7 +444,7 @@ Traitors and the like can also be revived with the previous role mostly intact. var/list/candidates = list() for(var/mob/M in player_list) if(M.stat != DEAD) continue //we are not dead! - if(!M.client.prefs.be_special & BE_ALIEN) 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(jobban_isbanned(M, "alien") || jobban_isbanned(M, "Syndicate")) continue //we are jobbanned 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 diff --git a/code/modules/hydroponics/seed_mobs.dm b/code/modules/hydroponics/seed_mobs.dm index b7fd3b4fdfd..57579a3a797 100644 --- a/code/modules/hydroponics/seed_mobs.dm +++ b/code/modules/hydroponics/seed_mobs.dm @@ -2,80 +2,4 @@ var/list/currently_querying // Used to avoid asking the same ghost repeatedly. // The following procs are used to grab players for mobs produced by a seed (mostly for dionaea). -/datum/seed/proc/handle_living_product(var/mob/living/host) -/* - if(!host || !istype(host)) return - - spawn(0) - request_player(host) - if(istype(host,/mob/living/simple_animal)) - return - spawn(75) - if(!host.ckey && !host.client) - host.death() // This seems redundant, but a lot of mobs don't - host.stat = DEAD // handle death() properly. Better safe than etc. - host.visible_message("[host] is malformed and unable to survive. It expires pitifully, leaving behind some seeds.") - - var/total_yield = rand(1,3) - for(var/j = 0;j<=total_yield;j++) - var/obj/item/seeds/S = new(get_turf(host)) - S.seed_type = name - S.update_seed() - -/datum/seed/proc/request_player(var/mob/living/host) - if(!host) return - for(var/mob/dead/observer/O in player_list) - if(jobban_isbanned(O, "Dionaea")) - continue - if(O.client) - if(O.client.prefs.be_special & BE_PLANT && !(O.client in currently_querying)) - currently_querying |= O.client - question(O.client,host) - -/datum/seed/proc/question(var/client/C,var/mob/living/host) - spawn(0) - - if(!C || !host || !(C.mob && istype(C.mob,/mob/dead))) return // We don't want to spam them repeatedly if they're already in a mob. - - var/response = alert(C, "Someone is harvesting [display_name]. Would you like to play as one?", "Sentient plant harvest", "Yes", "No", "Never for this round.") - - if(!C || !host || !(C.mob && istype(C.mob,/mob/dead))) return // ...or accidentally accept an invalid argument for transfer. - - if(response == "Yes") - transfer_personality(C,host) - else if (response == "Never for this round") - C.prefs.be_special ^= BE_PLANT - - currently_querying -= C - -/datum/seed/proc/transfer_personality(var/client/player,var/mob/living/host) - - //Something is wrong, abort. - if(!player || !host) return - - //Host already has a controller, pike off slowpoke. - if(host.client && host.ckey) return - - //Transfer them over. - host.ckey = player.ckey - if(player.mob && player.mob.mind) - player.mob.mind.transfer_to(host) - - if(host.dna) host.dna.real_name = host.real_name - - // Update mode specific HUD icons. - callHook("harvest_podman", list(host)) - - host << "\green You awaken slowly, stirring into sluggish motion as the air caresses you." - - // This is a hack, replace with some kind of species blurb proc. - if(istype(host,/mob/living/simple_animal/diona)) - host << "You are [host], one of a race of drifting interstellar plantlike creatures that sometimes share their seeds with human traders." - host << "Too much darkness will send you into shock and starve you, but light will help you heal." - - var/newname = input(host,"Enter a name, or leave blank for the default name.", "Name change","") as text - newname = sanitize(newname) - if (newname != "") - host.real_name = newname - host.name = host.real_name -*/ \ No newline at end of file +/datum/seed/proc/handle_living_product(var/mob/living/host) \ No newline at end of file diff --git a/code/modules/mob/living/silicon/pai/recruit.dm b/code/modules/mob/living/silicon/pai/recruit.dm index 768b46c2283..fe785adf929 100644 --- a/code/modules/mob/living/silicon/pai/recruit.dm +++ b/code/modules/mob/living/silicon/pai/recruit.dm @@ -348,15 +348,15 @@ var/datum/paiController/paiController // Global handler for pAI candidates proc/requestRecruits(var/obj/item/device/paicard/P) for(var/mob/dead/observer/O in player_list) - if(O.client && O.client.prefs.be_special & BE_PAI) - if(player_old_enough_antag(O.client,BE_PAI)) + if(O.client && (ROLE_PAI in O.client.prefs.be_special)) + if(player_old_enough_antag(O.client,ROLE_PAI)) if(check_recruit(O)) O << "\blue A pAI card is looking for personalities. (Teleport | Sign Up)" //question(O.client) proc/check_recruit(var/mob/dead/observer/O) if(jobban_isbanned(O, "pAI") || jobban_isbanned(O,"nonhumandept")) return 0 - if(!player_old_enough_antag(O.client,BE_PAI)) + if(!player_old_enough_antag(O.client,ROLE_PAI)) return 0 if(O.has_enabled_antagHUD == 1 && config.antag_hud_restricted) return 0 diff --git a/code/modules/mob/living/silicon/robot/drone/drone.dm b/code/modules/mob/living/silicon/robot/drone/drone.dm index 4b38f79c2cc..005b1194821 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone.dm @@ -259,7 +259,7 @@ if(jobban_isbanned(O,"nonhumandept") || jobban_isbanned(O,"Drone")) continue if(O.client) - if(O.client.prefs.be_special & BE_PAI) + if(ROLE_PAI in O.client.prefs.be_special) question(O.client,O) /mob/living/silicon/robot/drone/proc/question(var/client/C,var/mob/M) diff --git a/code/modules/mob/living/simple_animal/borer.dm b/code/modules/mob/living/simple_animal/borer.dm index ab593967725..854969123e5 100644 --- a/code/modules/mob/living/simple_animal/borer.dm +++ b/code/modules/mob/living/simple_animal/borer.dm @@ -462,7 +462,7 @@ mob/living/simple_animal/borer/proc/request_player() if(jobban_isbanned(O, "Syndicate")) continue if(O.client) - if(O.client.prefs.be_special & BE_ALIEN && !jobban_isbanned(O, "alien")) + if((BE_ALIEN in O.client.prefs.be_special) && !jobban_isbanned(O, "alien")) question(O.client) mob/living/simple_animal/borer/proc/question(var/client/C) diff --git a/paradise.dme b/paradise.dme index c4f2edc5dee..6c56a7fdaee 100644 --- a/paradise.dme +++ b/paradise.dme @@ -35,6 +35,7 @@ #include "code\__DEFINES\preferences.dm" #include "code\__DEFINES\process_scheduler.dm" #include "code\__DEFINES\qdel.dm" +#include "code\__DEFINES\role_preferences.dm" #include "code\__DEFINES\sight.dm" #include "code\__DEFINES\stat.dm" #include "code\__HELPERS\_string_lists.dm"