Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Imposter removing #12850

Merged
merged 1 commit into from Feb 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion code/__DEFINES/flags.dm
Expand Up @@ -191,7 +191,6 @@ var/global/list/bitflags = list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204
#define JOB_FLAG_NON_HUMAN 128
#define JOB_FLAG_HEAD_OF_STAFF 256
#define JOB_FLAG_BLUESHIELD_PROTEC 512
#define JOB_FLAG_IMPOSTER_PRIORITIZE 1024

//dir macros
///Returns true if the dir is diagonal, false otherwise
Expand Down
2 changes: 0 additions & 2 deletions code/__DEFINES/gamemodes.dm
Expand Up @@ -14,7 +14,6 @@
#define F_FAMILIES "Families"
#define F_HEIST "Vox Shoal"
#define F_HIVEMIND "Changeling Hivemind"
#define F_IMPOSTERS "Imposters"
#define F_PROPS "Props"
#define F_REVOLUTION "Revolution"
#define F_SYNDIOPS "Syndicate Operatives"
Expand Down Expand Up @@ -44,7 +43,6 @@
#define GANGSTER_LEADER "Gangster Leader"
#define GANGSTER_DEALER "Gangster Dealer"
#define HEADREV "Head Revolutionary"
#define IMPOSTER "Imposter"
#define MALF "Malf AI"
#define MALFBOT "Malf-Slaved Cyborg"
#define NUKE_OP "Nuclear Operative"
Expand Down
2 changes: 0 additions & 2 deletions code/__DEFINES/is_helpers.dm
Expand Up @@ -205,8 +205,6 @@

#define istraitor(H) isrole(TRAITOR, H)

#define isimposter(H) isrole(IMPOSTER, H)

#define iselitesyndie(H) isrole(SYNDIESQUADIE, H)

#define ismalf(H) isrole(MALF, H)
Expand Down
2 changes: 0 additions & 2 deletions code/__DEFINES/role_preferences.dm
Expand Up @@ -19,7 +19,6 @@
#define ROLE_ABDUCTOR "Abductor"
#define ROLE_FAMILIES "Families"
#define ROLE_GHOSTLY "Ghostly Roles"
#define ROLE_IMPOSTER "Imposter"
#define ROLE_REPLICATOR "Replicator"

#define ROLE_ERT "Emergency Response Team"
Expand Down Expand Up @@ -50,7 +49,6 @@ var/global/list/special_roles_ignore_question = list(
ROLE_SHADOWLING = null,
ROLE_FAMILIES = null,
ROLE_REPLICATOR = null,
ROLE_IMPOSTER = null,
ROLE_GHOSTLY = list(IGNORE_PAI, IGNORE_TSTAFF, IGNORE_SURVIVOR, IGNORE_POSBRAIN, IGNORE_DRONE),
)

Expand Down
1 change: 0 additions & 1 deletion code/_globalvars/lists/misc.dm
Expand Up @@ -29,7 +29,6 @@ var/global/list/roles_ingame_minute_unlock = list(
ROLE_SHADOWLING = 4320,
ROLE_FAMILIES = 2160,
ROLE_REPLICATOR = 2880,
ROLE_IMPOSTER = 720,
ROLE_GHOSTLY = 360,
)

Expand Down
102 changes: 0 additions & 102 deletions code/game/gamemodes/factions/autotraitors.dm
@@ -1,6 +1,3 @@
// Time for station to equip themselfs
#define FIRST_ADDITION_IMPOSTER_CD 7 MINUTES

/datum/faction/traitor/auto
name = "AutoTraitors"
var/next_try = 0
Expand Down Expand Up @@ -89,102 +86,3 @@
/datum/faction/traitor/auto/OnPostSetup()
addtimer(CALLBACK(src, PROC_REF(traitorcheckloop)), global.autotraitors_spawn_cd)
return ..()

/datum/faction/traitor/auto/imposter
name = F_IMPOSTERS
required_pref = ROLE_IMPOSTER
roletype = /datum/role/traitor/imposter
initroletype = /datum/role/traitor/imposter
//latespawned human can be imposter
accept_latejoiners = TRUE
rounstart_populate = FALSE
//abstract variable which helps decide how much imposters we need
var/antag_counting = 0

