Changes in what a 2.6 rule set can do

Contribute, display and discuss rulesets and modpacks for use in Freeciv here.
sveinung
Elite
Posts: 548
Joined: Wed Feb 20, 2013 4:50 pm

Re: Changes in what a 2.6 rule set can do

Post by sveinung »

Changed in Freeciv 2.6/trunk: The restriction that a diplomat/spy action must be done from a tile with a terrain where the acting unit can exist without a transport is now moved to the ruleset. See patch #4671

If you want to be able to establish an embassy using a Spy (land unit) in a Transport on Ocean open game.ruleset. Find the action enabler of "Establish Embassy". Remove the requirement ("UnitState", "TransportDependent", "Local", FALSE) from the requirement vector actor_reqs.

If you want to keep the restriction on establishing an embassy from TransportDependent terrain for all units except those that have the "Spy" flag add a new action enabler like this:

Code: Select all

[actionenabler_establish_embassy_from_transport]
action       = "Establish Embassy"
actor_reqs    =
    { "type",   "name", "range", "present"
      "UnitFlag", "Spy", "Local", TRUE
    }
target_reqs  =
    { "type",   "name", "range", "present"
      "Nation", "Barbarian", "Player", FALSE
      "Nation", "Pirate", "Player", FALSE
    }
You can of course do the same with other spy actions as well.
sveinung
Elite
Posts: 548
Joined: Wed Feb 20, 2013 4:50 pm

Re: Changes in what a 2.6 rule set can do

Post by sveinung »

Changed in Freeciv 2.6/trunk: It is now possible to test if the unit in question currently has at least the given amount of move fragments left. See patch #5033

This is done via MinMoveFrags, a new requirement type. It is true if the unit has the given amount of move fragments (or more) left. It may be useful as an actor requirement in action enablers.

Say you have a ruleset were you only wish to allow a spy to poison a city if it has a full move. In this ruleset 1 move is set (in terrain.ruleset) to be 9 move_fragments. To do this open game.ruleset and add ("MinMoveFrags", "9", "Local", TRUE) to actor_reqs of every action enabler that enables the "Poison City" action.

If the ruleset only have one action enabler for the "Poison City" action and it was configured to be like the rules of Freeciv 2.5 before you added the MinMoveFrags rules it should now look like this:

Code: Select all

[actionenabler_poison_city]
action = "Poison City"
actor_reqs    =
    { "type",   "name", "range", "present"
      "UnitFlag", "Spy", "Local", TRUE
      "DiplRel", "War", "Local", TRUE
      "UnitState", "TransportDependent", "Local", FALSE
      "MinMoveFrags", "9", "Local", TRUE
    }
target_reqs    =
    { "type",   "name", "range"
      "MinSize", "2", "City"
    }
sveinung
Elite
Posts: 548
Joined: Wed Feb 20, 2013 4:50 pm

Re: Changes in what a 2.6 rule set can do

Post by sveinung »

Changed in Freeciv 2.6/trunk: The restriction that a diplomat/spy must have at least one move fragment left to perform a spy action is now moved to the ruleset. See patch 5048

To remove this restriction open game.ruleset, find the enablers of the actions you wish to allow to units without any move fragments left and remove the requirement ("MinMoveFrags", "1", "Local", TRUE) from the requirement vector actor_reqs. The unit should then be able to do the enabled spy action without any moves left just like a Caravan can establish a trade route witout any moves left.

A spy/diplomat unit without any moves left can only act against the tile he currently is on. (He may, depending on other rules, be transported by another unit) To perform an action with a unit without movement point select the unit and press 'd' (or select "Diplomat/Spy actions" in the Combat menu). Update: If a spy unit is transported to a city and the city is the transporter's target the spy action dialog will also pop up.
cazfi
Elite
Posts: 3111
Joined: Tue Jan 29, 2013 6:54 pm

Re: Changes in what a 2.6 rule set can do

Post by cazfi »

Time it takes to pillage an extra (tile improvement) is now ruleset defined like other extra build and removal activities. It can be specific to either the extra being removed or terrain where it is. patch #5025
cazfi
Elite
Posts: 3111
Joined: Tue Jan 29, 2013 6:54 pm

Re: Changes in what a 2.6 rule set can do

Post by cazfi »

