Refactors antag datum hud adding and removing procs (#47573)

* Refactors antag datum hud giving code

* epic fail. this is a much better way to do it

* reduces copy and paste for clown mutation

* review additions

* didn't mean to put that there

* re-add check
This commit is contained in:
SteelSlayer
2019-11-06 14:30:21 -06:00
committed by AnturK
parent 8e00a581bb
commit f77d0db3e4
21 changed files with 123 additions and 221 deletions

View File

@@ -27,8 +27,6 @@ SUBSYSTEM_DEF(pai)
card.setPersonality(pai)
SSticker.mode.update_cult_icons_removed(card.pai.mind)
candidates -= candidate
usr << browse(null, "window=findPai")

View File

@@ -266,7 +266,6 @@
/datum/mind/proc/remove_brother()
if(src in SSticker.mode.brothers)
remove_antag_datum(/datum/antagonist/brother)
SSticker.mode.update_brother_icons_removed(src)
/datum/mind/proc/remove_nukeop()
var/datum/antagonist/nukeop/nuke = has_antag_datum(/datum/antagonist/nukeop,TRUE)
@@ -305,7 +304,6 @@
remove_wizard()
remove_cultist()
remove_rev()
SSticker.mode.update_cult_icons_removed(src)
/datum/mind/proc/equip_traitor(employer = "The Syndicate", silent = FALSE, datum/antagonist/uplink_owner)
if(!current)

View File

@@ -65,13 +65,3 @@
/datum/game_mode/traitor/bros/generate_report()
return "It's Syndicate recruiting season. Be alert for potential Syndicate infiltrators, but also watch out for disgruntled employees trying to defect. Unlike Nanotrasen, the Syndicate prides itself in teamwork and will only recruit pairs that share a brotherly trust."
/datum/game_mode/proc/update_brother_icons_added(datum/mind/brother_mind)
var/datum/atom_hud/antag/brotherhud = GLOB.huds[ANTAG_HUD_BROTHER]
brotherhud.join_hud(brother_mind.current)
set_antag_hud(brother_mind.current, "brother")
/datum/game_mode/proc/update_brother_icons_removed(datum/mind/brother_mind)
var/datum/atom_hud/antag/brotherhud = GLOB.huds[ANTAG_HUD_BROTHER]
brotherhud.leave_hud(brother_mind.current)
set_antag_hud(brother_mind.current, null)

View File

@@ -120,21 +120,11 @@
if(!cult_datum)
return FALSE
cult_datum.silent = silent
cult_datum.on_removal()
cult_mind.remove_antag_datum(cult_datum)
if(stun)
cult_mind.current.Unconscious(100)
return TRUE
/datum/game_mode/proc/update_cult_icons_added(datum/mind/cult_mind)
var/datum/atom_hud/antag/culthud = GLOB.huds[ANTAG_HUD_CULT]
culthud.join_hud(cult_mind.current)
set_antag_hud(cult_mind.current, "cult")
/datum/game_mode/proc/update_cult_icons_removed(datum/mind/cult_mind)
var/datum/atom_hud/antag/culthud = GLOB.huds[ANTAG_HUD_CULT]
culthud.leave_hud(cult_mind.current)
set_antag_hud(cult_mind.current, null)
/datum/game_mode/cult/proc/check_cult_victory()
return main_cult.check_cult_victory()

View File

@@ -15,16 +15,6 @@
else
objective.find_target()
/datum/game_mode/proc/update_devil_icons_added(datum/mind/devil_mind)
var/datum/atom_hud/antag/hud = GLOB.huds[ANTAG_HUD_DEVIL]
hud.join_hud(devil_mind.current)
set_antag_hud(devil_mind.current, "devil")
/datum/game_mode/proc/update_devil_icons_removed(datum/mind/devil_mind)
var/datum/atom_hud/antag/hud = GLOB.huds[ANTAG_HUD_DEVIL]
hud.leave_hud(devil_mind.current)
set_antag_hud(devil_mind.current, null)
/datum/game_mode/proc/update_soulless_icons_added(datum/mind/soulless_mind)
var/datum/atom_hud/antag/hud = GLOB.huds[ANTAG_HUD_SOULLESS]
hud.join_hud(soulless_mind.current)
@@ -34,6 +24,3 @@
var/datum/atom_hud/antag/hud = GLOB.huds[ANTAG_HUD_SOULLESS]
hud.leave_hud(soulless_mind.current)
set_antag_hud(soulless_mind.current, null)
/proc/isdevil(mob/living/M)
return istype(M) && M.mind && M.mind.has_antag_datum(/datum/antagonist/devil)

View File

@@ -15,6 +15,8 @@ GLOBAL_LIST_EMPTY(antagonists)
var/antag_memory = ""//These will be removed with antag datum
var/antag_moodlet //typepath of moodlet that the mob will gain with their status
var/can_hijack = HIJACK_NEUTRAL //If these antags are alone on shuttle hijack happens.
var/antag_hud_type
var/antag_hud_name
//Antag panel properties
var/show_in_antagpanel = TRUE //This will hide adding this antag type in antag panel, use only for internal subtypes that shouldn't be added directly but still show if possessed by mind
@@ -59,6 +61,30 @@ GLOBAL_LIST_EMPTY(antagonists)
/datum/antagonist/proc/remove_innate_effects(mob/living/mob_override)
return
// Adds the specified antag hud to the player. Usually called in an antag datum file
/datum/antagonist/proc/add_antag_hud(antag_hud_type, antag_hud_name, mob/living/mob_override)
var/datum/atom_hud/antag/hud = GLOB.huds[antag_hud_type]
hud.join_hud(mob_override)
set_antag_hud(mob_override, antag_hud_name)
// Removes the specified antag hud from the player. Usually called in an antag datum file
/datum/antagonist/proc/remove_antag_hud(antag_hud_type, mob/living/mob_override)
var/datum/atom_hud/antag/hud = GLOB.huds[antag_hud_type]
hud.join_hud(mob_override)
set_antag_hud(mob_override, null)
// Handles adding and removing the clumsy mutation from clown antags. Gets called in apply/remove_innate_effects
/datum/antagonist/proc/handle_clown_mutation(mob/living/mob_override, message, removing = TRUE)
var/mob/living/carbon/human/H = mob_override
if(H && istype(H) && H.mind.assigned_role == "Clown")
if(removing) // They're a clown becoming an antag, remove clumsy
H.dna.remove_mutation(CLOWNMUT)
if(!silent && message)
to_chat(H, "<span class='boldnotice'>[message]</span>")
else
H.dna.add_mutation(CLOWNMUT) // We're removing their antag status, add back clumsy
//Assign default team and creates one for one of a kind team antagonists
/datum/antagonist/proc/create_team(datum/team/team)
return

View File

@@ -5,6 +5,8 @@
roundend_category = "abductors"
antagpanel_category = "Abductor"
job_rank = ROLE_ABDUCTOR
antag_hud_type = ANTAG_HUD_ABDUCTOR
antag_hud_name = "abductor"
show_in_antagpanel = FALSE //should only show subtypes
var/datum/team/abductor_team/team
var/sub_role
@@ -76,7 +78,7 @@
H.forceMove(LM.loc)
break
update_abductor_icons_added(owner,"abductor")
add_antag_hud(antag_hud_type, antag_hud_name, owner.current)
/datum/antagonist/abductor/scientist/on_gain()
ADD_TRAIT(owner, TRAIT_ABDUCTOR_SCIENTIST_TRAINING, ABDUCTOR_ANTAGONIST)
@@ -162,6 +164,8 @@
name = "Abductee"
roundend_category = "abductees"
antagpanel_category = "Abductee"
antag_hud_type = ANTAG_HUD_ABDUCTOR
antag_hud_name = "abductee"
/datum/antagonist/abductee/on_gain()
give_objective()
@@ -181,10 +185,12 @@
objectives += O
/datum/antagonist/abductee/apply_innate_effects(mob/living/mob_override)
update_abductor_icons_added(mob_override ? mob_override.mind : owner,"abductee")
var/mob/living/M = mob_override || owner.current
add_antag_hud(antag_hud_type, antag_hud_name, M)
/datum/antagonist/abductee/remove_innate_effects(mob/living/mob_override)
update_abductor_icons_removed(mob_override ? mob_override.mind : owner)
var/mob/living/M = mob_override || owner.current
remove_antag_hud(antag_hud_type, M)
// LANDMARKS
@@ -211,13 +217,3 @@
if(E.team_number == T.team_number)
return E.points >= target_amount
return FALSE
/datum/antagonist/proc/update_abductor_icons_added(datum/mind/alien_mind,hud_type)
var/datum/atom_hud/antag/hud = GLOB.huds[ANTAG_HUD_ABDUCTOR]
hud.join_hud(alien_mind.current)
set_antag_hud(alien_mind.current, hud_type)
/datum/antagonist/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)

