Sat 14 Aug 2010 11:00:17 PM UTC, comment #5:
Thank you George. Then I guess the best option for now is to use the Great Wall effect of default ruleset.
I have noticed another possible bug similar to this one. When I use the requeriment "Special", "River", "Adjacent" in my rulesets, it seems to return always false, even when the city is placed near or over a river.
This code from effects.ruleset never works (it is supposed to give aqueduct bonus in cities near rivers):
I do not open a new topic in case I'm doing something wrong and there is no bug.
|
Fri 13 Aug 2010 03:41:16 AM UTC, comment #4:
> Would it be possible to give this defense bonus to every unit placed inside your national borders?
No. S2_2 has some requirement types that check tiles (like "Special", "Terrain", "TerrainClass", "Base", "TerrainAlter", "CityTile"), but none of these can check national borders.
> or to every unit in some of the tiles owned by your cities (workable tiles)?
No. "CityTile" of S2_2 can only check for city centers ("center"), not for workable tiles.
> or to every unit in same continent than the Great walls?
Yes, try this:
A comment at common/requirements.c:703 claims, ' At present, "Continent" effects can affect only cities and units in cities.' So there is no way to give bonus to units who are on continent but not in cities!
From common/combat.c:442, "Defend_Bonus" only knows three facts:
- the player of the defending unit.
- the defending city.
- the type of the attacking unit.
If there is no city, then the check has no information about the location of the unit. This is why "Continent" requires a city. "Continent", like "Player", checks the player. Because of this bug, "Defend_Bonus" checks the player of the defending unit (not the defending city).
The result is a Great Wall that checks the continent of the defending city (not the defending unit) and the player of the defending unit (not the defending city).
|
Tue 27 Jul 2010 01:10:36 AM UTC, original submission:
Let player C have the Great Wall. Help text says, "Works as a City Wall in all your cities." I would expect the Great Wall to protect all units in cities, where the cities belong to player C. The bug is that the Great Wall protects all units in cities, where the units belong to player C. (I have r17591 of S2_2, which has the fix from bug #16080 that actually requires units to be in cities.)
If player C has alliance with player K, then Great Wall protects whom? Units of K in cities of C, or units of C in cities of K? I attach x-great-wall-test.sav.bz2 which shows exactly this problem. (I made this game with the editing-mode.)
Load x-great-wall-test.sav.bz2 and take player S (Scottish), who is attacking player C (Chinese) and player K (Korean). Cities marked [C] have three Chinese defenders; cities marked [K] have three Korean defenders. All units are green Archers.
- Guangzhou [C] and Shanghai [K] are Chinese cities.
- Wanggomsong [C] and Jolbon [K] are Korean cities with no walls.
- Ungjin [C] and Wandu [K] are Korean cities with City Walls.
Kill all defenders, but never conquer cities. (They might be homecities of other defenders.) Shanghai [K] and Jolbon[K] are easy to kill; the four other cities are difficult to kill.
- Guangzhou [C] is a Chinese city with Chinese defenders. Difficult to kill. Chinese Great Wall protects defenders. No bug.
- Shanghai [K] is a Chinese city with Korean defenders. Easy to kill! Chinese Great Wall fails to protect Korean defenders in a Chinese city! This is bug.
- Wanggomsong [C] is a Korean city with Chinese defenders. Difficult to kill! Chinese Great Wall protects Chinese units in a Korean city! This is bug.
- Jolbon [K] is a Korean city with Korean defenders. Easy to kill. No bug.
- Ungjin [C] and Wandu [K] have City Walls. Difficult to kill. No bug.
Chinese Great Wall prevents loss of population in Shanghai [K], but not in Wanggomsong [C]. This is correct.
I thought that Chinese Great Wall and Korean City Walls might combine to add protection to Ungjin [C], but this seems not to happen.
These are the current rules in effects.c:
This says to protect all Chinese units in any city (if the attacker is land or helicopter unit). I would change this to say to protect any unit in all Chinese cities, if I knew a way.
|