diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/general_abilities.dm b/code/modules/mob/living/carbon/xenomorph/abilities/general_abilities.dm index d95fbc304397..cf9a01d89ee9 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/general_abilities.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/general_abilities.dm @@ -382,6 +382,7 @@ name = "Hide" action_icon_state = "xenohide" plasma_cost = 0 + xeno_cooldown = 0.5 SECONDS macro_path = /datum/action/xeno_action/verb/verb_hide action_type = XENO_ACTION_CLICK listen_signal = COMSIG_KB_XENO_HIDE @@ -391,6 +392,15 @@ if(X && !X.buckled && !X.is_mob_incapacitated()) return TRUE +/// remove hide and apply modified attack cooldown +/datum/action/xeno_action/onclick/xenohide/proc/post_attack() + var/mob/living/carbon/xenomorph/xeno = owner + if(xeno.layer == XENO_HIDING_LAYER) + xeno.layer = initial(xeno.layer) + button.icon_state = "template" + xeno.update_wounds() + apply_cooldown(4) //2 second cooldown after attacking + /datum/action/xeno_action/onclick/xenohide/give_to(mob/living/living_mob) . = ..() var/mob/living/carbon/xenomorph/xeno = owner diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm index 4a57c0729b91..a999836c00db 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm @@ -396,11 +396,9 @@ return if(X.layer == XENO_HIDING_LAYER) //Xeno is currently hiding, unhide him - X.layer = MOB_LAYER - X.update_wounds() - var/datum/action/hide_ability = get_xeno_action_by_type(X, /datum/action/xeno_action/onclick/xenohide) - if(hide_ability) - hide_ability.button.icon_state = "template" + var/datum/action/xeno_action/onclick/xenohide/hide = get_xeno_action_by_type(X, /datum/action/xeno_action/onclick/xenohide) + if(hide) + hide.post_attack() if(isravager(X)) X.emote("roar") @@ -508,6 +506,8 @@ var/mob/living/carbon/xenomorph/xeno = owner if(!xeno.check_state(TRUE)) return + if (!action_cooldown_check()) + return if(xeno.layer != XENO_HIDING_LAYER) xeno.layer = XENO_HIDING_LAYER to_chat(xeno, SPAN_NOTICE("You are now hiding.")) @@ -517,6 +517,7 @@ to_chat(xeno, SPAN_NOTICE("You have stopped hiding.")) button.icon_state = "template" xeno.update_wounds() + apply_cooldown() return ..() /datum/action/xeno_action/onclick/place_trap/use_ability(atom/A) diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Hellhound.dm b/code/modules/mob/living/carbon/xenomorph/castes/Hellhound.dm index 271fe3182210..a44fee5645ac 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Hellhound.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Hellhound.dm @@ -12,6 +12,7 @@ evasion = XENO_EVASION_LOW speed = XENO_SPEED_HELLHOUND attack_delay = -2 + behavior_delegate_type = /datum/behavior_delegate/hellhound_base minimum_evolve_time = 0 @@ -125,3 +126,13 @@ /mob/living/carbon/xenomorph/hellhound/handle_blood_splatter(splatter_dir) new /obj/effect/temp_visual/dir_setting/bloodsplatter/hellhound(loc, splatter_dir) + +/datum/behavior_delegate/hellhound_base + name = "Base Hellhound Behavior Delegate" + +/datum/behavior_delegate/hellhound_base/melee_attack_additional_effects_self() + ..() + + var/datum/action/xeno_action/onclick/xenohide/hide = get_xeno_action_by_type(bound_xeno, /datum/action/xeno_action/onclick/xenohide) + if(hide) + hide.post_attack() diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Runner.dm b/code/modules/mob/living/carbon/xenomorph/castes/Runner.dm index 04dd751bdcb8..69e5b82aa307 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Runner.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Runner.dm @@ -13,6 +13,7 @@ evasion = XENO_EVASION_NONE speed = XENO_SPEED_RUNNER attack_delay = -4 + behavior_delegate_type = /datum/behavior_delegate/runner_base evolves_to = list(XENO_CASTE_LURKER) deevolves_to = list("Larva") @@ -71,3 +72,13 @@ ..() if (PF) PF.flags_pass = PASS_FLAGS_CRAWLER + +/datum/behavior_delegate/runner_base + name = "Base Runner Behavior Delegate" + +/datum/behavior_delegate/runner_base/melee_attack_additional_effects_self() + ..() + + var/datum/action/xeno_action/onclick/xenohide/hide = get_xeno_action_by_type(bound_xeno, /datum/action/xeno_action/onclick/xenohide) + if(hide) + hide.post_attack()