/datum/faction/traitor/auto/imposter/can_setup(num_players)
limit_roles(num_players)
return TRUE

/datum/faction/traitor/auto/imposter/OnPostSetup()
. = ..()
antag_counting = members.len
addtimer(CALLBACK(src, PROC_REF(first_imposter_addition)), FIRST_ADDITION_IMPOSTER_CD)

// Mindprotected gain imposter
/datum/faction/traitor/auto/imposter/proc/first_imposter_addition()
var/list/mindprotected_list = list()
for(var/mob/living/carbon/human/player as anything in human_list)
if(!player.mind || !player.client)
continue
if(isanyantag(player))
continue
if(!(required_pref in player.client.prefs.be_role))
continue
if(jobban_isbanned(player, required_pref))
continue
if(!role_available_in_minutes(player, required_pref))
continue
var/datum/job/J = SSjob.GetJob(player.mind.assigned_role)
if(!J)
continue
if(J.flags & JOB_FLAG_IMPOSTER_PRIORITIZE)
mindprotected_list += player
log_mode("IMPOSTERS: First addition list has [mindprotected_list.len] lenght")
if(mindprotected_list.len)
var/mob/M = pick(mindprotected_list)
add_faction_member(src, M, TRUE, TRUE)
antag_counting++

/datum/faction/traitor/auto/imposter/get_max_traitors(playercount)
return antag_counting

//less maths
/datum/faction/traitor/auto/imposter/calculate_autotraitor_probability(playercount, current_traitors, max_traitors)
var/traitor_prob = 100
log_mode("IMPOSTERS: Current count of roles on station is [current_traitors].")
var/border_of_traitors = min(playercount, max_traitors)
log_mode("IMPOSTERS: Calculated border of roles is [border_of_traitors].")
if(current_traitors > border_of_traitors)
traitor_prob = 0
return traitor_prob

/datum/faction/traitor/auto/imposter/traitorcheckloop()
log_mode("IMPOSTERS: Try add new auto-imposter.")
antag_counting++
if(antag_counting > members.len)
return ..()
else
log_mode("IMPOSTERS: Imposter count is [antag_counting], members count is [members.len]. Adding auto-imposters failed")

/datum/faction/traitor/auto/imposter/limit_roles(num_players)
// No imposters on roundstart
max_roles = 0
min_roles = 0
return max_roles

/datum/faction/traitor/auto/imposter/can_latespawn_mob(mob/P)
//Not every joined human can start with traitor role
if(prob(50))
log_mode("IMPOSTERS: [P] latespawned without adding to [src] faction")
return FALSE
//calculate every time which members are succeed, stop spawn when at least 1 succeeded
for(var/datum/role/member_role in members)
if(member_role.IsSuccessful())
log_mode("IMPOSTERS: [P] wanna be a member of [src], but [src] faction members have completed objectives")
return FALSE
//probability 50% to increase amount of imposters by ~20%
if(members.len < calculate_traitor_scaling(player_list.len))
return TRUE
log_mode("IMPOSTERS: Members ([members.len]) has enough people for current players amount ([player_list.len])")

/datum/faction/traitor/auto/imposter/sort_possible_traitors(list/sorting_list)
for(var/mob/living/player in sorting_list)
if(!player.mind || !player.client)
sorting_list -= player
continue
for(var/job in list("Velocity Officer", "Velocity Chief", "Velocity Medical Doctor"))
if(player.mind.assigned_role == job)
sorting_list -= player
return sorting_list

#undef FIRST_ADDITION_IMPOSTER_CD
2 changes: 1 addition & 1 deletion code/game/gamemodes/game_mode.dm
Expand Up @@ -204,7 +204,7 @@ var/global/list/datum/faction/preinit_factions
addtimer(CALLBACK(src, PROC_REF(display_roundstart_logout_report)), ROUNDSTART_LOGOUT_REPORT_TIME)
addtimer(CALLBACK(src, PROC_REF(send_intercept)), rand(INTERCEPT_TIME_LOW , INTERCEPT_TIME_HIGH))

