Merge pull request #4930 from Citadel-Station-13/upstream-merge-34236

[MIRROR] Antag Panel / Check antagonists Refactor
This commit is contained in:
deathride58
2018-01-19 19:33:25 +00:00
committed by GitHub
63 changed files with 1224 additions and 1427 deletions
+5 -6
View File
@@ -73,8 +73,8 @@
C.prefs.copy_to(M)
M.key = C.key
var/datum/mind/app_mind = M.mind
var/datum/antagonist/wizard/apprentice/app = new(app_mind)
var/datum/antagonist/wizard/apprentice/app = new()
app.master = user
app.school = kind
@@ -136,7 +136,7 @@
C.prefs.copy_to(M)
M.key = C.key
var/datum/antagonist/nukeop/new_op = new(M.mind)
var/datum/antagonist/nukeop/new_op = new()
new_op.send_to_spawnpoint = FALSE
new_op.nukeop_outfit = /datum/outfit/syndicate/no_crystals
@@ -187,8 +187,8 @@
R.real_name = R.name
R.key = C.key
var/datum/antagonist/nukeop/new_borg = new(R.mind)
var/datum/antagonist/nukeop/new_borg = new()
new_borg.send_to_spawnpoint = FALSE
R.mind.add_antag_datum(new_borg,creator_op.nuke_team)
R.mind.special_role = "Syndicate Cyborg"
@@ -235,7 +235,6 @@
S.key = C.key
S.mind.assigned_role = S.name
S.mind.special_role = S.name
SSticker.mode.traitors += S.mind
var/datum/objective/assassinate/new_objective
if(user)
new_objective = new /datum/objective/assassinate
+13 -1
View File
@@ -31,4 +31,16 @@
report += "The [member_name]s were:"
report += printplayerlist(members)
return report.Join("<br>")
return report.Join("<br>")
//Get all teams [of type team_type]
//TODO move these to some antag helpers file with get_antagonists
/proc/get_all_teams(team_type)
. = list()
for(var/V in GLOB.antagonists)
var/datum/antagonist/A = V
if(!A.owner)
continue
var/datum/team/T = A.get_team()
if(!team_type || istype(T,team_type))
. |= T
+1 -4
View File
@@ -18,8 +18,6 @@
var/const/min_team_size = 2
traitors_required = FALSE //Only teams are possible
var/meeting_areas = list("The Bar", "Dorms", "Escape Dock", "Arrivals", "Holodeck", "Primary Tool Storage", "Recreation Area", "Chapel", "Library")
/datum/game_mode/traitor/bros/pre_setup()
if(CONFIG_GET(flag/protect_roles_from_antagonist))
restricted_jobs += protected_jobs
@@ -51,8 +49,7 @@
/datum/game_mode/traitor/bros/post_setup()
for(var/datum/team/brother_team/team in pre_brother_teams)
team.meeting_area = pick(meeting_areas)
meeting_areas -= team.meeting_area
team.pick_meeting_area()
team.forge_brother_objectives()
for(var/datum/mind/M in team.members)
M.add_antag_datum(ANTAG_DATUM_BROTHER, team)
+1 -1
View File
@@ -70,7 +70,7 @@ GLOBAL_VAR(changeling_team_objective_type) //If this is not null, we hand our th
for(var/datum/mind/changeling in changelings)
log_game("[changeling.key] (ckey) has been selected as a changeling")
var/datum/antagonist/changeling/new_antag = new(changeling)
var/datum/antagonist/changeling/new_antag = new()
new_antag.team_mode = TRUE
changeling.add_antag_datum(new_antag)
..()
@@ -78,12 +78,12 @@
recent_speech[spoken_memory] = say_log[spoken_memory]
if(recent_speech.len)
user.mind.store_memory("<B>Some of [target]'s speech patterns, we should study these to better impersonate them!</B>")
changeling.antag_memory += "<B>Some of [target]'s speech patterns, we should study these to better impersonate them!</B><br>"
to_chat(user, "<span class='boldnotice'>Some of [target]'s speech patterns, we should study these to better impersonate them!</span>")
for(var/spoken_memory in recent_speech)
user.mind.store_memory("\"[recent_speech[spoken_memory]]\"")
changeling.antag_memory += "\"[recent_speech[spoken_memory]]\"<br>"
to_chat(user, "<span class='notice'>\"[recent_speech[spoken_memory]]\"</span>")
user.mind.store_memory("<B>We have no more knowledge of [target]'s speech patterns.</B>")
changeling.antag_memory += "<B>We have no more knowledge of [target]'s speech patterns.</B><br>"
to_chat(user, "<span class='boldnotice'>We have no more knowledge of [target]'s speech patterns.</span>")
@@ -74,8 +74,35 @@ Credit where due:
var/datum/antagonist/clockcult/C = new update_type(L.mind)
C.make_team = create_team
C.show_in_roundend = create_team //tutorial scarabs begone
if(iscyborg(L))
var/mob/living/silicon/robot/R = L
if(R.deployed)
var/mob/living/silicon/ai/AI = R.mainframe
R.undeploy()
to_chat(AI, "<span class='userdanger'>Anomaly Detected. Returned to core!</span>") //The AI needs to be in its core to properly be converted
. = L.mind.add_antag_datum(C)
if(!silent && L)
if(.)
to_chat(L, "<span class='heavy_brass'>The world before you suddenly glows a brilliant yellow. [issilicon(L) ? "You cannot compute this truth!" : \
"Your mind is racing!"] You hear the whooshing steam and cl[pick("ank", "ink", "unk", "ang")]ing cogs of a billion billion machines, and all at once it comes to you.<br>\
Ratvar, the Clockwork Justiciar, [GLOB.ratvar_awakens ? "has been freed from his eternal prison" : "lies in exile, derelict and forgotten in an unseen realm"].</span>")
flash_color(L, flash_color = list("#BE8700", "#BE8700", "#BE8700", rgb(0,0,0)), flash_time = 50)
else
L.visible_message("<span class='boldwarning'>[L] seems to resist an unseen force!</span>", null, null, 7, L)
to_chat(L, "<span class='heavy_brass'>The world before you suddenly glows a brilliant yellow. [issilicon(L) ? "You cannot compute this truth!" : \
"Your mind is racing!"] You hear the whooshing steam and cl[pick("ank", "ink", "unk", "ang")]ing cogs of a billion billion machines, and the sound</span> <span class='boldwarning'>\
is a meaningless cacophony.</span><br>\
<span class='userdanger'>You see an abomination of rusting parts[GLOB.ratvar_awakens ? ", and it is here.<br>It is too late" : \
" in an endless grey void.<br>It cannot be allowed to escape"].</span>")
L.playsound_local(get_turf(L), 'sound/ambience/antag/clockcultalr.ogg', 40, TRUE, frequency = 100000, pressure_affected = FALSE)
flash_color(L, flash_color = list("#BE8700", "#BE8700", "#BE8700", rgb(0,0,0)), flash_time = 5)
/proc/remove_servant_of_ratvar(mob/L, silent = FALSE)
if(!L || !L.mind)
return
@@ -38,7 +38,8 @@
/obj/structure/destructible/clockwork/eminence_spire/attack_ghost(mob/user)
if(!IsAdminGhost(user))
return
var/datum/antagonist/clockcult/random_cultist = locate() in GLOB.antagonists //if theres no cultists new team without eminence will be created anyway.
var/datum/antagonist/clockcult/random_cultist = locate() in get_antagonists(/datum/antagonist/clockcult) //if theres no cultists new team without eminence will be created anyway.
if(random_cultist && random_cultist.clock_team && random_cultist.clock_team.eminence)
to_chat(user, "<span class='warning'>There's already an Eminence - too late!</span>")
return
+1 -1
View File
@@ -99,7 +99,7 @@
if (!istype(cult_mind))
return 0
var/datum/antagonist/cult/new_cultist = new(cult_mind)
var/datum/antagonist/cult/new_cultist = new()
new_cultist.give_equipment = equip
if(cult_mind.add_antag_datum(new_cultist))
+1
View File
@@ -338,6 +338,7 @@
return ..()
/datum/action/innate/cult/master/pulse/Destroy()
PM.attached_action = null //What the fuck is even going on here.
QDEL_NULL(PM)
return ..()
@@ -1,92 +1,6 @@
/datum/game_mode
var/list/datum/mind/abductors = list()
/datum/game_mode/abduction
name = "abduction"
config_tag = "abduction"
antag_flag = ROLE_ABDUCTOR
false_report_weight = 1
recommended_enemies = 2
required_players = 15
maximum_players = 50
var/max_teams = 4
var/list/datum/team/abductor_team/abductor_teams = list()
var/finished = FALSE
var/static/team_count = 0
/datum/game_mode/abduction/announce()
to_chat(world, "<B>The current game mode is - Abduction!</B>")
to_chat(world, "There are alien <b>abductors</b> sent to [station_name()] to perform nefarious experiments!")
to_chat(world, "<b>Abductors</b> - kidnap the crew and replace their organs with experimental ones.")
to_chat(world, "<b>Crew</b> - don't get abducted and stop the abductors.")
/datum/game_mode/abduction/pre_setup()
var/num_teams = max(1, min(max_teams, round(num_players() / CONFIG_GET(number/abductor_scaling_coeff))))
var/possible_teams = max(1, round(antag_candidates.len / 2))
num_teams = min(num_teams, possible_teams)
for(var/i = 1 to num_teams)
if(!make_abductor_team())
return FALSE
return TRUE
/datum/game_mode/abduction/proc/make_abductor_team(datum/mind/agent, datum/mind/scientist)
team_count++ //TODO: Fix the edge case of abductor game mode rolling twice+ and failing to setup on first time.
var/team_number = team_count
if(team_number > max_teams)
return //or should it try to stuff them in anway ?
var/datum/team/abductor_team/team = new
team.team_number = team_number
team.name = "Mothership [pick(GLOB.possible_changeling_IDs)]" //TODO Ensure unique and actual alieny names
team.add_objective(new/datum/objective/experiment)
if(antag_candidates.len < (!agent + !scientist))
return
if(!scientist)
scientist = pick(antag_candidates)
antag_candidates -= scientist
team.members |= scientist
scientist.assigned_role = "Abductor Scientist"
scientist.special_role = "Abductor Scientist"
log_game("[scientist.key] (ckey) has been selected as [team.name] abductor scientist.")
if(!agent)
agent = pick(antag_candidates)
antag_candidates -= agent
team.members |= agent
agent.assigned_role = "Abductor Agent"
agent.special_role = "Abductor Agent"
log_game("[agent.key] (ckey) has been selected as [team.name] abductor agent.")
abductor_teams += team
return team
/datum/game_mode/abduction/post_setup()
for(var/datum/team/abductor_team/team in abductor_teams)
post_setup_team(team)
return ..()
//Used for create antag buttons
/datum/game_mode/abduction/proc/post_setup_team(datum/team/abductor_team/team)
for(var/datum/mind/M in team.members)
if(M.assigned_role == "Abductor Scientist")
M.add_antag_datum(ANTAG_DATUM_ABDUCTOR_SCIENTIST, team)
else
M.add_antag_datum(ANTAG_DATUM_ABDUCTOR_AGENT, team)
/datum/game_mode/abduction/check_finished()
if(!finished)
for(var/datum/team/abductor_team/team in abductor_teams)
for(var/datum/objective/O in team.objectives)
if(O.check_completion())
SSshuttle.emergency.request(null, set_coefficient = 0.5)
finished = TRUE
return ..()
return ..()
// LANDMARKS
/obj/effect/landmark/abductor
var/team_number = 1
@@ -118,8 +32,4 @@
/datum/game_mode/proc/update_abductor_icons_removed(datum/mind/alien_mind)
var/datum/atom_hud/antag/hud = GLOB.huds[ANTAG_HUD_ABDUCTOR]
hud.leave_hud(alien_mind.current)
set_antag_hud(alien_mind.current, null)
/datum/game_mode/abduction/generate_report()
return "Nearby spaceships report crewmembers having been [pick("kidnapped", "abducted", "captured")] and [pick("tortured", "experimented on", "probed", "implanted")] by mysterious \
grey humanoids, before being sent back. Be advised that the kidnapped crewmembers behave strangely upon return to duties."
set_antag_hud(alien_mind.current, null)
@@ -226,7 +226,6 @@
player_mind.transfer_to(S)
player_mind.assigned_role = "Morph"
player_mind.special_role = "Morph"
SSticker.mode.traitors |= player_mind
player_mind.add_antag_datum(/datum/antagonist/auto_custom)
to_chat(S, S.playstyle_string)
SEND_SOUND(S, sound('sound/magic/mutate.ogg'))
@@ -86,7 +86,6 @@
to_chat(src, "<b>Objective #2</b>: [objective2.explanation_text]")
mind.assigned_role = "revenant"
mind.special_role = "Revenant"
SSticker.mode.traitors |= mind //Necessary for announcing
mind.add_antag_datum(/datum/antagonist/auto_custom)
AddSpell(new /obj/effect/proc_holder/spell/targeted/night_vision/revenant(null))
AddSpell(new /obj/effect/proc_holder/spell/targeted/revenant_transmit(null))
@@ -37,7 +37,6 @@
player_mind.transfer_to(S)
player_mind.assigned_role = "Slaughter Demon"
player_mind.special_role = "Slaughter Demon"
SSticker.mode.traitors |= player_mind
player_mind.add_antag_datum(/datum/antagonist/auto_custom)
to_chat(S, S.playstyle_string)
to_chat(S, "<B>You are currently not currently in the same plane of existence as the station. Blood Crawl near a blood pool to manifest.</B>")
+1 -1
View File
@@ -96,7 +96,7 @@
for(var/datum/mind/rev_mind in headrev_candidates)
log_game("[rev_mind.key] (ckey) has been selected as a head rev")
var/datum/antagonist/rev/head/new_head = new(rev_mind)
var/datum/antagonist/rev/head/new_head = new()
new_head.give_flash = TRUE
new_head.give_hud = TRUE
new_head.remove_clumsy = TRUE
+3 -5
View File
@@ -61,8 +61,7 @@
/datum/game_mode/traitor/post_setup()
for(var/datum/mind/traitor in pre_traitors)
var/datum/antagonist/traitor/new_antag = new antag_datum(traitor)
new_antag.should_specialise = TRUE
var/datum/antagonist/traitor/new_antag = new antag_datum()
addtimer(CALLBACK(traitor, /datum/mind.proc/add_antag_datum, new_antag), rand(10,100))
if(!exchange_blue)
exchange_blue = -1 //Block latejoiners from getting exchange objectives
@@ -82,8 +81,7 @@
add_latejoin_traitor(character.mind)
/datum/game_mode/traitor/proc/add_latejoin_traitor(datum/mind/character)
var/datum/antagonist/traitor/new_antag = new antag_datum(character)
new_antag.should_specialise = TRUE
var/datum/antagonist/traitor/new_antag = new antag_datum()
character.add_antag_datum(new_antag)
/datum/game_mode/traitor/generate_report()
@@ -98,4 +96,4 @@
/datum/game_mode/proc/update_traitor_icons_removed(datum/mind/traitor_mind)
var/datum/atom_hud/antag/traitorhud = GLOB.huds[ANTAG_HUD_TRAITOR]
traitorhud.leave_hud(traitor_mind.current)
set_antag_hud(traitor_mind.current, null)
set_antag_hud(traitor_mind.current, null)
-1
View File
@@ -39,7 +39,6 @@
user.dna.add_mutation(COLDRES)
user.dna.add_mutation(TK)
SSticker.mode.traitors += user.mind
user.mind.special_role = "Avatar of the Wish Granter"
var/datum/objective/hijack/hijack = new
@@ -35,7 +35,7 @@
/obj/item/device/doorCharge/examine(mob/user)
..()
if(user.mind in SSticker.mode.traitors) //No nuke ops because the device is excluded from nuclear
if(user.mind && user.mind.has_antag_datum(/datum/antagonist/traitor)) //No nuke ops because the device is excluded from nuclear
to_chat(user, "A small explosive device that can be used to sabotage airlocks to cause an explosion upon opening. To apply, remove the airlock's maintenance panel and place it within.")
else
to_chat(user, "A small, suspicious object that feels lukewarm when held.")