getCell

getCell([number entity]) → integer cell
Returns the cell where the entity entity is located. Use getCell() with no parameter to get your own cell.

Returns the cell where the entity with id entity is located. Use getCell() with no parameter to get your own cell.

Example: compute the distance between you and the enemy, and boost yourself if the enemy is close:

var distance = getCellDistance(getCell(), getCell(enemy))
if (distance < 10) {
	useChip(CHIP_PROTEIN)
}
const distance = Fight.me.cell.distance(enemy.cell)
if (distance < 10) {
	Fight.me.useChip(Chip.protein)
}
distance = Fight.me.cell.distance(enemy.cell)
if distance < 10:
	Fight.me.useChip(Chip.protein)
Parameters
Return
See also