var/list/exclude_autotraitor_for = list(/datum/game_mode/extended, /datum/game_mode/imposter)
var/list/exclude_autotraitor_for = list(/datum/game_mode/extended)
if(!(type in exclude_autotraitor_for))
CreateFaction(/datum/faction/traitor/auto, num_players())

Expand Down
11 changes: 0 additions & 11 deletions code/game/gamemodes/modes_declares/imposters.dm

This file was deleted.

92 changes: 0 additions & 92 deletions code/game/gamemodes/roles/traitor.dm
Expand Up @@ -146,95 +146,3 @@
. = ..()
var/mob/living/carbon/human/H = antag.current
H.equip_or_collect(new /obj/item/device/encryptionkey/syndicate(antag.current), SLOT_R_STORE)

/datum/role/traitor/imposter
name = IMPOSTER
id = IMPOSTER
required_pref = ROLE_IMPOSTER
//No restricts, everyone can be a imposter
restricted_jobs = list()
//Challenge
give_uplink = FALSE
telecrystals = 0

/datum/role/traitor/imposter/add_one_objective(datum/mind/traitor)
switch(rand(1, 100))
//most imposters is just stealers
if(1 to 70)
var/datum/job/J = SSjob.GetJob(antag.assigned_role)
//remove objectives for heads of staff to steal own items
if(J && (J.flags & JOB_FLAG_HEAD_OF_STAFF))
AppendObjective(/datum/objective/steal/non_heads_items, TRUE)
else
AppendObjective(/datum/objective/steal, TRUE)
if(71 to 80)
AppendObjective(/datum/objective/target/assassinate, TRUE)
if(81 to 90)
AppendObjective(/datum/objective/target/harm, TRUE)
else
AppendObjective(/datum/objective/target/dehead, TRUE)

/datum/role/traitor/imposter/proc/add_killhead_objectives()
var/list/heads = get_living_heads()
for(var/datum/mind/head_mind in heads)
if(antag == head_mind)
continue
var/datum/objective/target/assassinate/killhead_obj = AppendObjective(/datum/objective/target/assassinate, TRUE)
if(killhead_obj)
killhead_obj.target = head_mind

/datum/role/traitor/imposter/create_traitor_objectives()
if(issilicon(antag.current))
//probability 10% for default silent assassin AI
if(prob(10))
log_mode("IMPOSTERS: silicon imposter ([antag.current]) has standart objectives")
return ..()
//probability 90% for peace-protecter AI
AppendObjective(/datum/objective/target/protect, TRUE)
AppendObjective(/datum/objective/target/protect, TRUE)
AppendObjective(/datum/objective/survive)
log_mode("IMPOSTERS: silicon imposter ([antag.current]) has protect objectives")
//and 10% prob to hijack shuttle when has protect objective
if(prob(10))
AppendObjective(/datum/objective/block)
log_mode("IMPOSTERS: silicon [antag.current] has hijack with protect objectives")
return
//5% prob to killhead objectives for non-silicon imposter
if(prob(5))
add_killhead_objectives()
log_mode("IMPOSTERS: Non-silicon imposter ([antag.current]) has killhead objectives")
return
//default traitor objectives
for(var/i in 1 to 3)
add_one_objective()
//Setup last objective
switch(rand(1, 100))
//Escape is more interesting
if(1 to 90)
AppendObjective(/datum/objective/escape)
if(91 to 99)
AppendObjective(/datum/objective/survive)
else
AppendObjective(/datum/objective/hijack)
log_mode("IMPOSTERS: Non-silicon imposter ([antag.current]) has standart traitor objectives")

/datum/role/traitor/imposter/OnPostSetup(laterole)
. = ..()
if(antag.current.isloyal() && iscarbon(antag.current))
var/mob/living/carbon/C = antag.current
C.fake_loyal_implant_replacement()
// Free a unit from AI
if(isrobot(antag.current))
var/mob/living/silicon/robot/robot = antag.current
robot.UnlinkSelf()
robot.emagged = TRUE

/mob/living/carbon/proc/fake_loyal_implant_replacement()
for(var/obj/item/weapon/implant/mind_protect/loyalty/L in src)
qdel(L)
var/obj/item/weapon/implant/fake_loyal/F = new(src)
F.inject(src, BP_CHEST)

