Why do you list only "possible embargos" in the sit-rep? Wouldn't it be more important to list "actual" embargos here?
How do you determine whether there is a "possible embargo"?
14 SCREEN TURNED ON
23:39:33 DEBUG: Lonely Cyrus =========
23:39:33 DEBUG: Warrior
23:39:33 DEBUG: Swordsman
23:39:33 DEBUG: Axeman
23:39:33 DEBUG: Maceman
23:39:33 DEBUG: Spearman
23:39:33 DEBUG: Pikeman
23:39:33 DEBUG: Musketman -> doesn't know Gunpowder
23:39:33 DEBUG: Archer
23:39:33 DEBUG: Longbowman
23:39:33 DEBUG: Crossbowman
23:39:33 DEBUG: Immortal
23:39:33 DEBUG: Horse Archer
23:39:33 DEBUG: Knight
23:39:33 DEBUG: War Elephant -> no city can train unit
23:39:33 DEBUG: Catapult
23:39:33 DEBUG: Trebuchet
23:39:33 DEBUG: Galley -> no city can train unit
23:39:33 DEBUG: Trireme -> no city can train unit
23:39:33 DEBUG: Caravel -> no city can train unit
23:39:33 DEBUG: Galleon -> doesn't know Astronomy
23:39:33 DEBUG: ----------------------- fillStratAdvGrid start
00:28:38 DEBUG: Calling isSaltWaterPort(city=Persepolis, askingTeamOrID=True
00:28:39 DEBUG: Calling isSaltWaterPort(city=Moscow, askingTeamOrID=0
# cities
if cities and not canAnyCityBuildUnit(eUnit, cities, True):
def canAnyCityBuildUnit(eUnit, cities=None, askingTeamOrID=-1, checkBonuses=True):
The approach I take is very naive, unfortunately. Here's what I do:
The problems with being trickier include
- If you are connected to their trade network, I check if they have access to at least 1 of the resource. This ignores the source of that resource (not that I can find that out anyway), whether it be from their own territory or a trade with another civ.
- If you are not connected, I assume they have no resources. Every unit that requires at least one resource gets put into the "Needs Resource" column.
Ideally the player would be able to select the resources that they believe each rival has and have the screen use that information to determine which units are available.
- If you see a Swordsman, maybe it was a gift from another civ.
- If you see an Iron mine with a road, maybe it's not hooked up to their trade network.
- If you saw an Iron mine that is now in the fog of war, maybe it's been pillaged since you last saw it.