Skip to content

Commit

Permalink
small changes and queue assigning tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
xDanilcusx committed Nov 25, 2023
1 parent 4b91ef1 commit d898b13
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
4 changes: 2 additions & 2 deletions code/__DEFINES/xeno_ai.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ PROBABILITY CALCULATIONS ARE HERE

#define XENO_DOOR_BUILDING_CHANCE 25

#define PLASMA_RETREAT_PERCENTAGE 20
#define HEALTH_RETREAT_PERCENTAGE 40
#define PLASMA_RETREAT_PERCENTAGE 10
#define HEALTH_RETREAT_PERCENTAGE 20

#define LURKING_IGNORE_SHOT_CHANCE 75

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,11 @@
return FALSE

if(checked_xeno.get_plasma_percentage() < PLASMA_RETREAT_PERCENTAGE)
var/atom/xeno_loc = checked_xeno.loc
if(xeno_loc?.weeds)
checked_xeno.resting = TRUE
var/turf/xeno_loc = get_turf(checked_xeno)
if(xeno_loc.weeds && !checked_xeno.resting)
currently_assigned -= checked_xeno
checked_xeno.lay_down()

return FALSE

return TRUE
Expand All @@ -59,9 +61,9 @@

processing_xeno.resting = FALSE

var/atom/xeno_loc = processing_xeno.loc
if(xeno_loc?.density) // imagine putting droney in a bag
return FALSE
var/turf/xeno_loc = get_turf(processing_xeno)
if(xeno_loc.density)
return FALSE // We shouldn't stand in a wall, let's act default

var/turf/parent_turf = get_turf(parent)

Expand All @@ -82,19 +84,19 @@
var/list/resin_types = processing_xeno.resin_build_order
processing_xeno.selected_resin = locate(/datum/resin_construction/resin_turf/wall) in resin_types

var/walls = 0
var/wall_nearby
var/blocked_turfs = 0
for(var/turf/blocked_turf in orange(1, parent_turf) - parent_turf.AdjacentTurfs())
if(get_dir(blocked_turf, parent_turf) in diagonals)
continue

if(blocked_turf.density)
walls++
wall_nearby = TRUE

blocked_turfs++

if(blocked_turfs)
if(prob(XENO_DOOR_BUILDING_CHANCE) || (walls && blocked_turfs == 2))
if(prob(XENO_DOOR_BUILDING_CHANCE) || (wall_nearby && blocked_turfs == 2))
processing_xeno.selected_resin = locate(/datum/resin_construction/resin_obj/door) in resin_types

var/datum/action/xeno_action/activable/secrete_resin/build_action = locate() in processing_xeno.actions
Expand Down

0 comments on commit d898b13

Please sign in to comment.