Summary: Select "CanFortify"defender
                 Project: Freeciv
            Submitted by: cazfi
            Submitted on: Wed 06 Feb 2013 06:11:28 AM EET
                Category: ai
                Priority: 5 - Normal
                  Status: Ready For Test
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: 2.4.0, 2.5.0



Introduce new get_fortified_defense_power() function.
Unlike get_total_defense_power() it can be called with NULL attacker. Unlike
get_defense_power() it takes defense_multiplication() bonuses in to account.
Changed AI defender assessing to use this new function instead of
get_defense_power(). As attacker is not known, get_total_defense_power()
couldn't be used.
In practice this means that unit's ability to fortify is taken in to account.
Of otherwise equal units one with "CanFortify" flag would get better score as
it would get fortified bonus.

The other bonus applied by defense_multiplication() in case of NULL attacker
is extras (bases & roads) bonuses. It's not important at the moment (bases are
never inside city and this is ever called for city defenders only, roads
usually have no defense bonus) but it turns more important once rivers are
handled as road types.


File Attachments:

Date: Wed 06 Feb 2013 06:11:28 AM EET  Name: AiCanFortifyDefense.patch  Size:
2kB   By: cazfi



Reply to this item at:


  Message sent via/by Gna!

Freeciv-dev mailing list

Reply via email to