Page 1 of 1

Effects for 7x7 squares

Posted: Sun Apr 19, 2020 10:35 am
by Ignatus
7x7 squares centered at a unit are magical for Civilization games. In Civ2, units are healed 10% faster if a home (allied?) city is within this range, and another 10% if the city has Barracks. In Civ3, foreign unit positioned within a nation's borders in this range from some of the nation's cities is considered placed offensively enough to make ultimative request to its owner to remove all units out of the borders immediately. In Freeciv, some bases in this range from an allied city make military units inside not to cause military unhappiness to their city; also, barbarians may be disbanded if there are no hostile units or cities in the range.

Thus, let's introduce new requirements:
* "NearCityDiplRel", "War/Team/Alliance...", "Local/City/Player/Team/Alliance/World" - a city belonging to a player having this diplrel to a player in the range is within 3-radius square from the target tile; "Local" range means DiplRel to the owner of the tile and "City" to the owner of the target city.
* "NearBuilding", "Barracks etc.", "Player/Team/Alliance..." - The 3-radius square contains a city with this building belonging to a player in the range.
These two effects may make it possible to reproduce Civ2 healing effects.
* "NearUnitDiplRel", "War etc.", "Player etc." - analogical to NearCityDiplRel but towards owners of units around. This may unhardcode "Retire_Pct" effect and eventually transform it into a proper trireme sinking mechanism.

Re: Effects for 7x7 squares

Posted: Tue Jan 26, 2021 7:14 am
by Ignatus
Alternative solution for buildings is that they have parameters "effect_radius_sq", "effect_dist", "effect_radius_sq2" that, alongside with "Building", "Adjacent", have three separate requirement types that test if a player in given range has such a building within corresponding radius (e.g. Barracks definition will have effect_dist = 3, and the regeneration increment effect will have req "BuildingEffectDist", "Barracks", "Alliance"). We need two effect radii to support regional wonders like on Ways of History game that have one radius of their uniqueness (that we in Freeciv will pass as a negated building req to itself) and another radius of their effect.

Re: Effects for 7x7 squares

Posted: Tue Feb 16, 2021 7:33 am
by Lexxie
Something like this would be really nice. Especially it's ridiculous with 1 turn left on cease-fire, someone can put a stack of 20 cannons adjacent to your city, and the Senate says no, we don't have casus belli.

Re: Effects for 7x7 squares

Posted: Tue Feb 16, 2021 7:33 am
by Lexxie
Something like this would be really nice. Especially it's ridiculous with 1 turn left on cease-fire, someone can put a stack of 20 cannons adjacent to your city, and the Senate says no, we don't have casus belli.