diff --git a/code/__DEFINES/keybinding.dm b/code/__DEFINES/keybinding.dm index 764282d59765..f4503aeea5d5 100644 --- a/code/__DEFINES/keybinding.dm +++ b/code/__DEFINES/keybinding.dm @@ -170,8 +170,7 @@ #define COMSIG_KB_YAUTJA_BUTCHER "keybinding_yautja_butcher" #define COMSIG_KB_YAUTJA_PRED_BUY "keybinding_yautja_pred_buy" #define COMSIG_KB_YAUTJA_MARK_PANEL "keybinding_yautja_mark_panel" -#define COMSIG_KB_YAUTJA_MARK_FOR_HUNT "keybinding_yautja_mark_for_hunt" -#define COMSIG_KB_YAUTJA_REMOVE_FROM_HUNT "keybinding_yautja_remove_from_hunt" +#define COMSIG_KB_YAUTJA_TOGGLE_MARK_FOR_HUNT "keybinding_yautja_toggle_mark_for_hunt" // Yautja Bracer #define COMSIG_KB_YAUTJA_TOGGLE_NOTIFICATION_SOUND "keybinding_yautja_toggle_notification_sound" @@ -192,6 +191,7 @@ #define COMSIG_KB_YAUTJA_BRACERNAME "keybinding_yautja_bracername" #define COMSIG_KB_YAUTJA_IDCHIP "keybinding_yautja_idchip" #define COMSIG_KB_YAUTJA_LINK_BRACER "keybinding_yautja_link_bracer" +#define COMSIG_KB_YAUTJA_CONTROL_FALCON "keybinding_yautja_control_falcon" //mask #define COMSIG_KB_YAUTJA_MASK_TOGGLE_ZOOM "keybinding_yautja_mask_toggle_zoom" diff --git a/code/datums/keybinding/yautja.dm b/code/datums/keybinding/yautja.dm index 4729db004582..c79788df49a3 100644 --- a/code/datums/keybinding/yautja.dm +++ b/code/datums/keybinding/yautja.dm @@ -30,16 +30,7 @@ classic_keys = list("Unbound") name = "pred_buy" full_name = "Claim equipment" - keybind_signal = COMSIG_KB_YAUTJA_BUTCHER - -/datum/keybinding/yautja/pred_buy/down(client/user) - . = ..() - if(.) - return - var/mob/living/carbon/human/H = user.mob - if(!isyautja(H)) - return - H.pred_buy() + keybind_signal = COMSIG_KB_YAUTJA_PRED_BUY /datum/keybinding/yautja/mark_panel hotkey_keys = list("Unbound") @@ -48,46 +39,12 @@ full_name = "Mark panel" keybind_signal = COMSIG_KB_YAUTJA_MARK_PANEL -/datum/keybinding/yautja/mark_panel/down(client/user) - . = ..() - if(.) - return - var/mob/living/carbon/human/H = user.mob - if(!isyautja(H)) - return - H.mark_panel() - /datum/keybinding/yautja/mark_for_hunt hotkey_keys = list("Unbound") classic_keys = list("Unbound") name = "mark_for_hunt" - full_name = "Mark for hunt" - keybind_signal = COMSIG_KB_YAUTJA_MARK_FOR_HUNT - -/datum/keybinding/yautja/mark_for_hunt/down(client/user) - . = ..() - if(.) - return - var/mob/living/carbon/human/H = user.mob - if(!isyautja(H)) - return - H.mark_for_hunt() - -/datum/keybinding/yautja/remove_from_hunt - hotkey_keys = list("Unbound") - classic_keys = list("Unbound") - name = "remove_from_hunt" - full_name = "Remove from hunt" - keybind_signal = COMSIG_KB_YAUTJA_REMOVE_FROM_HUNT - -/datum/keybinding/yautja/remove_from_hunt/down(client/user) - . = ..() - if(.) - return - var/mob/living/carbon/human/H = user.mob - if(!isyautja(H)) - return - H.remove_from_hunt() + full_name = "Toggle mark for hunt" + keybind_signal = COMSIG_KB_YAUTJA_TOGGLE_MARK_FOR_HUNT // BRACER SPECIFIC \\ @@ -168,22 +125,6 @@ full_name = "Toggle wristblades" keybind_signal = COMSIG_KB_YAUTJA_WRISTBLADES -/datum/keybinding/yautja/bracer_hunter/wristblades/down(client/user) - . = ..() - if(.) - return - var/mob/living/carbon/human/H = user.mob - - var/obj/item/clothing/gloves/yautja/hunter/gloves = H.gloves - if(istype(gloves)) - gloves.wristblades() - return TRUE - - var/obj/item/clothing/gloves/yautja/hunter/held = H.get_held_item() - if(istype(held)) - held.wristblades() - return TRUE - /datum/keybinding/yautja/bracer_hunter/track_gear hotkey_keys = list("Unbound") classic_keys = list("Unbound") @@ -214,22 +155,6 @@ full_name = "Toggle cloak" keybind_signal = COMSIG_KB_YAUTJA_CLOAKER -/datum/keybinding/yautja/bracer_hunter/cloaker/down(client/user) - . = ..() - if(.) - return - var/mob/living/carbon/human/H = user.mob - - var/obj/item/clothing/gloves/yautja/hunter/gloves = H.gloves - if(istype(gloves)) - gloves.cloaker() - return TRUE - - var/obj/item/clothing/gloves/yautja/hunter/held = H.get_held_item() - if(istype(held)) - held.cloaker() - return TRUE - /datum/keybinding/yautja/bracer_hunter/caster hotkey_keys = list("Unbound") classic_keys = list("Unbound") @@ -237,22 +162,6 @@ full_name = "Toggle plasma caster" keybind_signal = COMSIG_KB_YAUTJA_CASTER -/datum/keybinding/yautja/bracer_hunter/caster/down(client/user) - . = ..() - if(.) - return - var/mob/living/carbon/human/H = user.mob - - var/obj/item/clothing/gloves/yautja/hunter/gloves = H.gloves - if(istype(gloves)) - gloves.caster() - return TRUE - - var/obj/item/clothing/gloves/yautja/hunter/held = H.get_held_item() - if(istype(held)) - held.caster() - return TRUE - /datum/keybinding/yautja/bracer_hunter/change_explosion_type hotkey_keys = list("Unbound") classic_keys = list("Unbound") @@ -283,22 +192,6 @@ full_name = "Self-destruct" keybind_signal = COMSIG_KB_YAUTJA_ACTIVATE_SUICIDE -/datum/keybinding/yautja/bracer_hunter/activate_suicide/down(client/user) - . = ..() - if(.) - return - var/mob/living/carbon/human/H = user.mob - - var/obj/item/clothing/gloves/yautja/hunter/gloves = H.gloves - if(istype(gloves)) - gloves.activate_suicide() - return TRUE - - var/obj/item/clothing/gloves/yautja/hunter/held = H.get_held_item() - if(istype(held)) - held.activate_suicide() - return TRUE - /datum/keybinding/yautja/bracer_hunter/injectors hotkey_keys = list("Unbound") classic_keys = list("Unbound") @@ -306,21 +199,6 @@ full_name = "Create Stabilising Crystal" keybind_signal = COMSIG_KB_YAUTJA_INJECTORS -/datum/keybinding/yautja/bracer_hunter/injectors/down(client/user) - . = ..() - if(.) - return - var/mob/living/carbon/human/H = user.mob - - var/obj/item/clothing/gloves/yautja/hunter/gloves = H.gloves - if(istype(gloves)) - gloves.injectors() - return TRUE - - var/obj/item/clothing/gloves/yautja/hunter/held = H.get_held_item() - if(istype(held)) - held.injectors() - return TRUE /datum/keybinding/yautja/bracer_hunter/healing_capsule hotkey_keys = list("Unbound") classic_keys = list("Unbound") @@ -328,22 +206,6 @@ full_name = "Create Healing Capsule" keybind_signal = COMSIG_KB_YAUTJA_CAPSULE -/datum/keybinding/yautja/bracer_hunter/healing_capsule/down(client/user) - . = ..() - if(.) - return - var/mob/living/carbon/human/H = user.mob - - var/obj/item/clothing/gloves/yautja/hunter/gloves = H.gloves - if(istype(gloves)) - gloves.healing_capsule() - return TRUE - - var/obj/item/clothing/gloves/yautja/hunter/held = H.get_held_item() - if(istype(held)) - held.healing_capsule() - return TRUE - /datum/keybinding/yautja/bracer_hunter/call_disc hotkey_keys = list("Unbound") classic_keys = list("Unbound") @@ -351,22 +213,6 @@ full_name = "Call smart-disc" keybind_signal = COMSIG_KB_YAUTJA_CALL_DISC -/datum/keybinding/yautja/bracer_hunter/call_disc/down(client/user) - . = ..() - if(.) - return - var/mob/living/carbon/human/H = user.mob - - var/obj/item/clothing/gloves/yautja/hunter/gloves = H.gloves - if(istype(gloves)) - gloves.call_disc() - return TRUE - - var/obj/item/clothing/gloves/yautja/hunter/held = H.get_held_item() - if(istype(held)) - held.call_disc() - return TRUE - /datum/keybinding/yautja/bracer_hunter/remove_tracked_item hotkey_keys = list("Unbound") classic_keys = list("Unbound") @@ -420,22 +266,6 @@ full_name = "Yank combi-stick" keybind_signal = COMSIG_KB_YAUTJA_CALL_COMBI -/datum/keybinding/yautja/bracer_hunter/call_combi/down(client/user) - . = ..() - if(.) - return - var/mob/living/carbon/human/H = user.mob - - var/obj/item/clothing/gloves/yautja/hunter/gloves = H.gloves - if(istype(gloves)) - gloves.call_combi() - return TRUE - - var/obj/item/clothing/gloves/yautja/hunter/held = H.get_held_item() - if(istype(held)) - held.call_combi() - return TRUE - /datum/keybinding/yautja/bracer_hunter/translate hotkey_keys = list("Unbound") classic_keys = list("Unbound") @@ -443,22 +273,6 @@ full_name = "Translator" keybind_signal = COMSIG_KB_YAUTJA_TRANSLATE -/datum/keybinding/yautja/bracer_hunter/translate/down(client/user) - . = ..() - if(.) - return - var/mob/living/carbon/human/H = user.mob - - var/obj/item/clothing/gloves/yautja/hunter/gloves = H.gloves - if(istype(gloves)) - gloves.translate() - return TRUE - - var/obj/item/clothing/gloves/yautja/hunter/held = H.get_held_item() - if(istype(held)) - held.translate() - return TRUE - /datum/keybinding/yautja/bracer_hunter/bracername hotkey_keys = list("Unbound") classic_keys = list("Unbound") @@ -528,6 +342,13 @@ held.link_bracer() return TRUE +/datum/keybinding/yautja/bracer_hunter/control_falcon_drone + hotkey_keys = list("Unbound") + classic_keys = list("Unbound") + name = "control_falcon" + full_name = "Control falcon drone" + keybind_signal = COMSIG_KB_YAUTJA_CONTROL_FALCON + // Misc stuff - mask, teleporter \\ // mask @@ -545,32 +366,14 @@ classic_keys = list("Unbound") name = "toggle_zoom" full_name = "Toggle mask zoom" - keybind_signal = COMSIG_KB_YAUTJA_LINK_BRACER - -/datum/keybinding/yautja/mask/toggle_zoom/down(client/user) - . = ..() - if(.) - return - var/mob/living/carbon/human/H = user.mob - var/obj/item/clothing/mask/gas/yautja/mask = H.wear_mask - mask.toggle_zoom() - return TRUE + keybind_signal = COMSIG_KB_YAUTJA_MASK_TOGGLE_ZOOM /datum/keybinding/yautja/mask/togglesight hotkey_keys = list("Unbound") classic_keys = list("Unbound") name = "togglesight" full_name = "Toggle mask visors" - keybind_signal = COMSIG_KB_YAUTJA_LINK_BRACER - -/datum/keybinding/yautja/mask/togglesight/down(client/user) - . = ..() - if(.) - return - var/mob/living/carbon/human/H = user.mob - var/obj/item/clothing/mask/gas/yautja/mask = H.wear_mask - mask.togglesight() - return TRUE + keybind_signal = COMSIG_KB_YAUTJA_MASK_TOGGLESIGHT // teleporter diff --git a/code/modules/cm_preds/falcon.dm b/code/modules/cm_preds/falcon.dm index dc898a2b76ba..eb97a19c2233 100644 --- a/code/modules/cm_preds/falcon.dm +++ b/code/modules/cm_preds/falcon.dm @@ -35,40 +35,57 @@ return "on [t_his] shoulder" return ..() +/obj/item/falcon_drone/equipped(mob/user, slot, silent) + . = ..() + if(!(slot == WEAR_L_EAR || slot == WEAR_R_EAR)) + return + add_verb(user, /obj/item/falcon_drone/proc/can_control_falcon_drone) + var/datum/action/predator_action/mask/control_falcon_drone/falcon_action = give_action(user, /datum/action/predator_action/mask/control_falcon_drone) + falcon_action.linked_falcon_drone = src + +/obj/item/falcon_drone/dropped(mob/user) + . = ..() + remove_verb(user, /obj/item/falcon_drone/proc/can_control_falcon_drone) + remove_action(user, /datum/action/predator_action/mask/control_falcon_drone) + /obj/item/falcon_drone/attack_self(mob/user) ..() - control_falcon_drone() + can_control_falcon_drone() -/obj/item/falcon_drone/verb/control_falcon_drone() +/obj/item/falcon_drone/proc/can_control_falcon_drone() set name = "Control Falcon Drone" set desc = "Activates your falcon drone." set category = "Yautja.Misc" - set src in usr if(usr.is_mob_incapacitated()) return - var/mob/living/carbon/human/H = usr - if(!istype(H) || !HAS_TRAIT(usr, TRAIT_YAUTJA_TECH)) + var/mob/living/carbon/human/human = usr + if(!istype(human) || !HAS_TRAIT(usr, TRAIT_YAUTJA_TECH)) to_chat(usr, SPAN_WARNING("You do not know how to use this.")) return - if(!istype(H.gloves, /obj/item/clothing/gloves/yautja)) + if(!istype(human.gloves, /obj/item/clothing/gloves/yautja)) to_chat(usr, SPAN_WARNING("You need your bracers to control \the [src]!")) return + control_falcon_drone(human, human.gloves) - var/mob/hologram/falcon/hologram = new /mob/hologram/falcon(usr.loc, usr, src, H.gloves) - usr.drop_inv_item_to_loc(src, hologram) +/obj/item/falcon_drone/proc/control_falcon_drone(mob/living/user, obj/item/clothing/gloves/yautja/bracers) + var/mob/hologram/falcon/hologram = new /mob/hologram/falcon(get_turf(user), user, src, bracers) + user.drop_inv_item_to_loc(src, hologram) /mob/hologram/falcon name = "falcon drone" + desc = "An agile drone used by Yautja to survey the hunting grounds." icon = 'icons/obj/items/hunter/pred_gear.dmi' + action_icon_state = "falcon_drone" icon_state = "falcon_drone_active" hud_possible = list(HUNTER_HUD) + motion_sensed = TRUE + initial_leave_button = /datum/action/leave_hologram/falcon + var/obj/item/falcon_drone/parent_drone var/obj/item/clothing/gloves/yautja/owned_bracers - desc = "An agile drone used by Yautja to survey the hunting grounds." - motion_sensed = TRUE /mob/hologram/falcon/Initialize(mapload, mob/M, obj/item/falcon_drone/drone, obj/item/clothing/gloves/yautja/bracers) . = ..() @@ -129,6 +146,11 @@ qdel(src) +/datum/action/leave_hologram/falcon + icon_file = 'icons/mob/hud/actions_yautja.dmi' + button_icon_state = "pred_template" + action_icon_state = "falcon_drone" + /obj/item/trash/falcon_drone name = "destroyed falcon drone" desc = "The wreckage of a Yautja drone." diff --git a/code/modules/cm_preds/yaut_actions.dm b/code/modules/cm_preds/yaut_actions.dm new file mode 100644 index 000000000000..f55f58e0a557 --- /dev/null +++ b/code/modules/cm_preds/yaut_actions.dm @@ -0,0 +1,329 @@ +#define PREDATOR_ACTION_ON_CLICK 2 //If the action is on click, and not toggled on or off +/datum/action/predator_action + icon_file = 'icons/mob/hud/actions_yautja.dmi' + button_icon_state = "pred_template" + ///If the action requires bracers worn or in-hand + var/require_bracers = FALSE + ///If the action requires a yautja mask to be worn + var/require_mask = FALSE + ///The mob calling the action + var/mob/living/carbon/human/yautja + ///The bracers on the mob (if applicable) + var/obj/item/clothing/gloves/yautja/hunter/bracers + ///The mask on the mob (if applicable) + var/obj/item/clothing/mask/gas/yautja/mask + ///If the action is currently on or in use + var/active = FALSE + +/datum/action/predator_action/can_use_action() + . = ..() + if(!.) + return FALSE + + yautja = null + bracers = null + mask = null + + var/mob/living/carbon/human/mob = owner + if(!isyautja(mob)) + return FALSE + if(mob.is_mob_incapacitated()) + return FALSE + yautja = mob + + if(require_bracers) + if(istype(yautja.gloves, /obj/item/clothing/gloves/yautja/hunter)) + bracers = yautja.gloves + else if(istype(yautja.get_held_item(), /obj/item/clothing/gloves/yautja/hunter)) + bracers = yautja.get_held_item() + if(!bracers) + to_chat(yautja, SPAN_WARNING("You don't have bracers.")) + return FALSE + + if(require_mask) + if(!istype(yautja.wear_mask, /obj/item/clothing/mask/gas/yautja)) + to_chat(yautja, SPAN_WARNING("You don't have a clan mask.")) + return FALSE + mask = yautja.wear_mask + + return TRUE + +/datum/action/predator_action/action_activate() + if(!can_use_action()) + return FALSE + +/datum/action/predator_action/update_button_icon(enabled) + . = ..() + if(active == PREDATOR_ACTION_ON_CLICK) + return + + if(isnull(enabled)) + active = !active + else + active = enabled + + button.icon_state = initial(button_icon_state) + if(active) + button.icon_state += "_on" + +/datum/action/predator_action/mark_for_hunt + name = "Mark for Hunt" + action_icon_state = "mark_for_hunt" + listen_signal = COMSIG_KB_YAUTJA_TOGGLE_MARK_FOR_HUNT + active = PREDATOR_ACTION_ON_CLICK + +/datum/action/predator_action/mark_for_hunt/action_activate() + . = ..() + if(yautja.hunter_data.prey) //You can only hunt one person at a time + yautja.remove_from_hunt() + return + yautja.mark_for_hunt() + +/datum/action/predator_action/mark_panel + name = "Open Mark Panel" + action_icon_state = "mark_panel" + listen_signal = COMSIG_KB_YAUTJA_MARK_PANEL + active = PREDATOR_ACTION_ON_CLICK + +/datum/action/predator_action/mark_panel/action_activate() + . = ..() + yautja.mark_panel() + +/datum/action/predator_action/claim_equipment + name = "Claim Equipment" + action_icon_state = "claim_equipment" + listen_signal = COMSIG_KB_YAUTJA_PRED_BUY + active = PREDATOR_ACTION_ON_CLICK + +/datum/action/predator_action/claim_equipment/action_activate() + . = ..() + yautja.pred_buy() + +//Actions that require wearing a mask +/datum/action/predator_action/mask + require_mask = TRUE + +/datum/action/predator_action/mask/zoom + name = "Toggle Mask Zoom" + action_icon_state = "zoom" + listen_signal = COMSIG_KB_YAUTJA_MASK_TOGGLE_ZOOM + +/datum/action/predator_action/mask/zoom/action_activate() + . = ..() + mask.toggle_zoom() + +/datum/action/predator_action/mask/visor + name = "Toggle Mask Visor" + action_icon_state = "visor" + require_bracers = TRUE //Needs bracer power to operate + listen_signal = COMSIG_KB_YAUTJA_MASK_TOGGLESIGHT + +/datum/action/predator_action/mask/visor/action_activate() + . = ..() + mask.togglesight() + +/datum/action/predator_action/mask/visor/update_button_icon(enabled) //Open or close the eye + . = ..() //Overlays + + var/new_icon_state = action_icon_state + if(enabled) + new_icon_state += "_on" + + button.overlays.Cut() + var/image/new_overlays + new_overlays = image(icon_file, button, new_icon_state) + + button.overlays += new_overlays + +/datum/action/predator_action/mask/control_falcon_drone + name = "Control Falcon Drone" + action_icon_state = "falcon_drone" + listen_signal = COMSIG_KB_YAUTJA_CONTROL_FALCON + active = PREDATOR_ACTION_ON_CLICK + require_bracers = TRUE + ///The falcon drone that will be sent when the action is pressed + var/obj/item/falcon_drone/linked_falcon_drone + +/datum/action/predator_action/mask/control_falcon_drone/action_activate() + . = ..() + linked_falcon_drone.control_falcon_drone(yautja, bracers) + + +//Actions that require wearing bracers +/datum/action/predator_action/bracer + require_bracers = TRUE + +/datum/action/predator_action/bracer/wristblade + name = "Toggle Wristblades" + action_icon_state = "wristblade" + listen_signal = COMSIG_KB_YAUTJA_WRISTBLADES + +/datum/action/predator_action/bracer/wristblade/action_activate() + . = ..() + bracers.wristblades() + +/datum/action/predator_action/bracer/combistick + name = "Yank Combi-stick" + action_icon_state = "combi" + listen_signal = COMSIG_KB_YAUTJA_CALL_COMBI + active = PREDATOR_ACTION_ON_CLICK + +/datum/action/predator_action/bracer/combistick/action_activate() + . = ..() + yautja.call_combi_internal(yautja, forced = FALSE) + +/datum/action/predator_action/bracer/smartdisc + name = "Recall nearby smart-discs" + action_icon_state = "smartdisc" + listen_signal = COMSIG_KB_YAUTJA_CALL_DISC + active = PREDATOR_ACTION_ON_CLICK + +/datum/action/predator_action/bracer/smartdisc/action_activate() + . = ..() + bracers.call_disc() + +/datum/action/predator_action/bracer/caster + name = "Toggle Plasma Caster" + action_icon_state = "plasma_caster" + listen_signal = COMSIG_KB_YAUTJA_CASTER + +/datum/action/predator_action/bracer/caster/action_activate() + . = ..() + bracers.caster() + +/datum/action/predator_action/bracer/cloak + name = "Toggle Cloak" + action_icon_state = "cloak" + listen_signal = COMSIG_KB_YAUTJA_CLOAKER + +/datum/action/predator_action/bracer/cloak/action_activate() + . = ..() + bracers.cloaker() + +/datum/action/predator_action/bracer/thwei + name = "Create Stabilizing Crystal" + action_icon_state = "thwei" + listen_signal = COMSIG_KB_YAUTJA_INJECTORS + active = PREDATOR_ACTION_ON_CLICK + +/datum/action/predator_action/bracer/thwei/action_activate() + . = ..() + bracers.injectors() + +/datum/action/predator_action/bracer/capsule + name = "Create Healing Capsule" + action_icon_state = "thwei" + listen_signal = COMSIG_KB_YAUTJA_CAPSULE + active = PREDATOR_ACTION_ON_CLICK + +/datum/action/predator_action/bracer/capsule/action_activate() + . = ..() + bracers.healing_capsule() + +/datum/action/predator_action/bracer/translator + name = "Use Translator" + action_icon_state = "translator" + listen_signal = COMSIG_KB_YAUTJA_TRANSLATE + active = PREDATOR_ACTION_ON_CLICK + +/datum/action/predator_action/bracer/translator/action_activate() + . = ..() + bracers.translate() + +/datum/action/predator_action/bracer/self_destruct + name = "Self Destruct" + action_icon_state = "self_destruct" + listen_signal = COMSIG_KB_YAUTJA_ACTIVATE_SUICIDE + +/datum/action/predator_action/bracer/self_destruct/action_activate() + . = ..() + bracers.activate_suicide() + +#undef PREDATOR_ACTION_ON_CLICK + +//Misc actions +/datum/action/yautja_emote_panel + name = "Open Emote Panel" + button_icon_state = "pred_template" + action_icon_state = "looc_toggle" + +/datum/action/yautja_emote_panel/action_activate() + var/mob/living/carbon/human/human_owner = owner + var/datum/species/yautja/yautja_species = human_owner.species + yautja_species.open_emote_panel() + +/datum/yautja_emote_panel + /// Static dict ("category" : (emotes)) of every yautja emote typepath + var/static/list/yautja_emotes + /// Static list of categories + var/static/list/yautja_categories = list() + /// Panel allows you to spam, so a manual CD is added here + COOLDOWN_DECLARE(panel_emote_cooldown) + +/datum/yautja_emote_panel/New() + if(length(yautja_emotes)) + return + var/list/emotes_to_add = list() + for(var/datum/emote/living/carbon/human/yautja/emote as anything in subtypesof(/datum/emote/living/carbon/human/yautja)) + if(!initial(emote.key) || initial(emote.no_panel)) + continue + + if(!(initial(emote.category) in yautja_categories)) + yautja_categories += initial(emote.category) + emotes_to_add += emote + yautja_emotes = emotes_to_add + +/datum/yautja_emote_panel/proc/ui_interact(mob/user, datum/tgui/ui) + ui = SStgui.try_update_ui(user, src, ui) + if(!ui) + ui = new(user, src, "YautjaEmotes") + ui.open() + +/datum/yautja_emote_panel/ui_data(mob/user) + var/list/data = list() + + data["on_cooldown"] = !COOLDOWN_FINISHED(src, panel_emote_cooldown) + + return data + +/datum/yautja_emote_panel/ui_state(mob/user) + return GLOB.conscious_state + +/datum/yautja_emote_panel/ui_static_data(mob/user) + var/list/data = list() + + data["categories"] = yautja_categories + data["emotes"] = list() + + for(var/datum/emote/living/carbon/human/yautja/emote as anything in yautja_emotes) + data["emotes"] += list(list( + "id" = initial(emote.key), + "text" = (initial(emote.override_say) || initial(emote.say_message) || initial(emote.key)), + "category" = initial(emote.category), + "path" = "[emote]", + )) + + return data + +/datum/yautja_emote_panel/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) + . = ..() + if(.) + return + + switch(action) + if("emote") + var/datum/emote/living/carbon/human/yautja/path + if(!params["emotePath"]) + return FALSE + + path = text2path(params["emotePath"]) + + if(!path || !COOLDOWN_FINISHED(src, panel_emote_cooldown)) + return + + if(!(path in subtypesof(/datum/emote/living/carbon/human/yautja))) + return FALSE + + COOLDOWN_START(src, panel_emote_cooldown, 2.5 SECONDS) + ui.user.emote(initial(path.key)) + return TRUE diff --git a/code/modules/cm_preds/yaut_bracers.dm b/code/modules/cm_preds/yaut_bracers.dm index df8ab136ea18..0a528e220914 100644 --- a/code/modules/cm_preds/yaut_bracers.dm +++ b/code/modules/cm_preds/yaut_bracers.dm @@ -260,8 +260,6 @@ cloak_alpha = 10 var/exploding = 0 - var/inject_timer = 0 - var/healing_capsule_timer = 0 var/disc_timer = 0 var/explosion_type = 1 //0 is BIG explosion, 1 ONLY gibs the user. var/name_active = TRUE @@ -278,6 +276,9 @@ var/obj/item/weapon/wristblades/left_wristblades var/obj/item/weapon/wristblades/right_wristblades + ///A list of all intrinsic bracer actions + var/list/bracer_actions = list(/datum/action/predator_action/bracer/wristblade, /datum/action/predator_action/bracer/caster, /datum/action/predator_action/bracer/cloak, /datum/action/predator_action/bracer/thwei, /datum/action/predator_action/bracer/capsule, /datum/action/predator_action/bracer/translator, /datum/action/predator_action/bracer/self_destruct, /datum/action/predator_action/bracer/smartdisc) + /obj/item/clothing/gloves/yautja/hunter/Initialize(mapload, new_translator_type, new_caster_material, new_owner_rank) . = ..() if(new_owner_rank) @@ -312,6 +313,10 @@ if(embedded_id.registered_name) embedded_id.set_user_data(user) + for(var/datum/action/action as anything in bracer_actions) + give_action(user, action) + + //Any projectile can decloak a predator. It does defeat one free bullet though. /obj/item/clothing/gloves/yautja/hunter/proc/bullet_hit(mob/living/carbon/human/H, obj/projectile/P) SIGNAL_HANDLER @@ -351,6 +356,10 @@ move_chip_to_bracer() if(HAS_TRAIT(user, TRAIT_CLOAKED)) decloak(user, TRUE) + + for(var/datum/action/action as anything in bracer_actions) + remove_action(user, action) + ..() /obj/item/clothing/gloves/yautja/hunter/on_enter_storage(obj/item/storage/S) @@ -362,8 +371,8 @@ //We use this to activate random verbs for non-Yautja /obj/item/clothing/gloves/yautja/hunter/proc/activate_random_verb(mob/caller) - var/option = rand(1, 11) - //we have options from 1 to 8, but we're giving the user a higher probability of being punished if they already rolled this bad + var/option = rand(1, 10) + //we have options from 1 to 7, but we're giving the user a higher probability of being punished if they already rolled this bad switch(option) if(1) . = wristblades_internal(caller, TRUE) @@ -379,8 +388,6 @@ . = call_disc_internal(caller, TRUE) if(7) . = translate_internal(caller, TRUE) - if(8) - . = call_combi_internal(caller, TRUE) else . = delimb_user(caller) @@ -451,6 +458,12 @@ to_chat(caller, SPAN_NOTICE("You activate your [left_wristblades.plural_name].")) playsound(caller, 'sound/weapons/wristblades_on.ogg', 15, TRUE) + var/datum/action/predator_action/bracer/wristblade/wb_action + for(wb_action as anything in caller.actions) + if(istypestrict(wb_action, /datum/action/predator_action/bracer/wristblade)) + wb_action.update_button_icon(wristblades_deployed) + break + return TRUE /obj/item/clothing/gloves/yautja/hunter/verb/track_gear() @@ -597,6 +610,12 @@ XI.remove_from_hud(M) anim(M.loc,M,'icons/mob/mob.dmi',,"cloak",,M.dir) + var/datum/action/predator_action/bracer/cloak/cloak_action + for(cloak_action as anything in M.actions) + if(istypestrict(cloak_action, /datum/action/predator_action/bracer/cloak)) + cloak_action.update_button_icon(HAS_TRAIT(caller, TRAIT_CLOAKED)) + break + return TRUE /obj/item/clothing/gloves/yautja/hunter/proc/wrapper_fizzle_camouflage() @@ -675,6 +694,12 @@ to_chat(caller, SPAN_NOTICE("You activate your plasma caster. It is in [caster.mode] mode.")) playsound(src, 'sound/weapons/pred_plasmacaster_on.ogg', 15, TRUE) + var/datum/action/predator_action/bracer/caster/caster_action + for(caster_action as anything in caller.actions) + if(istypestrict(caster_action, /datum/action/predator_action/bracer/caster)) + caster_action.update_button_icon(caster_deployed) + break + return TRUE @@ -793,10 +818,19 @@ to_chat(M, SPAN_NOTICE("Your bracers stop beeping.")) message_all_yautja("[M.real_name] has cancelled their bracer's self-destruction sequence.") message_admins("[key_name(M)] has deactivated their Self-Destruct.") + + var/datum/action/predator_action/bracer/self_destruct/sd_action + for(sd_action as anything in M.actions) + if(istypestrict(sd_action, /datum/action/predator_action/bracer/self_destruct)) + sd_action.update_button_icon(exploding) + break + return + if(istype(M.wear_mask,/obj/item/clothing/mask/facehugger) || (M.status_flags & XENO_HOST)) to_chat(M, SPAN_WARNING("Strange...something seems to be interfering with your bracer functions...")) return + if(forced || alert("Detonate the bracers? Are you sure?\n\nNote: If you activate SD for any non-accidental reason during or after a fight, you commit to the SD. By initially activating the SD, you have accepted your impending death to preserve any lost honor.","Explosive Bracers", "Yes", "No") == "Yes") if(M.gloves != src) return @@ -815,10 +849,16 @@ log_attack("[key_name(M)] triggered their predator self-destruct sequence in [A ? "in [A.name]":""]") message_all_yautja("[M.real_name] has triggered their bracer's self-destruction sequence.") explode(M) - return 1 + var/datum/action/predator_action/bracer/self_destruct/sd_action + for(sd_action as anything in M.actions) + if(istypestrict(sd_action, /datum/action/predator_action/bracer/self_destruct)) + sd_action.update_button_icon(exploding) + break + return TRUE +#define YAUTJA_CREATE_CRYSTAL_COOLDOWN "yautja_create_crystal_cooldown" /obj/item/clothing/gloves/yautja/hunter/verb/injectors() set name = "Create Stabilising Crystal" set category = "Yautja.Utility" @@ -826,7 +866,6 @@ set src in usr . = injectors_internal(usr, FALSE) - /obj/item/clothing/gloves/yautja/hunter/proc/injectors_internal(mob/caller, forced = FALSE) if(caller.is_mob_incapacitated()) return FALSE @@ -839,26 +878,22 @@ to_chat(caller, SPAN_WARNING("Your active hand must be empty!")) return FALSE - if(inject_timer) - to_chat(caller, SPAN_WARNING("You recently activated the stabilising crystal. Be patient.")) + if(TIMER_COOLDOWN_CHECK(src, YAUTJA_CREATE_CRYSTAL_COOLDOWN)) + var/remaining_time = DisplayTimeText(S_TIMER_COOLDOWN_TIMELEFT(src, YAUTJA_CREATE_CRYSTAL_COOLDOWN)) + to_chat(caller, SPAN_WARNING("You recently synthesized a stabilising crystal. A new crystal will be available in [remaining_time].")) return FALSE if(!drain_power(caller, 400)) return FALSE - inject_timer = TRUE - addtimer(CALLBACK(src, PROC_REF(injectors_ready)), 2 MINUTES) + S_TIMER_COOLDOWN_START(src, YAUTJA_CREATE_CRYSTAL_COOLDOWN, 2 MINUTES) to_chat(caller, SPAN_NOTICE("You feel a faint hiss and a crystalline injector drops into your hand.")) var/obj/item/reagent_container/hypospray/autoinjector/yautja/O = new(caller) caller.put_in_active_hand(O) playsound(src, 'sound/machines/click.ogg', 15, 1) return TRUE - -/obj/item/clothing/gloves/yautja/hunter/proc/injectors_ready() - if(ismob(loc)) - to_chat(loc, SPAN_NOTICE("Your bracers beep faintly and inform you that a new stabilising crystal is ready to be created.")) - inject_timer = FALSE +#undef YAUTJA_CREATE_CRYSTAL_COOLDOWN /obj/item/clothing/gloves/yautja/hunter/verb/healing_capsule() set name = "Create Healing Capsule" @@ -867,7 +902,7 @@ set src in usr . = healing_capsule_internal(usr, FALSE) - +#define YAUTJA_CREATE_CAPSULE_COOLDOWN "yautja_create_capsule_cooldown" /obj/item/clothing/gloves/yautja/hunter/proc/healing_capsule_internal(mob/caller, forced = FALSE) if(caller.is_mob_incapacitated()) return FALSE @@ -880,26 +915,22 @@ to_chat(caller, SPAN_WARNING("Your active hand must be empty!")) return FALSE - if(healing_capsule_timer) - to_chat(usr, SPAN_WARNING("Your bracer is still generating a new healing capsule!")) + if(TIMER_COOLDOWN_CHECK(src, YAUTJA_CREATE_CAPSULE_COOLDOWN)) + var/remaining_time = DisplayTimeText(S_TIMER_COOLDOWN_TIMELEFT(src, YAUTJA_CREATE_CAPSULE_COOLDOWN)) + to_chat(caller, SPAN_WARNING("You recently synthesized a healing capsule. A new capsule will be available in [remaining_time].")) return FALSE if(!drain_power(caller, 600)) return FALSE - healing_capsule_timer = TRUE - addtimer(CALLBACK(src, PROC_REF(healing_capsule_ready)), 4 MINUTES) + S_TIMER_COOLDOWN_START(src, YAUTJA_CREATE_CAPSULE_COOLDOWN, 4 MINUTES) to_chat(caller, SPAN_NOTICE("You feel your bracer churn as it pops out a healing capsule.")) var/obj/item/tool/surgery/healing_gel/O = new(caller) caller.put_in_active_hand(O) playsound(src, 'sound/machines/click.ogg', 15, 1) return TRUE - -/obj/item/clothing/gloves/yautja/hunter/proc/healing_capsule_ready() - if(ismob(loc)) - to_chat(loc, SPAN_NOTICE("Your bracers beep faintly and inform you that a new healing capsule is ready to be created.")) - healing_capsule_timer = FALSE +#undef YAUTJA_CREATE_CAPSULE_COOLDOWN /obj/item/clothing/gloves/yautja/hunter/verb/call_disc() set name = "Call Smart-Disc" @@ -991,26 +1022,6 @@ to_chat(caller, SPAN_NOTICE("You add \the [untracked_item] to the tracking system.")) return TRUE -/obj/item/clothing/gloves/yautja/hunter/verb/call_combi() - set name = "Yank combi-stick" - set category = "Yautja.Weapons" - set desc = "Yank on your combi-stick's chain, if it's in range. Otherwise... recover it yourself." - set src in usr - . = call_combi_internal(usr, FALSE) - -/obj/item/clothing/gloves/yautja/hunter/proc/call_combi_internal(mob/caller, forced = FALSE) - if(caller.is_mob_incapacitated()) - return FALSE - - . = check_random_function(caller, forced) - if(.) - return - - for(var/datum/effects/tethering/tether in caller.effects_list) - if(istype(tether.tethered.affected_atom, /obj/item/weapon/yautja/combistick)) - var/obj/item/weapon/yautja/combistick/stick = tether.tethered.affected_atom - stick.recall() - /obj/item/clothing/gloves/yautja/hunter/verb/translate() set name = "Translator" set desc = "Emit a message from your bracer to those nearby." diff --git a/code/modules/cm_preds/yaut_hudprocs.dm b/code/modules/cm_preds/yaut_hudprocs.dm index 6131ac135cb7..460cad894c6d 100644 --- a/code/modules/cm_preds/yaut_hudprocs.dm +++ b/code/modules/cm_preds/yaut_hudprocs.dm @@ -442,3 +442,18 @@ T.hud_set_hunter() else to_chat(src, SPAN_YAUTJABOLD("You cannot undo the actions of a living brother or sister!")) + +/mob/living/carbon/human/proc/call_combi() + set name = "Yank combi-stick" + set category = "Yautja.Weapons" + set desc = "Yank on your combi-stick's chain, if it's in range. Otherwise... recover it yourself." + + if(usr.is_mob_incapacitated()) + return FALSE + call_combi_internal(usr) + +/mob/living/carbon/human/proc/call_combi_internal(mob/caller, forced = FALSE) + for(var/datum/effects/tethering/tether in caller.effects_list) + if(istype(tether.tethered.affected_atom, /obj/item/weapon/yautja/combistick)) + var/obj/item/weapon/yautja/combistick/stick = tether.tethered.affected_atom + stick.recall() diff --git a/code/modules/cm_preds/yaut_mask.dm b/code/modules/cm_preds/yaut_mask.dm index 7e8e661e8a5e..f87c7a48c2e0 100644 --- a/code/modules/cm_preds/yaut_mask.dm +++ b/code/modules/cm_preds/yaut_mask.dm @@ -43,6 +43,8 @@ var/list/mask_huds = list(MOB_HUD_XENO_STATUS, MOB_HUD_HUNTER, MOB_HUD_HUNTER_CLAN, MOB_HUD_MEDICAL_OBSERVER) var/thrall = FALSE //Used to affect icon generation. + ///A list of all intrinsic mask actions + var/list/mask_actions = list(/datum/action/predator_action/mask/zoom, /datum/action/predator_action/mask/visor) /obj/item/clothing/mask/gas/yautja/New(location, mask_number = rand(1,12), armor_material = "ebony", legacy = "None") ..() @@ -96,8 +98,8 @@ if(istype(visor, /obj/item/clothing/glasses/night/yautja))//To change if any new vision modes are made human_holder.temp_drop_inv_item(visor) qdel(visor) - human_holder.update_inv_glasses() human_holder.update_sight() + add_vision(human_holder) /obj/item/clothing/mask/gas/yautja/proc/drain_power(mob/living/carbon/human/human_holder, drain_amount) var/obj/item/clothing/gloves/yautja/bracer = human_holder.gloves @@ -115,6 +117,18 @@ return zoom(usr, 11, 12) + update_zoom_action(src, usr) + if(zoom) + RegisterSignal(src, COMSIG_ITEM_UNZOOM, PROC_REF(update_zoom_action)) + return + +/obj/item/clothing/mask/gas/yautja/proc/update_zoom_action(source, mob/living/user) + UnregisterSignal(src, COMSIG_ITEM_UNZOOM) + var/datum/action/predator_action/mask/zoom/zoom_action + for(zoom_action as anything in user.actions) + if(istypestrict(zoom_action, /datum/action/predator_action/mask/zoom)) + zoom_action.update_button_icon(zoom) + break /obj/item/clothing/mask/gas/yautja/verb/togglesight() set name = "Toggle Mask Visors" @@ -165,12 +179,21 @@ playsound(src, 'sound/effects/pred_vision.ogg', 15, 1) user.update_inv_glasses() + var/datum/action/predator_action/mask/visor/visor_action + for(visor_action as anything in user.actions) + if(istypestrict(visor_action, /datum/action/predator_action/mask/visor)) + visor_action.update_button_icon(current_goggles) + break + #undef VISION_MODE_OFF #undef VISION_MODE_NVG /obj/item/clothing/mask/gas/yautja/dropped(mob/living/carbon/human/user) //Clear the gogglors if the helmet is removed. STOP_PROCESSING(SSobj, src) if(istype(user) && user.wear_mask == src) //inventory reference is only cleared after dropped(). + for(var/datum/action/action as anything in mask_actions) + remove_action(user, action) + for(var/listed_hud in mask_huds) var/datum/mob_hud/H = GLOB.huds[listed_hud] H.remove_hud_from(user, src) @@ -185,6 +208,9 @@ /obj/item/clothing/mask/gas/yautja/equipped(mob/living/carbon/human/user, slot) if(slot == WEAR_FACE) + for(var/datum/action/action as anything in mask_actions) + give_action(user, action) + START_PROCESSING(SSobj, src) for(var/listed_hud in mask_huds) var/datum/mob_hud/H = GLOB.huds[listed_hud] diff --git a/code/modules/cm_preds/yaut_procs.dm b/code/modules/cm_preds/yaut_procs.dm index 728e548dfd2f..d8ad1c297a37 100644 --- a/code/modules/cm_preds/yaut_procs.dm +++ b/code/modules/cm_preds/yaut_procs.dm @@ -337,3 +337,4 @@ equip_to_slot_if_possible(new /obj/item/falcon_drone(src.loc), WEAR_R_EAR, disable_warning = TRUE) remove_verb(src, /mob/living/carbon/human/proc/pred_buy) + remove_action(src, /datum/action/predator_action/claim_equipment) diff --git a/code/modules/cm_preds/yaut_weapons.dm b/code/modules/cm_preds/yaut_weapons.dm index 0ea527847d72..c9bb0fddeaa5 100644 --- a/code/modules/cm_preds/yaut_weapons.dm +++ b/code/modules/cm_preds/yaut_weapons.dm @@ -248,14 +248,16 @@ hitsound = 'sound/weapons/bladeslice.ogg' attack_verb = list("speared", "stabbed", "impaled") - var/on = 1 - var/charged + var/on = TRUE + var/charged = FALSE var/force_wielded = MELEE_FORCE_TIER_6 var/force_unwielded = MELEE_FORCE_TIER_2 var/force_storage = MELEE_FORCE_TIER_1 /// Ref to the tether effect when thrown var/datum/effects/tethering/chain + ///The mob the chain is linked to + var/mob/living/linked_to /obj/item/weapon/yautja/combistick/Destroy() cleanup_chain() @@ -273,11 +275,13 @@ charged = FALSE remove_filter("combistick_charge") unwield(user) //Otherwise stays wielded even when thrown - if(on) - setup_chain(user) return TRUE /obj/item/weapon/yautja/combistick/proc/setup_chain(mob/living/user) + give_action(user, /datum/action/predator_action/bracer/combistick) + add_verb(user, /mob/living/carbon/human/proc/call_combi) + linked_to = user + var/list/tether_effects = apply_tether(user, src, range = 6, resistable = FALSE) chain = tether_effects["tetherer_tether"] RegisterSignal(chain, COMSIG_PARENT_QDELETING, PROC_REF(cleanup_chain)) @@ -293,6 +297,10 @@ /// Clean up the chain, deleting/nulling/unregistering as needed /obj/item/weapon/yautja/combistick/proc/cleanup_chain() SIGNAL_HANDLER + if(linked_to) + remove_action(linked_to, /datum/action/predator_action/bracer/combistick) + remove_verb(linked_to, /mob/living/carbon/human/proc/call_combi) + if(!QDELETED(chain)) QDEL_NULL(chain) @@ -1238,6 +1246,13 @@ /obj/item/weapon/gun/energy/yautja/plasma_caster/dropped(mob/living/carbon/human/M) playsound(M, 'sound/weapons/pred_plasmacaster_off.ogg', 15, 1) to_chat(M, SPAN_NOTICE("You deactivate your plasma caster.")) + + var/datum/action/predator_action/bracer/caster/caster_action + for(caster_action as anything in M.actions) + if(istypestrict(caster_action, /datum/action/predator_action/bracer/caster)) + caster_action.update_button_icon(FALSE) + break + if(source) forceMove(source) source.caster_deployed = FALSE diff --git a/code/modules/cm_tech/hologram.dm b/code/modules/cm_tech/hologram.dm index 3509c0a73a7d..1fcba71a4560 100644 --- a/code/modules/cm_tech/hologram.dm +++ b/code/modules/cm_tech/hologram.dm @@ -14,6 +14,7 @@ GLOBAL_LIST_EMPTY_TYPED(hologram_list, /mob/hologram) var/action_icon_state = "hologram_exit" var/mob/linked_mob + var/initial_leave_button = /datum/action/leave_hologram var/datum/action/leave_hologram/leave_button ///If can be detected on motion detectors. var/motion_sensed = FALSE @@ -45,7 +46,7 @@ GLOBAL_LIST_EMPTY_TYPED(hologram_list, /mob/hologram) name = "[initial(name)] ([M.name])" - leave_button = new(null, action_icon_state) + leave_button = new initial_leave_button(null, action_icon_state) leave_button.linked_hologram = src leave_button.give_to(M) diff --git a/code/modules/mob/living/carbon/human/species/yautja/_species.dm b/code/modules/mob/living/carbon/human/species/yautja/_species.dm index f8937279d8b9..65444ded0732 100644 --- a/code/modules/mob/living/carbon/human/species/yautja/_species.dm +++ b/code/modules/mob/living/carbon/human/species/yautja/_species.dm @@ -211,7 +211,10 @@ limb.time_to_knit = 600 // 1 minute to self heal bone break, time is in tenths of a second hunter.set_languages(list(LANGUAGE_YAUTJA)) + give_action(hunter, /datum/action/predator_action/claim_equipment) give_action(hunter, /datum/action/yautja_emote_panel) + give_action(hunter, /datum/action/predator_action/mark_for_hunt) + give_action(hunter, /datum/action/predator_action/mark_panel) return ..() /datum/species/yautja/get_hairstyle(style) @@ -228,100 +231,3 @@ /datum/species/yautja/open_emote_panel() var/datum/yautja_emote_panel/ui = new(usr) ui.ui_interact(usr) - -/datum/action/yautja_emote_panel - name = "Open Emote Panel" - action_icon_state = "looc_toggle" - -/datum/action/yautja_emote_panel/can_use_action() - . = ..() - if(!.) - return FALSE - - if(!isyautja(owner)) - return FALSE - - return TRUE - -/datum/action/yautja_emote_panel/action_activate() - if(!can_use_action()) - return - - var/mob/living/carbon/human/human_owner = owner - var/datum/species/yautja/yautja_species = human_owner.species - yautja_species.open_emote_panel() - -/datum/yautja_emote_panel - /// Static dict ("category" : (emotes)) of every yautja emote typepath - var/static/list/yautja_emotes - /// Static list of categories - var/static/list/yautja_categories = list() - /// Panel allows you to spam, so a manual CD is added here - COOLDOWN_DECLARE(panel_emote_cooldown) - -/datum/yautja_emote_panel/New() - if(!length(yautja_emotes)) - var/list/emotes_to_add = list() - for(var/datum/emote/living/carbon/human/yautja/emote as anything in subtypesof(/datum/emote/living/carbon/human/yautja)) - if(!initial(emote.key) || initial(emote.no_panel)) - continue - - if(!(initial(emote.category) in yautja_categories)) - yautja_categories += initial(emote.category) - emotes_to_add += emote - yautja_emotes = emotes_to_add - -/datum/yautja_emote_panel/proc/ui_interact(mob/user, datum/tgui/ui) - ui = SStgui.try_update_ui(user, src, ui) - if(!ui) - ui = new(user, src, "YautjaEmotes") - ui.open() - -/datum/yautja_emote_panel/ui_data(mob/user) - var/list/data = list() - - data["on_cooldown"] = !COOLDOWN_FINISHED(src, panel_emote_cooldown) - - return data - -/datum/yautja_emote_panel/ui_state(mob/user) - return GLOB.conscious_state - -/datum/yautja_emote_panel/ui_static_data(mob/user) - var/list/data = list() - - data["categories"] = yautja_categories - data["emotes"] = list() - - for(var/datum/emote/living/carbon/human/yautja/emote as anything in yautja_emotes) - data["emotes"] += list(list( - "id" = initial(emote.key), - "text" = (initial(emote.override_say) || initial(emote.say_message) || initial(emote.key)), - "category" = initial(emote.category), - "path" = "[emote]", - )) - - return data - -/datum/yautja_emote_panel/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) - . = ..() - if(.) - return - - switch(action) - if("emote") - var/datum/emote/living/carbon/human/yautja/path - if(!params["emotePath"]) - return FALSE - - path = text2path(params["emotePath"]) - - if(!path || !COOLDOWN_FINISHED(src, panel_emote_cooldown)) - return - - if(!(path in subtypesof(/datum/emote/living/carbon/human/yautja))) - return FALSE - - COOLDOWN_START(src, panel_emote_cooldown, 2.5 SECONDS) - usr.emote(initial(path.key)) - return TRUE diff --git a/colonialmarines.dme b/colonialmarines.dme index 64f1338244b4..6e0fc02b45bf 100644 --- a/colonialmarines.dme +++ b/colonialmarines.dme @@ -1613,6 +1613,7 @@ #include "code\modules\cm_preds\smartdisc.dm" #include "code\modules\cm_preds\thrall_items.dm" #include "code\modules\cm_preds\thrall_procs.dm" +#include "code\modules\cm_preds\yaut_actions.dm" #include "code\modules\cm_preds\yaut_bracers.dm" #include "code\modules\cm_preds\yaut_hudprocs.dm" #include "code\modules\cm_preds\yaut_items.dm" diff --git a/icons/mob/hud/actions.dmi b/icons/mob/hud/actions.dmi index 843d38a67b86..820da22ea5b1 100644 Binary files a/icons/mob/hud/actions.dmi and b/icons/mob/hud/actions.dmi differ diff --git a/icons/mob/hud/actions_yautja.dmi b/icons/mob/hud/actions_yautja.dmi new file mode 100644 index 000000000000..c94388456e96 Binary files /dev/null and b/icons/mob/hud/actions_yautja.dmi differ