From 99363baa3e0f4d422a26201d2ad2ae0148b4657b Mon Sep 17 00:00:00 2001 From: xDanilcusx Date: Wed, 20 Mar 2024 16:16:52 +0300 Subject: [PATCH 1/4] xeno resting shouldn't be instant in this case --- .../mob/living/carbon/xenomorph/ai/movement/base_define.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/living/carbon/xenomorph/ai/movement/base_define.dm b/code/modules/mob/living/carbon/xenomorph/ai/movement/base_define.dm index 172461bfce..4eaff010c2 100644 --- a/code/modules/mob/living/carbon/xenomorph/ai/movement/base_define.dm +++ b/code/modules/mob/living/carbon/xenomorph/ai/movement/base_define.dm @@ -45,7 +45,7 @@ if(idle_xeno.move_to_next_turf(home_turf, home_locate_range)) if(get_dist(home_turf, idle_xeno) <= 0) - idle_xeno.set_resting(TRUE, FALSE, TRUE) + idle_xeno.set_resting(TRUE, FALSE) else home_turf = null From 6de39dd32174cf3ddc07eada794876597f6d7d6d Mon Sep 17 00:00:00 2001 From: xDanilcusx Date: Thu, 21 Mar 2024 01:09:19 +0300 Subject: [PATCH 2/4] Xeno AI interactions: tweaks and additions --- code/__DEFINES/xeno_ai.dm | 8 ++-- code/game/machinery/doors/poddoor.dm | 6 --- .../carbon/xenomorph/xeno_ai_interaction.dm | 48 +++++++++++++++---- 3 files changed, 44 insertions(+), 18 deletions(-) diff --git a/code/__DEFINES/xeno_ai.dm b/code/__DEFINES/xeno_ai.dm index a132aa28ed..52bb4f0c91 100644 --- a/code/__DEFINES/xeno_ai.dm +++ b/code/__DEFINES/xeno_ai.dm @@ -7,15 +7,15 @@ #define OPEN_TURF_PENALTY 1 #define DOOR_PENALTY 3 -#define OBJECT_PENALTY 20 #define HUMAN_PENALTY 4 #define XENO_PENALTY 20 -#define VEHICLE_PENALTY 25 +#define OBJECT_PENALTY 20 +#define FIRE_PENALTY 25 #define SENTRY_PENALTY 25 +#define VEHICLE_PENALTY 25 #define WINDOW_FRAME_PENALTY 25 #define BARRICADE_PENALTY 50 #define WALL_PENALTY 50 -#define FIRE_PENALTY 25 /* PROBABILITY CALCULATIONS ARE HERE @@ -90,7 +90,7 @@ PROBABILITY CALCULATIONS ARE HERE /// Special blockers for pathfinding or obstacle handling -#define XENO_AI_SPECIAL_BLOCKERS list(/obj/flamer_fire, /obj/vehicle/multitile, /turf/open/space) +#define XENO_AI_SPECIAL_BLOCKERS list(/obj/flamer_fire, /obj/vehicle/multitile, /turf/open/space, /turf/open/gm/river) // Friend-or-foe universal check #define IS_SAME_HIVENUMBER(A,B) (A.hivenumber == B.hivenumber) diff --git a/code/game/machinery/doors/poddoor.dm b/code/game/machinery/doors/poddoor.dm index a4455a988a..562a589c78 100644 --- a/code/game/machinery/doors/poddoor.dm +++ b/code/game/machinery/doors/poddoor.dm @@ -7,7 +7,6 @@ var/base_icon_state = "pdoor" id = 1 dir = NORTH - unslashable = TRUE health = 0 layer = PODDOOR_CLOSED_LAYER open_layer = PODDOOR_OPEN_LAYER @@ -253,13 +252,11 @@ name = "" icon = null icon_state = "" - unslashable = TRUE unacidable = TRUE /obj/structure/machinery/door/poddoor/two_tile/four_tile/secure icon = 'icons/obj/structures/doors/1x4blast_hor_secure.dmi' openspeed = 17 - unslashable = TRUE unacidable = TRUE /obj/structure/machinery/door/poddoor/two_tile/four_tile/secure/opened @@ -268,7 +265,6 @@ /obj/structure/machinery/door/poddoor/two_tile/four_tile/vertical/secure icon = 'icons/obj/structures/doors/1x4blast_vert_secure.dmi' openspeed = 17 - unslashable = TRUE unacidable = TRUE /obj/structure/machinery/door/poddoor/two_tile/four_tile/vertical/secure/open @@ -286,7 +282,6 @@ /obj/structure/machinery/door/poddoor/two_tile/secure icon = 'icons/obj/structures/doors/1x2blast_hor.dmi' openspeed = 17 - unslashable = TRUE unacidable = TRUE /obj/structure/machinery/door/poddoor/two_tile/vertical/secure @@ -325,7 +320,6 @@ addtimer(CALLBACK(src, TYPE_PROC_REF(/atom, relativewall_neighbours)), 10) /obj/structure/machinery/door/poddoor/almayer/locked - unslashable = TRUE unacidable = TRUE /obj/structure/machinery/door/poddoor/almayer/locked/attackby(obj/item/C as obj, mob/user as mob) 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 58021c2ab2..fb5c551686 100644 --- a/code/modules/mob/living/carbon/xenomorph/xeno_ai_interaction.dm +++ b/code/modules/mob/living/carbon/xenomorph/xeno_ai_interaction.dm @@ -122,6 +122,7 @@ At bare minimum, make sure the relevant checks from parent types gets copied in return + ///////////////////////////// // MOBS // ///////////////////////////// @@ -218,7 +219,7 @@ At bare minimum, make sure the relevant checks from parent types gets copied in if(!.) return - return VEHICLE_PENALTY + return SENTRY_PENALTY ///////////////////////////// @@ -229,13 +230,6 @@ At bare minimum, make sure the relevant checks from parent types gets copied in return ..() return WINDOW_FRAME_PENALTY -/obj/structure/barricade/handrail/xeno_ai_obstacle(mob/living/carbon/xenomorph/X, direction, turf/target) - . = ..() - if(!.) - return - - return DOOR_PENALTY - ///////////////////////////// // BARRICADES // @@ -247,6 +241,13 @@ At bare minimum, make sure the relevant checks from parent types gets copied in return BARRICADE_PENALTY +/obj/structure/barricade/handrail/xeno_ai_obstacle(mob/living/carbon/xenomorph/X, direction, turf/target) + . = ..() + if(!.) + return + + return DOOR_PENALTY + ///////////////////////////// // FIRE // @@ -258,6 +259,17 @@ At bare minimum, make sure the relevant checks from parent types gets copied in return FIRE_PENALTY +///////////////////////////// +// WALLS // +///////////////////////////// +/turf/closed/wall/resin/xeno_ai_obstacle(mob/living/carbon/xenomorph/xeno, direction, turf/target) + . = ..() + if(!.) + return + + return WALL_PENALTY + + ///////////////////////////// // FLOOR // ///////////////////////////// @@ -272,6 +284,11 @@ At bare minimum, make sure the relevant checks from parent types gets copied in return OPEN_TURF_PENALTY +/// For now there is no attack_alien() proc overrides on any child of /turf/open +/// Also, we don't want xenos swiping all around - forbit the clicking! +/turf/open/xeno_ai_act(mob/living/carbon/xenomorph/X) + return FALSE + /// Space, do NOT path into space. /turf/open/space/xeno_ai_obstacle(mob/living/carbon/xenomorph/X, direction, turf/target) . = ..() @@ -279,3 +296,18 @@ At bare minimum, make sure the relevant checks from parent types gets copied in return return INFINITY + + +///////////////////////////// +// RIVER // +///////////////////////////// +/turf/open/gm/river/xeno_ai_obstacle(mob/living/carbon/xenomorph/X, direction, turf/target) + . = ..() + if(!. && !covered) + . *= base_river_slowdown + +/turf/open/gm/river/desert/xeno_ai_obstacle(mob/living/carbon/xenomorph/X, direction, turf/target) + if(toxic && !covered) + return FIRE_PENALTY + + return ..() From 5762da0270491f04aece3df0e6a70709fae012e7 Mon Sep 17 00:00:00 2001 From: xDanilcusx Date: Thu, 21 Mar 2024 01:10:53 +0300 Subject: [PATCH 3/4] check_special_blockers() typecheck fix --- code/controllers/subsystem/pathfinding.dm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/code/controllers/subsystem/pathfinding.dm b/code/controllers/subsystem/pathfinding.dm index dfd66ae201..05301a4191 100644 --- a/code/controllers/subsystem/pathfinding.dm +++ b/code/controllers/subsystem/pathfinding.dm @@ -129,10 +129,11 @@ SUBSYSTEM_DEF(xeno_pathfinding) /datum/controller/subsystem/xeno_pathfinding/proc/check_special_blockers(mob/living/carbon/xenomorph/xeno, turf/checking_turf) var/list/pass_back = list() - pass_back += (checking_turf.type in XENO_AI_SPECIAL_BLOCKERS) ? checking_turf : list() + for(var/spec_blocker in XENO_AI_SPECIAL_BLOCKERS) + pass_back += istype(checking_turf, spec_blocker) ? checking_turf : list() - for(var/atom/checked_atom as anything in checking_turf) - pass_back += (checked_atom.type in XENO_AI_SPECIAL_BLOCKERS) ? checked_atom : list() + for(var/atom/checked_atom as anything in checking_turf) + pass_back += istype(checked_atom, spec_blocker) ? checked_atom : list() return pass_back From c090977ad014e14cd2eef66f7f43abf884b1868c Mon Sep 17 00:00:00 2001 From: xDanilcusx Date: Fri, 22 Mar 2024 00:24:00 +0300 Subject: [PATCH 4/4] minor tweak for river obstacles --- .../mob/living/carbon/xenomorph/xeno_ai_interaction.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 fb5c551686..177cd07433 100644 --- a/code/modules/mob/living/carbon/xenomorph/xeno_ai_interaction.dm +++ b/code/modules/mob/living/carbon/xenomorph/xeno_ai_interaction.dm @@ -303,8 +303,8 @@ At bare minimum, make sure the relevant checks from parent types gets copied in ///////////////////////////// /turf/open/gm/river/xeno_ai_obstacle(mob/living/carbon/xenomorph/X, direction, turf/target) . = ..() - if(!. && !covered) - . *= base_river_slowdown + if(. && !covered) + . += base_river_slowdown /turf/open/gm/river/desert/xeno_ai_obstacle(mob/living/carbon/xenomorph/X, direction, turf/target) if(toxic && !covered)