From 37d8d7cb1898b45e9e9271a91ffeb48c51e1b8d3 Mon Sep 17 00:00:00 2001 From: MichiRecRoom <1008889+LikeLakers2@users.noreply.github.com> Date: Thu, 7 Dec 2023 11:34:17 -0500 Subject: [PATCH 1/3] Ensure Timestop Guardian does not overwrite Standard Guardian --- .../bloodsuckers/bloodsucker/bloodsucker_guardian.dm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/monkestation/code/modules/bloodsuckers/bloodsucker/bloodsucker_guardian.dm b/monkestation/code/modules/bloodsuckers/bloodsucker/bloodsucker_guardian.dm index 97953c5a1d26..c6d2ebb8c768 100644 --- a/monkestation/code/modules/bloodsuckers/bloodsucker/bloodsucker_guardian.dm +++ b/monkestation/code/modules/bloodsuckers/bloodsucker/bloodsucker_guardian.dm @@ -6,7 +6,7 @@ used = FALSE return if(IS_BLOODSUCKER(user)) - var/mob/living/basic/guardian/standard/bloodsucker_guardian = new(user, GUARDIAN_THEME_MAGIC) + var/mob/living/basic/guardian/standard/timestop/bloodsucker_guardian = new(user, GUARDIAN_THEME_MAGIC) bloodsucker_guardian.set_summoner(user, different_person = TRUE) bloodsucker_guardian.key = candidate.key @@ -22,7 +22,7 @@ /** * The Guardian itself */ -/mob/living/basic/guardian/standard +/mob/living/basic/guardian/standard/timestop // Like Bloodsuckers do, you will take more damage to Burn and less to Brute damage_coeff = list(BRUTE = 0.5, BURN = 2.5, TOX = 0, CLONE = 0, STAMINA = 0, OXY = 0) @@ -30,7 +30,7 @@ creator_desc = "Devastating close combat attacks and high damage resistance. Can smash through weak walls and stop time." creator_icon = "standard" -/mob/living/basic/guardian/standard/Initialize(mapload, theme) +/mob/living/basic/guardian/standard/timestop/Initialize(mapload, theme) //Wizard Holoparasite theme, just to be more visibly stronger than regular ones theme = GLOB.guardian_themes[GUARDIAN_THEME_TECH] . = ..() From ff80485fb072d5a7d130597c60a58479ad9efc3b Mon Sep 17 00:00:00 2001 From: MichiRecRoom <1008889+LikeLakers2@users.noreply.github.com> Date: Thu, 7 Dec 2023 12:33:45 -0500 Subject: [PATCH 2/3] Update the Guardian Timestop description to be more accurate (subject to revert if we find out this is a bug) --- .../modules/bloodsuckers/bloodsucker/bloodsucker_guardian.dm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/monkestation/code/modules/bloodsuckers/bloodsucker/bloodsucker_guardian.dm b/monkestation/code/modules/bloodsuckers/bloodsucker/bloodsucker_guardian.dm index c6d2ebb8c768..52e1f13aa13b 100644 --- a/monkestation/code/modules/bloodsuckers/bloodsucker/bloodsucker_guardian.dm +++ b/monkestation/code/modules/bloodsuckers/bloodsucker/bloodsucker_guardian.dm @@ -40,8 +40,9 @@ ///Guardian Timestop ability /datum/action/cooldown/spell/timestop/guardian name = "Guardian Timestop" - desc = "This spell stops time for everyone except for you and your master, \ - allowing you to move freely while your enemies and even projectiles are frozen." + desc = "This spell stops time for everyone (including your master) in a \ + small radius around you, allowing you to move freely while your \ + enemies and even projectiles are frozen." cooldown_time = 60 SECONDS spell_requirements = NONE invocation_type = INVOCATION_NONE From 1bd450b5b668a459a898937d7e224254994f69f2 Mon Sep 17 00:00:00 2001 From: MichiRecRoom <1008889+LikeLakers2@users.noreply.github.com> Date: Thu, 7 Dec 2023 12:34:26 -0500 Subject: [PATCH 3/3] Refactoring Guardian code (first pass) --- .../living/basic/guardian/guardian_creator.dm | 20 +++++++++++++++---- .../bloodsucker/bloodsucker_guardian.dm | 18 +++-------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/code/modules/mob/living/basic/guardian/guardian_creator.dm b/code/modules/mob/living/basic/guardian/guardian_creator.dm index a3ba8d415329..b4c2975b3532 100644 --- a/code/modules/mob/living/basic/guardian/guardian_creator.dm +++ b/code/modules/mob/living/basic/guardian/guardian_creator.dm @@ -59,19 +59,27 @@ GLOBAL_LIST_INIT(guardian_radial_images, setup_guardian_radial()) mob_name = using_theme.name /obj/item/guardian_creator/attack_self(mob/living/user) + if(allowed_to_get_new_guardian(user)) + show_guardian_type_selector(user) + +/obj/item/guardian_creator/proc/allowed_to_get_new_guardian(mob/living/user) if(isguardian(user) && !allow_guardian) balloon_alert(user, "can't do that!") - return + return FALSE var/list/guardians = user.get_all_linked_holoparasites() if(length(guardians) && !allow_multiple) balloon_alert(user, "already have one!") - return + return FALSE if(user.mind && user.mind.has_antag_datum(/datum/antagonist/changeling) && !allow_changeling) to_chat(user, ling_failure) - return + return FALSE if(used) to_chat(user, used_message) - return + return FALSE + + return TRUE + +/obj/item/guardian_creator/proc/show_guardian_type_selector(mob/living/user) var/list/radial_options = GLOB.guardian_radial_images.Copy() for(var/possible_guardian in radial_options) if(possible_guardian in possible_guardians) @@ -84,6 +92,10 @@ GLOBAL_LIST_INIT(guardian_radial_images, setup_guardian_radial()) guardian_path = show_radial_menu(user, src, radial_options, custom_check = CALLBACK(src, PROC_REF(check_menu), user), radius = 42, require_near = TRUE) if(isnull(guardian_path)) return + + poll_for_guardian_player(user, guardian_path) + +/obj/item/guardian_creator/proc/poll_for_guardian_player(mob/living/user, mob/living/basic/guardian/guardian_path) used = TRUE to_chat(user, use_message) var/guardian_type_name = random ? "Random" : capitalize(initial(guardian_path.creator_name)) diff --git a/monkestation/code/modules/bloodsuckers/bloodsucker/bloodsucker_guardian.dm b/monkestation/code/modules/bloodsuckers/bloodsucker/bloodsucker_guardian.dm index 52e1f13aa13b..d65351c43534 100644 --- a/monkestation/code/modules/bloodsuckers/bloodsucker/bloodsucker_guardian.dm +++ b/monkestation/code/modules/bloodsuckers/bloodsucker/bloodsucker_guardian.dm @@ -1,19 +1,7 @@ ///Bloodsuckers spawning a Guardian will get the Bloodsucker one instead. -/obj/item/guardian_creator/spawn_guardian(mob/living/user, mob/dead/candidate) - var/list/guardians = user.get_all_linked_holoparasites() - if(length(guardians)) - to_chat(user, span_holoparasite("You already have a [mob_name]!")) - used = FALSE - return - if(IS_BLOODSUCKER(user)) - var/mob/living/basic/guardian/standard/timestop/bloodsucker_guardian = new(user, GUARDIAN_THEME_MAGIC) - - bloodsucker_guardian.set_summoner(user, different_person = TRUE) - bloodsucker_guardian.key = candidate.key - user.log_message("has summoned [key_name(bloodsucker_guardian)], a [bloodsucker_guardian.creator_name] holoparasite.", LOG_GAME) - bloodsucker_guardian.log_message("was summoned as a [bloodsucker_guardian.creator_name] holoparasite.", LOG_GAME) - to_chat(user, replacetext(success_message, "%GUARDIAN", mob_name)) - bloodsucker_guardian.client?.init_verbs() +/obj/item/guardian_creator/attack_self(mob/living/user) + if(allowed_to_get_new_guardian(user) && IS_BLOODSUCKER(user)) + poll_for_guardian_player(user, /mob/living/basic/guardian/standard/timestop) return // Call parent to deal with everyone else