Skip to content

Commit

Permalink
доработка
Browse files Browse the repository at this point in the history
  • Loading branch information
Antoonij authored Dec 28, 2024
1 parent d34994a commit 0510362
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 6 deletions.
7 changes: 5 additions & 2 deletions code/datums/mind.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2583,8 +2583,11 @@
*/
/datum/mind/proc/remove_antag_datum(datum_type)
var/datum/antagonist/antag = has_antag_datum(datum_type)
if(antag)
qdel(antag)

if(!antag)
return

qdel(antag)


/**
Expand Down
19 changes: 19 additions & 0 deletions code/modules/antagonists/_common/antag_datum.dm
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,32 @@ GLOBAL_LIST_EMPTY(antagonists)
/datum/antagonist/Destroy(force)
for(var/datum/objective/objective as anything in objectives)
objectives -= objective

if(!objective.team)
qdel(objective)

remove_owner_from_gamemode()
GLOB.antagonists -= src

if(!silent)
farewell()

remove_innate_effects()

antag_memory = null

var/datum/team/team = get_team()
team?.remove_member(owner)

if(owner)
LAZYREMOVE(owner.antag_datums, src)

if(!LAZYLEN(owner.antag_datums)) // that one was the last antag datum.
last_datum_removal()

restore_last_hud_and_role()
owner = null

return ..()


Expand All @@ -92,8 +104,15 @@ GLOBAL_LIST_EMPTY(antagonists)
/datum/antagonist/proc/is_banned(mob/user)
if(!user)
return FALSE

return (jobban_isbanned(user, ROLE_SYNDICATE) || (job_rank && jobban_isbanned(user, job_rank)))

/**
* When our datum was last and became removed.
*/
/datum/antagonist/proc/handle_last_instance_removal()
return


/**
* Attempts to replace the role banned antag with a ghost player.
Expand Down
5 changes: 4 additions & 1 deletion code/modules/antagonists/changeling/changeling_datum.dm
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ GLOBAL_LIST_INIT(possible_changeling_IDs, list("Alpha","Beta","Gamma","Delta","E
var/obj/item/organ/internal/brain/ling_brain = carbon_user.get_organ_slot(INTERNAL_ORGAN_BRAIN)
ling_brain?.decoy_brain = TRUE

AddComponent( \
user.AddComponent( \
/datum/component/pref_viewer, \
/datum/preference_info/take_out_of_the_round_without_obj, \
)
Expand All @@ -169,6 +169,9 @@ GLOBAL_LIST_INIT(possible_changeling_IDs, list("Alpha","Beta","Gamma","Delta","E
. = ..()
qdel(old_body.GetComponent(/datum/component/pref_viewer))

/datum/antagonist/changeling/handle_last_instance_removal()
qdel(owner.current.GetComponent(/datum/component/pref_viewer))

/datum/antagonist/changeling/remove_innate_effects(mob/living/mob_override)
var/mob/living/user = ..()

Expand Down
5 changes: 4 additions & 1 deletion code/modules/antagonists/space_ninja/ninja_datum.dm
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,14 @@
var/mob/living/user = ..()
user.faction = list(ROLE_NINJA)

AddComponent( \
user.AddComponent( \
/datum/component/pref_viewer, \
/datum/preference_info/take_out_of_the_round_without_obj, \
)

/datum/antagonist/ninja/handle_last_instance_removal()
qdel(owner.current.GetComponent(/datum/component/pref_viewer))

/datum/antagonist/ninja/on_body_transfer(mob/living/old_body, mob/living/new_body)
. = ..()
qdel(old_body.GetComponent(/datum/component/pref_viewer))
Expand Down
5 changes: 4 additions & 1 deletion code/modules/antagonists/traitor/datum_traitor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
datum_owner.AddComponent(/datum/component/codeword_hearing, GLOB.syndicate_code_phrase_regex, "codephrases", src)
datum_owner.AddComponent(/datum/component/codeword_hearing, GLOB.syndicate_code_response_regex, "coderesponses", src)

AddComponent( \
datum_owner.AddComponent( \
/datum/component/pref_viewer, \
/datum/preference_info/take_out_of_the_round_without_obj, \
)
Expand All @@ -47,6 +47,9 @@
. = ..()
qdel(old_body.GetComponent(/datum/component/pref_viewer))

/datum/antagonist/traitor/handle_last_instance_removal()
qdel(owner.current.GetComponent(/datum/component/pref_viewer))

/datum/antagonist/traitor/remove_innate_effects(mob/living/mob_override)
. = ..()
var/mob/living/datum_owner = mob_override || owner.current
Expand Down
5 changes: 4 additions & 1 deletion code/modules/antagonists/vampire/vampire_datum.dm
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
//slaved.leave_serv_hud(mob_override.mind)
//.mind.som = null

AddComponent( \
user.AddComponent( \
/datum/component/pref_viewer, \
/datum/preference_info/take_out_of_the_round_without_obj, \
)
Expand All @@ -122,6 +122,9 @@
. = ..()
qdel(old_body.GetComponent(/datum/component/pref_viewer))

/datum/antagonist/vampire/handle_last_instance_removal()
qdel(owner.current.GetComponent(/datum/component/pref_viewer))

/datum/antagonist/vampire/remove_innate_effects(mob/living/mob_override, transformation = FALSE)
var/mob/living/user = ..()

Expand Down

0 comments on commit 0510362

Please sign in to comment.