Skip to content

Commit

Permalink
Slight change to idle pathfinding and map
Browse files Browse the repository at this point in the history
  • Loading branch information
morrowwolf committed Oct 12, 2023
1 parent 4777e39 commit 648733e
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,29 @@

/datum/xeno_ai_movement/proc/ai_move_idle(delta_time, game_evaluation)
SHOULD_NOT_SLEEP(TRUE)
var/mob/living/carbon/xenomorph/X = parent
if(X.throwing)
var/mob/living/carbon/xenomorph/idle_xeno = parent
if(idle_xeno.throwing)
return

if(next_home_search < world.time && (!home_turf || !home_turf.weeds || get_dist(home_turf, X) > max_distance_from_home))
var/turf/T = get_turf(X.loc)
if(next_home_search < world.time && (!home_turf || !home_turf.weeds || get_dist(home_turf, idle_xeno) > max_distance_from_home))
var/turf/T = get_turf(idle_xeno.loc)
next_home_search = world.time + home_search_delay
if(T.weeds)
home_turf = T
else
var/shortest_distance = INFINITY
for(var/i in RANGE_TURFS(home_locate_range, T))
var/turf/potential_home = i
if(potential_home.weeds && !potential_home.density && get_dist(X, potential_home) < shortest_distance)
if(potential_home.weeds && !potential_home.density && get_dist(idle_xeno, potential_home) < shortest_distance)
home_turf = potential_home
shortest_distance = get_dist(idle_xeno, potential_home)

if(!home_turf)
return

if(X.move_to_next_turf(home_turf, home_locate_range))
if(get_dist(home_turf, X) <= 0 && !X.resting)
X.lay_down()
if(idle_xeno.move_to_next_turf(home_turf, home_locate_range))
if(get_dist(home_turf, idle_xeno) <= 0 && !idle_xeno.resting)
idle_xeno.lay_down()
else
home_turf = null

Expand Down
66 changes: 30 additions & 36 deletions maps/map_files/golden_arrow/golden_arrow.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,14 @@
dir = 6
},
/area/almayer/living/briefing)
"hZ" = (
/obj/structure/machinery/door/airlock/multi_tile/almayer/generic{
name = "\improper Briefing Room"
},
/turf/open/floor/almayer{
icon_state = "test_floor4"
},
/area/almayer/living/briefing)
"iA" = (
/obj/structure/surface/table/reinforced/almayer_B,
/obj/item/device/flashlight/lamp,
Expand All @@ -217,6 +225,12 @@
icon_state = "plate"
},
/area/almayer/hallways/hangar)
"jV" = (
/obj/structure/pipes/standard/simple/hidden/supply,
/turf/open/floor/almayer{
icon_state = "test_floor4"
},
/area/almayer/living/briefing)
"kB" = (
/turf/closed/wall/almayer/outer,
/area/almayer/living/briefing)
Expand Down Expand Up @@ -354,15 +368,6 @@
icon_state = "plate"
},
/area/almayer/hallways/hangar)
"rI" = (
/obj/structure/bed/chair/comfy/alpha{
dir = 1
},
/obj/structure/pipes/standard/simple/hidden/supply,
/turf/open/floor/almayer{
icon_state = "plate"
},
/area/almayer/living/briefing)
"rM" = (
/obj/structure/cargo_container/wy/mid,
/turf/open/floor/almayer,
Expand Down Expand Up @@ -483,15 +488,6 @@
/obj/structure/cargo_container/arious/right,
/turf/open/floor/almayer,
/area/almayer/hallways/hangar)
"xr" = (
/obj/structure/pipes/standard/simple/hidden/supply,
/obj/structure/machinery/door/firedoor/border_only/almayer{
dir = 2
},
/turf/open/floor/almayer{
icon_state = "test_floor4"
},
/area/almayer/living/briefing)
"yn" = (
/turf/open/floor/almayer{
icon_state = "test_floor4"
Expand Down Expand Up @@ -695,15 +691,10 @@
},
/area/almayer/living/briefing)
"HC" = (
/obj/structure/machinery/door/airlock/multi_tile/almayer/generic{
name = "\improper Briefing Room"
},
/obj/structure/machinery/door/firedoor/border_only/almayer{
dir = 2
},
/turf/open/floor/almayer{
icon_state = "test_floor4"
},
/obj/structure/surface/table/almayer,
/obj/item/paper_bin/uscm,
/obj/item/tool/pen,
/turf/open/floor/almayer,
/area/almayer/living/briefing)
"HH" = (
/obj/structure/machinery/status_display{
Expand Down Expand Up @@ -868,10 +859,13 @@
},
/area/almayer/living/platoon_commander_rooms)
"NO" = (
/obj/structure/surface/table/almayer,
/obj/item/paper_bin/uscm,
/obj/item/tool/pen,
/turf/open/floor/almayer,
/obj/structure/bed/chair/comfy/alpha{
dir = 1
},
/obj/structure/pipes/standard/simple/hidden/supply,
/turf/open/floor/almayer{
icon_state = "plate"
},
/area/almayer/living/briefing)
"OA" = (
/obj/structure/bed/chair/comfy/alpha{
Expand Down Expand Up @@ -12782,7 +12776,7 @@ gs
Ks
Ks
Ks
HC
hZ
Cr
Cr
Cr
Expand Down Expand Up @@ -12934,7 +12928,7 @@ PY
Pr
Pr
Pr
xr
jV
Cr
Cr
Cr
Expand Down Expand Up @@ -13080,8 +13074,8 @@ Ds
OA
OA
Gx
rI
rI
NO
NO
Fl
Ks
Ks
Expand Down Expand Up @@ -13224,7 +13218,7 @@ qA
qA
qA
FN
NO
HC
HJ
Ks
ZR
Expand Down

0 comments on commit 648733e

Please sign in to comment.