Module necro.game.enemy.ai.AI

Functions

classic.FLEE_8WAY ()
classic.SEEK_8WAY ()
classic.SEEK_DIAGONAL ()
classic.SEEK_ORTHOGONAL ()
getAction (entity, target)
getChargeDirection (entity, maxDistance, usePrevPos, directions, mask)
getCollisionMask (entity)
tryMoves (entity, moves, mask, fallbackMask) Try to find an unblocked movement, defaulting to the first move (or IDLE if specified)

Tables

Type
allDirections
defaultMovementMap
diagonals
orthogonals


Functions

classic.FLEE_8WAY ()
classic.SEEK_8WAY ()
classic.SEEK_DIAGONAL ()
classic.SEEK_ORTHOGONAL ()
getAction (entity, target)

Parameters:

  • entity
  • target
getChargeDirection (entity, maxDistance, usePrevPos, directions, mask)

Parameters:

  • entity
  • maxDistance
  • usePrevPos
  • directions
  • mask
getCollisionMask (entity)

Parameters:

  • entity
tryMoves (entity, moves, mask, fallbackMask)
Try to find an unblocked movement, defaulting to the first move (or IDLE if specified)

Parameters:

  • entity
  • moves
  • mask
  • fallbackMask

Tables

Type

Fields:

  • IDLE 0 - - Generic AIs No movement
  • LINEAR 1 - Always move forward (in the current facing direction)
  • PATTERN 2 - Perform a repeating sequence of movements, advancing only on success
  • RANDOM 3 - Move in a random non-blocked direction
  • FLEE 4 - Maximize L2 distance with the AI target
  • SEEK 5 - Minimize L1 distance with the AI target, prefer moving on ties
  • SEEK_LAZY 6 - Minimize L1 distance with the AI target, prefer standing still on ties
  • SEEK_BIASED 7 - Move towards the AI target orthogonally, preferring to move along the same axis for as long as possible
  • CLONE 8 - - Enemy-specific AIs Copy movements of the AI target, inverted
  • GO_HOME 9 - Move towards the AI home tile orthogonally
  • LIQUID_SEEK 10 - Move towards the AI target orthogaonally, favoring horizontal and avoiding non-liquids
  • FLEE_DIGGING 11 - Goblin digger AI
  • DB_PHASE1 12 - DB AI for phase 1
  • SEEK_L2 13 - DR AI for phase 1
  • CONDUCTOR_PHASE2 14
  • CR_PHASE1 15
  • DM_PHASE4 16
  • PAWN 17
  • LUTE_BODY 18
  • LUTE_HEAD 19
  • ND2_PHASE2 20
allDirections

Fields:

  • 7 1
  • 6 2
  • 4 3
  • 1 4
  • 2 5
  • 3 6
  • 5 7
  • 8 8
defaultMovementMap

Fields:

  • 4 { -1, -1 }
  • 5 { -1, 0 }
  • 6 { -1, 1 }
  • 3 { 0, -1 }
  • 7 { 0, 1 }
  • 2 { 1, -1 }
  • 1 { 1, 0 }
  • 8 { 1, 1 }
diagonals

Fields:

  • 2 2
  • 4 4
  • 3 6
  • 1 8
orthogonals

Fields:

  • 4 1
  • 2 3
  • 1 5
  • 3 7
generated by LDoc 1.4.6