From 2f8db98ea41c4fc340f77dce8d5dac59185c8355 Mon Sep 17 00:00:00 2001 From: Darius <5933805+LeDrascol@users.noreply.github.com> Date: Thu, 14 Nov 2024 15:13:26 -0500 Subject: [PATCH] Minor quirk action fixes - Add parent return checks - Add usage check flags to Cosmetic Glow and Werewolf - Removes unnecessary variable from Body Morpher --- .../datums/quirks/neutral_quirks/body_morpher.dm | 9 ++++----- .../code/datums/quirks/neutral_quirks/cosglow.dm | 6 +++++- .../code/datums/quirks/neutral_quirks/gargoyle.dm | 15 +++++++++++++++ .../code/datums/quirks/neutral_quirks/werewolf.dm | 7 +------ 4 files changed, 25 insertions(+), 12 deletions(-) diff --git a/modular_zzplurt/code/datums/quirks/neutral_quirks/body_morpher.dm b/modular_zzplurt/code/datums/quirks/neutral_quirks/body_morpher.dm index 12951dbe39eb5..196e087d660ba 100644 --- a/modular_zzplurt/code/datums/quirks/neutral_quirks/body_morpher.dm +++ b/modular_zzplurt/code/datums/quirks/neutral_quirks/body_morpher.dm @@ -12,7 +12,6 @@ /obj/item/toy/foamblade = 1 // Fake changeling ) hidden_quirk = TRUE - var/datum/action/innate/alter_form/alter_form_action /datum/quirk/body_morpher/add(client/client_source) . = ..() @@ -21,8 +20,8 @@ var/mob/living/carbon/human/quirk_mob = quirk_holder // Add quirk ability action datum - alter_form_action = new - alter_form_action.Grant(quirk_mob) + var/datum/action/innate/alter_form/quirk_action = new + quirk_action.Grant(quirk_mob) /datum/quirk/body_morpher/remove() . = ..() @@ -31,5 +30,5 @@ var/mob/living/carbon/human/quirk_mob = quirk_holder // Remove quirk ability action datum - alter_form_action.Remove(quirk_mob) - QDEL_NULL(alter_form_action) + var/datum/action/innate/alter_form/quirk_action = locate() in quirk_mob.actions + quirk_action.Remove(quirk_mob) diff --git a/modular_zzplurt/code/datums/quirks/neutral_quirks/cosglow.dm b/modular_zzplurt/code/datums/quirks/neutral_quirks/cosglow.dm index 0b03d5b58e682..17520ab8bbfb8 100644 --- a/modular_zzplurt/code/datums/quirks/neutral_quirks/cosglow.dm +++ b/modular_zzplurt/code/datums/quirks/neutral_quirks/cosglow.dm @@ -84,7 +84,7 @@ desc = "Report this to a coder." button_icon = 'icons/obj/lighting.dmi' button_icon_state = "slime-on" - var/obj/effect/dummy/lighting_obj/moblight/cosglow_light + check_flags = AB_CHECK_CONSCIOUS /datum/action/cosglow/update_glow name = "Modify Glow" @@ -137,6 +137,10 @@ /datum/action/cosglow/update_glow/Trigger(trigger_flags) . = ..() + // Check parent return + if(!.) + return + // Define user mob var/mob/living/carbon/human/action_mob = owner diff --git a/modular_zzplurt/code/datums/quirks/neutral_quirks/gargoyle.dm b/modular_zzplurt/code/datums/quirks/neutral_quirks/gargoyle.dm index a302f762d17d3..4be97f3066887 100644 --- a/modular_zzplurt/code/datums/quirks/neutral_quirks/gargoyle.dm +++ b/modular_zzplurt/code/datums/quirks/neutral_quirks/gargoyle.dm @@ -96,6 +96,11 @@ /datum/action/gargoyle/transform/Trigger(trigger_flags) . = ..() + + // Check parent return + if(!.) + return + var/mob/living/carbon/human/H = owner var/datum/quirk/gargoyle/T = H.get_quirk(/datum/quirk/gargoyle) if(!T.cooldown) @@ -133,6 +138,11 @@ /datum/action/gargoyle/check/Trigger(trigger_flags) . = ..() + + // Check parent return + if(!.) + return + var/mob/living/carbon/human/H = owner var/datum/quirk/gargoyle/T = H.get_quirk(/datum/quirk/gargoyle) to_chat(H, span_warning("You have [T.energy]/100 energy remaining!")) @@ -145,6 +155,11 @@ /datum/action/gargoyle/pause/Trigger(trigger_flags) . = ..() + + // Check parent return + if(!.) + return + var/mob/living/carbon/human/H = owner var/datum/quirk/gargoyle/T = H.get_quirk(/datum/quirk/gargoyle) diff --git a/modular_zzplurt/code/datums/quirks/neutral_quirks/werewolf.dm b/modular_zzplurt/code/datums/quirks/neutral_quirks/werewolf.dm index 90c0483b11dff..5a00152e760ad 100644 --- a/modular_zzplurt/code/datums/quirks/neutral_quirks/werewolf.dm +++ b/modular_zzplurt/code/datums/quirks/neutral_quirks/werewolf.dm @@ -41,6 +41,7 @@ /datum/action/cooldown/werewolf/transform name = "Toggle Lycanthrope Form" desc = "Transform in or out of your wolf form." + check_flags = AB_CHECK_CONSCIOUS | AB_CHECK_INCAPACITATED | AB_CHECK_PHASED var/transformed = FALSE var/species_changed = FALSE var/werewolf_gender = "Lycan" @@ -81,12 +82,6 @@ // Define action owner var/mob/living/carbon/human/action_owner = owner - // Check for restraints - if(!(action_owner.mobility_flags & MOBILITY_USE)) - // Warn user, then return - action_owner.visible_message(span_warning("You cannot transform while restrained!")) - return - // Define genital organs // Temporarily disabled /*