canReachMelee¶
Vrai si ton personnage peut finir collé à un ennemi en marchant ce tour.
Vrai s'il est déjà au contact, ou si une case voisine d'un ennemi est accessible avec ses PM restants.
Combat uniquement. À appeler dans fightManagement ou fightPlacement ; ailleurs, l'appel provoque une erreur.
Signature¶
fight:canReachMelee()
Retour¶
true ou false.
Exemple¶
local proche = fight:nearestEnemy()
if proche and not fight:isInMelee() and fight:canReachMelee() then
fight:moveToCell(fight:findCell(function(c)
return fight:getDistance(proche, c) == 1
end))
end
fight:cast(IOP.PRESSION, MELEE)