Pick what "Attack" target reqs should be evaluated against
When the "Attack" action was introduced in gna patch #7260 it was made tile targeted until the proper target class to evaluate its action enablers against could be determined. Releasing a version of Freeciv where the target is a tile would bind us to support DiplRel requirements against the owner of the tile the target unit is located at in future versions.
The "Attack" action's current target requirements are made against three different target classes. Two of the target classes, "individual cities" and "unit stacks", are supported as action enabler target kinds. The last class, "any or, if the unreachableprotects server setting is enabled, all untransported units", has no current support in the action enabler system.
#2 Updated by Sveinung Kvilhaugsvik about 3 years ago
- File 0001-Make-the-Attack-action-unit-stack-targeted.patch 0001-Make-the-Attack-action-unit-stack-targeted.patch added
- Status changed from In Progress to Resolved
The two candidates for the target to evaluate the "Attack" action's target requirement vector against are those about units. Each has a currently hardcoded unit requirement it alone can express. The unit stack target kind can express the "must be at war with all units in the stack" rule. The other target kind could, combined with the introduction of a new requirement type, have expressed the requirement that each/any non transported unit must be in a city, be in an extra native to it, not have the "Unreachable" unit class flag or belong to a unit type listed in the actor's targets.
Choose the unit stack action target kind. Move the "must be at war with all units in the stack" rule to the action enabler as an obligatory hard requirement.
A unit stack targeted "Attack" action makes ruleset authors able to specify requirements for all units in an attacked unit stack. Requirements for all non transported units in an attacked unit stacks can be achieved via the "Transported" UnitState requirement type property (and an action enabler that enables the action for a transported unit no matter what the non transported only requirements are).
Should having "Attack" action enabler target requirements closely following the unreachableprotects server setting become important in the future it can still be implemented. One potential way to do it is by introducing a version of "Attack" that targets individual units. Its and Attack's action enablers should then be able to use the "ServerSetting" requirement type to determine what action should be enabled based on the unreachableprotects server setting value.