From 36d5d5e14170439d2e9fbbe37c675ed6ce2b28da Mon Sep 17 00:00:00 2001 From: Ghommie <42542238+Ghommie@users.noreply.github.com> Date: Wed, 25 Mar 2020 23:33:50 +0100 Subject: [PATCH 1/3] Antagonists such as wizard and nuke ops are now more anonymous. --- code/__DEFINES/dcs/signals.dm | 1 + code/datums/elements/flavor_text.dm | 9 +++++++++ code/game/objects/structures/crates_lockers/closets.dm | 6 +++--- code/modules/antagonists/_common/antag_datum.dm | 1 + 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/code/__DEFINES/dcs/signals.dm b/code/__DEFINES/dcs/signals.dm index 3d76390ce1..0593a3c8f8 100644 --- a/code/__DEFINES/dcs/signals.dm +++ b/code/__DEFINES/dcs/signals.dm @@ -175,6 +175,7 @@ #define SPEECH_LANGUAGE 5 // #define SPEECH_IGNORE_SPAM 6 // #define SPEECH_FORCED 7 +#define COMSIG_MOB_ANTAG_ON_GAIN "mob_antag_on_gain" //from base of /datum/antagonist/on_gain(): (antag_datum) // /mob/living signals #define COMSIG_LIVING_REGENERATE_LIMBS "living_regenerate_limbs" //from base of /mob/living/regenerate_limbs(): (noheal, excluded_limbs) diff --git a/code/datums/elements/flavor_text.dm b/code/datums/elements/flavor_text.dm index 373647d6f5..5e0c581ec9 100644 --- a/code/datums/elements/flavor_text.dm +++ b/code/datums/elements/flavor_text.dm @@ -114,6 +114,9 @@ GLOBAL_LIST_EMPTY(mobs_with_editable_flavor_text) //et tu, hacky code //subtypes with additional hooks for DNA and preferences. /datum/element/flavor_text/carbon + //list of antagonists etcetera that should have nothing to do with people's snowflakes. + var/static/list/i_dont_even_know_who_you_are = typecacheof(list(/datum/antagonist/abductor, /datum/antagonist/ert, + /datum/antagonist/nukeop, /datum/antagonist/official, /datum/antagonist/wizard)) /datum/element/flavor_text/carbon/Attach(datum/target, text = "", _name = "Flavor Text", _addendum, _max_len = MAX_FLAVOR_LEN, _always_show = FALSE, _edit = TRUE) if(!iscarbon(target)) @@ -144,3 +147,9 @@ GLOBAL_LIST_EMPTY(mobs_with_editable_flavor_text) //et tu, hacky code /datum/element/flavor_text/carbon/proc/unset_flavor(mob/living/carbon/user) texts_by_atom[user] = "" + +/datum/element/flavor_text/carbon/proc/on_antag_gain(mob/living/carbon/user, datum/antagonist/antag) + if(is_type_in_typecache(antag, i_dont_even_know_who_you_are)) + texts_by_atom[user] = "" + if(user.dna) + user.dna.features["flavor_text"] = "" \ No newline at end of file diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm index e19feea582..11db7f37c8 100644 --- a/code/game/objects/structures/crates_lockers/closets.dm +++ b/code/game/objects/structures/crates_lockers/closets.dm @@ -121,7 +121,7 @@ return FALSE var/turf/T = get_turf(src) for(var/mob/living/L in T) - if(L.anchored || horizontal && L.mob_size > MOB_SIZE_TINY && L.density) + if(L.move_resist >= MOVE_FORCE_VERY_STRONG || (horizontal && L.mob_size > MOB_SIZE_TINY && L.density)) if(user) to_chat(user, "There's something large on top of [src], preventing it from opening." ) return FALSE @@ -133,7 +133,7 @@ if(closet != src && !closet.wall_mounted) return FALSE for(var/mob/living/L in T) - if(L.anchored || horizontal && L.mob_size > MOB_SIZE_TINY && L.density) + if(L.move_resist >= MOVE_FORCE_VERY_STRONG || horizontal && L.mob_size > MOB_SIZE_TINY && L.density) if(user) to_chat(user, "There's something too large in [src], preventing it from closing.") return FALSE @@ -216,7 +216,7 @@ if(!isliving(AM)) //let's not put ghosts or camera mobs inside closets... return FALSE var/mob/living/L = AM - if(L.anchored || L.buckled || L.incorporeal_move || L.has_buckled_mobs()) + if(L.move_resist >= MOVE_FORCE_VERY_STRONG || L.buckled || L.incorporeal_move || L.has_buckled_mobs()) return FALSE if(L.mob_size > MOB_SIZE_TINY) // Tiny mobs are treated as items. if(horizontal && L.density) diff --git a/code/modules/antagonists/_common/antag_datum.dm b/code/modules/antagonists/_common/antag_datum.dm index 2e3626dd4c..19845be315 100644 --- a/code/modules/antagonists/_common/antag_datum.dm +++ b/code/modules/antagonists/_common/antag_datum.dm @@ -75,6 +75,7 @@ GLOBAL_LIST_EMPTY(antagonists) remove_blacklisted_quirks() if(is_banned(owner.current) && replace_banned) replace_banned_player() + SEND_SIGNAL(owner.current, COMSIG_MOB_ANTAG_ON_GAIN, src) /datum/antagonist/proc/is_banned(mob/M) if(!M) From 4a01e59623a987f86b2814303a8aa05eacc9dcf7 Mon Sep 17 00:00:00 2001 From: Ghommie <42542238+Ghommie@users.noreply.github.com> Date: Wed, 25 Mar 2020 23:36:31 +0100 Subject: [PATCH 2/3] Signals things. --- code/datums/elements/flavor_text.dm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/datums/elements/flavor_text.dm b/code/datums/elements/flavor_text.dm index 5e0c581ec9..d34d6946ae 100644 --- a/code/datums/elements/flavor_text.dm +++ b/code/datums/elements/flavor_text.dm @@ -125,6 +125,7 @@ GLOBAL_LIST_EMPTY(mobs_with_editable_flavor_text) //et tu, hacky code if(. == ELEMENT_INCOMPATIBLE) return RegisterSignal(target, COMSIG_CARBON_IDENTITY_TRANSFERRED_TO, .proc/update_dna_flavor_text) + RegisterSignal(target, COMSIG_MOB_ANTAG_ON_GAIN, .proc/on_antag_gain) if(ishuman(target)) RegisterSignal(target, COMSIG_HUMAN_PREFS_COPIED_TO, .proc/update_prefs_flavor_text) RegisterSignal(target, COMSIG_HUMAN_HARDSET_DNA, .proc/update_dna_flavor_text) @@ -132,7 +133,7 @@ GLOBAL_LIST_EMPTY(mobs_with_editable_flavor_text) //et tu, hacky code /datum/element/flavor_text/carbon/Detach(mob/living/carbon/C) . = ..() - UnregisterSignal(C, list(COMSIG_CARBON_IDENTITY_TRANSFERRED_TO, COMSIG_HUMAN_PREFS_COPIED_TO, COMSIG_HUMAN_HARDSET_DNA, COMSIG_HUMAN_ON_RANDOMIZE)) + UnregisterSignal(C, list(COMSIG_CARBON_IDENTITY_TRANSFERRED_TO, COMSIG_MOB_ANTAG_ON_GAIN, COMSIG_HUMAN_PREFS_COPIED_TO, COMSIG_HUMAN_HARDSET_DNA, COMSIG_HUMAN_ON_RANDOMIZE)) /datum/element/flavor_text/carbon/proc/update_dna_flavor_text(mob/living/carbon/C) texts_by_atom[C] = C.dna.features["flavor_text"] From 1642903ab3c62777fc3236c81d80ed22aa042bf0 Mon Sep 17 00:00:00 2001 From: Ghommie <42542238+Ghommie@users.noreply.github.com> Date: Wed, 25 Mar 2020 23:46:27 +0100 Subject: [PATCH 3/3] Spares the official because they don't have their name replaced. --- code/datums/elements/flavor_text.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/datums/elements/flavor_text.dm b/code/datums/elements/flavor_text.dm index d34d6946ae..ea8e361694 100644 --- a/code/datums/elements/flavor_text.dm +++ b/code/datums/elements/flavor_text.dm @@ -116,7 +116,7 @@ GLOBAL_LIST_EMPTY(mobs_with_editable_flavor_text) //et tu, hacky code /datum/element/flavor_text/carbon //list of antagonists etcetera that should have nothing to do with people's snowflakes. var/static/list/i_dont_even_know_who_you_are = typecacheof(list(/datum/antagonist/abductor, /datum/antagonist/ert, - /datum/antagonist/nukeop, /datum/antagonist/official, /datum/antagonist/wizard)) + /datum/antagonist/nukeop, /datum/antagonist/wizard)) /datum/element/flavor_text/carbon/Attach(datum/target, text = "", _name = "Flavor Text", _addendum, _max_len = MAX_FLAVOR_LEN, _always_show = FALSE, _edit = TRUE) if(!iscarbon(target))