Open ilteroi opened 1 month ago
proposal for new lua api, hopefully simple and self-explanatory
unit:GetPotentialRangeAttackTargetPlots(plot)
unit:GetPotentialRangeAttackOriginPlots(plot)
initial implementation ready (cce485397277b61c94f12e5e997b6dadac15768d). should return a list of x,y pairs
v4.13 build here: CvGameCore_Expansion2.zip
so right now we have the "range attack mode" (shortcut B) which looks like this:
it shows which plots the selected ranged unit can attack from it's current position.
would it be possible to have a view (maybe shortcut Ctrl-B?) which shows where the units would need to be in order to attack the plot under the mouse cursor?
it seems the current implementation is mostly lua (RangedStrikeHighlight). this could be optimized by exposing CvMap::GetPlotsAtRangeX(...) which also supports line-of-sight checks in both directions. but it's also possible to do even more on gamecore side since updating on mouse-move might be performance critical.
if some lua whiz wants to tackle this i can provide the c++ part.