diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index 21626590306..32593329621 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -380,3 +380,53 @@ return new /datum/projectile_data(src_x, src_y, time, distance, power_x, power_y, dest_x, dest_y) +/proc/pollCandidates(var/Question, var/jobbanType, var/datum/game_mode/gametypeCheck) + var/list/mob/dead/observer/candidates = list() + var/time_passed = world.time + if (!Question) + Question = "Would you like to be a special role?" + + for(var/mob/dead/observer/G in player_list) + if(!G.key || !G.client) + continue + if (gametypeCheck) + if(!gametypeCheck.age_check(G.client)) + continue + if (jobbanType) + if(jobban_isbanned(G, jobbanType) || jobban_isbanned(G, "Syndicate")) + continue + spawn(0) + G << 'sound/misc/notice2.ogg' //Alerting them to their consideration + switch(alert(G,Question,"Please answer in 30 seconds!","Yes","No")) + if("Yes") + G << "Choice registered: Yes." + if((world.time-time_passed)>300)//If more than 30 game seconds passed. + G << "Sorry, you were too late for the consideration!" + G << 'sound/machines/buzz-sigh.ogg' + return + candidates += G + if("No") + G << "Choice registered: No." + return + else + return + sleep(300) + + //Check all our candidates, to make sure they didn't log off during the 30 second wait period. + for(var/mob/dead/observer/G in candidates) + if(!G.key || !G.client) + candidates.Remove(G) + + return candidates + +/proc/makeBody(mob/dead/observer/G_found) // Uses stripped down and bastardized code from respawn character + if(!G_found || !G_found.key) return + + //First we spawn a dude. + var/mob/living/carbon/human/new_character = new(pick(latejoin))//The mob being spawned. + + G_found.client.prefs.copy_to(new_character) + ready_dna(new_character) + new_character.key = G_found.key + + return new_character \ No newline at end of file diff --git a/code/controllers/subsystem/events.dm b/code/controllers/subsystem/events.dm index b381803ba67..eb5b6b5db80 100644 --- a/code/controllers/subsystem/events.dm +++ b/code/controllers/subsystem/events.dm @@ -64,6 +64,8 @@ var/datum/subsystem/events/SSevent for(var/datum/round_event_control/E in control) if(E.occurrences >= E.max_occurrences) continue if(E.earliest_start >= world.time) continue + if(ticker.mode.config_tag in E.gamemode_blacklist) continue + if(E.gamemode_whitelist && !(ticker.mode.config_tag in E.gamemode_whitelist)) continue if(E.holidayID) if(!holidays || !holidays[E.holidayID]) continue if(E.weight < 0) //for round-start events etc. diff --git a/code/game/gamemodes/abduction/abduction_gear.dm b/code/game/gamemodes/abduction/abduction_gear.dm index 9595f0883b9..0793989952f 100644 --- a/code/game/gamemodes/abduction/abduction_gear.dm +++ b/code/game/gamemodes/abduction/abduction_gear.dm @@ -460,11 +460,16 @@ Congratulations! You are now trained for xenobiology research!"} /obj/item/weapon/abductor_baton/proc/SleepAttack(mob/living/L,mob/living/user) if(L.stunned) L.SetSleeping(60) - L.visible_message("[user] has induced sleep in [L] with [src]!", \ + L.visible_message("[user] has induced sleep in [L] with [src]!", \ "You suddenly feel very drowsy!") - playsound(loc, 'sound/weapons/Egloves.ogg', 50, 1, -1) + playsound(loc, 'sound/weapons/Egloves.ogg', 50, 1, -1) - add_logs(user, L, "put to sleep") + add_logs(user, L, "put to sleep") + else + L.drowsyness += 1 + user << "Sleep inducement works fully only on stunned specimens! " + L.visible_message("[user] tried to induce sleep in [L] with [src]!", \ + "You suddenly feel drowsy!") return /obj/item/weapon/abductor_baton/proc/CuffAttack(mob/living/L,mob/living/user) @@ -490,13 +495,22 @@ Congratulations! You are now trained for xenobiology research!"} "[user] probes you!") var/species = "Unknown species" + var/helptext = "Species unsuitable for experiments." + if(ishuman(L)) var/mob/living/carbon/human/H = L if(H.dna && H.dna.species) species = "[H.dna.species.name]" if(L.mind && L.mind.changeling) species = "Changeling lifeform" + var/obj/item/organ/internal/gland/temp = locate() in H.internal_organs + if(temp) + helptext = "Experimental gland detected!" + else + helptext = "Subject suitable for experiments." + user << "Probing result:[species]" + user << "[helptext]" /obj/item/weapon/restraints/handcuffs/energy name = "hard-light energy field" diff --git a/code/game/machinery/computer/camera_advanced.dm b/code/game/machinery/computer/camera_advanced.dm index d7b9be9aaac..4cc24bf776b 100644 --- a/code/game/machinery/computer/camera_advanced.dm +++ b/code/game/machinery/computer/camera_advanced.dm @@ -38,7 +38,7 @@ GrantActions(user) current_user = user eyeobj.user = user - eyeobj.name = "Camere Eye ([user.name])" + eyeobj.name = "Camera Eye ([user.name])" L.remote_view = 1 L.remote_control = eyeobj L.client.perspective = EYE_PERSPECTIVE diff --git a/code/modules/admin/verbs/one_click_antag.dm b/code/modules/admin/verbs/one_click_antag.dm index 25b84838539..b8c43ebdb6c 100644 --- a/code/modules/admin/verbs/one_click_antag.dm +++ b/code/modules/admin/verbs/one_click_antag.dm @@ -233,7 +233,7 @@ /datum/admins/proc/makeNukeTeam() var/datum/game_mode/nuclear/temp = new - var/list/mob/dead/observer/candidates = getCandidates("Do you wish to be considered for a nuke team being sent in?", "operative", temp) + var/list/mob/dead/observer/candidates = pollCandidates("Do you wish to be considered for a nuke team being sent in?", "operative", temp) var/list/mob/dead/observer/chosen = list() var/mob/dead/observer/theghost = null @@ -307,7 +307,7 @@ // DEATH SQUADS /datum/admins/proc/makeDeathsquad() var/mission = input("Assign a mission to the deathsquad", "Assign Mission", "Leave no witnesses.") - var/list/mob/dead/observer/candidates = getCandidates("Do you wish to be considered for an elite Nanotrasen Strike Team?", "deathsquad", null) + var/list/mob/dead/observer/candidates = pollCandidates("Do you wish to be considered for an elite Nanotrasen Strike Team?", "deathsquad", null) var/squadSpawned = 0 if(candidates.len >= 2) //Minimum 2 to be considered a squad @@ -413,7 +413,7 @@ /datum/admins/proc/makeOfficial() var/mission = input("Assign a task for the official", "Assign Task", "Conduct a routine preformance review of [station_name()] and its Captain.") - var/list/mob/dead/observer/candidates = getCandidates("Do you wish to be considered to be a Centcom Official?", "pAI") + var/list/mob/dead/observer/candidates = pollCandidates("Do you wish to be considered to be a Centcom Official?", "pAI") if(candidates.len) var/mob/dead/observer/chosen_candidate = pick(candidates) @@ -466,7 +466,7 @@ return makeOfficial() var/teamsize = min(7,input("Maximum size of team? (7 max)", "Select Team Size",4) as null|num) var/mission = input("Assign a mission to the Emergency Response Team", "Assign Mission", "Assist the station.") - var/list/mob/dead/observer/candidates = getCandidates("Do you wish to be considered for a Code [alert] Nanotrasen Emergency Response Team?", "deathsquad", null) + var/list/mob/dead/observer/candidates = pollCandidates("Do you wish to be considered for a Code [alert] Nanotrasen Emergency Response Team?", "deathsquad", null) var/teamSpawned = 0 if(candidates.len > 0) @@ -559,50 +559,11 @@ //Abductors /datum/admins/proc/makeAbductorTeam() - var/list/mob/dead/observer/candidates = getCandidates("Do you wish to be considered for an Abductor Team?", "abductor", null) - - if(candidates.len >= 2) - //Oh god why we can't have static functions - var/number = ticker.mode.abductor_teams + 1 - - var/datum/game_mode/abduction/temp - if(ticker.mode.config_tag == "abduction") - temp = ticker.mode - else - temp = new - - var/agent_mind = pick(candidates) - candidates -= agent_mind - var/scientist_mind = pick(candidates) - - var/mob/living/carbon/human/agent=makeBody(agent_mind) - var/mob/living/carbon/human/scientist=makeBody(scientist_mind) - - agent_mind = agent.mind - scientist_mind = scientist.mind - - temp.scientists.len = number - temp.agents.len = number - temp.abductors.len = 2*number - temp.team_objectives.len = number - temp.team_names.len = number - temp.scientists[number] = scientist_mind - temp.agents[number] = agent_mind - temp.abductors |= list(agent_mind,scientist_mind) - temp.make_abductor_team(number,preset_scientist=scientist_mind,preset_agent=agent_mind) - temp.post_setup_team(number) - - ticker.mode.abductor_teams++ - - if(ticker.mode.config_tag != "abduction") - ticker.mode.abductors |= temp.abductors - - return 1 - else - return + new /datum/round_event/abductor + return 1 /datum/admins/proc/makeRevenant() - var/list/mob/dead/observer/candidates = getCandidates("Do you wish to be considered for becoming a revenant?", "revenant", null) + var/list/mob/dead/observer/candidates = pollCandidates("Do you wish to be considered for becoming a revenant?", "revenant", null) if(candidates.len >= 1) var/spook_op = pick(candidates) var/mob/dead/observer/O = spook_op @@ -644,54 +605,3 @@ candidates.Remove(H) return 1 return 0 - -/datum/admins/proc/getCandidates(var/Question, var/jobbanType, var/datum/game_mode/gametypeCheck) - var/list/mob/dead/observer/candidates = list() - var/time_passed = world.time - if (!Question) - Question = "Would you like to be a special role?" - - for(var/mob/dead/observer/G in player_list) - if(!G.key || !G.client) - continue - if (gametypeCheck) - if(!gametypeCheck.age_check(G.client)) - continue - if (jobbanType) - if(jobban_isbanned(G, jobbanType) || jobban_isbanned(G, "Syndicate")) - continue - spawn(0) - G << 'sound/misc/notice2.ogg' //Alerting them to their consideration - switch(alert(G,Question,"Please answer in 30 seconds!","Yes","No")) - if("Yes") - G << "Choice registered: Yes." - if((world.time-time_passed)>300)//If more than 30 game seconds passed. - G << "Sorry, you were too late for the consideration!" - G << 'sound/machines/buzz-sigh.ogg' - return - candidates += G - if("No") - G << "Choice registered: No." - return - else - return - sleep(300) - - //Check all our candidates, to make sure they didn't log off during the 30 second wait period. - for(var/mob/dead/observer/G in candidates) - if(!G.key || !G.client) - candidates.Remove(G) - - return candidates - -/datum/admins/proc/makeBody(mob/dead/observer/G_found) // Uses stripped down and bastardized code from respawn character - if(!G_found || !G_found.key) return - - //First we spawn a dude. - var/mob/living/carbon/human/new_character = new(pick(latejoin))//The mob being spawned. - - G_found.client.prefs.copy_to(new_character) - ready_dna(new_character) - new_character.key = G_found.key - - return new_character diff --git a/code/modules/events/event.dm b/code/modules/events/event.dm index 07dbff7d269..6d555cc8448 100644 --- a/code/modules/events/event.dm +++ b/code/modules/events/event.dm @@ -20,6 +20,9 @@ var/alertadmins = 1 //should we let the admins know this event is firing //should be disabled on events that fire a lot + var/gamemode_blacklist = list() // Event won't happen in these gamemodes + var/gamemode_whitelist = list() // Event will happen ONLY in these gamemodes if not empty + /datum/round_event_control/wizard wizardevent = 1 diff --git a/tgstation.dme b/tgstation.dme index 252a8f2c178..ccd81493634 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -950,6 +950,7 @@ #include "code\modules\detectivework\footprints_and_rag.dm" #include "code\modules\detectivework\scanner.dm" #include "code\modules\emoji\emoji_parse.dm" +#include "code\modules\events\abductor.dm" #include "code\modules\events\alien_infestation.dm" #include "code\modules\events\anomaly.dm" #include "code\modules\events\anomaly_bluespace.dm"