Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

You now lose hiding when melee attacking #3902

Merged
merged 12 commits into from
Jul 24, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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."))
Expand All @@ -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)
Expand Down
11 changes: 11 additions & 0 deletions code/modules/mob/living/carbon/xenomorph/castes/Hellhound.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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()
11 changes: 11 additions & 0 deletions code/modules/mob/living/carbon/xenomorph/castes/Runner.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down Expand Up @@ -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()