Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AI door interactions fixed #381

Merged
merged 2 commits into from
Aug 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions code/__DEFINES/xeno_ai.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions code/game/machinery/doors/shutters.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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))
Expand Down
25 changes: 18 additions & 7 deletions code/modules/mob/living/carbon/xenomorph/xeno_ai_interaction.dm
Original file line number Diff line number Diff line change
Expand Up @@ -76,21 +76,32 @@ 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)
. = ..()
if(!.)
return
return INFINITY

if(unacidable)
return INFINITY

if(!(stat & NOPOWER))
return
return INFINITY

return DOOR_PENALTY

if(operating)
return

/////////////////////////////
// SHUTTERS //
/////////////////////////////
/obj/structure/machinery/door/poddoor/shutters/xeno_ai_obstacle(mob/living/carbon/xenomorph/X, direction, turf/target)
. = ..()
if(!.)
return INFINITY

if(unacidable)
return
return INFINITY

return DOOR_PENALTY

Expand All @@ -104,7 +115,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!
Expand Down
Loading