1 The effects.ruleset file contains all effects in play in a Freeciv scenario.
2 They have the following form (this is perhaps the most complicated example I
9 { "type", "name", "range", "present", "quiet"
10 "Building", "Factory", "City", TRUE, FALSE
11 "Building", "Hydro Plant", "City", TRUE, FALSE
12 "OutputType", "Shield", "Local", TRUE, TRUE
13 "Building", "Hoover Dam", "Player", FALSE, FALSE
14 "Building", "Nuclear Plant", "City", FALSE, FALSE
17 The text in the brackets is the entry name, which just has to be unique, but
18 is otherwise not used. The name field tells Freeciv which effect you are
19 defining. The value is the effect's value, which depends on which effect it
20 is. The reqs table contain a list of requirements for this effect being in
21 effect. You need to satisfy all requirements listed here for this effect to
22 take effect in the game. Requirements with present = TRUE must be present,
23 those with present = FALSE must not be present.
25 Value is integral amount parameter for many effects (must be in the range
28 Requirement range may be one of: "None", "Local",
29 "CAdjacent" (Cardinally Adjacent), "Adjacent", "City",
30 "Continent", "Player", "Allied, "World". Some requirement types may only work at
31 certain ranges; this is not yet documented. In particular, at present,
32 "Continent" effects can affect only cities and units in cities.
34 A requirement may have a 'survives' field, and if this 'TRUE', the effect
35 survives destruction. This is supported for only a few conditions and
36 ranges: wonders (at world or player range), nations, and advances
37 (both at world range only).
39 A requirement may have a 'present' field, and if this is 'FALSE',
40 the requirement is negated (the condition must not be true for the req to be
44 Requirement types and supported ranges
45 ======================================
47 Tech: World, Alliance, Team, Player
48 TechFlag: World, Alliance, Team, Player
49 Achievement: World, Alliance, Team, Player
51 Building: World, Alliance, Team, Player, Continent, Traderoute, City, Local
52 Extra: Local, Adjacent, CAdjacent, Traderoute, City
53 BaseFlag: Local, Adjacent, CAdjacent, Traderoute, City
54 RoadFlag: Local, Adjacent, CAdjacent, Traderoute, City
55 ExtraFlag: Local, Adjacent, CAdjacent, Traderoute, City
56 Terrain: Local, Adjacent, CAdjacent, Traderoute, City
57 Resource: Local, Adjacent, CAdjacent, Traderoute, City
62 Nation: World, Alliance, Team, Player
63 NationGroup: World, Alliance, Team, Player
64 Nationality: Traderoute, City
65 DiplRel: World, Alliance, Team, Player, Local
71 MinSize: Traderoute, City
72 MinCulture: World, Alliance, Team, Player, Traderoute, City
74 MaxUnitsOnTile:Local, Adjacent, CAdjacent
75 TerrainClass: Local, Adjacent, CAdjacent, Traderoute, City
76 TerrainFlag: Local, Adjacent, CAdjacent, Traderoute, City
78 CityTile: Local, Adjacent, CAdjacent
86 MinSize is the minimum size of a city required.
87 AI is ai player difficulty level.
88 TerrainClass is either "Land" or "Oceanic".
89 CityTile is either "Center" (city center) or "Claimed" (owned).
90 DiplRel is a diplomatic relationship.
91 MaxUnitsOnTile is about the number of units present on a tile.
92 UnitState is "Transported" or "OnLivableTile".
93 MinMoveFargs is the minimum move fragments the unit must have left.
99 Gain any advance known already by amount number of other players. Note
100 that if you have two such effects, they combine into one much worse effect
101 (the number of players required to gain an advance is increased).
104 Allow airlift to/from a city.
107 Allow changing to any form of government regardless of tech prerequisites.
110 The city with this effect is the capital city.
113 The city with this effect is governmental center. Corruption and
114 waste depends on distance to nearest such city.
117 Allows the production of nuclear weapons.
120 Allows the production of space components.
123 Specify what outputs a specialist is producing. Should be used with an
124 OutputType requirement.
127 City production is increased by amount percent.
130 City production is increased by amount percent after Output_Bonus, so is
131 multiplicative with it.
134 Add amount to each worked tile.
137 Add amount to each worked tile that already has at least 1 output.
140 Increase tile output by amount percent.
142 Output_Tile_Punish_Pct
143 Reduce the output of a tile by amount percent. The number of units to
144 remove is rounded down. Applied after everything except a city center's
148 Reduce waste by amount percent.
151 Make amount' unhappy citizens content. Applied after martial law and unit
155 Give amount techs immediately.
158 Food left after cities grow or shrink is amount percent of the capacity of
159 the city's foodbox. This also affects the 'aqueductloss' penalty.
162 Like having embassies with all other players.
165 Irrigation output of the tile is value %.
168 Mining output of the tile is value %.
171 Make amount unhappy citizens content. Applied before martial law and unit
175 Make amount unhappy citizens caused by units outside of a city content.
178 Make amount per unit of unhappy citizens caused by units outside of a city
182 Make amount citizens happy.
184 Enemy_Citizen_Unhappy_Pct
185 There will be one extra unhappy citizen for each value/100 citizens
186 of enemy nationality in the city.
189 No period of anarchy between government changes. (This also neuters
190 the Has_Senate effect.)
196 Increases pollution caused by each unit of population by amount
197 percent (adds to baseline of 100%, i.e. 1 pollution per citizen).
200 Increases pollution caused by each unit of population by amount
201 percent (adds to baseline of 100%, i.e. 1 pollution per citizen).
202 This factor is applied after Pollu_Pop_Pct, so is multiplicative with it.
205 Increases pollution caused by shields by amount percent.
208 Reduces possibility of illness (plague) in a city by amount percent.
211 Immediately make all cities known.
214 Immediately make entire map known.
217 Increases revolt cost by amount percent.
220 Increases unit bribe cost by amount percent. Requirements are from the
221 point of view of the target unit, not the briber.
224 The upper limit on the permille of the players gold that may be
225 stolen by a unit doing the "Steal Gold" action. Evaluated against the city
229 The permille of the gold stolen by a unit doing the "Steal Gold"
230 action that is lost before it reaches the player ordering it. Evaluated
231 against the actor unit.
233 Illegal_Action_Move_Cost
234 The number of move fragments lost when the player tries to do an action
235 that turns out to be illegal.
238 Increase maximum size of a city by amount.
241 Make the size of a city unlimited.
243 SS_Structural, SS_Component and SS_Module
244 A part of a spaceship; this is a "Local" ranged effect. It (for now)
245 applies to improvements which cannot be built unless "Enable_Space" is felt.
246 Buildings which have this effect should probably not be given any other
250 If a spy specifies a target for sabotage, then she has an AMOUNT percent
251 chance to fail. Also in diplomatic combat defending diplomatic units in cities
252 will get an AMOUNT percent bonus. All Spy_Resistant's are summed before being
256 Add amount movement to units. Use UnitClass' requirement with range of
257 'Local' to give it a specific class of units only.
260 No population lost when a city's defender is lost.
263 Units recover amount extra hitpoints per turn.
266 Upgrade amount obsolete units per turn.
269 Improvements with amount or less upkeep cost become free to upkeep (others
273 If this value is greater than 0, the tech upkeep is reduced by this value.
274 For tech upkeep style "Basic" this is total reduction, for tech upkeep
275 style "Cities" this reduction is applied to every city.
278 No citizens in the city are ever unhappy.
281 Increases the veteran class of newly created units of this type. The
282 total amount determines the veteran class (clipped at the maximum for the
286 Increases the chance of units of this type becoming veteran after combat
290 Units that do not move recover amount percentage of their full hitpoints
293 City_Vision_Radius_Sq
294 Increase city vision radius in squared distance by amount tiles.
296 Unit_Vision_Radius_Sq
297 Increase unit vision radius in squared distance by amount tiles.
300 Increases defensive bonuses of units. Any unit requirements on this effect
301 will be applied to the _attacking_ unit. Attackers with "BadWallAttacker" flag
302 will have their firepower set to 1.
305 Gain amount points of "AI love" with AI(s).
308 Year advances by AMOUNT each turn unless Slow_Down_Timeline causes it
312 Year fragments advance by AMOUNT each turn.
315 Slow down the timeline based on the AMOUNT. If AMOUNT >= 3 the timeline
316 will be max 1 year/turn; with AMOUNT == 2 it is max 2 years/turn;
317 with AMOUNT == 1 it is max 5 years/turn; with AMOUNT <= 0 the timeline is
318 unaffected. The effect will be ignored if game.spacerace isn't set.
321 Base chance in per cent of a nation being split by civil war when its
322 capital is captured is increased by this amount. This percentage is in-
323 creased by 5 for each city in civil disorder and reduced by 5 for each one
327 The maximum number of citizens in each city that are naturally content;
328 in larger cities, new citizens above this limit start out unhappy. (Before
329 Empire_Size_Base/Step are applied.)
332 Once your civilization has more cities than the value of this effect,
333 each city gets one more unhappy citizen. If the sum of this effect and
334 Empire_Size_Step is zero, there is no such penalty.
337 After your civilization reaches Empire_Size_Base size, it gets one more
338 unhappy citizen for each amount of cities it gets above that. Set to zero to
339 disable. You can use Empire_Size_Step even if Empire_Size_Base is zero.
342 The maximum setting for each tax rate is amount.
345 The amount of citizens pacified by each military unit giving martial law.
348 The maximum amount of units that will give martial law in city.
351 Can rapture grow cities.
353 Revolution_Unhappiness
354 If value is greater than zero, it tells how many turns citizens
355 will tolerate city disorder before government falls. If value is
356 zero, government never falls.
359 Has a senate that prevents declarations of war in most cases.
362 Partisan units (defined in units.ruleset) may spring up when this player's
366 Make all Make_Content and Force_Content effects instead generate gold.
369 Number of trade routes that city can establish.
370 This is forced on trade route creation only. Existing trade routes
371 are never removed due to reduction of effect value. This is to
372 avoid micro-management, need to create same trade routes again
373 after their max number has been temporarily down.
376 Units with "Fanatics" flag incur no upkeep.
379 Cannot use any diplomacy.
382 Tech cannot be received from this player by any means.
385 One time trade revenue bonus is multiplied by pow(2, amount/1000).
386 The amount value is taken from the caravan's home city.
389 Percentage bonus for trade from traderoutes. This bonus applies after
390 the value of the traderoute is already calculated. It affects one end
391 of the traderoute only.
394 Multiply unhappy unit upkeep by amount.
397 Multiply unit upkeep by amount.
399 Unit_Upkeep_Free_Per_City
400 In each city unit upkeep is deducted by this amount. As usual, you can use
401 with OutputType requirement to specify which kind of upkeep this should be.
404 Base amount in percentage that each city has in waste. Waste can be used
405 with any output type, use an OutputType requirement to specify which.
407 Output_Waste_By_Distance
408 For each tile in real distance that a city is from nearest
409 Government Center, it gets amount of extra waste.
412 When a tile yields more output than amount, it gets a penalty of -1.
414 Output_Inc_Tile_Celebrate
415 Tiles get amount extra output when city working them is celebrating.
418 Increases unit upgrade cost by amount percent. This effect works at
419 player level. You cannot adjust upgrade costs for certain unit type or
420 for units upgraded in certain city.
423 The chance that unit gets retired (removed) when turn changes.
424 Retirement only happens if there are no enemy units or cities within
425 a few tiles. (This exists mainly to implement barbarian behavior.)
428 Instruct client to show specific buildings version of the city graphics.
429 Zero or below are considered normal city graphics.
432 Factor for research costs.
435 Factor in percent for the conversion of unit shield upkeep to gold upkeep.
436 A value of 200 would transfer 1 shield upkeep to 2 gold upkeep. The range
437 of this effect must be player or world. Note that only units with the
438 "Shield2Gold" flag will be affected by this.
441 If value > 0, city can work target tile.
444 If value > 0, unit can build irrigation to target tile. In addition to
445 requirements given to this effect, unit must also have Settlers flag.
448 If value > 0, unit can build mine to target tile. In addition to
449 requirements given to this effect, terrain type must be one to which mine
453 If value > 0, unit can transform target tile. In addition to requirements
454 given to this effect, terrain type needs to be one that can be transformed.
457 If value > 0, unit can transform target tile terrain to another by irrigating.
458 In addition to requirements given to this effect, terrain must be one that
459 can be transformed by irrigating.
462 If value > 0, unit can transform target tile terrain to another by mining.
463 In addition to requirements given to this effect, terrain must be one that
464 can be transformed by mining.
467 Increase the calculated migration score for the a city by amount in
471 Increase the squared city radius by amount. Currently, this can only
472 usefully have "MinSize", "Building", or "Tech" requirements.
475 Increase the number of units with no population cost a city can build in
476 a turn if there are enough shields.
479 The index for the city image of the given city style.
482 Positive value means that player wins the game.
485 Value is how much performance type culture city produces.
488 Value is how much history type (cumulative) culture city produces.
491 Value is how much performance type culture, not tied to any specific city,
495 Value is how much history type (cumulative) culture, not tied to any any
496 specific city, nation produces.
499 Details about requirement types
500 ===============================
502 The DiplRel requirement type
503 ----------------------------
504 Look for the diplomatic relationship "Never met", "War", "Cease-fire",
505 "Armistice", "Peace", "Alliance", "Team", "Gives shared vision",
506 "Receives shared vision", "Hosts embassy", "Has embassy",
507 "Hosts real embassy" (not from an effect), "Has real embassy",
508 "Has Casus Belli" (reason for war), "Provided Casus Belli" or "Is foreign".
510 A DiplRel is considered fulfilled for the range
511 * world if some player in the world has the specified diplomatic
512 relationship to some other living player.
513 * player if the player has the specified diplomatic relationship to some
515 * local if the first player has the specified relationship to the second
516 player. Example: When testing a build requirement for an extra the first
517 player is the owner of the unit and the second player the owner of the
518 terrain the extra is built on.
520 Only the exact relationship required fulfills it. Example: An alliance or
521 an armistice agreement won't fulfill a "Peace" requirement.
523 It is possible to create a requirement that in some situations won't have a
524 player to check. In those cases the requirement will always be considered
525 unfulfilled. This applies to both present and not present requirements. The
526 ranges Alliance, Team, Player and Local needs a player. The Local range also
527 needs the player the first player's relationship is to.
529 Example: The requirements below are about the relationship to the owner of a
530 tile. The table shows in what situations a requirement is fulfilled.
532 Requirement is fulfilled when the tile is
533 | domestic | unclaimed | foreign
534 "DiplRel", "Is foreign", "Local", TRUE | no | no | yes
535 "DiplRel", "Is foreign", "Local", FALSE | yes | no | no
537 The MaxUnitsOnTile requirement type
538 -----------------------------------
539 Check the number of units present on a tile. Is true if no more than the
540 specified number of units are present on a single tile.
542 Hint: By using negation ("not present") it is possible to check if a tile
543 has more than the given numbers. It is possible to combine a negated and a
544 non negated requirement to specify a range.
546 The UnitState requirement type
547 ------------------------------
548 "Transported" is fulfilled if the unit is transported by another unit.
549 "OnLivableTile" is fulfilled if the unit is on a tile where it can exist
550 outside of a transport.