From c6fb656d5ae80cb85f2d9c68a802d78252c7c72c Mon Sep 17 00:00:00 2001 From: SabreML <57483089+SabreML@users.noreply.github.com> Date: Sun, 8 Nov 2020 17:38:00 +0000 Subject: [PATCH] Various fixes Changes: Cult rise/ascension works properly now, Cult constructs now show as antagonists in admin logs, Manifested cult ghosts are now properly deconverted before being dusted, Admin culting someone during a non-cult round now works properly, and sets up cult objectives and thresholds (Hopefully, anyway) Also removed a couple of unused procs --- code/datums/mind.dm | 3 +++ code/game/gamemodes/cult/cult.dm | 22 +++++----------------- code/game/gamemodes/cult/runes.dm | 2 +- code/game/machinery/cloning.dm | 4 ++-- code/modules/mob/mob_helpers.dm | 10 +++++----- 5 files changed, 16 insertions(+), 25 deletions(-) diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 415536e45c5..4f6a1e71a98 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -841,6 +841,9 @@ message_admins("[key_name_admin(usr)] has de-culted [key_name_admin(current)]") if("cultist") if(!(src in SSticker.mode.cult)) + if(!SSticker.mode.ascend_percent) // If the rise/ascend thresholds haven't been set (non-cult rounds) + SSticker.mode.cult_objs.setup() + SSticker.mode.cult_threshold_check() SSticker.mode.add_cultist(src) special_role = SPECIAL_ROLE_CULTIST to_chat(current, CULT_GREETING) diff --git a/code/game/gamemodes/cult/cult.dm b/code/game/gamemodes/cult/cult.dm index dbbaa637df7..e8c846f92e6 100644 --- a/code/game/gamemodes/cult/cult.dm +++ b/code/game/gamemodes/cult/cult.dm @@ -95,8 +95,8 @@ GLOBAL_LIST_EMPTY(all_cults) add_cult_actions(cult_mind) update_cult_icons_added(cult_mind) cult_objs.study(cult_mind.current) - threshold_check() - addtimer(CALLBACK(src, .proc/threshold_check), 2 MINUTES) // Check again in 2 minutes for latejoiners + cult_threshold_check() + addtimer(CALLBACK(src, .proc/cult_threshold_check), 2 MINUTES) // Check again in 2 minutes for latejoiners ..() /** @@ -108,7 +108,7 @@ GLOBAL_LIST_EMPTY(all_cults) * Below 100 players, [CULT_RISEN_LOW] and [CULT_ASCENDANT_LOW] are used. * Above 100 players, [CULT_RISEN_HIGH] and [CULT_ASCENDANT_HIGH] are used. */ -/datum/game_mode/cult/proc/threshold_check() +/datum/game_mode/proc/cult_threshold_check() var/players = length(GLOB.player_list) var/cultists = get_cultists() // Don't count the starting cultists towards the number of needed conversions if(players >= CULT_POPULATION_THRESHOLD) @@ -212,7 +212,7 @@ GLOBAL_LIST_EMPTY(all_cults) if((cult_players >= rise_number) && !cult_risen) cult_risen = TRUE for(var/datum/mind/M in cult) - if(!M.current || !ishuman(M)) + if(!M.current || !ishuman(M.current)) continue SEND_SOUND(M.current, 'sound/hallucinations/i_see_you2.ogg') to_chat(M.current, "The veil weakens as your cult grows, your eyes begin to glow...") @@ -221,7 +221,7 @@ GLOBAL_LIST_EMPTY(all_cults) else if(cult_players >= ascend_number) cult_ascendant = TRUE for(var/datum/mind/M in cult) - if(!M.current || !ishuman(M)) + if(!M.current || !ishuman(M.current)) continue SEND_SOUND(M.current, 'sound/hallucinations/im_here1.ogg') to_chat(M.current, "Your cult is ascendant and the red harvest approaches - you cannot hide your true nature for much longer!") @@ -291,18 +291,6 @@ GLOBAL_LIST_EMPTY(all_cults) dagger.Grant(cult_mind.current) cult_mind.current.update_action_buttons(TRUE) -/datum/game_mode/cult/proc/get_unconvertables() - var/list/ucs = list() - for(var/mob/living/carbon/human/player in GLOB.player_list) - if(player.mind && player.mind.offstation_role) - continue - if(!is_convertable_to_cult(player.mind)) - ucs += player.mind - return ucs - -/atom/proc/cult_log(message) - investigate_log(message, "cult") - /datum/game_mode/cult/declare_completion() if(cult_objs.cult_status == NARSIE_HAS_RISEN) diff --git a/code/game/gamemodes/cult/runes.dm b/code/game/gamemodes/cult/runes.dm index 32b6614c061..0b6605f83d7 100644 --- a/code/game/gamemodes/cult/runes.dm +++ b/code/game/gamemodes/cult/runes.dm @@ -910,7 +910,7 @@ structure_check() searches for nearby cultist structures required for the invoca "Your link to the world fades. Your form breaks apart.") for(var/obj/item/I in new_human.get_all_slots()) new_human.unEquip(I) - SSticker.mode.remove_cultist(new_human, FALSE) + SSticker.mode.remove_cultist(new_human.mind, FALSE) new_human.dust() /obj/effect/rune/manifest/proc/ghostify(mob/living/user, turf/T) diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index a7b7bb287c9..3ddc66c386c 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -455,8 +455,8 @@ GLOBAL_LIST_INIT(cloner_biomass_items, list(\ SSticker.mode.add_cult_actions(H.mind) // And all the actions if(SSticker.mode.cult_risen) SSticker.mode.rise(H) - if(SSticker.mode.cult_ascendant) - SSticker.mode.ascend(H) + if(SSticker.mode.cult_ascendant) + SSticker.mode.ascend(H) if(H.mind.vampire) H.mind.vampire.update_owner(H) if((H.mind in SSticker.mode.vampire_thralls) || (H.mind in SSticker.mode.vampire_enthralled)) diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 50588b0fc3b..521439c4cb6 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -47,11 +47,11 @@ return istype(M) && M.player_logged && M.stat != DEAD /proc/isAntag(A) - if(istype(A, /mob/living/carbon)) - var/mob/living/carbon/C = A - if(C.mind && C.mind.special_role) - return 1 - return 0 + if(isliving(A)) + var/mob/living/L = A + if(L.mind?.special_role) + return TRUE + return FALSE /proc/isNonCrewAntag(A) if(!isAntag(A))