Project

Profile

Help

HostedRedmine.com has moved to the Planio platform. All logins and passwords remained the same. All users will be able to login and use Redmine just as before. Read more...

Feature #848689

Figure out unit_can_defend_here() while transported

Added by Sveinung Kvilhaugsvik over 1 year ago. Updated over 1 year ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
General
Sprint/Milestone:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

Should being able to be unloaded by the transport count as being able to defend (like it does now) or should a unit that can't alight be considered useless as a defender? What about a unit that can alight but can't be unloaded?

"Transport Alight" and "Transport Unload" can have ruleset defined side effects from Lua and effects. Should a transported unit be forced to unload before it can defend? What if it becomes unable to defend while performing the exit transport action? What if it becomes a worse defender?

My suspicion is that the answer to these questions should be answered by rule set. A Laser Gun loaded on a ship should be able to defend against an incoming attack while transported. A Legion on a River Boat should have to alight first and suffer the mp punishment from exiting. A unit that is unloaded slowly should not be able to defend.


Related issues

Related to Freeciv - Feature #848492: New action "Transport Unload"Closed

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>
Blocks Freeciv - Task #673656: S3_1 datafile format freeze (d3f)New

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

History

#1 Updated by Sveinung Kvilhaugsvik over 1 year ago

  • Blocks Task #673656: S3_1 datafile format freeze (d3f) added

#3 Updated by Sveinung Kvilhaugsvik over 1 year ago

#4 Updated by Sveinung Kvilhaugsvik over 1 year ago

Possible solution (brain storm-level): 2 phases. First prepare each unit to defend. Then check legality / best defender.

Prepare to defend
This makes the ruleset able to force units at a tile under attack to prepare them self. This should put them in a state where they legally can defend. Get a requirement vector and a list of actions from the ruleset. The requirement vector is evaluated against each possible defender unit. If a unit matches the requirement vector it will be forced to perform the first legal action in the action list. (Can probably be implemented as an action auto performer.) Example: Prepare to defend is triggered by a transported unit at a tile it can exist on and does alight in the requirement vector.

May need to special case transports unloading cargo since that is a unit preparing another unit, not a unit preparing it self.

Pick defender
Get another requirement vector from the ruleset. A unit can defend at the tile if this vector is fulfilled (and hard coded limitations are fulfilled). Pick the best defender as normal. Example: the requirement vector forbids units inside transports from defending.

Also available in: Atom PDF