function ShowParadropRangeIndicator()
local pHeadSelectedUnit = UI.GetHeadSelectedUnit();
if not pHeadSelectedUnit then
return;
end
local thisPlot = pHeadSelectedUnit:GetPlot();
if pHeadSelectedUnit:CanParadrop(thisPlot, false) then
local iRange= pHeadSelectedUnit:GetDropRange();
print("irange: "..tostring(iRange))
local thisX = pHeadSelectedUnit:GetX();
local thisY = pHeadSelectedUnit:GetY();
for iDX = -iRange, iRange, 1 do
for iDY = -iRange, iRange, 1 do
local pTargetPlot = Map.GetPlotXY(thisX, thisY, iDX, iDY);
if pTargetPlot ~= nil then
local plotX = pTargetPlot:GetX();
local plotY = pTargetPlot:GetY();
local plotDistance = Map.PlotDistance(thisX, thisY, plotX, plotY);
if plotDistance <= iRange then
if pHeadSelectedUnit:CanParadropAt(thisPlot, plotX, plotY) then
local hexID = ToHexFromGrid( Vector2( plotX, plotY) );
Events.SerialEventHexHighlight( hexID, true, turn1Color, pathBorderStyle );
end
end
end
end
end
end
end
function HideParadropRangeIndicator()
ClearUnitHexHighlights();
end