From 086b8b33380d77d0db75a4e1ab8b8d14f0c377cf Mon Sep 17 00:00:00 2001 From: Morrow Date: Mon, 30 Oct 2023 08:59:19 -0400 Subject: [PATCH] blah --- .../kidnap_override_behavior.dm | 56 +++++++++++++++++++ .../mob/living/carbon/xenomorph/ai/xeno_ai.dm | 21 ------- colonialmarines.dme | 1 + 3 files changed, 57 insertions(+), 21 deletions(-) create mode 100644 code/datums/components/xeno/ai_behavior_overrides/kidnap_override_behavior.dm diff --git a/code/datums/components/xeno/ai_behavior_overrides/kidnap_override_behavior.dm b/code/datums/components/xeno/ai_behavior_overrides/kidnap_override_behavior.dm new file mode 100644 index 0000000000..28cf660bd3 --- /dev/null +++ b/code/datums/components/xeno/ai_behavior_overrides/kidnap_override_behavior.dm @@ -0,0 +1,56 @@ + +/datum/component/ai_behavior_override/kidnap + +/datum/component/ai_behavior_override/kidnap/Initialize(...) + . = ..() + + if(!istype(parent, /mob)) + return COMPONENT_INCOMPATIBLE + +/datum/component/ai_behavior_override/kidnap/check_behavior_validity(mob/living/carbon/xenomorph/checked_xeno, distance) + . = ..() + + if(distance > 10) // Probably want checks like if(!target) and not already pulling someone and such + return FALSE + + return TRUE + +/datum/component/ai_behavior_override/kidnap/process_override_behavior(mob/living/carbon/xenomorph/processing_xeno, delta_time) + . = ..() + +/* + if(get_active_hand()) + swap_hand() + + if(stat_check && GLOB.xeno_kidnapping) + if(pulling) + if(ai_move_hive(delta_time)) + return TRUE + + if(isxeno(current_target.pulledby) || HAS_TRAIT(current_target, TRAIT_NESTED)) + current_target = null + ai_move_idle(delta_time) + return TRUE + + if(get_dist(current_target, src) <= 1) + INVOKE_ASYNC(src, PROC_REF(start_pulling), current_target) + face_atom(current_target) + swap_hand() + + ai_move_target(delta_time) + return TRUE + + return FALSE +*/ + +/* +This is where we do our target setting and such, instead of moving in here:. +If pulling our target should be the hive landmark so we just keep pulling all the way there +If in certain range of hive landmark and are pulling we try to find a wall to place the person + +If we are not pulling we want to set target to the parent of this component so we walk towards the person +If distance <= 1 we start pulling + +As a note you'll likely need to implement some sort of "target stat_check bypass" variable so we don't get our target cleaned up when he's unconscious + +*/ diff --git a/code/modules/mob/living/carbon/xenomorph/ai/xeno_ai.dm b/code/modules/mob/living/carbon/xenomorph/ai/xeno_ai.dm index 713eb75446..a6e264a11c 100644 --- a/code/modules/mob/living/carbon/xenomorph/ai/xeno_ai.dm +++ b/code/modules/mob/living/carbon/xenomorph/ai/xeno_ai.dm @@ -90,27 +90,6 @@ GLOBAL_LIST_INIT(ai_target_limbs, list( a_intent = INTENT_HARM - if(get_active_hand()) - swap_hand() - - if(stat_check && GLOB.xeno_kidnapping) - if(pulling) - if(ai_move_hive(delta_time)) - return TRUE - - if(isxeno(current_target.pulledby) || HAS_TRAIT(current_target, TRAIT_NESTED)) - current_target = null - ai_move_idle(delta_time) - return TRUE - - if(get_dist(current_target, src) <= 1) - INVOKE_ASYNC(src, PROC_REF(start_pulling), current_target) - face_atom(current_target) - swap_hand() - - ai_move_target(delta_time) - return TRUE - if(!current_target) ai_move_idle(delta_time) return TRUE diff --git a/colonialmarines.dme b/colonialmarines.dme index 0b9386d4fe..38429bff9f 100644 --- a/colonialmarines.dme +++ b/colonialmarines.dme @@ -400,6 +400,7 @@ #include "code\datums\components\xeno\shield_slash.dm" #include "code\datums\components\xeno\ai_behavior_overrides\attack_override_behavior.dm" #include "code\datums\components\xeno\ai_behavior_overrides\base_override_behavior.dm" +#include "code\datums\components\xeno\ai_behavior_overrides\kidnap_override_behavior.dm" #include "code\datums\construction\construction_template.dm" #include "code\datums\construction\xenomorph\construction_template_xenomorph.dm" #include "code\datums\decorators\decorator.dm"