// Now dont show green/red text
/datum/role/traitor/imposter/GetObjectiveDescription(datum/objective/objective)
return "[objective.explanation_text]"
4 changes: 2 additions & 2 deletions code/game/jobs/job/captain.dm
Expand Up @@ -16,7 +16,7 @@
minimal_player_ingame_minutes = 3900
outfit = /datum/outfit/job/captain
skillsets = list("Captain" = /datum/skillset/captain)
flags = JOB_FLAG_COMMAND|JOB_FLAG_HEAD_OF_STAFF|JOB_FLAG_BLUESHIELD_PROTEC|JOB_FLAG_IMPOSTER_PRIORITIZE
flags = JOB_FLAG_COMMAND|JOB_FLAG_HEAD_OF_STAFF|JOB_FLAG_BLUESHIELD_PROTEC

// Non-human species can't be captains.
/datum/job/captain/special_species_check(datum/species/S)
Expand Down Expand Up @@ -89,4 +89,4 @@
*/
restricted_species = list(SKRELL, UNATHI, TAJARAN, DIONA, VOX, IPC)
skillsets = list("Blueshield Officer" = /datum/skillset/blueshield)
flags = JOB_FLAG_COMMAND|JOB_FLAG_IMPOSTER_PRIORITIZE
flags = JOB_FLAG_COMMAND
12 changes: 6 additions & 6 deletions code/game/jobs/job/security.dm
Expand Up @@ -28,7 +28,7 @@
~Luduk
*/
restricted_species = list(SKRELL, UNATHI, TAJARAN, DIONA, VOX, IPC)
flags = JOB_FLAG_SECURITY|JOB_FLAG_COMMAND|JOB_FLAG_HEAD_OF_STAFF|JOB_FLAG_BLUESHIELD_PROTEC|JOB_FLAG_IMPOSTER_PRIORITIZE
flags = JOB_FLAG_SECURITY|JOB_FLAG_COMMAND|JOB_FLAG_HEAD_OF_STAFF|JOB_FLAG_BLUESHIELD_PROTEC

/datum/job/warden
title = "Warden"
Expand All @@ -53,7 +53,7 @@
~Luduk
*/
restricted_species = list(TAJARAN, DIONA, VOX, IPC)
flags = JOB_FLAG_SECURITY|JOB_FLAG_IMPOSTER_PRIORITIZE
flags = JOB_FLAG_SECURITY

/datum/job/warden/post_equip(mob/living/carbon/human/H, visualsOnly = FALSE)
if(HAS_ROUND_ASPECT(ROUND_ASPECT_ELITE_SECURITY))
Expand Down Expand Up @@ -82,7 +82,7 @@
~Luduk
*/
restricted_species = list(DIONA, IPC)
flags = JOB_FLAG_SECURITY|JOB_FLAG_IMPOSTER_PRIORITIZE
flags = JOB_FLAG_SECURITY

/datum/job/officer
title = "Security Officer"
Expand All @@ -107,7 +107,7 @@
~Luduk
*/
restricted_species = list(DIONA, TAJARAN, VOX, IPC)
flags = JOB_FLAG_SECURITY|JOB_FLAG_IMPOSTER_PRIORITIZE
flags = JOB_FLAG_SECURITY

/datum/job/officer/post_equip(mob/living/carbon/human/H, visualsOnly = FALSE)
if(HAS_ROUND_ASPECT(ROUND_ASPECT_ELITE_SECURITY))
Expand Down Expand Up @@ -137,7 +137,7 @@
~Luduk
*/
restricted_species = list(UNATHI, DIONA)
flags = JOB_FLAG_SECURITY|JOB_FLAG_IMPOSTER_PRIORITIZE
flags = JOB_FLAG_SECURITY

