Skip to content

Commit

Permalink
Minor quirk action fixes
Browse files Browse the repository at this point in the history
- Add parent return checks
- Add usage check flags to Cosmetic Glow and Werewolf
- Removes unnecessary variable from Body Morpher
  • Loading branch information
LeDrascol committed Nov 14, 2024
1 parent b6b2dc6 commit 2f8db98
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
. = ..()
Expand All @@ -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()
. = ..()
Expand All @@ -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)
6 changes: 5 additions & 1 deletion modular_zzplurt/code/datums/quirks/neutral_quirks/cosglow.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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

Expand Down
15 changes: 15 additions & 0 deletions modular_zzplurt/code/datums/quirks/neutral_quirks/gargoyle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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!"))
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
/*
Expand Down

0 comments on commit 2f8db98

Please sign in to comment.