Skip to content

Commit

Permalink
You now lose hiding when melee attacking (#3902)
Browse files Browse the repository at this point in the history
# About the pull request

Hiding now has 0.5 second cooldown, if you melee attack it will be 2
second cooldown and you lose hiding.

# Explain why it's good for the game

For melee users, having to try to hit a target that is hiding can be an
exercise in futility, with many aspects such as hitbox, placing weapon
on table by mistake, and other factors, leading to a overall unfair
advantage. (Other abilities unaffected.)

# Testing Photographs and Procedure
<details>
<summary>Screenshots & Videos</summary>


https://github.com/cmss13-devs/cmss13/assets/91219575/238673b5-6dff-4362-ab32-ef4b3e208dcc

</details>

# Changelog

:cl:
balance: Xenomorphs lose their hiding ability for 2 seconds after a
melee attack. 0.5 second cooldown applied to hide ability.
/:cl:
  • Loading branch information
Ben10083 authored Jul 24, 2023
1 parent dc85d5c commit 4cd36ed
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 5 deletions.
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()

0 comments on commit 4cd36ed

Please sign in to comment.