URL:
<http://gna.org/patch/?3881>
Summary: Use an effect to control fortification capability
Project: Freeciv
Submitted by: persia
Submitted on: Thu 25 Apr 2013 03:35:57 AM JST
Category: general
Priority: 5 - Normal
Status: None
Privacy: Public
Assigned to: None
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Planned Release:
_______________________________________________________
Details:
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
Rebreathing technology.
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()
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Thu 25 Apr 2013 03:35:57 AM JST Name:
fortification-possible-effect.patch Size: 20kB By: persia
<http://gna.org/patch/download.php?file_id=17827>
_______________________________________________________
Reply to this item at:
<http://gna.org/patch/?3881>
_______________________________________________
Message sent via/by Gna!
http://gna.org/
_______________________________________________
Freeciv-dev mailing list
[email protected]
https://mail.gna.org/listinfo/freeciv-dev