View File

@@ -3,6 +3,8 @@
antagpanel_category = "Brother"
job_rank = ROLE_BROTHER
var/special_role = ROLE_BROTHER
antag_hud_type = ANTAG_HUD_BROTHER
antag_hud_name = "brother"
var/datum/team/brother_team/team
antag_moodlet = /datum/mood_event/focused
can_hijack = HIJACK_HIJACKER
@@ -31,6 +33,14 @@
owner.special_role = null
return ..()
/datum/antagonist/brother/apply_innate_effects(mob/living/mob_override)
var/mob/living/M = mob_override || owner.current
add_antag_hud(antag_hud_type, antag_hud_name, M)
/datum/antagonist/brother/remove_innate_effects(mob/living/mob_override)
var/mob/living/M = mob_override || owner.current
remove_antag_hud(antag_hud_type, M)
/datum/antagonist/brother/antag_panel_data()
return "Conspirators : [get_brother_names()]]"
@@ -60,7 +70,6 @@
give_meeting_area()
/datum/antagonist/brother/proc/finalize_brother()
SSticker.mode.update_brother_icons_added(owner)
owner.current.playsound_local(get_turf(owner.current), 'sound/ambience/antag/tatoralert.ogg', 100, FALSE, pressure_affected = FALSE)
/datum/antagonist/brother/admin_add(datum/mind/new_owner,mob/admin)

View File

@@ -8,6 +8,8 @@
antagpanel_category = "Changeling"
job_rank = ROLE_CHANGELING
antag_moodlet = /datum/mood_event/focused
antag_hud_type = ANTAG_HUD_CHANGELING
antag_hud_name = "changeling"
var/you_are_greet = TRUE
var/give_objectives = TRUE
@@ -88,7 +90,6 @@
if(team_mode)
forge_team_objectives()
forge_objectives()
remove_clownmut()
. = ..()
/datum/antagonist/changeling/on_removal()
@@ -102,13 +103,6 @@
remove_changeling_powers()
. = ..()
/datum/antagonist/changeling/proc/remove_clownmut()
if (owner)
var/mob/living/carbon/human/H = owner.current
if(istype(H) && owner.assigned_role == "Clown")
to_chat(H, "<span class='boldnotice'>You have evolved beyond your clownish nature, allowing you to wield weapons without harming yourself.</span>")
H.dna.remove_mutation(CLOWNMUT)
/datum/antagonist/changeling/proc/reset_properties()
changeling_speak = 0
chosen_sting = null
@@ -353,7 +347,7 @@
if(ishuman(C))
add_new_profile(C)
/datum/antagonist/changeling/apply_innate_effects()
/datum/antagonist/changeling/apply_innate_effects(mob/living/mob_override)
//Brains optional.
var/mob/living/carbon/C = owner.current
if(istype(C))
@@ -362,10 +356,14 @@
B.organ_flags &= ~ORGAN_VITAL
B.decoy_override = TRUE
RegisterSignal(C, list(COMSIG_MOB_MIDDLECLICKON, COMSIG_MOB_ALTCLICKON), .proc/stingAtom)
update_changeling_icons_added()
var/mob/living/M = mob_override || owner.current
add_antag_hud(antag_hud_type, antag_hud_name, M)
handle_clown_mutation(M, "You have evolved beyond your clownish nature, allowing you to wield weapons without harming yourself.")
/datum/antagonist/changeling/remove_innate_effects()
update_changeling_icons_removed()
/datum/antagonist/changeling/remove_innate_effects(mob/living/mob_override)
var/mob/living/M = mob_override || owner.current
remove_antag_hud(antag_hud_type, M)
handle_clown_mutation(M, removing = FALSE)
UnregisterSignal(owner.current, list(COMSIG_MOB_MIDDLECLICKON, COMSIG_MOB_ALTCLICKON))
@@ -478,15 +476,6 @@
objectives += identity_theft
escape_objective_possible = FALSE
/datum/antagonist/changeling/proc/update_changeling_icons_added()
var/datum/atom_hud/antag/hud = GLOB.huds[ANTAG_HUD_CHANGELING]
hud.join_hud(owner.current)
set_antag_hud(owner.current, "changeling")
/datum/antagonist/changeling/proc/update_changeling_icons_removed()
var/datum/atom_hud/antag/hud = GLOB.huds[ANTAG_HUD_CHANGELING]
hud.leave_hud(owner.current)
set_antag_hud(owner.current, null)
/datum/antagonist/changeling/admin_add(datum/mind/new_owner,mob/admin)
. = ..()

View File

@@ -3,6 +3,8 @@
show_in_antagpanel = TRUE
antagpanel_category = "Other"
job_rank = ROLE_OBSESSED
antag_hud_type = ANTAG_HUD_OBSESSED
antag_hud_name = "obsessed"
show_name_in_check_antagonists = TRUE
roundend_category = "obsessed"
silent = TRUE //not actually silent, because greet will be called by the trauma anyway.
@@ -37,11 +39,11 @@
/datum/antagonist/obsessed/apply_innate_effects(mob/living/mob_override)
var/mob/living/M = mob_override || owner.current
update_obsession_icons_added(M)
add_antag_hud(antag_hud_type, antag_hud_name, M)
/datum/antagonist/obsessed/remove_innate_effects(mob/living/mob_override)
var/mob/living/M = mob_override || owner.current
update_obsession_icons_removed(M)
remove_antag_hud(antag_hud_type, M)
/datum/antagonist/obsessed/proc/forge_objectives(var/datum/mind/obsessionmind)
var/list/objectives_left = list("spendtime", "polaroid", "hug")
@@ -273,13 +275,3 @@
explanation_text = "Steal [target.name]'s family heirloom, [steal_target] they cherish."
else
explanation_text = "Free Objective"
/datum/antagonist/obsessed/proc/update_obsession_icons_added(var/mob/living/carbon/human/obsessed)
var/datum/atom_hud/antag/creephud = GLOB.huds[ANTAG_HUD_OBSESSED]
creephud.join_hud(obsessed)
set_antag_hud(obsessed, "obsessed")
/datum/antagonist/obsessed/proc/update_obsession_icons_removed(var/mob/living/carbon/human/obsessed)
var/datum/atom_hud/antag/creephud = GLOB.huds[ANTAG_HUD_OBSESSED]
creephud.leave_hud(obsessed)
set_antag_hud(obsessed, null)

View File

@@ -9,6 +9,8 @@
var/datum/action/innate/cult/mastervote/vote = new
var/datum/action/innate/cult/blood_magic/magic = new
job_rank = ROLE_CULTIST
antag_hud_type = ANTAG_HUD_CULT
antag_hud_name = "cult"
var/ignore_implant = FALSE
var/give_equipment = FALSE
var/datum/team/cult/cult_team
@@ -58,7 +60,6 @@
if(give_equipment)
equip_cultist(TRUE)
SSticker.mode.cult += owner // Only add after they've been given objectives
SSticker.mode.update_cult_icons_added(owner)
current.log_message("has been converted to the cult of Nar'Sie!", LOG_ATTACK, color="#960000")
if(cult_team.blood_target && cult_team.blood_target_image && current.client)
@@ -69,9 +70,6 @@
var/mob/living/carbon/H = owner.current
if(!istype(H))
return
if (owner.assigned_role == "Clown")
to_chat(owner, "Your training has allowed you to overcome your clownish nature, allowing you to wield weapons without harming yourself.")
H.dna.remove_mutation(CLOWNMUT)
. += cult_give_item(/obj/item/melee/cultblade/dagger, H)
if(metal)
. += cult_give_item(/obj/item/stack/sheet/runed_metal/ten, H)
@@ -102,6 +100,8 @@
var/mob/living/current = owner.current
if(mob_override)
current = mob_override
add_antag_hud(antag_hud_type, antag_hud_name, current)
handle_clown_mutation(current, mob_override ? null : "Your training has allowed you to overcome your clownish nature, allowing you to wield weapons without harming yourself.")
current.faction |= "cult"
current.grant_language(/datum/language/narsie)
if(!cult_team.cult_master)
@@ -120,6 +120,8 @@
var/mob/living/current = owner.current
if(mob_override)
current = mob_override
remove_antag_hud(antag_hud_type, current)
handle_clown_mutation(current, removing = FALSE)
current.faction -= "cult"
current.remove_language(/datum/language/narsie)
vote.Remove(current)
@@ -136,7 +138,6 @@
/datum/antagonist/cult/on_removal()
SSticker.mode.cult -= owner
SSticker.mode.update_cult_icons_removed(owner)
if(!silent)
owner.current.visible_message("<span class='deconversion_message'>[owner.current] looks like [owner.current.p_theyve()] just reverted to [owner.current.p_their()] old faith!</span>", null, null, null, owner.current)
to_chat(owner.current, "<span class='userdanger'>An unfamiliar white light flashes through your mind, cleansing the taint of the Geometer and all your memories as her servant.</span>")

View File

