Skip to content

Commit

Permalink
Lurkers hiding on structures and minor xeno interactions tweaks (#54)
Browse files Browse the repository at this point in the history
Co-authored-by: morrowwolf <[email protected]>
  • Loading branch information
xDanilcusx and morrowwolf committed Jan 15, 2024
1 parent a5ab856 commit 0551232
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 7 deletions.
36 changes: 30 additions & 6 deletions code/modules/mob/living/carbon/xenomorph/ai/movement/lurking.dm
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,38 @@
continue

var/blocked = FALSE
for(var/atom/potential_blocker as anything in potential_home)
if(potential_blocker != idle_xeno && (potential_blocker.can_block_movement || potential_blocker.density))
for(var/obj/structure/potential_blocker in potential_home)
if(potential_blocker.unslashable && potential_blocker.can_block_movement && potential_blocker.density)
blocked = TRUE
break

for(var/mob/potential_blocker in potential_home)
if(potential_blocker != idle_xeno && potential_blocker.can_block_movement && potential_blocker.density)
blocked = TRUE
break

if(blocked)
continue

var/preferred = FALSE
for(var/obj/structure/structure in potential_home)
if(structure.unslashable && structure.can_block_movement && structure.density)
continue

if(structure.invisibility == 101)
continue

preferred = TRUE
break

for(var/turf/closed/touching_turf in orange(1, potential_home))
if(get_dir(potential_home, touching_turf) in diagonals)
continue

preferred = TRUE
break

for(var/obj/item/stack/sheet/sheet in potential_home)
preferred = TRUE
break

Expand Down Expand Up @@ -194,12 +216,14 @@
#undef LURKER_BAITS_BEFORE_AMBUSH

/datum/xeno_ai_movement/linger/lurking/proc/interact_random(mob/living/carbon/xenomorph/X)
for(var/obj/potential_interaction in orange(1, X))
if(istype(potential_interaction, /obj/structure/window_frame))
for(var/atom/potential_interaction in orange(1, X))
if(istype(potential_interaction, /obj/structure/shuttle))
continue
if(istype(potential_interaction, /turf/closed/shuttle))
continue
if(istype(potential_interaction, /obj/structure/pipes))
if(istype(potential_interaction, /obj/effect))
continue
if(istype(potential_interaction, /obj/structure/sign))
if(istype(potential_interaction, /turf/open))
continue
if(!potential_interaction.xeno_ai_act(X))
continue
Expand Down
5 changes: 5 additions & 0 deletions code/modules/mob/living/carbon/xenomorph/attack_alien.dm
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,10 @@

. = XENO_NO_DELAY_ACTION

if(M.action_busy)
to_chat(M, SPAN_WARNING("You are already doing something!"))
return

if(M.claw_type >= CLAW_TYPE_SHARP)
M.animation_attack_on(src)
playsound(src, 'sound/effects/metalhit.ogg', 25, 1)
Expand Down Expand Up @@ -934,6 +938,7 @@
M.visible_message(SPAN_DANGER("[M] smashes [src] beyond recognition!"), \
SPAN_DANGER("You enter a frenzy and smash [src] apart!"), null, 5, CHAT_TYPE_XENO_COMBAT)
malfunction()
tip_over()
else
M.visible_message(SPAN_DANGER("[M] [M.slashes_verb] [src]!"), \
SPAN_DANGER("You [M.slash_verb] [src]!"), null, 5, CHAT_TYPE_XENO_COMBAT)
Expand Down
1 change: 1 addition & 0 deletions code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
icon_xeno = 'icons/mob/xenos/lurker.dmi'
icon_xenonid = 'icons/mob/xenonids/lurker.dmi'

forced_retarget_time = (2 SECONDS)
var/pull_direction

/mob/living/carbon/xenomorph/lurker/launch_towards(datum/launch_metadata/LM)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,19 @@ At bare minimum, make sure the relevant checks from parent types gets copied in
return OBJECT_PENALTY

/obj/structure/xeno_ai_act(mob/living/carbon/xenomorph/X)
if(unslashable)
if(unslashable || indestructible || (climbable && islurker(X)))
if(!X.action_busy)
do_climb(X)
return

return ..()

/obj/structure/machinery/xeno_ai_act(mob/living/carbon/xenomorph/X)
if(stat & TIPPED_OVER)
return

return ..()

// MINERAL DOOR
/obj/structure/mineral_door/xeno_ai_obstacle(mob/living/carbon/xenomorph/X, direction, turf/target)
return DOOR_PENALTY
Expand Down

0 comments on commit 0551232

Please sign in to comment.