getAwakeningZone([number entity]) → integer zone
Returns the radius of the awakening zone of the entity entity, in cells.
A plant with a zone does not play a turn: it wakes up when an entity walks into its zone, and that is when its AI runs. The function returns 0 for any entity that plays its turn normally, including a rooted plant without an awakening zone.
Neither getType nor getEntityTurnOrder answers this question: the ENTITY_PLANT type does not say whether the plant has a zone, and a plant with a zone keeps its place in the turn order — only its AI is never run there. The zone is a circle measured in cells, like getCellDistance, and every cell walked on counts: crossing the zone wakes the plant, even without stopping in it.
Example:
var plant = getNearestEnemy()
var zone = getAwakeningZone(plant)
if (zone > 0 && getCellDistance(getCell(), getCell(plant)) <= zone) {
debug("I am inside a plant's zone!")
}
const plant = Fight.getNearestEnemy()
if (plant.awakeningZone > 0 && Fight.me.cell.distance(plant) <= plant.awakeningZone) {
Debug.log("I am inside a plant's zone!")
}
plant = Fight.getNearestEnemy()
if plant.awakeningZone > 0 and Fight.me.cell.distance(plant) <= plant.awakeningZone:
Debug.log("I am inside a plant's zone!")
0 if the entity has none, or null if the entity does not exist.Impossible de charger les données du jeu.
Vérifiez votre connexion et réessayez.