Any extra adding or removing activity can now be disabled for a given terrain like road and base building was already possible, by setting relevant _time field to 0. patch #5026

This allows for example one to prevent cleaning of pollution or fallout from some terrain types, or make some terrain safe from pillaging. The main reason for the change was consistency between handling different _time -fields, though, and most things doable with it has been already possible by various other means (in most cases by negated terrain(flag) requirement for the activity)
sveinung
Elite
Posts: 548
Joined: Wed Feb 20, 2013 4:50 pm

Re: Changes in what a 2.6 rule set can do

Post by sveinung »

Changed in Freeciv 2.6/trunk: The DiplRel requirement type can now test if the relationship looked at is to another player via the new test "Is foreign". See patch 5068
User avatar
JTN
Elite
Posts: 473
Joined: Wed Jan 30, 2013 12:15 am

Re: Changes in what a 2.6 rule set can do

Post by JTN »

The tech flag "Population_Pollution_Inc" is replaced by a new effect "Pollu_Pop_Pct_2", which is multipled by the existing "Pollu_Pop_Pct" effect, so that you can have population pollution that's entirely independent of tech discovery. (patch #5015)
User avatar
JTN
Elite
Posts: 473
Joined: Wed Jan 30, 2013 12:15 am

Re: Changes in what a 2.6 rule set can do

Post by JTN »

There's a new "MinVeteran" requirement in the effects system, allowing you to specify that an effect only applies to units which have (or haven't) reached a certain veteran level. (patch #4902)

The "Veteran_Combat" effect (which controls gaining experience from combat) can now depend on the properties of a specific unit, not just the unit's type. (patch #5094)

You can combine these two changes to give rules such as restricting promotions to the Elite veteran level to the owner of a certain tech or wonder.
sveinung
Elite
Posts: 548
Joined: Wed Feb 20, 2013 4:50 pm

Re: Changes in what a 2.6 rule set can do

Post by sveinung »

Changed in Freeciv 2.6/trunk: The restriction that a unit must have the Diplomat flag to perform diplomat/spy actions is now moved to the ruleset. See patch #5131

The Diplomat unit type flag is now only about the ability to defend against spy actions.

To allow units without the Diplomat flag to perform an action simply add an action enabler that allows them to do it (or rewrite an existing action enabler).

Example that allows explorers to establish an embassy after writing is discovered:

Code: Select all

[actionenabler_explorer_establish_embassy]
action       = "Establish Embassy"
actor_reqs    =
    { "type",   "name", "range", "present"
      "UnitType", "Explorer", "Local", TRUE
      "Tech", "Writing", "Player", TRUE
      "UnitState", "TransportDependent", "Local", FALSE
      "MinMoveFrags", "1", "Local", TRUE
    }
target_reqs  =
    { "type",   "name", "range", "present"
      "Nation", "Barbarian", "Player", FALSE
      "Nation", "Pirate", "Player", FALSE
    }
sveinung
Elite
Posts: 548
Joined: Wed Feb 20, 2013 4:50 pm

Re: Changes in what a 2.6 rule set can do

Post by sveinung »

Changed in Freeciv 2.6/trunk: The new requirement type MinHitPoints allows you to test if the unit in question currently has at least the given amount of hit points left. See patch #5135

MinHitPoints is true if the unit has the given amount of hit point (or more) left.

Example rule: Units will only accept a bribe when their morale is reduced by the fact that they are wounded (have less than 10 HP left).

Code: Select all

[actionenabler_bribe_low_morale]
action = "Bribe Unit"
actor_reqs    =
    { "type",   "name", "range", "present"
      "UnitFlag", "Diplomat", "Local", TRUE
      "DiplRel", "Alliance", "Local", FALSE
      "DiplRel", "Team", "Local", FALSE
      "UnitState", "TransportDependent", "Local", FALSE
      "MinMoveFrags", "1", "Local", TRUE
    }
target_reqs    =
    { "type",   "name", "range", "present"
      "UnitType", "Leader", "Local", FALSE
      "UnitType", "Barbarian Leader", "Local", FALSE
      "CityTile", "Center", "Local", FALSE
      "Gov", "Democracy", "Player", FALSE
      "MinHitPoints", "10", "Local", FALSE
    }
Post Reply