From 5a3ad4c5dffcfe70cf8ba48e406b03775fe9a784 Mon Sep 17 00:00:00 2001 From: Morrow Date: Tue, 11 Jul 2023 00:34:13 -0400 Subject: [PATCH 1/8] Initial --- code/modules/mob/living/carbon/xenomorph/Xenomorph.dm | 5 +++++ .../mob/living/carbon/xenomorph/castes/Lurker.dm | 11 +++++++++++ .../carbon/xenomorph/mutators/behavior_delegate.dm | 3 +++ 3 files changed, 19 insertions(+) diff --git a/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm b/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm index f1d03d6507b1..4bc630a6a486 100644 --- a/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm +++ b/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm @@ -1085,3 +1085,8 @@ if(D) color_override = D.color new /obj/effect/temp_visual/dir_setting/bloodsplatter/xenosplatter(loc, splatter_dir, duration, color_override) + +/mob/living/carbon/xenomorph/Collide(atom/movable/movable_atom) + . = ..() + if(behavior_delegate) + behavior_delegate.on_collide(movable_atom) diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm b/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm index fb75ed3900ac..9a26ac2fbaee 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm @@ -151,3 +151,14 @@ . = list() var/invis_message = (invis_start_time == -1) ? "N/A" : "[(invis_duration-(world.time - invis_start_time))/10] seconds." . += "Invisibility Time Left: [invis_message]" + +/datum/behavior_delegate/lurker_base/on_collide(atom/movable/movable_atom) + . = ..() + + if(!ishuman(movable_atom)) + return + + if(bound_xeno) + var/datum/action/xeno_action/onclick/lurker_invisibility/lurker_invisibility_action = get_xeno_action_by_type(bound_xeno, /datum/action/xeno_action/onclick/lurker_invisibility) + if(lurker_invisibility_action && istype(lurker_invisibility_action)) + lurker_invisibility_action.invisibility_off() 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 1cb563461138..7a923d9a9abb 100644 --- a/code/modules/mob/living/carbon/xenomorph/mutators/behavior_delegate.dm +++ b/code/modules/mob/living/carbon/xenomorph/mutators/behavior_delegate.dm @@ -104,3 +104,6 @@ /// Used to override an intent for some abilities that must force harm on next attack_alien() /datum/behavior_delegate/proc/override_intent(mob/living/carbon/target_carbon) return bound_xeno.a_intent + +/datum/behavior_delegate/proc/on_collide(atom/movable/movable_atom) + return From 05f931525c10240b2e7cb2f7afab365efba449b5 Mon Sep 17 00:00:00 2001 From: Morrow Date: Tue, 11 Jul 2023 00:35:39 -0400 Subject: [PATCH 2/8] comment --- .../mob/living/carbon/xenomorph/mutators/behavior_delegate.dm | 1 + 1 file changed, 1 insertion(+) 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 7a923d9a9abb..53ca8c3a74da 100644 --- a/code/modules/mob/living/carbon/xenomorph/mutators/behavior_delegate.dm +++ b/code/modules/mob/living/carbon/xenomorph/mutators/behavior_delegate.dm @@ -105,5 +105,6 @@ /datum/behavior_delegate/proc/override_intent(mob/living/carbon/target_carbon) return bound_xeno.a_intent +/// Used to do something when a xeno collides with a movable atom /datum/behavior_delegate/proc/on_collide(atom/movable/movable_atom) return From 32d43f18b36795fc3fb8a433af544f976bf5917d Mon Sep 17 00:00:00 2001 From: Morrow Date: Tue, 11 Jul 2023 00:42:44 -0400 Subject: [PATCH 3/8] only do when stealthed --- code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm b/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm index 9a26ac2fbaee..a998fe65bbdb 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm @@ -158,7 +158,7 @@ if(!ishuman(movable_atom)) return - if(bound_xeno) + if(bound_xeno && bound_xeno.stealth) var/datum/action/xeno_action/onclick/lurker_invisibility/lurker_invisibility_action = get_xeno_action_by_type(bound_xeno, /datum/action/xeno_action/onclick/lurker_invisibility) if(lurker_invisibility_action && istype(lurker_invisibility_action)) lurker_invisibility_action.invisibility_off() From ab00b8f678a08392f614b06dde857bc2ea1bca8a Mon Sep 17 00:00:00 2001 From: Morrow Date: Wed, 12 Jul 2023 01:22:12 -0400 Subject: [PATCH 4/8] extraneous check begone --- code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm b/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm index a998fe65bbdb..1c8654fb40be 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm @@ -160,5 +160,5 @@ if(bound_xeno && bound_xeno.stealth) var/datum/action/xeno_action/onclick/lurker_invisibility/lurker_invisibility_action = get_xeno_action_by_type(bound_xeno, /datum/action/xeno_action/onclick/lurker_invisibility) - if(lurker_invisibility_action && istype(lurker_invisibility_action)) + if(lurker_invisibility_action) lurker_invisibility_action.invisibility_off() From b9c0e7a92b0e183c13445f6558d4b3f9005a21af Mon Sep 17 00:00:00 2001 From: morrowwolf Date: Tue, 11 Jul 2023 23:27:38 -0600 Subject: [PATCH 5/8] Apply suggestions from code review Co-authored-by: harryob --- .../mob/living/carbon/xenomorph/castes/Lurker.dm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm b/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm index 1c8654fb40be..e03803b78139 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm @@ -158,7 +158,11 @@ if(!ishuman(movable_atom)) return - if(bound_xeno && bound_xeno.stealth) - var/datum/action/xeno_action/onclick/lurker_invisibility/lurker_invisibility_action = get_xeno_action_by_type(bound_xeno, /datum/action/xeno_action/onclick/lurker_invisibility) - if(lurker_invisibility_action) - lurker_invisibility_action.invisibility_off() + if(!bound_xeno || !bound_xeno.stealth) + return + + var/datum/action/xeno_action/onclick/lurker_invisibility/lurker_invisibility_action = get_xeno_action_by_type(bound_xeno, /datum/action/xeno_action/onclick/lurker_invisibility) + if(!lurker_invisibility_action) + return + + lurker_invisibility_action.invisibility_off() From 2459263102f7d735f45da605b2454dbf800389c7 Mon Sep 17 00:00:00 2001 From: morrowwolf Date: Wed, 12 Jul 2023 00:22:04 -0600 Subject: [PATCH 6/8] Update code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm Co-authored-by: BeagleGaming1 <56142455+BeagleGaming1@users.noreply.github.com> --- code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm b/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm index e03803b78139..f584ef3fbc7d 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm @@ -161,7 +161,7 @@ if(!bound_xeno || !bound_xeno.stealth) return - var/datum/action/xeno_action/onclick/lurker_invisibility/lurker_invisibility_action = get_xeno_action_by_type(bound_xeno, /datum/action/xeno_action/onclick/lurker_invisibility) + var/datum/action/xeno_action/onclick/lurker_invisibility/lurker_invisibility_action = get_xeno_action_by_type(bound_xeno, /datum/action/xeno_action/onclick/lurker_invisibility_action) if(!lurker_invisibility_action) return From 59d11d9eb6d64f8dc440cc5222208ae94901768c Mon Sep 17 00:00:00 2001 From: harryob Date: Wed, 12 Jul 2023 08:17:59 +0100 Subject: [PATCH 7/8] sorry morrow :) Co-authored-by: BeagleGaming1 <56142455+BeagleGaming1@users.noreply.github.com> --- code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm b/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm index f584ef3fbc7d..157e051be6c9 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm @@ -161,7 +161,7 @@ if(!bound_xeno || !bound_xeno.stealth) return - var/datum/action/xeno_action/onclick/lurker_invisibility/lurker_invisibility_action = get_xeno_action_by_type(bound_xeno, /datum/action/xeno_action/onclick/lurker_invisibility_action) + var/datum/action/xeno_action/onclick/lurker_invisibility/lurker_invisibility_action = get_xeno_action_by_type(bound_xeno, /datum/action/xeno_action/onclick/lurker_invisibility_action) if(!lurker_invisibility_action) return From f6dd6b4d3147f1457580ba4e9caf66ea551c9562 Mon Sep 17 00:00:00 2001 From: morrowwolf Date: Wed, 12 Jul 2023 16:05:12 -0600 Subject: [PATCH 8/8] Update code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm Co-authored-by: BeagleGaming1 <56142455+BeagleGaming1@users.noreply.github.com> --- code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm b/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm index 157e051be6c9..5010857301e0 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm @@ -161,7 +161,7 @@ if(!bound_xeno || !bound_xeno.stealth) return - var/datum/action/xeno_action/onclick/lurker_invisibility/lurker_invisibility_action = get_xeno_action_by_type(bound_xeno, /datum/action/xeno_action/onclick/lurker_invisibility_action) + var/datum/action/xeno_action/onclick/lurker_invisibility/lurker_invisibility_action = get_xeno_action_by_type(bound_xeno, /datum/action/xeno_action/onclick/lurker_invisibility) if(!lurker_invisibility_action) return