Skip to content

Commit

Permalink
fixes combistick folding
Browse files Browse the repository at this point in the history
  • Loading branch information
Zonespace27 committed Sep 26, 2023
1 parent a33bb0c commit 2800ece
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
1 change: 1 addition & 0 deletions code/__DEFINES/keybinding.dm
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@
//misc yautja

#define COMSIG_KB_YAUTJA_TELE_LOC "keybinding_yautja_tele_loc"
#define COMSIG_KB_YAUTJA_FOLD_COMBISTICK "keybinding_yautja_fold_combistick"

#define COMSIG_KB_OBSERVER_JOIN_XENO "keybinding_observer_join_as_xeno"
#define COMSIG_KB_OBSERVER_JOIN_ERT "keybinding_observer_join_ert"
Expand Down
18 changes: 18 additions & 0 deletions code/datums/keybinding/yautja.dm
Original file line number Diff line number Diff line change
Expand Up @@ -594,3 +594,21 @@
var/mob/living/carbon/human/H = user.mob
var/obj/item/device/yautja_teleporter/tele = locate(/obj/item/device/yautja_teleporter) in H.contents
tele.add_tele_loc()


/datum/keybinding/yautja/fold_combi
hotkey_keys = list("Space")
classic_keys = list("Unbound")
name = "fold_combi"
full_name = "Fold Combistick"
keybind_signal = COMSIG_KB_YAUTJA_FOLD_COMBISTICK

/datum/keybinding/yautja/fold_combi/down(client/user)
. = ..()
if(.)
return
var/mob/living/carbon/human/human = user.mob
var/obj/item/weapon/yautja/combistick/held_item = human.get_held_item()
if(istype(held_item))
held_item.fold_combistick()
return TRUE
9 changes: 5 additions & 4 deletions code/modules/cm_preds/yaut_weapons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -337,11 +337,12 @@
/obj/item/weapon/yautja/combistick/IsShield()
return on

/obj/item/weapon/yautja/combistick/verb/use_unique_action()
/obj/item/weapon/yautja/combistick/verb/fold_combistick()
set category = "Weapons"
set name = "Unique Action"
set desc = "Activate or deactivate the combistick."
set src in usr
set name = "Fold Combistick"
set desc = "Fold or unfold the combistick."
set src = usr.contents

unique_action(usr)

/obj/item/weapon/yautja/combistick/attack_self(mob/user)
Expand Down

0 comments on commit 2800ece

Please sign in to comment.