Module br.player.enemies

These functions return a table of enemies for the provided parameters.

Enemies functions are stored in br.player.enemies and can be utilized by `local enemies = br.player.enemies` in your profile.

After defining enemies you would place the below functions in the main profile loop to populate and update the enemy tables.

Once done you can use variables such as these examples, you can also get count of enemies but just added a `#` in front of the variable name:

* `enemies.yards8` - Returns all enemies around player in 8yrds, generated by function enemies.get(8)

* `enemies.yards8t` - Returns all enemies around target in 8yrds, generated by function enemies.get(8,"target")

* `enemies.yards8tnc` - Returns all units around target in 8yrds, generated by function enemies.get(8,"target",true)

* `enemies.yards8tncf` - Returns all units the target is facing in 8yrds, generated by function enemies.get(8,"target",true,true)

For enemies in a cone it is the same as above but you use the `c` tag instead of `t`. Ex function: enemies.cone.get(45,8)

For enemies in a rectangle it is the same as above but you use the `r` tag instead of `t`. Ex function: enemies.rect.get(5,8)

Functions

enemies.get (range, unit, checkNoCombat, facing) Returns a table of all enemies around unit for given range, combat situation, and facing
enemies.cone.get (angle, range, checkNoCombat, showLines) Returns a table of all enemies in the players frontal cone for given angle, range, and combat situation
enemies.rect.get (width, range, showLines, checkNoCombat, facing) Returns all enemies in a rectangular area from a unit for given range, combat situation, and facing


Functions

enemies.get (range, unit, checkNoCombat, facing)
Returns a table of all enemies around unit for given range, combat situation, and facing

Parameters:

  • range number The range to check for enemies
  • unit string The unit to check for enemies around
  • checkNoCombat boolean Check for enemies even if not in combat
  • facing boolean Check if enemies are facing unit

Returns:

    table
enemies.cone.get (angle, range, checkNoCombat, showLines)
Returns a table of all enemies in the players frontal cone for given angle, range, and combat situation

Parameters:

  • angle number The angle of the cone to check for enemies
  • range number The range to check for enemies
  • checkNoCombat boolean Check for enemies even if not in combat
  • showLines boolean Show lines for the cone *non-functional atm*

Returns:

    table
enemies.rect.get (width, range, showLines, checkNoCombat, facing)
Returns all enemies in a rectangular area from a unit for given range, combat situation, and facing

Parameters:

  • width number The width of the rectangle to check for enemies
  • range number The range to check for enemies
  • showLines boolean Show lines for the rectangle *non-functional atm*
  • checkNoCombat boolean Check for enemies even if not in combat
  • facing boolean Check if enemies are facing unit *no longer used*

Returns:

    table

generated by LDoc 1.5.0 Last updated 2024-11-26 17:42:33