From 86a7e0f5940110cd5d8824ed7768e38b97f25bbb Mon Sep 17 00:00:00 2001 From: Ben10083 Date: Sat, 15 Jul 2023 16:06:48 -0400 Subject: [PATCH 01/10] 1 second cooldown to hide --- .../mob/living/carbon/xenomorph/abilities/general_abilities.dm | 1 + .../mob/living/carbon/xenomorph/abilities/general_powers.dm | 3 +++ 2 files changed, 4 insertions(+) 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..0de92cd67363 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 = 1 SECONDS macro_path = /datum/action/xeno_action/verb/verb_hide action_type = XENO_ACTION_CLICK listen_signal = COMSIG_KB_XENO_HIDE 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..3f21f6063f87 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm @@ -508,6 +508,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 +519,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) From e2ae9f70c39cde343fe8c47bac5eda5ccf3e83ec Mon Sep 17 00:00:00 2001 From: Ben10083 Date: Sat, 15 Jul 2023 16:21:35 -0400 Subject: [PATCH 02/10] post_attack proc to call after a attack --- .../carbon/xenomorph/abilities/general_abilities.dm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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 0de92cd67363..14b9fbbcabe3 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/general_abilities.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/general_abilities.dm @@ -382,7 +382,7 @@ name = "Hide" action_icon_state = "xenohide" plasma_cost = 0 - xeno_cooldown = 1 SECONDS + 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 @@ -392,6 +392,15 @@ if(X && !X.buckled && !X.is_mob_incapacitated()) return TRUE +/// remove hide and apply cooldown +/datum/action/xeno_action/onclick/xenohide/post_attack() + var/mob/living/carbon/xenomorph/xeno = owner + xeno.layer = initial(xeno.layer) + to_chat(xeno, SPAN_NOTICE("You have lost the element of surprise after your attack!")) + 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 From 84af06da60e90f149fd272e3aec8821230aefac2 Mon Sep 17 00:00:00 2001 From: Ben10083 Date: Sat, 15 Jul 2023 16:26:11 -0400 Subject: [PATCH 03/10] master plan part 1 --- .../mob/living/carbon/xenomorph/mutators/behavior_delegate.dm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/modules/mob/living/carbon/xenomorph/mutators/behavior_delegate.dm b/code/modules/mob/living/carbon/xenomorph/mutators/behavior_delegate.dm index 53ca8c3a74da..5b7bd163a8ca 100644 --- a/code/modules/mob/living/carbon/xenomorph/mutators/behavior_delegate.dm +++ b/code/modules/mob/living/carbon/xenomorph/mutators/behavior_delegate.dm @@ -65,6 +65,8 @@ /datum/behavior_delegate/proc/melee_attack_additional_effects_self() SEND_SIGNAL(bound_xeno, COMSIG_XENO_SLASH_ADDITIONAL_EFFECTS_SELF) + if(bound_xeno.layer = XENO_HIDING_LAYER) + // Identical to the above 3 procs but for ranged attacks. /** From 37beb2c340c79c24a44cf287ee3ebc5bba816d5d Mon Sep 17 00:00:00 2001 From: Ben10083 Date: Sat, 15 Jul 2023 16:54:11 -0400 Subject: [PATCH 04/10] Master Plan --- .../living/carbon/xenomorph/abilities/general_abilities.dm | 4 ++-- .../living/carbon/xenomorph/mutators/behavior_delegate.dm | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) 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 14b9fbbcabe3..4b3a177e69fa 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/general_abilities.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/general_abilities.dm @@ -393,10 +393,10 @@ return TRUE /// remove hide and apply cooldown -/datum/action/xeno_action/onclick/xenohide/post_attack() +/datum/action/xeno_action/onclick/xenohide/proc/post_attack() var/mob/living/carbon/xenomorph/xeno = owner xeno.layer = initial(xeno.layer) - to_chat(xeno, SPAN_NOTICE("You have lost the element of surprise after your attack!")) + to_chat(xeno, SPAN_NOTICE("You have stopped hiding.")) button.icon_state = "template" xeno.update_wounds() apply_cooldown(4) //2 second cooldown after attacking diff --git a/code/modules/mob/living/carbon/xenomorph/mutators/behavior_delegate.dm b/code/modules/mob/living/carbon/xenomorph/mutators/behavior_delegate.dm index 5b7bd163a8ca..4f5076a3f2d5 100644 --- a/code/modules/mob/living/carbon/xenomorph/mutators/behavior_delegate.dm +++ b/code/modules/mob/living/carbon/xenomorph/mutators/behavior_delegate.dm @@ -65,8 +65,11 @@ /datum/behavior_delegate/proc/melee_attack_additional_effects_self() SEND_SIGNAL(bound_xeno, COMSIG_XENO_SLASH_ADDITIONAL_EFFECTS_SELF) - if(bound_xeno.layer = XENO_HIDING_LAYER) - + var/datum/action/xeno_action/onclick/xenohide/hide = get_xeno_action_by_type(bound_xeno, /datum/action/xeno_action/onclick/xenohide) + if(!hide || bound_xeno.layer != XENO_HIDING_LAYER) //if not hiding or have hide ability + return + else + hide.post_attack() // Identical to the above 3 procs but for ranged attacks. /** From dd12bd171258f0056a45bb93451589c55b0fbc34 Mon Sep 17 00:00:00 2001 From: Ben10083 Date: Sat, 15 Jul 2023 16:55:38 -0400 Subject: [PATCH 05/10] better logic --- .../mob/living/carbon/xenomorph/mutators/behavior_delegate.dm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/code/modules/mob/living/carbon/xenomorph/mutators/behavior_delegate.dm b/code/modules/mob/living/carbon/xenomorph/mutators/behavior_delegate.dm index 4f5076a3f2d5..eb74282f6bcd 100644 --- a/code/modules/mob/living/carbon/xenomorph/mutators/behavior_delegate.dm +++ b/code/modules/mob/living/carbon/xenomorph/mutators/behavior_delegate.dm @@ -66,9 +66,7 @@ /datum/behavior_delegate/proc/melee_attack_additional_effects_self() SEND_SIGNAL(bound_xeno, COMSIG_XENO_SLASH_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 || bound_xeno.layer != XENO_HIDING_LAYER) //if not hiding or have hide ability - return - else + if(hide) hide.post_attack() // Identical to the above 3 procs but for ranged attacks. From 3c6f744ba796d052d8bab20a2ec0071239d35839 Mon Sep 17 00:00:00 2001 From: Ben10083 Date: Thu, 20 Jul 2023 13:49:11 -0400 Subject: [PATCH 06/10] only trigger if already hiding (cooldown still applies) --- .../carbon/xenomorph/abilities/general_abilities.dm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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 4b3a177e69fa..489635a09ea7 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/general_abilities.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/general_abilities.dm @@ -395,10 +395,11 @@ /// remove hide and apply cooldown /datum/action/xeno_action/onclick/xenohide/proc/post_attack() var/mob/living/carbon/xenomorph/xeno = owner - xeno.layer = initial(xeno.layer) - to_chat(xeno, SPAN_NOTICE("You have stopped hiding.")) - button.icon_state = "template" - xeno.update_wounds() + if(xeno.layer != XENO_HIDING_LAYER) + xeno.layer = initial(xeno.layer) + to_chat(xeno, SPAN_NOTICE("You have stopped hiding.")) + 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) From 0ffff332bf5cb2e43e04e14e101aacfed669585c Mon Sep 17 00:00:00 2001 From: Ben10083 Date: Thu, 20 Jul 2023 13:53:38 -0400 Subject: [PATCH 07/10] ok but fr tho --- .../mob/living/carbon/xenomorph/abilities/general_abilities.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 489635a09ea7..9d2b7b5ceac2 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/general_abilities.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/general_abilities.dm @@ -395,7 +395,7 @@ /// remove hide and apply cooldown /datum/action/xeno_action/onclick/xenohide/proc/post_attack() var/mob/living/carbon/xenomorph/xeno = owner - if(xeno.layer != XENO_HIDING_LAYER) + if(xeno.layer == XENO_HIDING_LAYER) xeno.layer = initial(xeno.layer) to_chat(xeno, SPAN_NOTICE("You have stopped hiding.")) button.icon_state = "template" From 94935913625cb276bc1a5449139cced51e661be2 Mon Sep 17 00:00:00 2001 From: Ben10083 Date: Thu, 20 Jul 2023 14:00:29 -0400 Subject: [PATCH 08/10] use new proc with pounce --- .../mob/living/carbon/xenomorph/abilities/general_powers.dm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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 3f21f6063f87..17ea45273512 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" + hide_ability.post_attack() if(isravager(X)) X.emote("roar") From 320ea049facd7c76845c018b770d296547a6cc37 Mon Sep 17 00:00:00 2001 From: Ben10083 Date: Thu, 20 Jul 2023 14:08:31 -0400 Subject: [PATCH 09/10] First pass for suggested changes --- .../carbon/xenomorph/abilities/general_abilities.dm | 3 +-- .../mob/living/carbon/xenomorph/castes/Hellhound.dm | 11 +++++++++++ .../mob/living/carbon/xenomorph/castes/Runner.dm | 11 +++++++++++ .../carbon/xenomorph/mutators/behavior_delegate.dm | 3 --- 4 files changed, 23 insertions(+), 5 deletions(-) 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 9d2b7b5ceac2..cf9a01d89ee9 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/general_abilities.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/general_abilities.dm @@ -392,12 +392,11 @@ if(X && !X.buckled && !X.is_mob_incapacitated()) return TRUE -/// remove hide and apply cooldown +/// 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) - to_chat(xeno, SPAN_NOTICE("You have stopped hiding.")) button.icon_state = "template" xeno.update_wounds() apply_cooldown(4) //2 second cooldown after attacking 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() diff --git a/code/modules/mob/living/carbon/xenomorph/mutators/behavior_delegate.dm b/code/modules/mob/living/carbon/xenomorph/mutators/behavior_delegate.dm index eb74282f6bcd..53ca8c3a74da 100644 --- a/code/modules/mob/living/carbon/xenomorph/mutators/behavior_delegate.dm +++ b/code/modules/mob/living/carbon/xenomorph/mutators/behavior_delegate.dm @@ -65,9 +65,6 @@ /datum/behavior_delegate/proc/melee_attack_additional_effects_self() SEND_SIGNAL(bound_xeno, COMSIG_XENO_SLASH_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() // Identical to the above 3 procs but for ranged attacks. /** From 68a180494f7052f6b54629262f1b4ba5f18ba5d9 Mon Sep 17 00:00:00 2001 From: Ben10083 Date: Thu, 20 Jul 2023 14:15:33 -0400 Subject: [PATCH 10/10] same thing but it works?!?!?!?!?! --- .../mob/living/carbon/xenomorph/abilities/general_powers.dm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 17ea45273512..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,9 +396,9 @@ return if(X.layer == XENO_HIDING_LAYER) //Xeno is currently hiding, unhide him - var/datum/action/hide_ability = get_xeno_action_by_type(X, /datum/action/xeno_action/onclick/xenohide) - if(hide_ability) - hide_ability.post_attack() + 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")