/datum/job/cadet
title = "Security Cadet"
Expand All @@ -162,4 +162,4 @@
~Luduk
*/
restricted_species = list(DIONA, TAJARAN, VOX, IPC)
flags = JOB_FLAG_SECURITY|JOB_FLAG_IMPOSTER_PRIORITIZE
flags = JOB_FLAG_SECURITY
2 changes: 1 addition & 1 deletion code/game/jobs/job/silicon.dm
Expand Up @@ -38,7 +38,7 @@
alt_titles = list("Android", "Robot")
minimal_player_ingame_minutes = 1800
give_loadout_items = FALSE
flags = JOB_FLAG_NON_HUMAN|JOB_FLAG_IMPOSTER_PRIORITIZE
flags = JOB_FLAG_NON_HUMAN

/datum/job/cyborg/equip(mob/living/carbon/human/H, visualsOnly = FALSE)
if(!H) return 0
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/weapons/implants/mindshield.dm
Expand Up @@ -77,7 +77,7 @@
if(.)
if(M.mind)
var/cleared_role = FALSE
var/list/remove_roles = list(TRAITOR, NUKE_OP, NUKE_OP_LEADER, HEADREV, GANGSTER_LEADER, IMPOSTER)
var/list/remove_roles = list(TRAITOR, NUKE_OP, NUKE_OP_LEADER, HEADREV, GANGSTER_LEADER)
for(var/role in remove_roles)
var/datum/role/R = M.mind.GetRole(role)
if(!R)
Expand Down
3 changes: 0 additions & 3 deletions code/game/objects/items/weapons/melee/misc.dm
Expand Up @@ -23,9 +23,6 @@
return
if(!ishuman(target))
return
if(isimposter(user))
to_chat(user, "<span class='warning'>[src] not working, broken, try another time.</span>")
return
var/mob/living/carbon/human/H = target
user.visible_message("<span class='notice'>[user] flails their [src] at [H]</span>")
if(HAS_TRAIT_FROM(H, TRAIT_VISUAL_OBEY, FAKE_IMPLANT_TRAIT))
Expand Down
2 changes: 1 addition & 1 deletion code/modules/admin/DB_ban/functions.dm
Expand Up @@ -345,7 +345,7 @@
output += "<option value='[j]'>[j]</option>"
for(var/j in nonhuman_positions)
output += "<option value='[j]'>[j]</option>"
for(var/j in list(ROLE_TRAITOR, ROLE_CHANGELING, ROLE_OPERATIVE, ROLE_REV, ROLE_RAIDER, ROLE_CULTIST, ROLE_WIZARD, ROLE_ERT, ROLE_SHADOWLING, ROLE_ABDUCTOR, ROLE_FAMILIES, ROLE_NINJA, ROLE_BLOB, ROLE_MALF, ROLE_DRONE, ROLE_GHOSTLY, ROLE_REPLICATOR, ROLE_IMPOSTER))
for(var/j in list(ROLE_TRAITOR, ROLE_CHANGELING, ROLE_OPERATIVE, ROLE_REV, ROLE_RAIDER, ROLE_CULTIST, ROLE_WIZARD, ROLE_ERT, ROLE_SHADOWLING, ROLE_ABDUCTOR, ROLE_FAMILIES, ROLE_NINJA, ROLE_BLOB, ROLE_MALF, ROLE_DRONE, ROLE_GHOSTLY, ROLE_REPLICATOR))
output += "<option value='[j]'>[j]</option>"
output += "</select></td></tr></table>"
output += "<b>Reason:<br></b><textarea name='dbbanreason' cols='50'></textarea><br>"
Expand Down
5 changes: 0 additions & 5 deletions code/modules/admin/topic.dm
Expand Up @@ -755,11 +755,6 @@
else
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=[ROLE_REPLICATOR];jobban4=\ref[M]'>[ROLE_REPLICATOR]</a></td>"

if(jobban_isbanned(M, ROLE_IMPOSTER) || isbanned_dept)
jobs += "<td width='20%'><a class='red' href='?src=\ref[src];jobban3=[ROLE_IMPOSTER];jobban4=\ref[M]'>[ROLE_IMPOSTER]</a></td>"
else
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=[ROLE_IMPOSTER];jobban4=\ref[M]'>[ROLE_IMPOSTER]</a></td>"

jobs += "</tr><tr align='center'>"

jobs += "</tr></table>"
Expand Down