Summary: Use an effect to control fortification capability
Submitted by: persia
Submitted on: Thu 25 Apr 2013 03:35:57 AM JST
Priority: 5 - Normal
Assigned to: None
Discussion Lock: Any
The current code has a hardcoded is_ocean() call in the gate conditional
for ACTIVITY_FORTIFYING, meaning that UCF_CAN_FORTIFY units can fortify on any
land terrain and never fortify on any oceanic terrain. The attached patch
changes this conditional to use an effect, supporting both more expressiveness
in ruleset definition and wider scopes for complex nativity. Some examples of
things the patch enables:
Submarines may fortify in Deep Ocean if the player has researched the
Amphibious Assault Vehicles may fortify on land other than mountains or hills,
but wallow in water and may not fortify even in the presence of a river.
Big Land units cannot fortify on Farmland.
This patch depends on the exposure of is_effect_active() from patch #3871,
but it is trivial to restack the exposure if anyone thinks this should be
applied with greater priority than that.
Note also that the construction in helpdata.c here and the construction in
city.c there are sufficiently parallel that if anything else wants to do this
class of RPT_POSSIBLE test, it may be better to define a simple function for
that specific purpose, rather than exposing is_effect_active()
Date: Thu 25 Apr 2013 03:35:57 AM JST Name:
fortification-possible-effect.patch Size: 20kB By: persia
Reply to this item at:
Message sent via/by Gna!
Freeciv-dev mailing list