Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into apc
Browse files Browse the repository at this point in the history
  • Loading branch information
Doubleumc committed Oct 23, 2023
2 parents 498798c + 8972de9 commit 1cc2df6
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 74 deletions.
86 changes: 44 additions & 42 deletions code/modules/mob/living/carbon/xenomorph/ai/movement/drone.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
if(idle_xeno.throwing)
return

if(idle_xeno.resting)
return

if(home_turf)
if(get_dist(home_turf, idle_xeno) > max_distance_from_home)
home_turf = null
Expand All @@ -38,52 +35,16 @@
if(next_home_search > world.time)
return

var/turf/current_turf = get_turf(idle_xeno.loc)
var/turf/current_turf = get_turf(idle_xeno)
next_home_search = world.time + home_search_delay
if(!current_turf.weeds && current_turf.is_weedable() >= FULLY_WEEDABLE)
if(!current_turf.weeds && check_turf(current_turf))
home_turf = current_turf
else
var/shortest_distance
for(var/turf/potential_home as anything in RANGE_TURFS(home_locate_range, current_turf))

var/area/found_area = get_area(potential_home)
if(found_area.flags_area & AREA_NOTUNNEL)
continue

if(found_area.flags_area & AREA_UNWEEDABLE)
continue

if(!found_area.can_build_special)
continue

if(potential_home in blacklisted_turfs)
continue

if(potential_home.weeds)
continue

if(potential_home.is_weedable() < FULLY_WEEDABLE)
continue

if(locate(/obj/effect/alien/weeds/node) in range(3, potential_home))
continue

if(potential_home.density)
if(!check_turf(potential_home))
continue

var/blocked = FALSE
for(var/atom/potential_blocker as anything in potential_home)
if(potential_blocker.can_block_movement)
blocked = TRUE
break

if(blocked)
continue

for(var/obj/structure/struct in potential_home)
if(struct.density && !(struct.flags_atom & ON_BORDER))
continue

if(shortest_distance && get_dist(idle_xeno, potential_home) > shortest_distance)
continue

Expand All @@ -103,3 +64,44 @@

/datum/xeno_ai_movement/drone/proc/unblacklist_turf(turf/unblacklisting_turf)
blacklisted_turfs -= unblacklisting_turf

/datum/xeno_ai_movement/drone/proc/check_turf(turf/checked_turf)
var/area/found_area = get_area(checked_turf)
if(found_area.flags_area & AREA_NOTUNNEL)
return FALSE

if(found_area.flags_area & AREA_UNWEEDABLE)
return FALSE

if(!found_area.can_build_special)
return FALSE

if(checked_turf in blacklisted_turfs)
return FALSE

if(checked_turf.weeds)
return FALSE

if(checked_turf.is_weedable() < FULLY_WEEDABLE)
return FALSE

if(locate(/obj/effect/alien/weeds/node) in range(3, checked_turf))
return FALSE

if(checked_turf.density)
return FALSE

var/blocked = FALSE
for(var/atom/potential_blocker as anything in checked_turf)
if(potential_blocker.can_block_movement)
blocked = TRUE
break

if(blocked)
return FALSE

for(var/obj/structure/struct in checked_turf)
if(struct.density && !(struct.flags_atom & ON_BORDER))
return FALSE

return TRUE
51 changes: 19 additions & 32 deletions maps/map_files/golden_arrow/golden_arrow.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,14 @@
},
/area/almayer/hallways/hangar)
"bg" = (
/obj/structure/largecrate/supply/supplies/sandbags,
/obj/structure/machinery/light{
dir = 1
},
/obj/structure/closet/crate/construction,
/obj/item/stack/sandbags_empty/half,
/obj/item/stack/sandbags_empty/half,
/obj/item/stack/sandbags_empty/half,
/obj/item/stack/sandbags_empty/half,
/turf/open/floor/almayer{
icon_state = "cargo"
},
Expand Down Expand Up @@ -3122,8 +3126,6 @@
/obj/structure/closet/secure_closet/personal/cabinet{
req_access = null
},
/obj/item/clothing/suit/storage/jacket/marine/service/tanker,
/obj/item/clothing/suit/storage/jacket/marine/service,
/turf/open/floor/almayer{
icon_state = "plate"
},
Expand Down Expand Up @@ -3385,10 +3387,10 @@
/turf/closed/wall/almayer,
/area/almayer/living/platoon_commander_rooms)
"vc" = (
/obj/structure/closet/radiation,
/obj/structure/machinery/light{
dir = 1
},
/obj/structure/closet/emcloset,
/turf/open/floor/almayer{
icon_state = "test_floor5"
},
Expand Down Expand Up @@ -3640,6 +3642,10 @@
/obj/structure/pipes/standard/simple/hidden/supply{
dir = 8
},
/obj/item/device/walkman{
pixel_y = -6;
pixel_x = 4
},
/turf/open/floor/almayer{
dir = 5;
icon_state = "plating"
Expand Down Expand Up @@ -4347,10 +4353,6 @@
name = "Damage Control Locker";
req_one_access = list()
},
/obj/structure/machinery/door/airlock/multi_tile/almayer/engidoor{
name = "\improper Damage Control Locker";
req_one_access = list()
},
/turf/open/floor/almayer{
icon_state = "test_floor4"
},
Expand Down Expand Up @@ -5425,6 +5427,7 @@
"Hx" = (
/obj/structure/closet/secure_closet/engineering_personal,
/obj/structure/machinery/light,
/obj/item/device/cassette_tape/aesthetic,
/turf/open/floor/almayer{
icon_state = "test_floor5"
},
Expand Down Expand Up @@ -5565,15 +5568,6 @@
},
/turf/open/floor/plating/plating_catwalk,
/area/almayer/squads/alpha/squad_two)
"IN" = (
/obj/structure/closet/toolcloset,
/obj/structure/machinery/light{
dir = 1
},
/turf/open/floor/almayer{
icon_state = "plate"
},
/area/almayer/engineering)
"IP" = (
/turf/open/floor/plating/plating_catwalk,
/area/almayer/engineering)
Expand Down Expand Up @@ -6419,7 +6413,7 @@
},
/area/almayer/living/cryo_cells)
"NZ" = (
/obj/structure/closet/radiation,
/obj/structure/closet/secure_closet/engineering_electrical,
/turf/open/floor/almayer{
icon_state = "test_floor5"
},
Expand Down Expand Up @@ -6487,6 +6481,9 @@
"OC" = (
/obj/structure/surface/table/reinforced/almayer_B,
/obj/structure/machinery/light,
/obj/item/device/cassette_tape/pop3{
pixel_y = 3
},
/turf/open/floor/almayer{
icon_state = "plate"
},
Expand Down Expand Up @@ -6895,10 +6892,10 @@
/turf/open/floor/plating/plating_catwalk,
/area/almayer/living/cryo_cells)
"Qz" = (
/obj/structure/closet/radiation,
/obj/structure/machinery/status_display{
pixel_y = 30
},
/obj/structure/closet/firecloset/full,
/turf/open/floor/almayer{
icon_state = "test_floor5"
},
Expand Down Expand Up @@ -7772,15 +7769,6 @@
},
/turf/open/floor/plating/plating_catwalk,
/area/almayer/living/grunt_rnr)
"UR" = (
/obj/structure/pipes/standard/simple/hidden/supply{
dir = 8
},
/turf/open/floor/almayer{
dir = 5;
icon_state = "plating"
},
/area/almayer/engineering)
"UT" = (
/obj/structure/machinery/disposal{
density = 0;
Expand Down Expand Up @@ -8251,12 +8239,11 @@
},
/area/almayer/engineering)
"XP" = (
/obj/effect/decal/cleanable/greenglow,
/obj/structure/reagent_dispensers/fueltank/custom,
/obj/structure/sign/safety/storage{
pixel_x = 7;
pixel_y = -28
},
/obj/structure/reagent_dispensers/ammoniatank,
/turf/open/floor/almayer{
icon_state = "plate"
},
Expand Down Expand Up @@ -21750,7 +21737,7 @@ DC
RW
mZ
TN
IN
CX
IP
gf
Bd
Expand Down Expand Up @@ -22668,7 +22655,7 @@ fm
fm
fm
TN
UR
yc
Sn
Vq
YB
Expand Down

0 comments on commit 1cc2df6

Please sign in to comment.