@@ -89,6 +89,8 @@ GLOBAL_LIST_INIT(devil_suffix, list(" the Red", " the Soulless", " the Master",
roundend_category = "devils"
antagpanel_category = "Devil"
job_rank = ROLE_DEVIL
antag_hud_type = ANTAG_HUD_DEVIL
antag_hud_name = "devil"
var/obligation
var/ban
var/bane
@@ -510,10 +512,6 @@ GLOBAL_LIST_INIT(devil_suffix, list(" the Red", " the Soulless", " the Master",
var/laws = list("You may not use violence to coerce someone into selling their soul.", "You may not directly and knowingly physically harm a devil, other than yourself.", GLOB.lawlorify[LAW][ban], GLOB.lawlorify[LAW][obligation], "Accomplish your objectives at all costs.")
robot_devil.set_law_sixsixsix(laws)
sleep(10)
if(owner.assigned_role == "Clown" && ishuman(owner.current))
var/mob/living/carbon/human/S = owner.current
to_chat(S, "<span class='notice'>Your infernal nature has allowed you to overcome your clownishness.</span>")
S.dna.remove_mutation(CLOWNMUT)
.=..()
/datum/antagonist/devil/on_removal()
@@ -522,6 +520,9 @@ GLOBAL_LIST_INIT(devil_suffix, list(" the Red", " the Soulless", " the Master",
/datum/antagonist/devil/apply_innate_effects(mob/living/mob_override)
give_appropriate_spells()
var/mob/living/M = mob_override || owner.current
add_antag_hud(antag_hud_type, antag_hud_name, M)
handle_clown_mutation(M, mob_override ? null : "Your infernal nature has allowed you to overcome your clownishness.")
owner.current.grant_all_languages(TRUE)
update_hud()
.=..()
@@ -531,6 +532,9 @@ GLOBAL_LIST_INIT(devil_suffix, list(" the Red", " the Soulless", " the Master",
var/obj/effect/proc_holder/spell/S = X
if(is_type_in_typecache(S, devil_spells))
owner.RemoveSpell(S)
var/mob/living/M = mob_override || owner.current
remove_antag_hud(antag_hud_type, M)
handle_clown_mutation(M, removing = FALSE)
.=..()
/datum/antagonist/devil/proc/printdevilinfo()

View File

@@ -10,6 +10,8 @@
name = "sintouched"
roundend_category = "sintouched"
antagpanel_category = "Devil"
antag_hud_type = ANTAG_HUD_SINTOUCHED
antag_hud_name = "sintouched"
var/sin
var/static/list/sins = list(SIN_ACEDIA,SIN_GLUTTONY,SIN_GREED,SIN_SLOTH,SIN_WRATH,SIN_ENVY,SIN_PRIDE)
@@ -57,22 +59,13 @@
. = ..()
/datum/antagonist/sintouched/apply_innate_effects(mob/living/mob_override)
. = ..()
add_hud()
var/mob/living/M = mob_override || owner.current
add_antag_hud(antag_hud_type, antag_hud_name, M)
/datum/antagonist/sintouched/remove_innate_effects(mob/living/mob_override)
remove_hud()
. = ..()
var/mob/living/M = mob_override || owner.current
remove_antag_hud(antag_hud_type, M)
/datum/antagonist/sintouched/proc/add_hud()
var/datum/atom_hud/antag/hud = GLOB.huds[ANTAG_HUD_SINTOUCHED]
hud.join_hud(owner.current)
set_antag_hud(owner.current, "sintouched")
/datum/antagonist/sintouched/proc/remove_hud()
var/datum/atom_hud/antag/hud = GLOB.huds[ANTAG_HUD_SINTOUCHED]
hud.leave_hud(owner.current)
set_antag_hud(owner.current, null)
#undef SIN_ACEDIA
#undef SIN_ENVY

View File

@@ -5,17 +5,19 @@
silent = TRUE //greet called by the event
show_in_antagpanel = FALSE
prevent_roundtype_conversion = FALSE
antag_hud_type = ANTAG_HUD_FUGITIVE
antag_hud_name = "fugitive"
var/datum/team/fugitive/fugitive_team
var/is_captured = FALSE
var/backstory = "error"
/datum/antagonist/fugitive/apply_innate_effects(mob/living/mob_override)
var/mob/living/M = mob_override || owner.current
update_fugitive_icons_added(M)
add_antag_hud(antag_hud_type, antag_hud_name, M)
/datum/antagonist/fugitive/remove_innate_effects(mob/living/mob_override)
var/mob/living/M = mob_override || owner.current
update_fugitive_icons_removed(M)
remove_antag_hud(antag_hud_type, M)
/datum/antagonist/fugitive/on_gain()
forge_objectives()
@@ -89,13 +91,3 @@
result += "<b>[printplayer(antag.owner)]</b>"
return result.Join("<br>")
/datum/antagonist/fugitive/proc/update_fugitive_icons_added(var/mob/living/carbon/human/fugitive)
var/datum/atom_hud/antag/fughud = GLOB.huds[ANTAG_HUD_FUGITIVE]
fughud.join_hud(fugitive)
set_antag_hud(fugitive, "fugitive")
/datum/antagonist/fugitive/proc/update_fugitive_icons_removed(var/mob/living/carbon/human/fugitive)
var/datum/atom_hud/antag/fughud = GLOB.huds[ANTAG_HUD_FUGITIVE]
fughud.leave_hud(fugitive)
set_antag_hud(fugitive, null)

View File

@@ -5,16 +5,18 @@
silent = TRUE //greet called by the spawn
show_in_antagpanel = FALSE
prevent_roundtype_conversion = FALSE
antag_hud_type = ANTAG_HUD_FUGITIVE
antag_hud_name = "fugitive_hunter"
var/datum/team/fugitive_hunters/hunter_team
var/backstory = "error"
/datum/antagonist/fugitive_hunter/apply_innate_effects(mob/living/mob_override)
var/mob/living/M = mob_override || owner.current
update_fugitive_icons_added(M)
add_antag_hud(antag_hud_type, antag_hud_name, M)
/datum/antagonist/fugitive_hunter/remove_innate_effects(mob/living/mob_override)
var/mob/living/M = mob_override || owner.current
update_fugitive_icons_removed(M)
remove_antag_hud(antag_hud_type, M)
/datum/antagonist/fugitive_hunter/on_gain()
forge_objectives()
@@ -168,13 +170,3 @@
result += "</div>"
return result.Join("<br>")
/datum/antagonist/fugitive_hunter/proc/update_fugitive_icons_added(var/mob/living/carbon/human/fugitive)
var/datum/atom_hud/antag/fughud = GLOB.huds[ANTAG_HUD_FUGITIVE]
fughud.join_hud(fugitive)
set_antag_hud(fugitive, "fugitive_hunter")
/datum/antagonist/fugitive_hunter/proc/update_fugitive_icons_removed(var/mob/living/carbon/human/fugitive)
var/datum/atom_hud/antag/fughud = GLOB.huds[ANTAG_HUD_FUGITIVE]
fughud.leave_hud(fugitive)
set_antag_hud(fugitive, null)

View File

@@ -2,6 +2,8 @@
name = "Ninja"
antagpanel_category = "Ninja"
job_rank = ROLE_NINJA
antag_hud_type = ANTAG_HUD_NINJA
antag_hud_name = "ninja"
show_name_in_check_antagonists = TRUE
antag_moodlet = /datum/mood_event/focused
var/helping_station = FALSE
@@ -15,11 +17,11 @@
/datum/antagonist/ninja/apply_innate_effects(mob/living/mob_override)
var/mob/living/M = mob_override || owner.current
update_ninja_icons_added(M)
add_antag_hud(antag_hud_type, antag_hud_name, M)
/datum/antagonist/ninja/remove_innate_effects(mob/living/mob_override)
var/mob/living/M = mob_override || owner.current
update_ninja_icons_removed(M)
remove_antag_hud(antag_hud_type, M)
/datum/antagonist/ninja/proc/equip_space_ninja(mob/living/carbon/human/H = owner.current)
return H.equipOutfit(/datum/outfit/ninja)
@@ -148,13 +150,3 @@
new_owner.add_antag_datum(src)
message_admins("[key_name_admin(admin)] has [adj] ninja'ed [key_name_admin(new_owner)].")
log_admin("[key_name(admin)] has [adj] ninja'ed [key_name(new_owner)].")
/datum/antagonist/ninja/proc/update_ninja_icons_added(var/mob/living/carbon/human/ninja)
var/datum/atom_hud/antag/ninjahud = GLOB.huds[ANTAG_HUD_NINJA]
ninjahud.join_hud(ninja)
set_antag_hud(ninja, "ninja")
/datum/antagonist/ninja/proc/update_ninja_icons_removed(var/mob/living/carbon/human/ninja)
var/datum/atom_hud/antag/ninjahud = GLOB.huds[ANTAG_HUD_NINJA]
ninjahud.leave_hud(ninja)
set_antag_hud(ninja, null)

View File

@@ -3,6 +3,8 @@
roundend_category = "syndicate operatives" //just in case
antagpanel_category = "NukeOp"
job_rank = ROLE_OPERATIVE
antag_hud_type = ANTAG_HUD_OPS
antag_hud_name = "synd"
antag_moodlet = /datum/mood_event/focused
var/datum/team/nuclear/nuke_team
var/always_new_team = FALSE //If not assigned a team by default ops will try to join existing ones, set this to TRUE to always create new team.
@@ -10,24 +12,15 @@
var/nukeop_outfit = /datum/outfit/syndicate
can_hijack = HIJACK_HIJACKER //Alternative way to wipe out the station.
/datum/antagonist/nukeop/proc/update_synd_icons_added(mob/living/M)
var/datum/atom_hud/antag/opshud = GLOB.huds[ANTAG_HUD_OPS]
opshud.join_hud(M)
set_antag_hud(M, "synd")
/datum/antagonist/nukeop/proc/update_synd_icons_removed(mob/living/M)
var/datum/atom_hud/antag/opshud = GLOB.huds[ANTAG_HUD_OPS]
opshud.leave_hud(M)
set_antag_hud(M, null)
/datum/antagonist/nukeop/apply_innate_effects(mob/living/mob_override)
var/mob/living/M = mob_override || owner.current
update_synd_icons_added(M)
add_antag_hud(antag_hud_type, antag_hud_name, M)
ADD_TRAIT(owner, TRAIT_DISK_VERIFIER, NUKEOP_TRAIT)
/datum/antagonist/nukeop/remove_innate_effects(mob/living/mob_override)
var/mob/living/M = mob_override || owner.current
update_synd_icons_removed(M)
remove_antag_hud(antag_hud_type, M)
REMOVE_TRAIT(owner, TRAIT_DISK_VERIFIER, NUKEOP_TRAIT)
/datum/antagonist/nukeop/proc/equip_op()

View File

@@ -7,7 +7,8 @@
antagpanel_category = "Revolution"
job_rank = ROLE_REV
antag_moodlet = /datum/mood_event/revolution
var/hud_type = "rev"
antag_hud_type = ANTAG_HUD_REV
antag_hud_name = "rev"
var/datum/team/revolution/rev_team
/datum/antagonist/rev/can_be_owned(datum/mind/new_owner)
@@ -22,11 +23,13 @@
/datum/antagonist/rev/apply_innate_effects(mob/living/mob_override)
var/mob/living/M = mob_override || owner.current
update_rev_icons_added(M)
add_antag_hud(antag_hud_type, antag_hud_name, M)
handle_clown_mutation(M, mob_override ? null : "Your training has allowed you to overcome your clownish nature, allowing you to wield weapons without harming yourself.")
/datum/antagonist/rev/remove_innate_effects(mob/living/mob_override)
var/mob/living/M = mob_override || owner.current
update_rev_icons_removed(M)
remove_antag_hud(antag_hud_type, M)
handle_clown_mutation(M, removing = FALSE)
/datum/antagonist/rev/proc/equip_rev()
return
@@ -147,7 +150,7 @@
/datum/antagonist/rev/head
name = "Head Revolutionary"
hud_type = "rev_head"
antag_hud_name = "rev_head"
var/remove_clumsy = FALSE
var/give_flash = FALSE
var/give_hud = TRUE
@@ -155,16 +158,6 @@
/datum/antagonist/rev/head/antag_listing_name()
return ..() + "(Leader)"
/datum/antagonist/rev/proc/update_rev_icons_added(mob/living/M)
var/datum/atom_hud/antag/revhud = GLOB.huds[ANTAG_HUD_REV]
revhud.join_hud(M)
set_antag_hud(M,hud_type)
/datum/antagonist/rev/proc/update_rev_icons_removed(mob/living/M)
var/datum/atom_hud/antag/revhud = GLOB.huds[ANTAG_HUD_REV]
revhud.leave_hud(M)
set_antag_hud(M, null)
/datum/antagonist/rev/proc/can_be_converted(mob/living/candidate)
if(!candidate.mind)
return FALSE
@@ -238,10 +231,6 @@
if(!ishuman(H) && !ismonkey(H))
return
if(remove_clumsy && owner.assigned_role == "Clown")
to_chat(owner, "Your training has allowed you to overcome your clownish nature, allowing you to wield weapons without harming yourself.")
H.dna.remove_mutation(CLOWNMUT)
if(give_flash)
var/obj/item/assembly/flash/T = new(H)
var/list/slots = list (

View File

@@ -7,6 +7,8 @@
antagpanel_category = "Traitor"
job_rank = ROLE_TRAITOR
antag_moodlet = /datum/mood_event/focused
antag_hud_type = ANTAG_HUD_TRAITOR
antag_hud_name = "traitor"
var/special_role = ROLE_TRAITOR
var/employer = "The Syndicate"
var/give_objectives = TRUE
@@ -26,21 +28,7 @@
forge_traitor_objectives()
finalize_traitor()
RegisterSignal(owner.current, COMSIG_MOVABLE_HEAR, .proc/handle_hearing)
..()
/datum/antagonist/traitor/apply_innate_effects()
if(owner.assigned_role == "Clown")
var/mob/living/carbon/human/traitor_mob = owner.current
if(traitor_mob && istype(traitor_mob))
if(!silent)
to_chat(traitor_mob, "Your training has allowed you to overcome your clownish nature, allowing you to wield weapons without harming yourself.")
traitor_mob.dna.remove_mutation(CLOWNMUT)
/datum/antagonist/traitor/remove_innate_effects()
if(owner.assigned_role == "Clown")
var/mob/living/carbon/human/traitor_mob = owner.current
if(traitor_mob && istype(traitor_mob))
traitor_mob.dna.add_mutation(CLOWNMUT)
return ..()
/datum/antagonist/traitor/on_removal()
//Remove malf powers.
@@ -55,7 +43,7 @@
if(!silent && owner.current)
to_chat(owner.current,"<span class='userdanger'>You are no longer the [special_role]!</span>")
owner.special_role = null
..()
return ..()
/datum/antagonist/traitor/proc/handle_hearing(datum/source, list/hearing_args)
var/message = hearing_args[HEARING_MESSAGE]
@@ -210,16 +198,6 @@
if(should_give_codewords)
give_codewords()
/datum/antagonist/traitor/proc/update_traitor_icons_added(datum/mind/traitor_mind)
var/datum/atom_hud/antag/traitorhud = GLOB.huds[ANTAG_HUD_TRAITOR]
traitorhud.join_hud(owner.current)
set_antag_hud(owner.current, "traitor")
/datum/antagonist/traitor/proc/update_traitor_icons_removed(datum/mind/traitor_mind)
var/datum/atom_hud/antag/traitorhud = GLOB.huds[ANTAG_HUD_TRAITOR]
traitorhud.leave_hud(owner.current)
set_antag_hud(owner.current, null)
/datum/antagonist/traitor/proc/finalize_traitor()
switch(traitor_kind)
if(TRAITOR_AI)
@@ -233,15 +211,19 @@
/datum/antagonist/traitor/apply_innate_effects(mob/living/mob_override)
. = ..()
update_traitor_icons_added()
var/mob/living/silicon/ai/A = mob_override || owner.current
var/mob/living/M = mob_override || owner.current
add_antag_hud(antag_hud_type, antag_hud_name, M)
handle_clown_mutation(M, mob_override ? null : "Your training has allowed you to overcome your clownish nature, allowing you to wield weapons without harming yourself.")
var/mob/living/silicon/ai/A = M
if(istype(A) && traitor_kind == TRAITOR_AI)
A.hack_software = TRUE
/datum/antagonist/traitor/remove_innate_effects(mob/living/mob_override)
. = ..()
update_traitor_icons_removed()
var/mob/living/silicon/ai/A = mob_override || owner.current
var/mob/living/M = mob_override || owner.current
remove_antag_hud(antag_hud_type, M)
handle_clown_mutation(M, removing = FALSE)
var/mob/living/silicon/ai/A = M
if(istype(A) && traitor_kind == TRAITOR_AI)
A.hack_software = FALSE

View File

@@ -79,7 +79,7 @@
return
if(!ishuman(M))//If target is not a human.
return ..()
if(!M.mind.hasSoul || isdevil(M))
if(!M.mind.hasSoul || is_devil(M))
to_chat(user, "<span class='warning'>This... thing has no soul! It's filled with evil!</span>")
return
if(iscultist(M))
@@ -249,8 +249,7 @@
makeNewConstruct(/mob/living/simple_animal/hostile/construct/builder/noncult, A, user, 0, T.loc)
for(var/datum/mind/B in SSticker.mode.cult)
if(B == A.mind)
SSticker.mode.cult -= A.mind
SSticker.mode.update_cult_icons_removed(A.mind)
SSticker.mode.remove_cultist(A.mind)
qdel(T)
qdel(src)
else

View File

@@ -3,11 +3,12 @@
roundend_category = "wizards/witches"
antagpanel_category = "Wizard"
job_rank = ROLE_WIZARD
antag_hud_type = ANTAG_HUD_WIZ
antag_hud_name = "wizard"
antag_moodlet = /datum/mood_event/focused
var/give_objectives = TRUE
var/strip = TRUE //strip before equipping
var/allow_rename = TRUE
var/hud_version = "wizard"
var/datum/team/wizard/wiz_team //Only created if wizard summons apprentices
var/move_to_lair = TRUE
var/outfit_type = /datum/outfit/wizard
@@ -49,7 +50,7 @@
wiz_team = new(owner)
wiz_team.name = "[owner.current.real_name] team"
wiz_team.master_wizard = src
update_wiz_icons_added(owner.current)
add_antag_hud(antag_hud_type, antag_hud_name, owner.current)
/datum/antagonist/wizard/proc/send_to_lair()
if(!owner || !owner.current)
@@ -152,12 +153,12 @@
/datum/antagonist/wizard/apply_innate_effects(mob/living/mob_override)
var/mob/living/M = mob_override || owner.current
update_wiz_icons_added(M, wiz_team ? TRUE : FALSE) //Don't bother showing the icon if you're solo wizard
add_antag_hud(antag_hud_type, antag_hud_name, M)
M.faction |= ROLE_WIZARD
/datum/antagonist/wizard/remove_innate_effects(mob/living/mob_override)
var/mob/living/M = mob_override || owner.current
update_wiz_icons_removed(M)
remove_antag_hud(antag_hud_type, M)
M.faction -= ROLE_WIZARD
@@ -170,7 +171,7 @@
/datum/antagonist/wizard/apprentice
name = "Wizard Apprentice"
hud_version = "apprentice"
antag_hud_name = "apprentice"
var/datum/mind/master
var/school = APPRENTICE_DESTRUCTION
outfit_type = /datum/outfit/wizard/apprentice
@@ -252,17 +253,6 @@
owner.AddSpell(new /obj/effect/proc_holder/spell/targeted/turf_teleport/blink(null))
owner.AddSpell(new /obj/effect/proc_holder/spell/targeted/ethereal_jaunt(null))
/datum/antagonist/wizard/proc/update_wiz_icons_added(mob/living/wiz,join = TRUE)
var/datum/atom_hud/antag/wizhud = GLOB.huds[ANTAG_HUD_WIZ]
wizhud.join_hud(wiz)
set_antag_hud(wiz, hud_version)
/datum/antagonist/wizard/proc/update_wiz_icons_removed(mob/living/wiz)
var/datum/atom_hud/antag/wizhud = GLOB.huds[ANTAG_HUD_WIZ]
wizhud.leave_hud(wiz)
set_antag_hud(wiz, null)
/datum/antagonist/wizard/academy
name = "Academy Teacher"
outfit_type = /datum/outfit/wizard/academy