From d1d35962248e7bd661483fd1dde788b2e0c21f68 Mon Sep 17 00:00:00 2001 From: xDanilcusx Date: Thu, 15 Aug 2024 17:40:32 +0300 Subject: [PATCH 1/2] AI door interactions fixed --- code/__DEFINES/xeno_ai.dm | 1 + code/game/machinery/doors/poddoor.dm | 2 +- .../living/carbon/xenomorph/xeno_ai_interaction.dm | 12 +++--------- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/code/__DEFINES/xeno_ai.dm b/code/__DEFINES/xeno_ai.dm index 9095f56ad9..d7cbe1bf22 100644 --- a/code/__DEFINES/xeno_ai.dm +++ b/code/__DEFINES/xeno_ai.dm @@ -13,6 +13,7 @@ #define FIRE_PENALTY 25 #define SENTRY_PENALTY 25 #define VEHICLE_PENALTY 25 +#define LOCKED_DOOR_PENALTY 25 #define WINDOW_FRAME_PENALTY 25 #define BARRICADE_PENALTY 50 #define WALL_PENALTY 100 diff --git a/code/game/machinery/doors/poddoor.dm b/code/game/machinery/doors/poddoor.dm index 562a589c78..a348feae0c 100644 --- a/code/game/machinery/doors/poddoor.dm +++ b/code/game/machinery/doors/poddoor.dm @@ -49,7 +49,7 @@ operating = 0 /obj/structure/machinery/door/poddoor/attack_alien(mob/living/carbon/xenomorph/X) - if((stat & NOPOWER) && density && !operating && !unacidable) + if(density && !operating && !unacidable) INVOKE_ASYNC(src, PROC_REF(pry_open), X) return XENO_ATTACK_ACTION diff --git a/code/modules/mob/living/carbon/xenomorph/xeno_ai_interaction.dm b/code/modules/mob/living/carbon/xenomorph/xeno_ai_interaction.dm index 177cd07433..79dea446ca 100644 --- a/code/modules/mob/living/carbon/xenomorph/xeno_ai_interaction.dm +++ b/code/modules/mob/living/carbon/xenomorph/xeno_ai_interaction.dm @@ -81,16 +81,10 @@ At bare minimum, make sure the relevant checks from parent types gets copied in /obj/structure/machinery/door/poddoor/xeno_ai_obstacle(mob/living/carbon/xenomorph/X, direction, turf/target) . = ..() if(!.) - return - - if(!(stat & NOPOWER)) - return - - if(operating) - return + return INFINITY if(unacidable) - return + return INFINITY return DOOR_PENALTY @@ -104,7 +98,7 @@ At bare minimum, make sure the relevant checks from parent types gets copied in return if(locked || welded || isElectrified()) - return INFINITY + return LOCKED_DOOR_PENALTY if(isfacehugger(X)) return -1 // We LOVE going under doors! From e3bf390ef7a609b53ff06a54818bb079d522063b Mon Sep 17 00:00:00 2001 From: xDanilcusx Date: Thu, 15 Aug 2024 19:47:09 +0300 Subject: [PATCH 2/2] Shutters interaction fixed --- code/game/machinery/doors/poddoor.dm | 2 +- code/game/machinery/doors/shutters.dm | 14 +++++++------- .../carbon/xenomorph/xeno_ai_interaction.dm | 19 ++++++++++++++++++- 3 files changed, 26 insertions(+), 9 deletions(-) diff --git a/code/game/machinery/doors/poddoor.dm b/code/game/machinery/doors/poddoor.dm index a348feae0c..562a589c78 100644 --- a/code/game/machinery/doors/poddoor.dm +++ b/code/game/machinery/doors/poddoor.dm @@ -49,7 +49,7 @@ operating = 0 /obj/structure/machinery/door/poddoor/attack_alien(mob/living/carbon/xenomorph/X) - if(density && !operating && !unacidable) + if((stat & NOPOWER) && density && !operating && !unacidable) INVOKE_ASYNC(src, PROC_REF(pry_open), X) return XENO_ATTACK_ACTION diff --git a/code/game/machinery/doors/shutters.dm b/code/game/machinery/doors/shutters.dm index da904f255c..4c9b7beb21 100644 --- a/code/game/machinery/doors/shutters.dm +++ b/code/game/machinery/doors/shutters.dm @@ -72,6 +72,13 @@ /obj/structure/machinery/door/poddoor/shutters/finish_close() operating = FALSE +/obj/structure/machinery/door/poddoor/shutters/attack_alien(mob/living/carbon/xenomorph/M) + if(density && !operating) + INVOKE_ASYNC(src, PROC_REF(pry_open), M) + return XENO_ATTACK_ACTION + else + . = ..(M) + /obj/structure/machinery/door/poddoor/shutters/almayer icon = 'icons/obj/structures/doors/blastdoors_shutters.dmi' openspeed = 4 //shorter open animation. @@ -101,13 +108,6 @@ /obj/structure/machinery/door/poddoor/shutters/almayer/containment unacidable = TRUE -/obj/structure/machinery/door/poddoor/shutters/almayer/containment/attack_alien(mob/living/carbon/xenomorph/M) - if(isqueen(M) && density && !operating) - INVOKE_ASYNC(src, PROC_REF(pry_open), M) - return XENO_ATTACK_ACTION - else - . = ..(M) - /obj/structure/machinery/door/poddoor/shutters/almayer/containment/pry_open(mob/living/carbon/xenomorph/X, time = 4 SECONDS) . = ..() if(. && !(stat & BROKEN)) diff --git a/code/modules/mob/living/carbon/xenomorph/xeno_ai_interaction.dm b/code/modules/mob/living/carbon/xenomorph/xeno_ai_interaction.dm index 79dea446ca..40e20fc06f 100644 --- a/code/modules/mob/living/carbon/xenomorph/xeno_ai_interaction.dm +++ b/code/modules/mob/living/carbon/xenomorph/xeno_ai_interaction.dm @@ -76,7 +76,7 @@ At bare minimum, make sure the relevant checks from parent types gets copied in ///////////////////////////// -// Poddoors/shutters // +// PODDDOORS // ///////////////////////////// /obj/structure/machinery/door/poddoor/xeno_ai_obstacle(mob/living/carbon/xenomorph/X, direction, turf/target) . = ..() @@ -86,6 +86,23 @@ At bare minimum, make sure the relevant checks from parent types gets copied in if(unacidable) return INFINITY + if(!(stat & NOPOWER)) + return INFINITY + + return DOOR_PENALTY + + +///////////////////////////// +// SHUTTERS // +///////////////////////////// +/obj/structure/machinery/door/poddoor/shutters/xeno_ai_obstacle(mob/living/carbon/xenomorph/X, direction, turf/target) + . = ..() + if(!.) + return INFINITY + + if(unacidable) + return INFINITY + return DOOR_PENALTY