getCellToUseChip

getCellToUseChip(number chip, number entity, [array<integer> ignoredCells]) → integer cell

Returns a cell from which your entity can use the chip chip on the entity entity. It is the closest one your entity can reach by moving, with no movement point limit: it may be several turns away. If no cell is reachable (for example if your entity is surrounded), the function returns -1, even when getCellsToUseChip finds some.

Example of throwing a Rock:

var cell = getCellToUseChip(CHIP_ROCK, enemy)
moveTowardCell(cell)
useChip(CHIP_ROCK, enemy)
const cell = Fight.me.chipCell(Chip.rock, enemy)
Fight.me.moveToward(cell)
Fight.me.useChip(Chip.rock, enemy)
cell = Fight.me.chipCell(Chip.rock, enemy)
Fight.me.moveToward(cell)
Fight.me.useChip(Chip.rock, enemy)
Parameters
Return