Skip to content

Commit

Permalink
Adds a keybind for canceling landslide (#16240)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wisemonster committed Jul 9, 2024
1 parent f46715d commit 82f99f6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions code/__DEFINES/dcs/signals/signals_keybindings.dm
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@

#define COMSIG_XENOABILITY_BEHEMOTH_ROLL "xenoability_behemoth_roll"
#define COMSIG_XENOABILITY_LANDSLIDE "xenoability_landslide"
#define COMSIG_XENOABILITY_CANCEL_LANDSLIDE "xenoability_cancel_landslide"
#define COMSIG_XENOABILITY_EARTH_RISER "xenoability_earth_riser"
#define COMSIG_XENOABILITY_EARTH_RISER_ALTERNATE "xenoability_earth_riser_alternate"
#define COMSIG_XENOABILITY_EARTH_PILLAR_THROW "xenoability_earth_pillar_throw"
Expand Down
6 changes: 6 additions & 0 deletions code/datums/keybinding/xeno.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1115,6 +1115,12 @@
description = "Rush forward in the selected direction, damaging enemies caught in a wide path."
keybind_signal = COMSIG_XENOABILITY_LANDSLIDE

/datum/keybinding/xeno/cancel_landslide
name = "Cancel Landslide"
full_name = "Behemoth: Cancel Landslide"
description = "Cancels landslide without having to select the ability"
keybind_signal = COMSIG_XENOABILITY_CANCEL_LANDSLIDE

/datum/keybinding/xeno/earth_riser
name = "Earth Riser"
full_name = "Behemoth: Earth Riser"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@
target_flags = ABILITY_TURF_TARGET
keybinding_signals = list(
KEYBINDING_NORMAL = COMSIG_XENOABILITY_LANDSLIDE,
KEYBINDING_ALTERNATE = COMSIG_XENOABILITY_CANCEL_LANDSLIDE,
)
/// Whether this ability is currently active or not.
var/ability_active = FALSE
Expand All @@ -244,6 +245,10 @@
/// The maximum amount of charges we can have.
var/maximum_charges = 1

/datum/action/ability/activable/xeno/landslide/alternate_action_activate()
if(can_use_ability(null, FALSE, ABILITY_IGNORE_SELECTED_ABILITY))
INVOKE_ASYNC(src, PROC_REF(use_ability))

/datum/action/ability/activable/xeno/landslide/give_action(mob/living/L)
. = ..()
var/mutable_appearance/counter_maptext = mutable_appearance(icon = null, icon_state = null, layer = ACTION_LAYER_MAPTEXT)
Expand Down

0 comments on commit 82f99f6

Please sign in to comment.