[SOLVED] How exactly does "TerrainAlter" requirement type work?

Contribute, display and discuss rulesets and modpacks for use in Freeciv here.
User avatar
Corbeau
Elite
Posts: 1039
Joined: Mon Jan 13, 2014 11:13 pm

[SOLVED] How exactly does "TerrainAlter" requirement type work?

Postby Corbeau » Thu Aug 29, 2019 10:40 pm

I am trying to prevent the building of a certain base if there is irrigation or mine on a hill/mountain tile. Would this work?

Code: Select all

[base_resort]
name           = _("Resort")
graphic        = "base.buoy"
graphic_alt    = "base.ruins"
activity_gfx   = "unit.buoy"
act_gfx_alt    = "unit.fortress"
reqs           =
    { "type", "name", "range", "negated"
      "Tech", "Explosives", "Player", FALSE
      "Terrain", "Mountains", "Local", FALSE
      "UnitFlag", "Settlers", "Local", FALSE
      "CityTile", "Center", "Local", TRUE
      "TerrainAlter", "Irrigation", "Local", TRUE    <------------ THIS
      "TerrainAlter", "Mine", "Local", TRUE     <--------THIS
    }
Last edited by Corbeau on Mon Sep 02, 2019 8:46 pm, edited 1 time in total.

cazfi
Elite
Posts: 1718
Joined: Tue Jan 29, 2013 6:54 pm

Re: How exactly does "TerrainAlter" requirement type work?

Postby cazfi » Fri Aug 30, 2019 1:29 am

"TerrainAlter" is about the potential of the terrain to be altered. Typically it's used to provide an irrigation bonus in the city center tile that is not irrigated, but could be ("CanIrrigate").
To test if there's an "Irrigation" or "Mine" extra in the tile, use "Extra" requirement (2.6 and later) or "Special" requirement (2.5 and earlier).

User avatar
Corbeau
Elite
Posts: 1039
Joined: Mon Jan 13, 2014 11:13 pm

Re: How exactly does "TerrainAlter" requirement type work?

Postby Corbeau » Fri Aug 30, 2019 9:19 am

Thanks.