Skip to content

Commit

Permalink
Leap layer fix (#16792)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lumipharon authored Dec 12, 2024
1 parent 6e91079 commit 115fb1b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
10 changes: 7 additions & 3 deletions code/modules/mob/living/carbon/xenomorph/abilities.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1065,22 +1065,26 @@
KEYBINDING_NORMAL = COMSIG_XENOABILITY_HIDE,
)

/datum/action/ability/xeno_action/xenohide/remove_action(mob/living/L)
UnregisterSignal(L, COMSIG_XENOMORPH_POUNCE)
return ..()

/datum/action/ability/xeno_action/xenohide/can_use_action(silent, override_flags)
. = ..()
if(!.)
return FALSE
if(HAS_TRAIT(owner, TRAIT_TANK_DESANT))
if(!silent)
owner.balloon_alert(owner, "cannot while on vehicle")
return FALSE
return ..()

/datum/action/ability/xeno_action/xenohide/action_activate()
var/mob/living/carbon/xenomorph/X = owner
if(X.layer != XENO_HIDING_LAYER)
RegisterSignal(owner, COMSIG_XENOMORPH_POUNCE, PROC_REF(action_activate))
X.layer = XENO_HIDING_LAYER
to_chat(X, span_notice("We are now hiding."))
button.add_overlay(mutable_appearance('icons/Xeno/actions/general.dmi', "selected_purple_frame", ACTION_LAYER_ACTION_ICON_STATE, FLOAT_PLANE))
else
UnregisterSignal(owner, COMSIG_XENOMORPH_POUNCE)
X.layer = MOB_LAYER
to_chat(X, span_notice("We have stopped hiding."))
button.cut_overlay(mutable_appearance('icons/Xeno/actions/general.dmi', "selected_purple_frame", ACTION_LAYER_ACTION_ICON_STATE, FLOAT_PLANE))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,17 +295,11 @@
return ..()

/datum/action/ability/activable/xeno/pounce/can_use_ability(atom/A, silent = FALSE, override_flags)
. = ..()
if(!.)
return FALSE
if(!A || A.layer >= FLY_LAYER)
if(!A)
return FALSE
return ..()

/datum/action/ability/activable/xeno/pounce/use_ability(atom/A)
if(owner.layer != MOB_LAYER)
owner.layer = MOB_LAYER
var/datum/action/ability/xeno_action/xenohide/hide_action = owner.actions_by_path[/datum/action/ability/xeno_action/xenohide]
hide_action?.button?.cut_overlay(mutable_appearance('icons/Xeno/actions/general.dmi', "selected_purple_frame", ACTION_LAYER_ACTION_ICON_STATE, FLOAT_PLANE)) // Removes Hide action icon border
if(owner.buckled)
owner.buckled.unbuckle_mob(owner)
RegisterSignal(owner, COMSIG_MOVABLE_MOVED, PROC_REF(movement_fx))
Expand Down

0 comments on commit 115fb1b

Please sign in to comment.