URL: <http://gna.org/patch/?4894>
Summary: UnitState requirement type with the test TransportDependent Project: Freeciv Submitted by: sveinung Submitted on: Wed 02 Jul 2014 08:51:11 PM UTC Category: None Priority: 5 - Normal Status: In Progress Privacy: Public Assigned to: sveinung Originator Email: Open/Closed: Open Discussion Lock: Any Planned Release: 2.6.0 _______________________________________________________ Details: Add the new requirement type UnitState. UnitState is for checking the properties of a unit's state. It is intended to be like CityTile, but for units. The first test, TransportDependent, checks if the unit can't exist outside a transport on the tile where it currently is located. It uses !can_unit_exist_at_tile() internally. I expect it to mostly be used with !present. The reason for the double negative is to make the documentation easier to write. The purpose of this test is to later use it to move the spy action's "can't attack from terrain it can't exist on"-rule to the ruleset. That will make it easier to move actions that don't have this requirement, like Establish Trade Route, to be controlled by action enablers. Note that the rule I wish to move is different from the rule about regular attacks. Regular attacks check if the tile the unit is located at is native or not. A spy action check if the unit can exist (outside a transport) on the tile it is located at. Alternative approaches: * Change the rule to require nativity to do a Spy action. Change this to test nativity in stead. Consequence: A spy ship in a land city would no longer be able to act from it (unless the restriction is removed). Consistent with normal attack. * Change the rule to ban actions when transported. Change this test to see if a unit is transported. Consequence: a land spy transported over land would have to exit its transport before it could act (unless the restriction is removed). _______________________________________________________ File Attachments: ------------------------------------------------------- Date: Wed 02 Jul 2014 08:51:11 PM UTC Name: 0002-UnitState-requirement-type-with-the-test-TransportDe.patch Size: 13kB By: sveinung <http://gna.org/patch/download.php?file_id=21247> _______________________________________________________ Reply to this item at: <http://gna.org/patch/?4894> _______________________________________________ Message sent via/by Gna! http://gna.org/ _______________________________________________ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev